The amount of samples in a song basically defines how good the quality of the audio is. Usually, the sample rate is 44100 for regular CDs, meaning 44100 numbers between -1 and 1 per channel and second.
To visualise this song, I deduce a pixel position by taking a sample from the left channel as the X position and a sample from the right channel as the Y position.
Since the coordinates are (-1 < x < 1, -1 < y < 1), I need to decide where to put each point in the full window.
The finished position looks something like this: (getWidth() / 2 + getWidth() * x, getHeight() / 2 + getHeight() * y).
Öscillofun
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: Öscillofun
But how do you get multiple pixels on the screen at the same time? How do you know how many samples to draw per frame?
EDIT: Oh, you probably use dt to decide the number of samples.
EDIT: Oh, you probably use dt to decide the number of samples.
Re: Öscillofun
It's open source
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
-
- Citizen
- Posts: 86
- Joined: Mon Jul 17, 2017 2:07 pm
Re: Öscillofun
thread ressurection warning
seriously i would really love to make a visualizer, how do you get this data into Love 2D?
seriously i would really love to make a visualizer, how do you get this data into Love 2D?
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Öscillofun
0. Stop resurrecting dead threads, and open a new oneDarkShroom wrote: ↑Wed Jun 20, 2018 12:11 am thread ressurection warning
seriously i would really love to make a visualizer, how do you get this data into Love 2D?
1. Create SoundData (Either empty or from a music file)
There, now the data is there, and you can access it with :getSample().
As for how to actually visualize things, that's up for the reader to figure out (There are tons of methods, even for just a plain and simple oscilloscope)
But let me post an image of one of the many projects i made in löve, albeit not yet released, to illustrate what's possible.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Öscillofun
Nice looking
That looks like a spectrogram! IMO spectrograms look sooo much nicer when the magnitude at each pixel is represented by a palette colour, preferably ranging from black through cold then warm colours, peaking at bright yellow or white e.g. https://www.youtube.com/watch?v=yzFit0nldf4
That looks like a spectrogram! IMO spectrograms look sooo much nicer when the magnitude at each pixel is represented by a palette colour, preferably ranging from black through cold then warm colours, peaking at bright yellow or white e.g. https://www.youtube.com/watch?v=yzFit0nldf4
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Öscillofun
Agreed, it would make more sense, but since i was coloring the sine-decomposition circles in the background, i didn't want the spectrogram to be too distracting... the upside is i know the perfect combination of blendmodes to clear one line every time, the downside is that it can only show 256 separate values since monochrome.pgimeno wrote: ↑Wed Jun 20, 2018 9:08 am Nice looking
That looks like a spectrogram! IMO spectrograms look sooo much nicer when the magnitude at each pixel is represented by a palette colour, preferably ranging from black through cold then warm colours, peaking at bright yellow or white e.g. https://www.youtube.com/watch?v=yzFit0nldf4
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
-
- Citizen
- Posts: 67
- Joined: Sat May 08, 2021 9:45 pm
Re: Öscillofun
anyone with a copy? i got a 404 for pretty much everything
Code: Select all
target = boardIndex.getWhosPeekingThisLine()
target:setObey(true)
Who is online
Users browsing this forum: No registered users and 2 guests