Page 1 of 1
Procedural sound in Love ; looking for an example
Posted: Sun Mar 20, 2011 7:38 am
by trookat
Hi all , been a while since I have posted . I have taken a interest in procedural generation and I thought i would start with what i consider the hardest, sound.
I am unsure if this is possible using love.sound so I'm asking for a simple example on getting tabled wave data ( from what iv have read ranges from -1 to 1) into a playable sound.
any tips or code will be appreciated
Re: Procedural sound in Love ; looking for an example
Posted: Sun Mar 20, 2011 8:13 am
by Robin
Recently, I attempted the same. Unfortunately, it failed to generate anything near useful.
I'm rather interested in what this turns up, but I have no tips or code that could be of use.
Re: Procedural sound in Love ; looking for an example
Posted: Sun Mar 20, 2011 8:55 am
by BlackBulletIV
Moan is a good example of procedural sound.
Re: Procedural sound in Love ; looking for an example
Posted: Sun Mar 20, 2011 9:06 am
by trookat
BlackBulletIV wrote:Moan is a good example of procedural sound.
thanks , I'll take a look at it
Re: Procedural sound in Love ; looking for an example
Posted: Sun Mar 20, 2011 6:35 pm
by Taehl
As just a quick little example:
Code: Select all
local samples = math.floor(.2 * 44100) --.2 seconds long
local data = love.sound.newSoundData(samples, 44100, 16, 1)
for i = 0,samples do data:setSample(i, (math.random()*2-1)*(1-i/samples)) end
staticBurst = love.audio.newSource(data)
That will give you a burst of static which will fade out.
Re: Procedural sound in Love ; looking for an example
Posted: Sun Mar 20, 2011 10:35 pm
by trookat
Taehl wrote:As just a quick little example:
Code: Select all
local samples = math.floor(.2 * 44100) --.2 seconds long
local data = love.sound.newSoundData(samples, 44100, 16, 1)
for i = 0,samples do data:setSample(i, (math.random()*2-1)*(1-i/samples)) end
staticBurst = love.audio.newSource(data)
That will give you a burst of static which will fade out.
thank you sooo much is spent a goodly time looking at moan yesterday , and i still could not see the exact minimum needed
Re: Procedural sound in Love ; looking for an example
Posted: Mon Mar 21, 2011 12:58 am
by Taehl
You're welcome. Good luck on your project.