Different ways to adjust audio

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Gunroar:Cannon()
Party member
Posts: 1088
Joined: Thu Dec 10, 2020 1:57 am

Different ways to adjust audio

Post by Gunroar:Cannon() »

I want to create a gibberish-like speech thing and do that by making different short audio tracks of sounds (like nah, bah, kan, etc). Then add them together with slight fluctuations in the pitch. For characters with deeper voices I'll make the average pitch lower, and higher pitches for "cuter" characters.

Now I was wondering if there's more I can do besides changing pitch (so I can use same sounds for more characters). I noticed the love.audio.setEffect and setFilter, but I know close to nothing about what lowpass, etc filters do.

Could you please help guide and explain some more ways I could change Audio? Thank you.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
RNavega
Party member
Posts: 253
Joined: Sun Aug 16, 2020 1:28 pm

Re: Different ways to adjust audio

Post by RNavega »

I'm in the same boat, in that I haven't tried the Löve audio system yet.
What I'd do is make a folder with a main.lua inside it and treat it like a sandbox, testing all kinds of stuff.

You mentioned that Banjo Kazooie style of speech, I think there are only two ways: playing the same source over and over, setting the pitch of the source each time, or creating a set of audio buffers for each pitch level, then queueing them at random with a queueable source, if it's supported. In this last method, also having a buffer of silence for spaces.
But which method works best, I don't know. Some testing should let you know better, as there might be something we're not considering here.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Different ways to adjust audio

Post by zorg »

You could just use one sounddata for one "vocal" grunt, and write to a short buffer in a way to interpolate between samplepoints when you want to sample between the stored ones (to manually alter the playback rate, so, the pitch and speed)

That said, the effects themselves might not really be needed for just that kind of gibberish vocals. EffectType does have a list explaining what they do, and if that doesn't help, look up random youtube videos on the topics or download a DAW like FL studio (demo's free) and experiment.
Me and my stuff :3True 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.
User avatar
dusoft
Party member
Posts: 510
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Different ways to adjust audio

Post by dusoft »

I would recommend maybe going over code of these libs:
https://github.com/Ulydev/wave (If I understand it already provides pitch modulation etc.)
https://github.com/tesselode/ripple (This one has some effects)

I haven't studied the code, but I would start here for some inspiration and tips.

Reverb is well explained here:
https://en.wikipedia.org/wiki/Reverb_effect

These are also good info for beginners on various effects including diff passes:
https://www.productionmusiclive.com/blo ... ained-2021
https://www.izotope.com/en/learn/guide- ... fects.html
(I know you can Google too ;-)
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Different ways to adjust audio

Post by zorg »

(Source:setPitch in and of itself already provides changing the pitch (=resampling rate), you don't necessarily need a library for that for just grunts)

And neither wave, nor the ripple library does not add any effects, so to speak. The former just adds some helper functions for existing functionality to be easier to use, and the latter just explicitly mentions you can use löve's with it.

Also, would be nice if those sites didn't shill specific tools' capabilities and just talked generically about effects; otherwise people will have silly preconceptions about things... :c

Speaking of, here's my library that does implement independent time stretching and pitch shifting effects, along with non-effect features that you can *use* as effects, like reverse playback, custom loop points and flipped buffers, and some other things.
Me and my stuff :3True 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 39 guests