I loved when zozi said it’s zozin time and zozied all over
@distant66069 ай бұрын
🤣
@maxmster559 ай бұрын
My favorite part
@waxlbloh64509 ай бұрын
😳
@adr4209 ай бұрын
❤
@tekno6799 ай бұрын
I once attempted to write a music visualizer in python and failed horribly. This man did it in C and made it hot-swappable. Respect.
@contentprogramming5 ай бұрын
try it again to prove to yourself that youre improving ;)
@tekno6795 ай бұрын
@@contentprogramming Sadly I don't think I'll have time for that, but I think I did improve, because now I'm doing an image->sound conversion program for my bachelor's thesis 😎
@austinhutchen5 ай бұрын
@@tekno679Making some sound out of a FFT transformation of the discrete information present in the image, I presume? It sounds like an interesting project!
@tekno6795 ай бұрын
@@austinhutchen I'm planning on it being a modular program where you can select the exact algorithm you want to use for the conversion. Currently I have an algorithm that does straightening of the image by a space-filling curve and mapping to frequencies and some other basic ones. I did think about adding a DCT too, but the most challenging thing about this is that it increases the space to 3D essentially and you want to output a "1D" sound that somehow corresponds to the input.
@vitfirringur9 ай бұрын
In my late teens I wrote an irc bot in C which used hot reloading to support plugins. I did this by parsing the the shared objects manually and looking for exported functions that were prefixed by IRC commands and an underscore: PRIVMSG_foo, etc. Probably the coolest, most advanced thing I had built at that point. This sort of reminds me of that.
@RobertFletcherOBE4 ай бұрын
No lies from the artists, Once you get good at drawing you don't need smoothing (though they do still use it when they don't need control). The reason your line is jittery is your drawing from your wrist, and your drawing short strokes, digital artists zoom in so that they can do long fluent strokes from the elbow and shoulder (broader radius). (source: classically trained animator who now develops tools for creatives). Also I hope it goes without saying. Awesome stream :)
@TsodingDaily4 ай бұрын
Oh! I see what you mean! Thanks! I'll practice that.
@user-ng6jb5jh5r9 ай бұрын
The math as to which frequencies you get from the FFT is a bit more complicated than you used here. There are two issues, because of reasons the top half of your FFT (for example elements 128-255 if N = 256) will mirror the bottom half and doesn't give you any more information, you might as well throw it away. The highest frequency you get will always be half of the sampling frequency (for example 22.05 kHz if you use 44.1 kHz audio). You can't change this even by increasing N and it will be the middle (emph. middle) element of your FFT vector. Your value of N will determine the lowest frequency you can resolve, it will be 44.1 kHz (again assuming 44.1 kHz audio) divided by the number of samples. Say you choose N = 2048 then the FFT[0] will be your zero hertz amplitude then FFT[1] will be 44.1 kHz / 2048 = 21.53 Hz and FFT[2] will be 43.06 Hz. This will continue until FFT[1024] which will give the amplitude at half the sampling rate, i.e. 22.05 kHz. You can throw away everything after this because it will just mirror the first half (blame Nyquist). Also it's customary to view both the amplitude and the frequency logarithmically in which case your amplitude is essentially in dB (human's also perceive amplitude logarithmically). Also you'll want to sum over the bins if you view the frequencies logarithmically instead of average.
@ade53249 ай бұрын
yepieee!!! Thats the think I'm interested rn, interactive programming, jit compilers, hot reloading, things like that. this video is just in time!!!
@flyLeonardofly9 ай бұрын
1:26:58 Dap, dap technology from the 70ies😂😂😂😂
@JonnyDeRico9 ай бұрын
you could use a sine wave sweep to check for correct working fft
@lifeng84038 ай бұрын
Respect and thanks the remarkable work.
@steled039 ай бұрын
Its always possible to implement a raylib callback handler inside the program, which calls the callback in the plu gin with some data argument!
@zombozer63339 ай бұрын
For the macro around 2:04:44 you can use the # symbol to turn symbols like 'plug_hello' into strings. #define PLUG_HOOK(f_name, libplug) \ do { \ f_name = dlsym(libplug, #f_name); \ if (f_name== NULL) { \ fprint(stderr, "ERROR: could not find %s symbol in %s: %s", \ #f_name, libplug_file_name, dlerror()); \ return false; \ } \ while(1) \ You could use it like this: PLUG_HOOK(plug_hello, libplug); I haven't tested this though. You still need to declare all the global variables and repeat this macro for every function but it's a pretty simple solution for what it does.
@mohammedalhaddar21825 ай бұрын
Why is it enclosed in an infinite loop?
@IGrizzllyGuy5 ай бұрын
@@mohammedalhaddar2182 I think he wanted to say while(0);
@robsokolowski90159 ай бұрын
Flyway reminds me a bit of Lamdera, a "full stack Elm" that has type safe migrations for the stateful backend.
@bobby95689 ай бұрын
The King is back! 🎉
@zombozer63339 ай бұрын
Padding samples with zeros caused smoothing around 1:38:12 also the range of frequencies you get from the fft depends only on the sample rate not the number of samples. The number of samples only effects the precision of the frequencies you get back.
@arcxm9 ай бұрын
23:13 "reload this hot library" ^^, 1:26:56 xD
@francklenormand26809 ай бұрын
The technic to clean all the symbols resolution is to resolve only 1: a structure containing all the pointers on functions. The struct must be defined in the plugin and retrieved by main app
@TECHN012009 ай бұрын
I love the message of programming is universal. I am entirely with you on this point, it disappoints me that there are hardly any low level jobs anymore for anyone with fewer than 5 years of C experience.
@kibels8949 ай бұрын
If you're skilled enough in C to work in low level then put it on your resume. If you have the skills there's no reason to let your resume be the reason they reject you.
@OxAA004 ай бұрын
Great channel and great video!
@ryonagana9 ай бұрын
this was perfectly done by Id Software,, used in Quake 2 Engine, when you enter in a server it hot loads the server dynamic library of the game, doesnt matter if the server is running on windows or linux, it just take cares of the loading and endianess
@awesomeguy110009 ай бұрын
If I could make a stream request: try to program anything without warnings using clang -Weverything and clang static analyzer
@zombozer63339 ай бұрын
The high frequencies seem to be shown to be very low. Maybe you could sum them instead of taking the average. That would also make more sence to me because it preserves the area under the curve (sort of like the energy in the sound).
@ferasboulala62209 ай бұрын
This is exactly what should have been done with a log scale on top for visualization, if needed.
@parallel43449 ай бұрын
I have also done something like this for my visualizers.
@enc64289 ай бұрын
js hot reloading is just reading a js file as a string and passing it to eval()
@brd55484 ай бұрын
Very entertaining and educational demonstration! Python dev here😝, but we do have dll hot reloading functionality within python since very early days. For dlopen/dlclose/dlsym calls, they exist under the standard lib ctypes, whose signatures are pretty much the same with the posix ones if I remember. The whole CPython interpreter itself is just basically a huge C virtual machine, so it's pretty easy for cpython to interop with c code. For JavaScript, I do believe the node.js runtime has similar functionalities, but I'm not sure if it's a js language standard feature or just a node.js thing.
@shrddr4 ай бұрын
since fft() has no time scale reference, it doesn't produce frequencies in Hz, but in multiples of (1/windowsize). the window size was 0.1sec iirc so it returns multiples of 10Hz and when you start drawing at f=20.0 that's actually 200Hz
@SimGunther9 ай бұрын
Virgin VM image vs Chad hot reloaded .so file 😎
@DanelonNicolas9 ай бұрын
I love this man... ❤ the moment when hot realoading works was EPIC!!!! how about that!!!
@byterbrodTV9 ай бұрын
Thank you for video. Interesting project. I guess after watching this video we all doesn't need java or c# with their "VM hotswap thingy" anymore. Will put my little thoughts below. 1:03:00 - I suppose guy from chat means the case when you press R and hold it. I wonder, will it reload plugin every frame? I don't know how exactly KeyPressed() works, but in that cases something like KeyReleased() might be better, because it would called once when you release your R button. 1:35:47 - As a little bit of music making person i would say that normal people can't hear frequences after about 15-16k, it's just a high pitch noise, so 2^14 is enough for EQ. Keep this project up, we waiting for the moment when we could drag and drop music into player by hand :>
@nilsnilss9 ай бұрын
you can use multiple compilation buffers by renaming the compilation buffer and then switiching the buffer and then start a new compilation
@Celicaw89 ай бұрын
1:06:39 Couldn't you make a wrapper function with the same signature, where the bufferData is a structure with the bufferdata and the userdata, then pass this wrapper to the function you registered the callback with?
@johnhammer86687 ай бұрын
How did you find static linking was the cause for crash? Why does dynamically linked library does not crash?
@wrnlb6669 ай бұрын
libdl has a windows wrapper. I think it is crossplatform enough?
@maximeetienne26013 ай бұрын
Great video, very informative. Could someone explain why did he was forced to link dynamically raylib to make the hot reloading work ?
@not_just_burnt9 ай бұрын
i love myself some fearofdark music too!!
@LogicEu9 ай бұрын
Very cool stuff
@somecretin7 ай бұрын
the pervasive self-absorbed narcissism is such a turn-off
@slendi96239 ай бұрын
This is really cool, I tried doing the same thing but with getting the .so file's mtime and doing a compare on that `if (get_modification_date() > prev_modification_date)`, however it likes to bus error and segfault for some reason. But when I do IsKeyPressed, it just werks. Weird.
@slendi96239 ай бұрын
Its because I recompiled main
@portersky9 ай бұрын
Bro just made ringbuffer like I did in my DSP lab 😂
@mightyhelper83369 ай бұрын
Maybe you could run some pure sine waves to test it
@parlor31159 ай бұрын
Oh yeah!
@mason-pe5lk9 ай бұрын
Sounds complicated. I would've just piped the music to my headset and to the visualizer.
@anotherlevelofselfawareness8 ай бұрын
Tsoding, was you ever try to write AGI?
@eazypeazy85599 ай бұрын
so fcking cool. I watch your streams as entertainment random CS course....
@TankorSmash9 ай бұрын
1:27:00 Python does have hotreloading, basically built in. Javascript absolutely has hot reloading if you use a build tool. It absolutely wasn't your point but in case anyone is curious, it's very common!
@haakonness9 ай бұрын
In the start of the stream he said that it is possible in python, js and even java. So he is aware, he was just hyping :P
@gaweqqwgfas99809 ай бұрын
you're doing cool stuff while i struggle to install a c compiler ffs
@TsodingDaily9 ай бұрын
You can do it! I believe in you!
@gameofpj32869 ай бұрын
Maybe smooth the fft by using 50% of the previous fft and 50% of the new calculated one :D I think it's called exponential smoothing or something like that.
@jamesbarret42408 ай бұрын
afaik it's called temporal smoothing, similar algorithms are used in anti-aliasing (TAA). good idea
@gameofpj32868 ай бұрын
@@jamesbarret4240 Yea it's exponential smoothing. Probably a good idea to have it just smoothed when it goes down tho.
@SimonBuchanNz9 ай бұрын
One really annoying thing with trying to do this especially in other languages is if you use global init code or thread locals or the like, it just stops working because apparently that's just too hard for glibc to figure out. Ugh. A more reliable and buzzword friendly approach is to use WASM, but now you have the mess of interop.
@exciting-burp66139 ай бұрын
Hot teloading is a big deal in JS bevause everything is unnecessarily complicated in JS.
@flleaf8 ай бұрын
1:12:18 two weeks? isn't there only one video on youtube on this?
@ShowierData99789 ай бұрын
you can use a callback within the main program; then call the dll callback
@bloomingvision9 ай бұрын
Thats the point of all this though - its about not doing the short cuts. "just use a this and this is all unnecessary" . T's "Programming is Universal" speech captures the essence of it. There is a fundamental universality that we should know. LINKERS AND LOADERS - A beautiful are. We should all know it. My Book coming out: Computer Science in Rust :) Will re-deliver these arts. Soding.... this goes down in my book as the Traders equivalent of Gecko's Greed is Good speech -- PROGRAMMING IS UNIVERSAL.
@MrDujmanu9 ай бұрын
What font(s) do you use?
@RagePower20009 ай бұрын
What font do you use?
@SebastianSipos9 ай бұрын
dll is dynamic link library.
@phill13able3 ай бұрын
How to confirm neovim like yours?
@deathvall3y9 ай бұрын
0:03:0 why does it say porn folder 7.6 GiB in the tray 🤔
@postmodernist18489 ай бұрын
The standard library has an M_PI #define. GNU extension has M_PIf. Also why not just cast M_PI to float?
@dancinglazer16289 ай бұрын
apparently M_PI is non standard
@aciddev_9 ай бұрын
zozi bought new camera! yay
@desertfish749 ай бұрын
Rezozing ze code
@azir89309 ай бұрын
❤
@bd36708 ай бұрын
Am I the only one who noticed: "Porn Folder" in his terminal?
@png2618 ай бұрын
what software does he use to zoom in out and dim screen ?
@flleaf8 ай бұрын
boomer (on his github)
@png2618 ай бұрын
@@flleaf thanks a lot, such a useful tool
@rogerbusquetsduran55963 ай бұрын
How were you anble to build the shared lib while having it opened by your application?
@ClickHappyGamesАй бұрын
readonly does not lock files, so read+write succeeds.
@zombozer63339 ай бұрын
I think it's crashing because you are passing a callback to instruction in the SO. Then when the SO is closed the callback is called and it segfaults. I gues when the code barely changed the new version gets loaded into the same memory? That seems weird though because I would expect the memory layout to be randomized through ASLR although I'm not an expert on that. To fix this you could place the callback function in the static file. This can then call into the updated version of the SO. Otherwise you would have to somehow pause the audio so the callback doesn't get called. (Edit): I didn't see the extra section at the end. You already solved it so nvm.
@user-oe4id9eu4v9 ай бұрын
ASLR is something to do with kernel loading process into memory with exec* syscalls. Dynamic linking using dl* functions is resolved by dynamic linker, which is part of libc. So address of each functions will change every time program is reloaded, but not when simply shared object is reloaded.
@bibliusz7777 ай бұрын
What is wrong with Nix?
@filipbook56059 ай бұрын
Does anyone here have a license for a switch case developer??? I'm looking for one
@vividimagination20449 ай бұрын
If you want to get around these annoying "accept our cookies or else" prompts without accepting anything then you can just open your browsers console, find the modal and elegantly slam that delete button with fervor
@lazarstanojevic78419 ай бұрын
is there a video where he talks about his setup (editor, os and stuff like that)?
@Stroopwafe19 ай бұрын
Editor: Emacs OS: Debian Keyboard: Yes /j He has some videos where he talks about that it doesn't matter what he uses, just use what works best for you
@varshneydevansh9 ай бұрын
Woah in just 2 mins
@tauraamui9 ай бұрын
you should use Excalidraw instead of trying to handwrite text with a mouse.
@paco34479 ай бұрын
Regarding this, a whatever’s Erlang project could be a next and funny try.
@glorioussir96739 ай бұрын
You can use "x macro" for function loading deduplication, quite handy technic en.wikipedia.org/wiki/X_macro
@Shonicheck9 ай бұрын
12:57 The --cake-- smooth line is a lie!
@andrewlamichhane10909 ай бұрын
Is that a new zozing place ?
@rakaboy16199 ай бұрын
its like i cant build a http server and this man out here casually makes a hot code reloading in C in a time it takes me to make a class. trutly a tsoding moment
@heyyouhere9 ай бұрын
todays session is hot omgggg
@TurokroIV9 ай бұрын
Sometimes I wish I was a C programmer up in the sky, I wouldn't mind debugging if my loop could fly But I'll be a Pyhonista until the day I die with ten years to go in the big data mine
@user-bn4wn7ll3e9 ай бұрын
"Can your python and javascript do that??!" Python and javascript don't segfault lol
@ryonagana9 ай бұрын
imp library, now importlib in Python 3
@Isaac-zy5do9 ай бұрын
Just give you NaNs instead lol
@bonniesimon149 ай бұрын
Love the video without it, but still would be awesome to have timestamps.
@Gordonfreems9 ай бұрын
This was a vibe, amazing stream
@begga96829 ай бұрын
1:26:58 Python goobers got owned lmao
@Narblo9 ай бұрын
why dont you use pragma once?
@aviationbutterr9 ай бұрын
pragma once is a non-standard directive. header guards will always work on any standard-compliant compiler
@AbelShields9 ай бұрын
2:10:43 hypocracy, you can't do fft on 32k frames because "computers slow", but you'll do a memmove of 8k (or however much it ended up) in a hot loop in the callback because "computers fast"? :P Hey, thanks for recognising me though, really enjoyed seeing the logarithms come to life tsodingHeart the end result looks great!
@AbelShields9 ай бұрын
@@tripplefives1402 copying bytes takes time too!
@zombozer63339 ай бұрын
@@tripplefives1402 Big O notation isn't everything but still, fft is O(n log n) while the copying he was doing was O(n^2).
@gameofpj32869 ай бұрын
Also I really love how you can see the melody playing at 2:13:07 :o
@titaniumtomato72479 ай бұрын
So is this how a shell is made, or does the shell just have its own interpreter?
@TehFuckingDoctor9 ай бұрын
Why don't you use VIM?
@sinamobasheri9 ай бұрын
This is not hot I wanna hot
@dryoldcrabman68904 ай бұрын
1:11:46 kek
@enclave2k19 ай бұрын
if code_is_working { self.is_twerking = true; }
@monprenometmonnom55189 ай бұрын
en.wikipedia.org/wiki/Tiny_C_Compiler : TinyC Compiler able to compile C string code inside EXE
@flleaf8 ай бұрын
interesting, didn't know youtube doesn't delete comments with wikipedia links