Hey there, just registered,
have pianoteq for a while, saw a DIY thread and well, then I just had to register :-D
I have 1) a suggestion and 2) a question
1) value fluttering
I don't know how fast this fluttering is and how much of an *audible* change from e.g. 126 to 127 does.
Does the value e.g. 126 or 127 sometimes stay for a long time and then it flips to the other number, stays for a long time and flips again? Depending on the audible change it wouldn't be too bad perhaps.
But if it indeed changes "reliably" between a few very close values, with no long pauses, maybe some sort of low-pass filtering would help?
Which means no values in the range, and no deltas are excluded from the output categorically, just that time is factored in there.
I'm not quite a DSP guru, only have very fractional knowledge there.
But IIRC, the simplest form of low pass, which might work here, would be just to average a box of values.
Say, you have a circular buffer of size 3 (perhaps sufficient, perhaps needs to be bigger). In this case it would make sense I guess to put one new value in the buffer and discard the oldest *one* (you could also move about other lengths over the input stream, but intuitively I'd say that makes no sense here).
You average all values in the buffer, and pass on the result of that, which should be more stable than the fluttering input. If 3 is not stable enough, try 4..5.. etc).
Example:
The input stream of Sustain events: {126,125,127,125,126,127,126}
Output stream of averages (with fractional part | rounded by 0.5)
(After program start, when the first CC event arrives, I guess you need to fill the buffer initially completely with the first ever received value before generating the first output event. After that, each new incoming event just does the regular step: "put newest into buffer, discard oldest from buffer, average all, generate output event")
{126,126,126} -> 126 | 126
{126,126,125} -> 125.6 | 126
{126,125,127} -> 126 | 126
{125,127,125} -> 125.6 | 126
{127,125,126} -> 126 | 126
{125,126,127} -> 126 | 126
{126,127,126} -> 126.3 | 126
As you see, the rounded output remains stable. This depends of course on how widely and with what kind of distribution the input fluctuates and how many values the averaging buffer has.
But differences of (on average) 1 are still possible, which it would not with a solution like "only pass deltas >= 4" or so.
E.g., if it fluctuates, say, around 125 +/-1, and you kick the pedal fully, and it fluctuates around 126 +/-1.
2) Pianoteq and extra MIDI Sustain pedal as own MIDI device
Seeing this thread here, tells me, it must be possible in Pianoteq to have more than one MIDI input device, each for a different purpose?
E.g. use my MIDI keyboard which does not have a continuous sustain pedal input for notes, and a Pedal as own MIDI device as pedal input?
Can someone tell me how to set this up in Pianoteq 5? (I think I have the cheapest version...)