Комментарии:
pitchStandard :: Hz
pitchStandard = 440.0/2.0 -- because 1st harmonic in the tembr is smaller then the 2nd
tembr = [1/d, 0.7, 0.5/d, 0.4, 0.3/d , 0.2, 0.2 , 0.2, 0.1 , 0.1, 0.1, 0.1] :: [Float]
where d = 4.0 -- make odd harmonics smaller then even (тёплый ламповый звук!)
-- just sum of harmonics, maybe there is a prettier way to do it
freq :: Hz -> Seconds -> [Pulse]
freq tone dur = foldr (\(n, k) acc -> zipWith (\s v -> s + k*v ) acc $ freq' (tone * n) dur ) (map (\x -> x * (head tembr) ) $ freq' tone dur) $ tail $ zip [1..] tembr
-- change only 'output' subfunction, to make it sound more interesting
freq' :: Hz -> Seconds -> [Pulse]
freq' hz duration =
map (* volume) $ zipWith3 (\x y z -> x * y * z) release attack output
where
step = (hz * 2 * pi) / sampleRate
attack :: [Pulse]
attack = map (min 1.0) [0.0,0.001 ..]
release :: [Pulse]
release = reverse $ take (length output) attack
output :: [Pulse] -- sin^3 sounds better then sin for my (It's rock!). Also add distorshn effect with min-max
output = map (\x -> max (min ((sin x)^3) 0.6) (-0.6) ) $ map (* step) [0.0 .. sampleRate * duration]
more haskell videos pls :b
ОтветитьYou should look into ImplicitCAD. It lets you write Haskell that generates 3D models.
ОтветитьI challenge you to do that in typescript haskell style, how about that?
ОтветитьNow implement overtones and playing multiple notes at the same time
ОтветитьIt's really nice, proposal for the next session: music visualization :-)
Ответить"I will make semitones floats, because I don't feel like converting ints to floats." Time for some microtonal music :)
ОтветитьYou will never know that it is a click bait when he played the tone in the end part. Omegalol. Darudepoggers
ОтветитьDUDE WHERE ARE YOU?? COME BACK 😭
ОтветитьMan. Where are you? Please, don't tell that you got a job, just do Haskell videos! :-D
ОтветитьГде видосы?
Ответить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
ОтветитьNot so much activity anymore, was enjoying haskell content. We need more of that!
ОтветитьWhat a Nerd
ОтветитьThanks for posting such a great video ! :)
ОтветитьThis is really cool! Can we play two (or more) [Pulse] at the same time? Trying to do Für Elise. :-)
Ответитьне знаю что больше поразило, sandstorm на хаскеле или температура чая
ОтветитьAwesome Video! Since you made me wanna start with haskell, whats the best way to learn haskell?
Ответить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!
ОтветитьCan someone explain what's up with the line numbers?
Ответить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!
Ответитьso fucking awesome. Thanks so much
ОтветитьThis is the first video
ОтветитьWow he was a little bit fat
ОтветитьHow do I "like" this 1000 times?
ОтветитьSir, you are a musician.
ОтветитьDoes anyone have any idea of how to write that raw binary file in C++?
Ответитьanother fantastic video sir you are fantastic at coding haskell nice video
ОтветитьHaskell > Music Trackers
ОтветитьOh man tsoding, wait until you hear about bytebeat then realise you could have just sent "cycle[1..65535] " to the audio file to get a sawtoothwave
Ответитьmesmerising
ОтветитьOh yeah the old channele
ОтветитьThis is the coolest thing i've seen about programming since i started learning it 5 month ago.
Ответитьcan you implement fm synthesis in haskell?
ОтветитьNoice
Ответитьчувак, ты лучший
ОтветитьCould've really used musializer back then
ОтветитьThat was great. Now I really want to learn Haskell
ОтветитьSays the legend there was a dude who uses Haskell to compose Electronic music by ear.❤
ОтветитьThe bitch standard is fire 🔥🔥🔥
Ответить2020 Tsoding: Linus Torvalds
2024 Tsoding: Mark Succerburg
Thank you.......
ОтветитьSo great tutorial! I recommend this great work to my students in a Haskell course!!!
Ответить