Log In  

Cart #dft_test-0 | 2021-11-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

had a silly idea, why not make a spectrum analyzer that reads data sent to the pcm channel?
while it does work, it uses an unoptimized discrete fourier transform, which is very slow! watch the cpu meter almost die when it starts doing the calculations
i should have implemented a fast fourier transform, but i didn't because 1: i don't fully understand how it works, 2: it involves keeping track of and manipulating multiple lists of data points, and i don't know all of the nuances of tables in lua so while i could technically implement the algorithm while only half knowing how it works, i wouldn't be able to do so efficiently. maybe one of you kind souls can spare a gamer some advice? the idea is there and i do think this would make for some really cool effects in pcm music players

anyway if you dare to use this as-is, the drawspectrum(x, y, w, h, pos, len) function does as follows:
draws a spectrum at (x, y), computes w points of the dft, and draws the magnitude spectrum w pixels wide, and scales the plot by h. pos is the address where it should look for pcm data and len is the number of samples to use when computing the dft. again, it's very slow, it's like O(w * len) time or something

P#100486 2021-11-20 16:03 ( Edited 2021-11-20 16:04)

Cart #wwiiddeejjeellppii-0 | 2020-07-15 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

song is titled "Song for Denise" which is a song that i did not write
edit: ゴゴゴゴ

P#79342 2020-07-15 00:38 ( Edited 2020-07-15 00:39)

Cart #music_visualizer-1 | 2020-05-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

i tried using the tracker for the first time. the song is Porky's Porkies from Mother 3.
the sound organization is a bit of a mess so good luck trying to learn anything from it
I also added a music visualizer to keep it from being boring. The visualizer should work for any arbitrary song you shove into it.
edit: i made it prettier :3

P#76482 2020-05-13 01:37 ( Edited 2020-05-17 12:58)

tossed together in about an hour
made for tweet tweet jam 3
have fun and remember to play safe

Cart #crescent-1 | 2019-11-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

older version with exploits
Cart #crescent-0 | 2019-11-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

P#69837 2019-11-12 00:54 ( Edited 2019-11-12 13:15)

Follow Lexaloffle:        
Generated 2021-12-09 12:43:05 | 0.062s | Q:22