Music Visualizer (Fast Fourier Transform)

  Рет қаралды 59,671

Tsoding Daily

Tsoding Daily

10 ай бұрын

More Episodes: • Music Visualizer
References:
- Music: / @nu11_ft
- Raylib: www.raylib.com/
- Veritasium Video on FFT • The Remarkable Story B...
- Euler's Formula: en.wikipedia.org/wiki/Euler%2...

Пікірлер: 133
@michalbotor
@michalbotor 10 ай бұрын
protect this man at all cost. he is a gift to humanity.
@TheBarretNL
@TheBarretNL 9 ай бұрын
Exaggeration is also an art I see ;)
@pokefreak2112
@pokefreak2112 10 ай бұрын
28:46 maaan I feel you there. I remember having an assignment to make a game in Java, they recommended people to use Swing but other libraries were also allowed. I ended up writing my own software renderer and built a game on top of that with smooth 60fps animations, the teacher ended up deducting half a point from my otherwise perfect grade because "my approach was unusual"
@TsodingDaily
@TsodingDaily 10 ай бұрын
🫂
@ablobofgarbage
@ablobofgarbage 10 ай бұрын
Getting points deducted by thinking outside the box is fucking stupid, what do they expect you to learn if they punish you for figuring out your own solutions to problems? Programming isn't just about knowing the magic words to make the computer do the thing.
@abhishek.rathore
@abhishek.rathore 10 ай бұрын
Happened with me too but on a smaller scale. We had to make an Bezier Curve renderer in OpenGL which rendered a curve. I am made it fucking interactive where you can move the points and it would render the curve in realtime. I got an 8 when my other classmates got a 9 or a 10 for their generic implementation which just read it the points off of stdin and then put up the curve.
@kaksisve4012
@kaksisve4012 10 ай бұрын
I remembered, that I was giving a talk on a local conference at my university about monads. I was preparing it for several weeks and was questioning people how to make it more comprehendable. And guess what? Nobody of those boomers from jury f*cking understood what I was talking about. Such a waste of time... Generally speaking professors in our (Belarusian) education system are brain-locked in what they know and don't even try to go further. "I teach people logic!" "Oh, what that weird lollipop operator from linear logic is? I can't understand it"
@ablobofgarbage
@ablobofgarbage 10 ай бұрын
@@abhishek.rathore I am struggling to imagine how any rational person could deduct points because of that
@gelding
@gelding 10 ай бұрын
Please keep adding those videos, they are gold
@chomik3873
@chomik3873 10 ай бұрын
12:36: second result about QOA 13:03: result disappeared Pepehba
@delofon
@delofon 4 ай бұрын
elite trolling from ddg
@furti
@furti 10 ай бұрын
Tsoding is absolutely terrified of floats after this one. (if you know, you know)
@monsieuralexandergulbu3678
@monsieuralexandergulbu3678 10 ай бұрын
Endianness 💀
@mrorigo
@mrorigo 10 ай бұрын
F floats.
@aciddev_
@aciddev_ 10 ай бұрын
alt stream title: zozin flashbanging us with vlc and listening chiptune
@rsa5991
@rsa5991 10 ай бұрын
Tsoding, there is a video that helped me to understand FFT: it is by Reducible - "FFT: the most ingenious algorithm ever?" What made me "click" is that DFT is essentially a polynomial evaluation with x=exp(-2pi*i*f/N), and samples as coefficients. But if it's a polynomial p(x) - we can split it into even and odd powers: then we get p(-x) for "free": p(x)=even(x)+odd(x) p(-x)=even(x)-odd(x) Now, even(x) is a polynomial with only even powers, but you can also think about it as a polynomial with *all* powers, but with x^2 as a variable! So we can split it again, and get a value for (-x^2) for "free". The odd(x) can also be split, but we need to factor out (x) first - so it would have only even powers = be a polynomial of x^2. So we'll get: p(x)=even(x)+x*odd(x) p(-x)=even(x)-x*odd(x) Now, repeat the same for even and odd, to get x^2 and (-x^2) - and use the second to calculate p(ix) and p(-ix), etc.
@vmannn4259
@vmannn4259 6 ай бұрын
These vids are amazing, even tho i usually just program in rust, your intricate detail into talking about your implementations of the code is good to the point of me wanting to go along with you so i can get some taste of C.
@slugpet3000
@slugpet3000 3 ай бұрын
The literal amount of knowledge per second I gain from watching your videos is insane
@muhammadmustafa3158
@muhammadmustafa3158 6 ай бұрын
Amazing explanation and a treat to watch the goat zozin
@elJohnnySilva
@elJohnnySilva 10 ай бұрын
Dude, I love your videos
@DeveloVooshGWeb
@DeveloVooshGWeb 7 ай бұрын
This is really helpful online learning material lmao thank you for this
@mmmmm1438
@mmmmm1438 10 ай бұрын
please put all videos on KZfaq ❤
@mr.daniish
@mr.daniish 10 ай бұрын
The legend does it again!
@danv8718
@danv8718 10 ай бұрын
"Cooley-Tuckey are turning in their grave"....I'm pissing myself here! Loved the video Tsoding. You're making me fall in love again with C and programming.
@MetinCloup
@MetinCloup 10 ай бұрын
İ just searching this. youre the man who always teach me something in need
@varshneydevansh
@varshneydevansh 10 ай бұрын
I was just watching your old video today about the music generation 😮.
@simonl1938
@simonl1938 10 ай бұрын
Please make a spatial mix panel, setting sound sources in 3D space relative to the user, that'd be absolutely insane.
@cheebadigga4092
@cheebadigga4092 8 ай бұрын
Love the beer mug for drinking tea! :D
@lolapplesauce
@lolapplesauce 10 ай бұрын
2:29:05 Tsoding always making 3 hour long programming streams worth the watch
@stephaneduhamel7706
@stephaneduhamel7706 10 ай бұрын
To get pi, I usually use acosf(-1) instead of atan2. I don't know if it's actually faster to compute, but it's faster to type.
@benjaminschmidties9989
@benjaminschmidties9989 10 ай бұрын
amazing video thanks
@leongarcia3281
@leongarcia3281 10 ай бұрын
I had a dream a few days ago, where I saw you building an audio editor on stream. Then this came out.
@sparshpriyadarshi
@sparshpriyadarshi 3 ай бұрын
this stream brought out the humble side of our guy, charming stuff
@chillydill4703
@chillydill4703 10 ай бұрын
The visuals and explanations from @1:38:00 was superb! Great job!
@mrorigo
@mrorigo 10 ай бұрын
Go Tsoding. I would not have any way to learn without you.
@no_cola
@no_cola 10 ай бұрын
Thanks a lot, great explanation! But you stopped on exactly that point where FastFt started - removing extra calculations of W, thats why we use recursion (those 3 lines of code 😀). You can get explanation in Veritasium video that you suggested (from 17:00 to 19:00). Some time you can encountered with bit reversing operation - for me it was the most confusing. Indeed it just for emulating recursive calls.
@Asdafgaser
@Asdafgaser 5 ай бұрын
Thank you for the cool video and stream! I used this video as a reference for some c practice and i found out through testing and debugging that the "amp" function will access out[i] out of bounds for some bigger "frames" variable's values - happened to me and i had to increase, temporarily, the array's length. Also, the cell_width would be 0 if N was bigger and the rectangles would not be drawn. so i had to use floorf to approximate to an int value and to set it to a value bigger than 1. It's some months later but maybe has similar fun like me. Very curious to look in the next videos if he fixes these things too.
@hetias
@hetias 10 ай бұрын
I remember trying to do this a couple of moths ago, using c++ and sfml. It didn't work that well and i kinda felt like it was beyond me so i just move on to other projects. Now gonna try again now with c and sdl2 'cause i'm more used to these, so i can have help by watching this but i would still have to figure out some things by myself. Thanks again tsoding (:
@meatlover6916
@meatlover6916 4 ай бұрын
2:10:34 you're essentially getting Fourier coefficients but negating back their rotations by some clockwise value by using the negative sign; so if you manage to rotate it back by a clockwise value equal to the counterclockwise value it was already rotated by you will get the magnitude with respect to one of the fundamental frequencies that make up the original wave that it contributes to the original amplitude.
@10tronic
@10tronic 7 ай бұрын
Genial encontrar este valioso contenido. Contigo estoy aprendiendo C e inglés . Gracias
@gurgalof
@gurgalof 10 ай бұрын
you can do cabsf(out[i]) to get the magnitude of the complex number
@kawaikaede2269
@kawaikaede2269 10 ай бұрын
epic vod
@benjagamen2964
@benjagamen2964 2 күн бұрын
So i figured out that learning fourier transforms in college was worth just to understand this video :D
@alvarobyrne
@alvarobyrne 10 ай бұрын
there is a fft course from standford around youtube , a season range
@ruiuniver4
@ruiuniver4 10 ай бұрын
wonder are tsoding using HHKB? the keyboard sound is so nice
@versace10
@versace10 10 ай бұрын
You should do a stream where you try to solve as many problems from the euler project
@Mons429
@Mons429 5 ай бұрын
28:17 this reminds me of a program I wrote few years ago that decompose audio into a spectrum of frequencies with fourier transform, it also allows you to edit the spectrum and inverse transform it into a new audio, when I show it to my math teacher.... he was unimpressed
@vanish3408
@vanish3408 10 ай бұрын
I need that giant glass cup that you have for watching your sessions
@thacuber2a03
@thacuber2a03 10 ай бұрын
holy shit you used nu11's songs!!!!!!
@kennethmanheim265
@kennethmanheim265 10 ай бұрын
how do I can make Keywords like complex from the complex.h headerfile? It seems for me like a swooped template in C, which shouldn't be that possible. PS: And am I right by 1.0i means it's complex number or?
@poopybutt-jb5fv
@poopybutt-jb5fv 9 ай бұрын
Have you ever considered making like music production plugins? I feel like that could be cool
@byterbrodTV
@byterbrodTV 10 ай бұрын
Thank you for another education and interesting video. I'm sad that i can't like it twice. I notice, that it all was within one stream :o. As a person who streamed before i know that 5 hours of streaming is hard. And I'm not saying about the quality of content. I don't know how you can think about Fourier transformations at night. My brain refuses to work at that time. P.S. 2:28:34 - The point 👏👏👏 i'm laughing as fk :D
@user-nq5es4co3d
@user-nq5es4co3d 10 ай бұрын
2:28:30 АХАХАХАХАХ!!1
@blastygamez
@blastygamez 10 ай бұрын
Nice
@VictorMasnikov
@VictorMasnikov 9 ай бұрын
Синус и косинус блин 😂😂
@vuongbinhan
@vuongbinhan 2 ай бұрын
Just a note for anyone who is curious in the FFT: - FFT uses butterfly method to recursively divide and swap to compute the discrete frequency contribution of each sample. It works because exp(-jf) is a point on the unit circle on the complex plane, for DFT, these points will repeat. - The minus sign is not really important, it's just a (widely used) convention for the forward Fourier transform, if there's no minus sign for the forward transform, then the reverse transform must have the minus sign. The region where the integral converges might be different but I think all the properties remain the same.
@wagsman9999
@wagsman9999 4 ай бұрын
This is a great video on how to process raw buffered data. If anyone is coding this... recommend adding a negative to the h after the else statement - otherwise, all the rectangles are rendered above the "zero" axis. This is because the samples (the t's) are negative. See below: if (t >= 0) { DrawRectangle(i * cell_width, h / 2 - (h / 2) * t, 1, (h / 2) * t, RED); } else { DrawRectangle(i * cell_width, h / 2, 1, (-h / 2) * t, RED);
@wermair
@wermair 10 ай бұрын
Demoscene awaits you 👾
@caienmusharraf7222
@caienmusharraf7222 10 ай бұрын
nice
@syedahkam7164
@syedahkam7164 10 ай бұрын
Hey, where can I find an invite link to your discord server?
@elitracy1784
@elitracy1784 10 ай бұрын
Need a flash bang warning when you switch over to vlc
@NicolaGuerrera
@NicolaGuerrera 10 ай бұрын
Damn, I was just making a music visualizer with webgpu and this popped up!
@peterheijstek5288
@peterheijstek5288 10 ай бұрын
You have the same IKEA chair as me lmao
@sempiternal_futility
@sempiternal_futility 10 ай бұрын
how are you so good at writing code?
@defini7
@defini7 10 ай бұрын
Next video: using audio files to generate terrain a.k.a. 1d perlin noise or vice-versa
@vanshaggarwal1358
@vanshaggarwal1358 7 ай бұрын
i don't know why but the audio doesn't seem to work on my mac ?? any solutions ??
@davidsewell4999
@davidsewell4999 2 ай бұрын
Noob question. How did he pull up the raylib docs so fast (@7:55) ? Looked like searched using telescope or something within vim for the include folder that contained the doc. Is that right?
@SebastianSipos
@SebastianSipos 10 ай бұрын
flac is just specialized (lossless) compression for wav.
@rogo7330
@rogo7330 10 ай бұрын
wav is just a container for PCM. and PCM is just how samples (literally amplitude sample of sound wave at this moment) are stored and readed by sound cards. flac trying to compress that PCM without loosing any data.
@ShotgunLlama
@ShotgunLlama 10 ай бұрын
That's odd that FLAC was excluded. I didn't think it was too hard, I wrote a FLAC encoder in C++ as part of an MJPEG AVI writer
@thegremlin9876
@thegremlin9876 10 ай бұрын
the weirdest thing is hat as far as i could tell from the commits, it was excluded arbitrarily from the default configuration for no apparent reason. There haven't been any issues specifically about the format and the commit itself doesn't reference anything either, very weird
@abzrg
@abzrg 10 ай бұрын
won't you continue fortran stuff?
@ooze9808
@ooze9808 9 ай бұрын
my compiler won't let me set a struct { float left; float right; } Frames equal to a void pointer like you're doing??
@accountprincipale2293
@accountprincipale2293 7 ай бұрын
what operating system do you use?
@andrewzuy6012
@andrewzuy6012 10 ай бұрын
2:28:30 Sinus i Cosinus BLYAD! 😁😆🤣
@tianned
@tianned 10 ай бұрын
не выдержал и жостко перешел на нейтив ленгвиж
@ilovepeaceandplaying8917
@ilovepeaceandplaying8917 9 ай бұрын
pog
@xhivo97
@xhivo97 10 ай бұрын
Help this recreational programmer keeps making cool awesome content how can I keep up lol
@kodukoders
@kodukoders 8 ай бұрын
Why I can't understand how sounds work
@hoteny
@hoteny 6 ай бұрын
45:19 what kind of black magic did i witness here? Especially at the end…
@ryanshea5221
@ryanshea5221 5 ай бұрын
I identify with your seething frustration and confusion with inconsistent terminology on a spiritual level
@mthia
@mthia 10 ай бұрын
1:35:25 yeah, it is. i remember 50 digits of pi 😅
@thisisrealmaybe3430
@thisisrealmaybe3430 10 ай бұрын
Make audio plugin like reverb after this 😂
@vitaliyotdihaet
@vitaliyotdihaet 10 ай бұрын
1:40:25 actually you can measure precisely n/2 frequencies, because of periodic nature of sins (that's why 48000 Hz sample rate is so common, because normal humans can hear up to 20 kHz)
@josephlagrange9531
@josephlagrange9531 10 ай бұрын
I think you wrong, the number 48kHz was not chosen besause of that
@fkeyzuwu
@fkeyzuwu 10 ай бұрын
​@@josephlagrange9531 the number 44.1khz was chosen because of that, look into nyquist theorm. basically we can hear up to 20khz~, so we need twice as much samples + a bit more to be able to detect frequencies up until our hearing range with no major information loss. 48khz is basically just a better number for video + audio since videos are a lot of time made in 24fps.
@Bobbias
@Bobbias 9 ай бұрын
​@@josephlagrange9531no, 48khz wasn't, but 44.1khz was chosen in part because it's slightly over double 20khz.
@blackhorse8427
@blackhorse8427 10 ай бұрын
And at nights you helping fsb to fight "The west" using your hacking skills?
@lilultime6555
@lilultime6555 10 ай бұрын
Where did that raylib.env come from? How is that set up?
@TsodingDaily
@TsodingDaily 10 ай бұрын
It contains just 2 lines export PKG_CONFIG_PATH="$HOME/opt/raylib/lib/pkgconfig/:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$HOME/opt/raylib/lib/:$LD_LIBRARY_PATH"
@lilultime6555
@lilultime6555 10 ай бұрын
@@TsodingDaily thank you!
@markpi2350
@markpi2350 10 ай бұрын
Great!
@try-restart
@try-restart 6 ай бұрын
@Rubyd777
@Rubyd777 10 ай бұрын
What editor is he using?
@alexandersanchez9138
@alexandersanchez9138 10 ай бұрын
emacs
@luxluth
@luxluth 10 ай бұрын
emacs
@yuriicherniak
@yuriicherniak 10 ай бұрын
2:28:24
@grenadier4702
@grenadier4702 10 ай бұрын
Where are you from?
@Bobbias
@Bobbias 9 ай бұрын
He's from Russia, living in Novosibirsk.
@grenadier4702
@grenadier4702 9 ай бұрын
@@Bobbias As I expected looking at the accent
@rogo7330
@rogo7330 10 ай бұрын
One thing that pissing me off is that when you google "what is samples", Adobe says on their site that "more samples = better result", which is total BS if you just listening sound. It can be true when you apply different transformations on sound, but they don't mention that. Basically, you need at least two points ("samples") to reproduce original frequency of wave, which is making sence if you think about it as "we hearing how volume changed and our brain doing FFT on that change". So, human ear theoretically can sense freqs up to 22kHz. Double that and add some room to avoid aliasing, and here you get 44.1kHz and 48kHz. DON'T DOWNLOAD 96kHz MUSIC, IT'S POINTLESS.
@semenkuzovchikov8150
@semenkuzovchikov8150 10 ай бұрын
no mpd lol
@stewartzayat7526
@stewartzayat7526 10 ай бұрын
1:26:57 the answer I need to question lmao
@user-wd7qu7vu4k
@user-wd7qu7vu4k 10 ай бұрын
2:28:35 lulz
@konstantinrebrov675
@konstantinrebrov675 8 ай бұрын
Is this C programming language?
@levveliki8888
@levveliki8888 10 ай бұрын
fft these nuts 🤣🤣🤣🤣
@mohmoh-sj5hp
@mohmoh-sj5hp 10 ай бұрын
Please. Do mp3. Player in c
@dandreani
@dandreani 10 ай бұрын
It's the same thing. Raylib will load mp3 like the ogg file
@adarsh3196
@adarsh3196 10 ай бұрын
fft implemention is wrong its was giving different output compare to first dft implementation
@ooze9808
@ooze9808 9 ай бұрын
wtf is a cliteral?
@TsodingDaily
@TsodingDaily 9 ай бұрын
It's a hidden Raylib feature. Only Senior Developers can find it.
@mightbearobot
@mightbearobot 8 ай бұрын
​@@TsodingDailybro
@kibaofficial6332
@kibaofficial6332 5 ай бұрын
Bin ich der einzige der nicht wusste das Tsoding Deutsch kann? English: Am i the only one who dosn't know that he speaks german?
@srivarshan7925
@srivarshan7925 10 ай бұрын
Did anyone notice that "Porn Folder : 7.4GB" in i3 bars😂😂 Is that a troll or Is that real?? I noticed that When I was watching this in full screen
@chomik3873
@chomik3873 10 ай бұрын
it is not troll frfr
@ineverknowdoyou
@ineverknowdoyou 10 ай бұрын
its been in every stream i belive.
@rian0xFFF
@rian0xFFF 10 ай бұрын
What is it suppose to mean?
@ruslangareev3280
@ruslangareev3280 10 ай бұрын
Swap file i guess
@aspectreishauntingeurope
@aspectreishauntingeurope 10 ай бұрын
it's been shrinking, i remember it being 7.5
@TheMoQingbird
@TheMoQingbird 10 ай бұрын
ugh, that music is giving me a headache
@paklenizmaj
@paklenizmaj 10 ай бұрын
Write macro ARRAY_LEN with parentheses to protect the code in the future. ARRAY_LEN (xs) = ( sizeof (xs) / sizeof (xs [ 0 ] ) ) This is one way of hidden error: float errorValue = someNum / ARRAY(X); => float errorValue = someNum / sizeof (xs) / sizeof (xs [ 0 ] ); => float errorValue = ( someNum / sizeof (xs) ) / sizeof (xs [ 0 ] ) ; and this is not correct value
@josephlagrange9531
@josephlagrange9531 10 ай бұрын
Why write macro instead of a plain func for this?
@paklenizmaj
@paklenizmaj 10 ай бұрын
​@@josephlagrange9531In runtime you lose informatiotion about array size, so we must calculate this in compile time, and if we could do that in runtime becouse we do not have templates, we must write function separatly for each type.
@paklenizmaj
@paklenizmaj 10 ай бұрын
I forgot to mention, this way the size of the array can only be calculated if the array is created statically. For dynamic arrays, this macro does not work, but the programmer must take care of how much memory is needed and the size of the array.
Hot Code Reloading in C
2:16:18
Tsoding Daily
Рет қаралды 60 М.
The Math Behind Fourier Transforms & Music
3:01
Amy Liu
Рет қаралды 25 М.
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 24 МЛН
Cute Barbie Gadget 🥰 #gadgets
01:00
FLIP FLOP Hacks
Рет қаралды 37 МЛН
Eccentric clown jack #short #angel #clown
00:33
Super Beauty team
Рет қаралды 29 МЛН
New Gadgets! Bycycle 4.0 🚲 #shorts
00:14
BongBee Family
Рет қаралды 13 МЛН
Windows Development on Linux
2:15:17
Tsoding Daily
Рет қаралды 48 М.
Weird Parts of C you probably never heard of...
38:06
Tsoding Daily
Рет қаралды 54 М.
Revisiting GUI in 3D (Raylib and Nuklear
0:55
chriscchrisc
Рет қаралды 1,1 М.
Wait, but Who's Debugging the Debugger?!
59:53
Tsoding Daily
Рет қаралды 33 М.
You don't need Generics in C
1:37:38
Tsoding Daily
Рет қаралды 56 М.
Image Processing with Fourier Transform
5:47
Sidd Singal
Рет қаралды 158 М.
Is John Carmack Right about UI?!
1:52:02
Tsoding Daily
Рет қаралды 44 М.
This is better than TempleOS
1:55:21
Tsoding Daily
Рет қаралды 72 М.
What is a Discrete Fourier Transform? | Week 14 | MIT 18.S191 Fall 2020 | Grant Sanderson
34:48
Can you guess the song? Fourier Music Decomposition
3:58
JaDropping Science
Рет қаралды 33 М.
cool watercooled mobile phone radiator #tech #cooler #ytfeed
0:14
Stark Edition
Рет қаралды 8 МЛН