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.
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.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit! Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
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
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit! Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.