Making Music with Haskell From Scratch

Ғылым және технология

Source Code: github.com/tsoding/haskell-music
Note Frequency Math: pages.mtu.edu/~suits/NoteFreq...
Chapters:
0:00 Producing First Sounds
19:03 Frequency in Hertz
28:06 Semitones
34:10 Attack-Release
43:32 Tempo
46:06 Making Music

Пікірлер: 226

  • @Tsoding
    @Tsoding4 жыл бұрын

    As was discussed on the premiere in the chat, minutephysics has a video explaining 2^1/12 in the Semitones -> Hz formula: kzread.info/dash/bejne/Y3ylz5Kdia67qJc.html Thanks Jagholin for bringing it up! Now I understand that black box! :)

  • @lividphysics1237
    @lividphysics12374 жыл бұрын

    Who needs Ableton when you have Haskell?

  • @webgpu

    @webgpu

    4 жыл бұрын

    don't know if this video's author got the acid criticism in your sarcastic comment

  • @felixlipski3956

    @felixlipski3956

    4 жыл бұрын

    imbecils!

  • @DanDart

    @DanDart

    3 жыл бұрын

    No one has ever needed ableton when rosegarden exists!

  • @robertbradley3320

    @robertbradley3320

    3 жыл бұрын

    @@webgpu Depends on how cynical you are on a scale from this video's author to you.

  • @Capewearer

    @Capewearer

    6 ай бұрын

    @@DanDart also LMMS with Ardour.

  • @dbzlinkinpark99
    @dbzlinkinpark994 жыл бұрын

    “hey what song is that?” “It’s Darude Sandstorm “

  • @dbzlinkinpark99
    @dbzlinkinpark994 жыл бұрын

    46:51 he almost let his plan slip with that laugh when he heard it and wondered probably if you can already recognize it, the mad lad is a coding Meme Legend

  • @joriskbos1115
    @joriskbos11153 жыл бұрын

    "I will make semitones floats, because I don't feel like converting ints to floats." Time for some microtonal music :)

  • @abhi111094
    @abhi1110944 жыл бұрын

    Tsoding inspired me to start a channel myself, where I am explaining Haskell algorithms, he is indeed an epic haskeller.

  • @anuraghooda8439

    @anuraghooda8439

    4 жыл бұрын

    Cool, there should be more content for haskellers. You have got yourself a new subscriber.

  • @abhi111094

    @abhi111094

    4 жыл бұрын

    It's the truth and advertisement both

  • @Bratjuuc

    @Bratjuuc

    4 жыл бұрын

    Subscribed just in case you upload something new to me.

  • @ricardorodriguez4180

    @ricardorodriguez4180

    3 жыл бұрын

    Subbed, thanks

  • @gonzalochristobal
    @gonzalochristobal4 жыл бұрын

    omg this is the best youtube recommendation of the month for me

  • @pasdenom.9062

    @pasdenom.9062

    4 жыл бұрын

    ikr

  • @ebonilha
    @ebonilha4 жыл бұрын

    That attack-decay-sustain-release thing could be implemented very elegantly with simplexes or splines. As they form interesting algebras, I think Haskell would have very nice representations of that.

  • @johnnyphoney5669
    @johnnyphoney56694 жыл бұрын

    This is my favorite video of yours now! I like how you come from the absolute simplicity to the details.

  • @tthermic
    @tthermic4 жыл бұрын

    i had to learn haskell for school so thats why i guess this is in my recommended. man this language is so over my head, watching this brought back bad memories of spending 5 hours to write 5 lines of code lol.

  • @Neroordie
    @Neroordie4 жыл бұрын

    It's been a while since I viewed a programming video but this one was really fun to watch, thank you!

  • @ih1d
    @ih1d3 жыл бұрын

    You, sir, are an excellent explainer. Really, not many youtuber programmers have your ability to explain, let alone the knowledge of Haskell. Again, excellent content.

  • @fernandogurgel
    @fernandogurgel3 жыл бұрын

    "Music is the most advanced form of mathematics" - GPT-3. Now everything makes sense.

  • @ninoman123
    @ninoman1234 жыл бұрын

    That was great. As a musician and programmer I really learned a lot about both things! Subbed!

  • @JackSchpeck
    @JackSchpeck4 жыл бұрын

    This was really entertaining video. I coded along and it was fun. You just got yourself another subscriber, sir :D

  • @thepuzzlemaker2159
    @thepuzzlemaker21594 жыл бұрын

    Attack, decay, sustain, and release are used as they can help to emulate sounds of many instruments more accurately and pleasantly. For example, some instruments have a very strong “front” or attack, that decays quickly, whereas others have a weak attack but sustain for a bit then decay.

  • @dfurmans
    @dfurmans4 жыл бұрын

    Wicked! Love your sessions ! Keep rockin!

  • @mrshurukan
    @mrshurukan4 жыл бұрын

    Never really saw Haskell before, but the way you explain it... My God, I think I'm into Haskell now You've done a great job! It was entertaining and to some extend even useful to a person who never touched that language before Kudos from a fellow programmer and a musician

  • @KamiKagutsuchi
    @KamiKagutsuchi4 жыл бұрын

    I love how you can't help but laugh when you're putting together the song at the end

  • 4 жыл бұрын

    I found myself enjoying this as a child, wicked man, you are awesome!!!

  • @polza_dg
    @polza_dg10 ай бұрын

    This is the coolest thing i've seen about programming since i started learning it 5 month ago.

  • @anuraghooda8439
    @anuraghooda84394 жыл бұрын

    Very fun and educative. Really liked this video. Keep making amazing and cool stuff.

  • @DeineOmaStinkt2
    @DeineOmaStinkt23 жыл бұрын

    Thank you a lot for this cool tutorial. It was so fun following around and even I just started programming in Haskell I could learn a lot about Haskell AND music :D Keep on going!

  • @RuRu-vm6yw
    @RuRu-vm6yw3 жыл бұрын

    Not so much activity anymore, was enjoying haskell content. We need more of that!

  • @boriscreativespace
    @boriscreativespace4 жыл бұрын

    this was the most legendary programming video I've seen in a while

  • @arturshum7612
    @arturshum76123 жыл бұрын

    i've gotten myself into this weird situation where i'd put on your videos as i go to bed and now hearing your voice is the only thing that effectively knocks me out

  • @Bloodfox610
    @Bloodfox6104 жыл бұрын

    The text at the bottom of the screen is my favorite.

  • @ewowoi

    @ewowoi

    4 жыл бұрын

    i3wm ?

  • @itsblack2321

    @itsblack2321

    4 жыл бұрын

    @@ewowoi Yeah it looks like default i3status or py3status

  • @AndersJackson

    @AndersJackson

    4 жыл бұрын

    @@itsblack2321 Probably using XMonad and its staus bar, or I will not be happy. :-)

  • @DanielPetri
    @DanielPetri4 жыл бұрын

    Wow amazing content! Keep it up. Deserves way more views

  • @developandplay

    @developandplay

    4 жыл бұрын

    Lol KZread Vorschläge😂

  • @firespindash

    @firespindash

    3 жыл бұрын

    Wow, you were here, nice :)

  • @ekkoflok
    @ekkoflok3 жыл бұрын

    Thanks a lot for this video! It's really educational to see a master at work! I wish there were some similar stuff with common lisp or scheme hacking!

  • @Mathilde3219
    @Mathilde32193 жыл бұрын

    extremely satisfying. Thank you!

  • @robert33232
    @robert332323 жыл бұрын

    Bro, I've watched the video with "one breath", really enjoyed it. Thanks a lot!

  • @HeatCrawler
    @HeatCrawler4 жыл бұрын

    That was amaizing! ❤️

  • @monnef
    @monnef4 жыл бұрын

    Nice educational and entertaining video (not many people can pull off both aspects), good job. Even though I knew everything on the Haskell front, I learned a lot about music :D.

  • @Chemaclass
    @Chemaclass4 жыл бұрын

    This is just amazing, bro! :D (and crazy...)

  • @OleJodd10
    @OleJodd104 жыл бұрын

    Very fun and educational, thank you!

  • @mariansam_was_taken
    @mariansam_was_taken4 жыл бұрын

    This video is awesome. I've never used Emacs and Haskell, but this is awesome.

  • @DanDart
    @DanDart4 жыл бұрын

    "442 pies per second" - Tsoding, 2020

  • @Hypafrag
    @Hypafrag4 жыл бұрын

    Переписываю, значит, я тут второй день свой синт с плюсов на раст. Подумываю в процессе как бы это на хаскеле выглядело. А чувак такой: «ща покажу». На следующий день после того как я вообще этот канал обнаружил. Что это? Телепатия? Отсутствие приватности? Магия?

  • @shegeley

    @shegeley

    4 жыл бұрын

    Это Гугл тебя слушает.

  • @user-cy3do4xc2c

    @user-cy3do4xc2c

    4 жыл бұрын

    Да, со мной происходило подобное. Мне близко объяснение такого явления тем, что у людей с похожими интересами и занятиями рождаются +/- одни и те же идеи. Ну, а получить соответствующее видео к просмотру - вопрос времени. Есть история одного писателя-фантаста, который изо всех сил торопился выпустить свой роман. Потому что по его убеждению в то самое время другие ~двадцать человек обыгрывали ту же самую идею в своих произведениях. Вопрос был в том, кому удастся высказаться первым. В то же время публично эта идея не обсуждалась, и было это в доинтернетную эпоху. Но идеи-то витают: кто-то где-то обмолвился, кто-то что-то подумал, - и вот оказывается, таких больше одного.

  • @katem.1586
    @katem.15863 жыл бұрын

    Thanks for posting such a great video ! :)

  • @EsperSpirit
    @EsperSpirit4 жыл бұрын

    This is really great content!

  • @jackkensik7002
    @jackkensik70024 жыл бұрын

    OMG he made DARUDE SANDSTORM IN HASKELL, absolute mad lad

  • @redumptious2544

    @redumptious2544

    Жыл бұрын

    Argh!! Thank you. I knew I definitely knew the song but I could not find it for the life of me. First comment I found that actually mentioned the name 🙏

  • @luizinoue8635
    @luizinoue86354 жыл бұрын

    Amazing content. I would like to see more video exploring sound generation changing the frequency as a function of the time. Like police car alarm.

  • @asdfmonstrosity
    @asdfmonstrosity5 ай бұрын

    That was great. Now I really want to learn Haskell

  • @wliaputs
    @wliaputs4 жыл бұрын

    Subscribed when I see music and Haskell

  • @davidfriedman6625
    @davidfriedman66253 жыл бұрын

    That was so happy! Loved how much you were enjoying it. (And what a great invitation to Haskell...)

  • @eliasavelino6729
    @eliasavelino6729 Жыл бұрын

    another fantastic video sir you are fantastic at coding haskell nice video

  • @shadowleague2486
    @shadowleague24864 жыл бұрын

    Code You a Sound for Great Good!

  • @cuadernoazul5958
    @cuadernoazul59583 ай бұрын

    Says the legend there was a dude who uses Haskell to compose Electronic music by ear.❤

  • @cn-ml
    @cn-ml4 жыл бұрын

    I watched the whole thing. You have a really nice coding style. That undertale in the end caught me pretty off guard though

  • @gonzalochristobal
    @gonzalochristobal4 жыл бұрын

    the reason why a is 2 ^ 1/12 is because an octave has 12 notes, (i think it's kind of made to be like that, because of the chromatic scale and things) so if we multiply the standard pitch with that 12 times: (2 ^ 1/12) ^ 12 = 2 we get 2, and that's because the ratio of one octave to the next is 1/2. if the process start again multiplying the last frequency we got, times 2 ^ 1/12 that will be in the next octave. our ears perceives pitches with double the frequency as one octave above :) source: www.simplifyingtheory.com/mathematics-and-music/

  • @felixlipski3956
    @felixlipski39564 жыл бұрын

    Very cool! this convinced me to learn Haskell

  • @beauteetmusculation8191

    @beauteetmusculation8191

    3 жыл бұрын

    One year later, how is it going?

  • @felixlipski3956

    @felixlipski3956

    3 жыл бұрын

    @@beauteetmusculation8191 very well, I'm learning OCaml and Agda now

  • @beauteetmusculation8191

    @beauteetmusculation8191

    3 жыл бұрын

    @@felixlipski3956 Nice! Did you learn Haskell too?

  • @miconomo
    @miconomo3 жыл бұрын

    It's really nice, proposal for the next session: music visualization :-)

  • @spacewad8745
    @spacewad87454 жыл бұрын

    oh. god!!! i am now discovering this channel.

  • @pepegasit610
    @pepegasit6104 жыл бұрын

    Do you know about TidalCycles? It's a music DSL based on haskell that allows you to do cool live music performances.

  • @GabrielFreites
    @GabrielFreites4 жыл бұрын

    This is amazing o.o!

  • @kacperozieblowski3809
    @kacperozieblowski38094 жыл бұрын

    I'm new here and I have one thing to say, love the slavic accent

  • @juancasilla684
    @juancasilla6844 жыл бұрын

    Awesome man thanks a lot

  • @random-characters4162
    @random-characters4162 Жыл бұрын

    mesmerising

  • @pasdenom.9062
    @pasdenom.90624 жыл бұрын

    That was awesome.

  • @divest6527
    @divest65274 жыл бұрын

    I've been following through this tutorial. FYI: the pitch standard tone seems slightly sharp in Tsoding's KZread video, but when you compare against the Wikipedia 440hz tone ( en.wikipedia.org/wiki/File:Sine_wave_440.ogg ), it sounds identical :)

  • @robert33232
    @robert332323 жыл бұрын

    We can go further: to construct notes with the sine overtones, to use Just Intonation note system.

  • @shamsartem
    @shamsartem4 жыл бұрын

    Really cool video

  • @htol78
    @htol783 жыл бұрын

    не знаю что больше поразило, sandstorm на хаскеле или температура чая

  • @evebogomil2777
    @evebogomil27774 жыл бұрын

    this is a completely different lvl of insanity

  • @tagged5life
    @tagged5life4 жыл бұрын

    idea for a part 2: make it read .midi files, and have summation of [Pulse] for multiple frequencies at the same time

  • @AndersJackson

    @AndersJackson

    4 жыл бұрын

    Sum and scale the pulses. Anonther thing that is needed is symbols for notes and symbols for periods (full, half, quater, eighth and so forth). And not to forget abour doted notes. Probably more useful to parse the abc format.

  • @AlexsandError
    @AlexsandError4 жыл бұрын

    amazing!

  • @yomaru_1999
    @yomaru_19994 жыл бұрын

    Interesting tutorial

  • @rifaldhiaw
    @rifaldhiaw4 жыл бұрын

    HELL YEAHH.. 48:59

  • @kahnfatman
    @kahnfatman2 жыл бұрын

    Sir, you are a musician.

  • @AmitGold00
    @AmitGold004 жыл бұрын

    Great video, if you want to explore this topic more you can do videos on different types of waves like sawtooth and square, and maybe on distortions and effects like that

  • @PhLADiPreLiO
    @PhLADiPreLiO4 жыл бұрын

    I have a question. I am making my independent research in the domain. I find some information useful for me in the video. My project code is published under MIT licence but does not use the code from the video. May I use some ideas (e. g. Float type etc.) in the project with credits to the authors of the video and still with the same license?

  • @Tsoding

    @Tsoding

    4 жыл бұрын

    The code shown in this video is also released under MIT license github.com/tsoding/haskell-music/blob/master/LICENSE So, yes, I suppose. :)

  • @mgetommy
    @mgetommy4 жыл бұрын

    wonderful

  • @Jango1989
    @Jango19894 жыл бұрын

    That's amazing >_

  • @dewijones92
    @dewijones922 жыл бұрын

    so fucking awesome. Thanks so much

  • @karolisr
    @karolisr2 жыл бұрын

    How do I "like" this 1000 times?

  • @valcron-1000
    @valcron-10004 жыл бұрын

    Tsoding: "But I'm not a musician..."

  • @meneereenhoorn

    @meneereenhoorn

    4 жыл бұрын

    Either that statement was (Just Musician) or he had some notes and this was (Just NotByEar). Awesome video btw :D

  • @bashful228
    @bashful2283 жыл бұрын

    loved this tutorial, thanks for it. only been learning Haskell for a couple of days, I didn't understand the beta reduction used @37:40 - could someone explain pls? does the compiler simply infer the other argument to the min function?

  • @aurorazuoris6654

    @aurorazuoris6654

    2 жыл бұрын

    It uses currying.

  • @buddyze
    @buddyze4 жыл бұрын

    Subscribed because of this video only :p

  • @gabrielebellavia6024
    @gabrielebellavia60244 жыл бұрын

    it can become a morse translator if you create a table of letters

  • @418teapot9
    @418teapot93 жыл бұрын

    Awesome Video! Since you made me wanna start with haskell, whats the best way to learn haskell?

  • @anwiseru9064
    @anwiseru90644 жыл бұрын

    hot i3wm setup, near default ftw

  • @JarerFolders
    @JarerFolders9 ай бұрын

    чувак, ты лучший

  • @strelkan
    @strelkan4 жыл бұрын

    я человек простой, вижу цодинг - ставлю лайк

  • @tjpld
    @tjpld3 жыл бұрын

    Which key switches do you use? Sound nice.

  • @greob
    @greob4 жыл бұрын

    I noticed your mouse cursor becomes the "hourglass" cursor whenever you zoom-in to highlight what your pointing at (e.g. 19:44 and 29:11). Maybe you forgot to do "exec --no-startup-id" in your i3 config? This should prevent the cursor from changing.

  • @smuecke
    @smuecke4 жыл бұрын

    How is it possible that printf takes a variable number of arguments depending on the number of %s, %f etc?? I didn't think this would be possible with Haskell's type system

  • @teliph3U

    @teliph3U

    4 жыл бұрын

    The answer is type classes. You can define instances for function types. This works so well because functions are always curried. If you're interested take a look at the QuickCheck package. As long as each parameter type of a function has an *Arbitrary* instance there is an instance that allows to test arbitrary functions.

  • @harryhead100

    @harryhead100

    4 жыл бұрын

    stackoverflow.com/questions/7828072/how-does-haskell-printf-work Long story short: Typeclasses and recursion

  • @creaatiive1718
    @creaatiive17184 жыл бұрын

    who are you? why is your voice so magical ? you make me melt no homo

  • @afonsorafael2728
    @afonsorafael27283 жыл бұрын

    more haskell videos pls :b

  • @HissingStone714
    @HissingStone7144 жыл бұрын

    Song name? /s

  • @Zorgatone
    @Zorgatone4 жыл бұрын

    Name of outro song?

  • @johncontoso7232
    @johncontoso72324 жыл бұрын

    Nice. What's the name of the emacs theme?

  • @spandanroy8380
    @spandanroy83802 жыл бұрын

    Does anyone have any idea of how to write that raw binary file in C++?

  • @creepr524
    @creepr5244 жыл бұрын

    Does anyone know the name of the song in the beginning?

  • @obnoxiouslisper1548
    @obnoxiouslisper15484 жыл бұрын

    is there any way (any package) to do this with common lisp?

  • @AndersJackson

    @AndersJackson

    4 жыл бұрын

    Write one. It shouldn't be that hard. Except the lazy stuff, which you actually don't really need here. Even if it is nice.

  • @npb73
    @npb734 жыл бұрын

    Теперь ждем самодельную флку)

  • @harshadmhatre6021
    @harshadmhatre60213 жыл бұрын

    I find all your haskell videos very helpful, Can you please please create a video on how to connect to a mysql database. There is no single video on youtube to get help from.

  • @pasdenom.9062
    @pasdenom.90624 жыл бұрын

    I would find great to have better tooling for Haskell. For example, an Haskell compiler that can be easily ported to any system (it's painful to port it on new systems…), a compiler which can easily compile statically (even itself), etc.

  • @robert33232
    @robert332323 жыл бұрын

    "Специфик" - I'm already hearing this for the second time from you ;) Don't reveal yourself :-D

  • @nexovec
    @nexovec4 жыл бұрын

    Lol I'm first... also I'm glad you uploaded sth. again

  • @robert33232
    @robert332323 жыл бұрын

    It was fun for me to listen to you in English realizing that we're both Russian :-D

Келесі