setReverb() - sounds different on subsequent notes
-
The sound synthesizer is really great to get a better understanding of sound. Do you know the point when you just think you understood something and the very next moment you think you understand nothing?
I thought I found the way to create a nice echo/delay withsetReverb(0, 1000, 0.9)
by using 1000 as a delay parameter and 0.9 for a small attenuation, on a sound with a length of 1 sec (speed = 10).
But what happend is, that the sound gets out of "sync" (the echo only sounds clean on the first note played), not anymore on the second attempt to play it. To find out what happened, I recorded it, after doing a test program, that plays the sound twice and then applies a workaround (just playing with a very small reverberation effect). See the picture below:
The image shows the sound generated by three calls of theplayNote()
function with enabled reverberation filter. It shows that the sound is repeated three times as an echo when played. The middle one, looks like there is an overlapping reverberation sound starting right before the vertical white line. The lowest sound with echo, is played after I called playNote() with a very small reverberation filter setting, and the echo seems to be (almost) reseted by this workaround.
To check how this sounds, download the DEMO with the ID: 6AN73MLSMB"Pedantic", somehow yes, but I recently learned that these filter effects open up a whole world of music and special FX. But managing the parameter-control is the first step to go there. So, thank you for commenting on this and maybe take a note, if this needs to be fixed or teach me. I know this is really no show-stopper, its just an additional show we can enjoy ;-)
-
Ok, this is maybe a clearer example. This example plays two sequential notes. But together with the second note you still hear the first note:
setReverb(0,100,0.95) playNote(0,1,noet2freq(55),0.5,10,0.5) sleep(3) playNote(0,1,note2freq(34),0.35,10,0.5) setReverb(0,90,0.95) sleep(3)
-
I can imagine that the idea was, that a reverb effect is not interrupted, when another note is played on the same channel. But if the notes are played several seconds after each other with a silence in between, its probably not working as supposed.
-
@spikey sorry slightly off topic but not, how can i use a fade out on a music track when a channel has been stopped
-
@waldron hey, hijacking the thread;-)?. I think stopping the channel sets vol to 0. So, i have to think if this has to be done manually.
-
@waldron I do not understand exactly what you mean. When you stop the channel with
stopChannel()
, is there still something played, that you need to fade out? For a fade out the way I would go is to adjust the volume from 1 to 0. The FUZE team may have better knowledge about the best way to do it, but this worked for me:channel = 0 vol = 1 pan = 0.5 speed = 1 loopTimes = 1 clip = loadAudio("David Silvera/music_funky_science") // lasts about 1.49 secs playAudio(channel, clip, vol, pan, loopTimes) startTime = time() fadeoutTime = 5 // fade out after x seconds t = 0 // lerping factor goes from 0 to 1 duration = 10 // fadeout time in seconds loop if time() - startTime >= fadeoutTime then t += deltaTime() / duration // returns the amount t shall increase per second newVol = lerp(1, 0, t) setVolume(channel, newVol) endif repeat
-
@spikey thanks for that! looks like i could apply this to many different functions not just audio. im setting up an intro to a game where the music starts on the logo menu screen and carry's on during the start of the game but the music just stopping ruins the mood.
-
@waldron oohh.. that sounds excellent. We could even fade out one song and the main song in. I will try that as soon my next project is ready for music ;-)