Procedural sound in Love ; looking for an example

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
trookat
Prole
Posts: 18
Joined: Sun Nov 14, 2010 12:32 pm
Location: Western Australia
Contact:

Procedural sound in Love ; looking for an example

Post 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 :awesome:
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Procedural sound in Love ; looking for an example

Post 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.
Help us help you: attach a .love.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Procedural sound in Love ; looking for an example

Post by BlackBulletIV »

Moan is a good example of procedural sound.
User avatar
trookat
Prole
Posts: 18
Joined: Sun Nov 14, 2010 12:32 pm
Location: Western Australia
Contact:

Re: Procedural sound in Love ; looking for an example

Post by trookat »

BlackBulletIV wrote:Moan is a good example of procedural sound.
thanks , I'll take a look at it
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Procedural sound in Love ; looking for an example

Post 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.
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+.
User avatar
trookat
Prole
Posts: 18
Joined: Sun Nov 14, 2010 12:32 pm
Location: Western Australia
Contact:

Re: Procedural sound in Love ; looking for an example

Post 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 :awesome:
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Procedural sound in Love ; looking for an example

Post by Taehl »

You're welcome. Good luck on your project.
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+.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 8 guests