sustaining audio input

Emerson's icon

Hi,
I'm trying to make a patch which sustains (and adds) incoming audio (i.e. simulating the sustain pedal of the piano). It seems to be about automatically selecting and looping the appropriate portions of the audio.
Could anyone recommend a way?

brendan mccloskey's icon

Hi
numerous solutions to this one, dependent on whether you want quick plug-n-play action:

or more complex DIY tools:

My personal preference is for granular playback, and I can send you an example patch if you wish; but it won't do that "immediate freeze" - it'll do it retrospectively though.

Brendan

Emerson's icon

Thanks a lot for your help, Brendan. Could you please send me that example patch?

I'm just going through the links, the first one doesn't seem to do that, will try the "melody-to-harmony" patch from J-F Charles now.
I'm not looking for freezing a single spectrum, what I'm rather trying to get is: a monophonic instrument player will be arpeggiating some chords, and whenever 'the patch' is active, the notes will be adding up sounding together, just as if we pressed the sustain pedal.

brendan mccloskey's icon

Hi
here's the example patch, in two parts. Save this first one as "grainLiveSub" without the quotes, then close it:

Max Patch
Copy patch and select New From Clipboard in Max.

Then save the main patch below, in the same place as the first and call it whatever you wish:

Max Patch
Copy patch and select New From Clipboard in Max.

Close the subpatch and reopen the main one, in order to ensure everything is initialized.

For your needs, I think fft-freeze or reverb freeze is the way to go; give the Baz tutorials another chance and explore the examples mentioned in the above thread.

Best
Brendan

Emerson's icon

Thanks again.
Trying your patch. (Somehow not getting any audio, though... connected the outlet of poly to output gain, still just the visual of signal but no sound)

brendan mccloskey's icon

I tested the posted version:

Close the subpatch
Save close and reopen main patch
Turn dac's on and set input level
Click the (set liveFile) message
Activate the record toggle, make some noise and you'll see the buffer fill up
Change the pitch/location/amp values for the voice(s).

Done

I'll put up a quick video after my wife and I have some soup and fresh bread for lunch, here in County Down

Brendan

brendan mccloskey's icon
Sean's icon

Delicious patch thanks!

@Emerson, the main patch is just missing
a signal chord from output of poly~ which
needs to pop into the gain~ slider, without
which you'll hear nothing.

Seán (here in County Dublin)

Emerson's icon

@Sean: Yes, I noticed that, had mentioned in my previous post.
("...connected the outlet of poly to output gain")

Thank you.

Problem was due to some silly speakers...

Emerson's icon

Hi,
As a suggestion to simulating 'sustain pedaled audio' I'm posting the attached patch. I didn't use the fft freezing approaches, however.

The condition for my patch to work is to give slight pauses between the sounds to be added (this time, chosen as > 25 ms.)

What do you think?

4281.sust4.zip
zip
Emerson's icon

So, any opinions on comparing its results to those of the fft freezers?

Also, could someone tell whether poly~ is applicable with this kind of patch?

brendan mccloskey's icon

Hi
Can I first suggest that you add some illustrative comments; the lack of user input/control makes this less than immediately intuitive. But sound-wise it's great!

Qualitatively at least, fft-feezers (a la J F Charles) seem to give more "bang-for-your-buck"; in trying to duplicate the effect in the time domain I have found my CPU demands increasing.
Brendan

Emerson's icon

Thanks for the comment, Brendan -and sorry for the delay.

It's true that I have a bad habit of not commenting my code; what's more, I'm inclined here to totally avoid it rather than decide its dosage from being nothing to insulting to many experienced forum members like you, especially when I'm claiming to demonstrate a simpler thing -at least on the "signal" side.

I forgot to add that input sounds also should last at least 0.5 seconds to be accepted. My final purpose is to 'sustain-pedal' a woodwind instrument, so I tailored the default values accordingly. (the instrument can be blown much shorter of course but I'll tell the player not to!) Shortening the required duration will eventually conflict with the need to avoid the inclusion of the attack portion in the loop.

For sounds with a prominent specialty of change in every aspect over time, choosing what to loop (or its equivalent frequency domain operations) would naturally be hard to imagine; in this respect, the problem of sustaining audio input seems to be limited to having "particular solutions" for expected types of input only.

Uzay Bora