Using OteyPiano with ddw VoicerSusPedal?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using OteyPiano with ddw VoicerSusPedal?

Seth Nickell-2
I'm trying to use ddw's Voicer, VoicerMIDISocket and VoicerSusPedal with OteyPiano. Since OteyPianoString is very CPU intensive, its important to keep the number of synthnodes down when using it. e.g. on my computer I can't reliably keep more than about 8-voices going, ie: v = Voicer(8, \oteypiano);

If I hold the sustain pedal down and press one key on my keyboard over and over (say: I hammer middle-c over and over a few times per second), its allocating a new voice/synth for each keypress rather than re-triggering the voice already assigned to that note. The voicer keeps the max number of synths down (in my case to 8), but I'd still rather have only one synth going in this condition, and just retrigger it over and over.

In other words: I'd like to imitate the "physical piano" behavior whereby only one string can exist for a given note at a time, and holding the sustain pedal while pressing the key over-and-over will just re-trigger the existing string, rather than creating new strings each time the key is pressed (so e.g. 8 strings are all playing a decaying middle-C note at the same time).

Is this possible with ddw Voicer? If not, can somebody recommend another library/approach to voice allocation? I scanned the ddwVoicer code, and it seems fairly complicated, so I'd rather not reinvent the wheel badly if possible.

thanks!
-Seth
Reply | Threaded
Open this post in threaded view
|

Re: Using OteyPiano with ddw VoicerSusPedal?

ddw_music
Seth Nickell-2 wrote
In other words: I'd like to imitate the "physical piano" behavior whereby
only one string can exist for a given note at a time, and holding the
sustain pedal while pressing the key over-and-over will just re-trigger the
existing string, rather than creating new strings each time the key is
pressed (so e.g. 8 strings are all playing a decaying middle-C note at the
same time).

Is this possible with ddw Voicer?
Hi, I don't have much time just now, but briefly: currently it isn't possible. But, after I make a simple change, it will be possible... I can't do it right this second, but soon.

Voicer already supports different algorithms to decide which node to steal. To do what you want, the "stealer" needs to know the frequency of the new-note request. Currently, it doesn't know this... but that's a trivial change. After I do that, it will be easy to add a "stealer" method to reuse a node with the same frequency whenever possible.

Hang on a day or two... it's definitely supportable, just not supported yet.

hjh
Reply | Threaded
Open this post in threaded view
|

Re: Using OteyPiano with ddw VoicerSusPedal?

ddw_music
ddw_music wrote
Voicer already supports different algorithms to decide which node to steal. To do what you want, the "stealer" needs to know the frequency of the new-note request. Currently, it doesn't know this... but that's a trivial change. After I do that, it will be easy to add a "stealer" method to reuse a node with the same frequency whenever possible.
Actually I had a little more time this evening than I thought, so I pushed in a couple of changes.

After you update your ddwVoicer quark, you should be able to do this:

v = Voicer(.......);  // exactly like before
v.stealer = \preferSameFreq;

... and then it should do what you want: triggering the same frequency twice will cause the older node to be "stolen."

v = Voicer(10, \default);

v.stealer = \preferEarly;
n = v.trigger(440, 1);
n.dump;

n = v.trigger(440, 1);
n.dump;

v.releaseAll;

// ^^ two synths, 'dump' shows different object memory locations

v.stealer = \preferSameFreq;

n = v.trigger(440, 1);
n.dump;

n = v.trigger(440, 1);
n.dump;

// ^^ one synth, 'dump' shows the same object memory location

v.releaseAll;

I also tested with the sustainPedal method, works as expected.

hjh