Topic: Ignore pitch bends after striking note?

Hi there,

I'm looking into purchasing PianoTeq. Overall, it appears to be a fantastic (dare I say, revolutionary) technology that I'm looking forward to using.

One question though - is there a way to have the VST ignore pitch bend messages during a note's sustain, after the note-on? In other words, can the VST pitch the note at the correct initial tuning, and then continue to hold that tuning for the rest of the note's audible lifetime, regardless of later pitch-bend movements?

Here's why I ask. I have a setup in which I am dealing with microtonal tunings, and each note is rounded to the nearest 12-tone pitch with a pitch bend offset. Additionally, each new note is placed on a different channel (MPE) in order to accommodate all these different pitch bends. This is basic MPE stuff - and although MPE isn't typically as useful on a piano plugin vs. a synth plugin, pitch bend is a notable exception if you're dealing with microtonality.

Here's the problem: MIDI's 16-channel limitation. As you know, piano polyphony with the sustain pedal often goes well beyond 16 unique voices. When I zoom past that number, I hit a 17th note that is supposed to be tuned a certain way, but it then also alters the 1st note (17 - 16 = 1) to that same pitch bend value (presumably, a totally different value). This logic would keep wrapping on itself every 16 additional voices. The issue is that PianoTeq (and just about every other piano VST) seems to process the pitch bend DURING a note's lifetime, which I would like to bypass.

Let me also say - I know about .tun, .scl, and other tuning files. This is not the same thing - it's a custom workflow that I've created inside my DAW of choice, REAPER. I could go into why I use the system I've programmed but that's not relevant here - I'm just wondering if PianoTeq can/will support ignoring pitch bends after the start of a note.

Re: Ignore pitch bends after striking note?

jarodfedele wrote:

One question though - is there a way to have the VST ignore pitch bend messages during a note's sustain, after the note-on? In other words, can the VST pitch the note at the correct initial tuning, and then continue to hold that tuning for the rest of the note's audible lifetime, regardless of later pitch-bend movements?

What do you mean by "regardless of *later* pitch-bend movements"?    Note On messages are not pitch-bend messages and the onset of a new key's sound is not a pitch "bend"; it's a discrete movement to entirely new pitch. 

If I understand what you mean, though, yes there is a way to turn responsiveness to pitch bend off.  Look at the (O)ptions, (M)idi page.  There among the midi items that Pianoteq responds to, you will see one row with 'Pitch Bend' as target in Pianoteq.  Delete that row.  Done.

I don't know much about it, but if the microtonal stuff is actually implemented via pitch bend midi messages, this will also disable that (I think, but maybe not).  There would be various ways to filter pitch bend midi messages, allowing some and filtering out others, but this would typically be part of some app controlling midi outside Pianoteq, and would have to be set up by user.  I'm a little confused, though, even if microtonal tuning with MPE relies on pitch bend messages, I see no reason why it would apply pitch bend messages beyond a single one at the onset of the note. . . .

EDIT:  Just did quick google search and found that microtonal tuning with MPE does rely on pitch bend messages. I'm still unclear why it would send multiple pitch bend messages after a note on.  I question whether this is actually part of the microtonal tuning, suspect that you are getting many pitch bend messages because they are being sent from your MPE controller.  In this case, do NOT disable pitch bend response in Pianoteq, but DO disable your controller's sending of pitch bend messages.  Pretty sure this means that your controller will then send no pitch bend messages (so no variation after note is hit) and the microtuning functionality in Pianoteq willl automatically send the precise pitch bend required for the microtuned note.

EDIT 2:  Sorry, only now am fully reading the initial post and realizing you have a good idea of what's going on.  However, assuming your controller is not sending pitch bend messages after the initial microtuning one, then I question whether the Pianoteq behavior you're seeing is the result of pitch bend messages at all.  Seems more likely it's just how Pianoteq processes sustain internally, doesn't seem like there's any reason for Pianoteq to send midi pitch bend messages to itself when it already knows what it's doing (apart from microtuning implementation, which is separate generic standard that uses pitch bend to make it generally interoperable with different systems).  Or not, just some ideas.

I do still have a question.  Are you seeing multiple midi pitch bend messages for single note-on on the (O)ptions, (M)idi page?  If not, there's no reason to think it has to do with pitch bend messages at all, is there?  It's just how Pianoteq processes things.

And, just to make sure you're aware:  The Pianoteq demo is fully functional apart from the time limitation and a few disabled keys.  So you can definitely experiment with it, if you're not already, and it should behave same as a licensed version.

Last edited by hesitz (15-05-2023 16:45)

Re: Ignore pitch bends after striking note?

Thanks for the reply, @hesitz.

hesitz wrote:

What do you mean by "regardless of *later* pitch-bend movements"?    Note On messages are not pitch-bend messages and the onset of a new key's sound is not a pitch "bend"; it's a discrete movement to entirely new pitch.

I'm aware that pitch bend data is separate from note-on data. My request is that pitch bend data is only audibly heard when a note-on is triggered. That is, whatever the current pitch bend value is at a particular note's channel at the time of the note-on will sound throughout the lifetime of the note, even if the 'pitch wheel' is moved around during the note.

hesitz wrote:

If I understand what you mean, though, yes there is a way to turn responsiveness to pitch bend off.  Look at the (O)ptions, (M)idi page.  There among the midi items that Pianoteq responds to, you will see one row with 'Pitch Bend' as target in Pianoteq.  Delete that row.  Done.

The problem here is that doing this will disable microtonality entirely. I would like the notes to audibly reflect the current pitch bend CC data when a note-on is triggered, but ignore any other pitch bend data afterward for that note.

Here's an example of what I'm doing here:

Let's say I'm playing a 24-EDO (quarter-tone) chromatic scale. A, A quarter-sharp, B-flat, B quarter-flat, B, etc. Half of these notes would need to be pitch bent up a quarter-step (let's say that's a MIDI pitch bend value of 8192). The other half of the notes should not be pitch bent at all (a value of 0). So as an example, if I play this chromatic scale with the sustain pedal held down...

-"A" would correspond to MIDI note #69 with 0 pitch bend offset (channel 1).
-"A quarter-sharp" would correspond to MIDI note #69 with 8192 pitch bend offset (channel 2).
-"B-flat" would correspond to MIDI note #70 with 0 pitch bend offset (channel 3).
-"B quarter-flat" would correspond to MIDI note #70 with 8192 pitch bend offset (channel 4).
-"B" would correspond to MIDI note #71 with 0 pitch bend offset (channel 5).
...and so on.

The 17th note in this scale would correspond to "F" which has a pitch bend value of 0. We lucked out, because this note would wrap back around to channel 1, but channel 1 already has a pitch bend value of 0. This works because the original "A" note on channel 1 won't be pitch-shifted due to the new "F" note.

But let's say we instead wanted to play "F quarter-sharp"? Well now, the pitch bend value will need to be set to 8192 on channel 1. This will allow F quarter-sharp to sound correct, but the original A note will now sound pitch shifted up a quarter-step. Why? Because PianoTeq is processing additional pitch bend data on notes after they were struck. I would like the plugin to stop processing pitch bend data on a note after it has been struck.

hesitz wrote:

I'm a little confused, though, even if microtonal tuning with MPE relies on pitch bend messages, I see no reason why it would apply pitch bend messages beyond a single one at the onset of the note. . . .

It is definitely counterintuitive for a piano. On a synthesizer, you may be pitch-bending a note during its sustain all the time. Bending notes like a guitarist is a hallmark of synth lead playing. But applying bends during a note's sustain on piano often doesn't sound right, and I'd like the ability to have the plugin disable that feature. But you can test this yourself. Hold down a note (with your fingers or with the sustain pedal) and move the pitch wheel up and down. The note will pitch-shift during the sustain. I instead want the note to 'tune' itself to the current pitch bend value, but then not respond to any other wheel movement.

hesitz wrote:

In this case, do NOT disable pitch bend response in Pianoteq, but DO disable your controller's sending of pitch bend messages.  Pretty sure this means that your controller will then send no pitch bend messages (so no variation after note is hit) and the microtuning functionality in Pianoteq willl automatically send the precise pitch bend required for the microtuned note.

I appreciate the suggestion, though there is a problem. I could filter out pitch bend messages that occur during a note's sustain from the MIDI stream, but this would mean that the 17th, 18th, 19th... notes would not receive new pitch bend data, because those MIDI channels (1, 2, 3...) are already occupied by a sounding note. So the later notes wouldn't be tuned properly; they'd be arbitrarily tuned based on the first 16 channels. This is effectively the opposite of the problem I explained earlier, in which the earlier notes would be arbitrarily re-tuned to the 17th, 18th, 19th... notes, mid-sustain.

hesitz wrote:

I do still have a question.  Are you seeing multiple midi pitch bend messages for single note-on on the (O)ptions, (M)idi page?  If not, there's no reason to think it has to do with pitch bend messages at all, is there?  It's just how Pianoteq processes things.

And, just to make sure you're aware:  The Pianoteq demo is fully functional apart from the time limitation and a few disabled keys.  So you can definitely experiment with it, if you're not already, and it should behave same as a licensed version.

I have been using the demo to test this out. I strike a note and, immediately before the note-on message, a single pitch bend message at that channel is sent that tunes the incoming note through a script I've written. In my system, the plugin should still log and store into memory the current pitch bend values per channel even when modifying those values during the sustain; the plugin should just ignore those other values when generating its tone.

Last edited by jarodfedele (15-05-2023 17:36)

Re: Ignore pitch bends after striking note?

jarodfedele wrote:

Thanks for the reply, @hesitz.

Sorry, it's taken me quite a while to understand exactly what you're doing.  Not even sure I've still got it, but I'm at least closer.

You seem to have identified the main problem: If polyphony is going beyond 16 and channels are being reused for new notes, the new microtonal adjustment affects the previous note(s) sounded in that channel.  I don't see any way around that.  It's a well-known limitation of Midi 1.0:  pitch bend works on a per-channel basis, not a per-note basis.  MPE for Midi 1.0 is essentially a giant kludge that works around that by placing notes on different channels, but if you go beyond 16 (or 15?) polyphony and start reusing channels, MPE no longer provides per-note adjustments, the adjustments you make will affect previous notes that are still sounding.

Which makes me think of two things:

1.  Maybe you're already aware of this, but I believe Midi 2.0 would allow for a relatively easy solution of your problem.  "MIDI 2.0, on the other hand, introduces a major change to the whole MIDI spec for Per Note Controllers and Per Note Pitch Bend. Users can also control individual note parameters with this feature. "  https://www.audiocipher.com/post/midi-2-0 

The problem with Midi 2.0 is finding a good piano VST (if piano is what you want) that supports Midi 2.0.  And, not sure, maybe you also need controller that supports Midi 2.0, e.g., Roland A-88MkII.  I have no idea what Midi 2.0 support there is in Reaper or other DAWS.  It seems they all use the buzzword, but actual implementations vary.

2.  Separately from MPE, Pianoteq does implement "Polyphonic aftertouch" that can be used to apply per-note pitch bend with controllers that support polyphonic aftertouch.  Not sure how this works, but it's Midi 1.0 and I believe all pitch bend is on per-channel basis, so I suspect it may be breaking notes off into channels behind the scenes.  If so, it would suffer from same problem you have with MPE.  Maybe you've already investigated this.


Finally, I can think of a giant kludge with Pianoteq that, in theory, could extend per-note pitch bend to 32 notes, 48 notes, 64 or more, depending on how many instances of Pianoteq you wanted to run.  I've created "roll my own MPE" setups by just creating an instance of a VST on 4, 8, 16 channels and managing routing of note and pitch bend and other messages via code or utility.  The main downside is it's a pain in the ass to change/edit patches in multiple VST instances, and with MPE all that management is centralized.  I'm sure there's a way to write code to spread notes out among multiple MPE-enabled instances of Pianoteq, in which case you'd get 32 notes with two instances, 48 with three, etc.  More trouble than it's worth, I'd say, but I think it would work.  A nit-picky issue, but sympathetic resonance might suffer if done in separate instances of Pianoteq (not sure how it works), but if so there's even a way around that:  disable sympathetic resonance in the note-producing instances of Pianoteq, then route their audio into a different instance that does nothing but add sympathetic resonance to its input; this is feature in Pianoteq, I believe.  This is the "Rube Goldberg machine" solution.

Last edited by hesitz (16-05-2023 00:59)

Re: Ignore pitch bends after striking note?

hesitz wrote:

You seem to have identified the main problem: If polyphony is going beyond 16 and channels are being reused for new notes, the new microtonal adjustment affects the previous note(s) sounded in that channel.  I don't see any way around that.  It's a well-known limitation of Midi 1.0:  pitch bend works on a per-channel basis, not a per-note basis.  MPE for Midi 1.0 is essentially a giant kludge that works around that by placing notes on different channels, but if you go beyond 16 (or 15?) polyphony and start reusing channels, MPE no longer provides per-note adjustments, the adjustments you make will affect previous notes that are still sounding.

Indeed, this is the problem. However, PianoTeq doesn't have to *respond* to all pitch bend information when generating sound. That's just what the developers told the software to do. I believe it would be quite simple for the developers to implement a feature that would tell the plugin to ignore subsequent pitch bend information after a note's initial state, for purposes of producing sound. That way, whatever tuning the note starts at is what it will stick with throughout its duration. But that's 100% on the developer side, as there's nothing I can do on through MIDI to tell the software how to interpret the MIDI stream. Just a matter if they find it worth their time to implement.

Maybe one day MIDI 2.0 will actually be widely implemented in hardware and software. For now though, it looks like that's not the case.

Your solution at the end indeed could work, but as you said, it would be an extreme pain to maintain! But that is something to think about if I'm desperate enough to get it to work. Or, PianoTeq could simply not allow notes to be re-tuned during its sustain. I hope that one day they can implement this. Why would you ever be fiddling with the pitch wheel during a piano note's sustain, anyways?

Last edited by jarodfedele (16-05-2023 03:01)

Re: Ignore pitch bends after striking note?

Your idea is a great suggestion! It'd be cool to see this implemented as an optional configuration.

jarodfedele wrote:

Why would you ever be fiddling with the pitch wheel during a piano note's sustain, anyways?

Not the pitch wheel specifically, but I find it pretty fun to stretch the virtual piano strings (like bending strings on a guitar) via polyphonic aftertouch. Physical modeling is great for both faithfully reproducing acoustic instruments as well as simulating impractical/impossible instruments. Pinch harmonics on the piano, string bending, morphing, etc. can open up new dimensions of expression that aren't available on a real piano.

Re: Ignore pitch bends after striking note?

jarodfedele wrote:

I'm looking into purchasing PianoTeq. Overall, it appears to be a fantastic (dare I say, revolutionary) technology that I'm looking forward to using.

One question though - is there a way to have the VST ignore pitch bend messages during a note's sustain, after the note-on? In other words, can the VST pitch the note at the correct initial tuning, and then continue to hold that tuning for the rest of the note's audible lifetime, regardless of later pitch-bend movements?

Here's why I ask. I have a setup in which I am dealing with microtonal tunings, and each note is rounded to the nearest 12-tone pitch with a pitch bend offset. Additionally, each new note is placed on a different channel (MPE) in order to accommodate all these different pitch bends. This is basic MPE stuff - and although MPE isn't typically as useful on a piano plugin vs. a synth plugin, pitch bend is a notable exception if you're dealing with microtonality.

Here's the problem: MIDI's 16-channel limitation. As you know, piano polyphony with the sustain pedal often goes well beyond 16 unique voices. When I zoom past that number, I hit a 17th note that is supposed to be tuned a certain way, but it then also alters the 1st note (17 - 16 = 1) to that same pitch bend value (presumably, a totally different value). This logic would keep wrapping on itself every 16 additional voices. The issue is that PianoTeq (and just about every other piano VST) seems to process the pitch bend DURING a note's lifetime, which I would like to bypass.

Let me also say - I know about .tun, .scl, and other tuning files. This is not the same thing - it's a custom workflow that I've created inside my DAW of choice, REAPER. I could go into why I use the system I've programmed but that's not relevant here - I'm just wondering if PianoTeq can/will support ignoring pitch bends after the start of a note.

MIDI 1.0 was extended with the MIDI Polyphonic Extensions (MPE)

Now MPE basically allows the Keyboardist to send “per note” Pitch Bends by sending individual Notes across Channels 2 through 16.

This request to apply pitch bends to more than 15 notes breaks the specification becuase there are only 16 channels and channe 1 is reserved for general system messages.

How would anyone implement more than 15 notes with unique pitch bends? Well, notes can be held (with a custome pitch adjustment) by the use of the sustain pedal so perhaps an “MPE Sustain” CC channel could be created that holds the existing up to 15 notes at their current pitch and allows new notes on all 15 channels to get new pitch bend values. This “MPE Sustain CC Pedal” would not break the MPE spec and it would be implemented on an app by app basis as a custom feature that users of microtonal software or hardware controllers have requested. The Control Hardware or software would re-use a MIDI channel only after sending out an MPE Sustain CC command so existing notes would not follow new Pitch Bends adjustments.

I hate microtonal music because it just sounds out of tune in ways I don’t like but you have every right to cause me undue pain :^) That’s art for ya’.

For people that provide realtime MIDI with 10 fingers and 2 feet the 15 note limit is not a problem. Every when you do arpeggios with sustain your hand can’t send that per note pitch bend on 16 notes at once. You have to leave that finger on the controller. But you can definitely play out of tune to your hearts content. I do have respect for the blues but that’s soul baby and not just poor taste.

Last edited by Mcdtracy (17-05-2023 00:05)

Re: Ignore pitch bends after striking note?

jarodfedele wrote:

I would like the plugin to stop processing pitch bend data on a note after it has been struck.

Agree. For some reason I thought Pianoteq was already capable of doing that on its own. Alas, by now, I think it is possible only if you got some MTS-ESP plug-in installed. Specifically, if you're going for it, you might want to check which pitch-bending option is enabled (in Pianoteq 8) by clicking onto the temperament text field (within the Tuning section in the main window, on the left), and then going to opening menu: "External tuning (MIDI, MTS-ESP) -> New notes only (no pitch-bending)". If that option is ticked, any change pertaining the MTS-ESP tuning table, will actually apply at new note-on events only, while pitches corresponding to hold notes will just not bend. Now I have no idea if you will finally get your needs met with the free MTS-ESP mini version. But, as far as the topic in the quote goes, sure you can process pitch bend data that way in Pianoteq - if Pianoteq is controlled by MTS-ESP Suite version, which is 30 days free trial. This I can tell, tested it. Works 100%. Developers have done an excellent job and really improved how it sounds with it. It was barely usable at the beginning. If I recall correctly with the MTS-ESP mini version you can only select between different scales and not modulate. If you are into microtuning and all that stuff, do not hesitate and give it a try. I'm currently unaware of alternative solutions for this. Also, didn't go through the whole discussion. Hope this helps.

Re: Ignore pitch bends after striking note?

Sorry to come late to the party.  I don't know if you're still looking for a solution...

I think your best option here is to use multiple instances of Pianoteq.  Send that 17th note to MIDI channel 1 routed to a different track with a separate Pianoteq instance.  It will take a bit of messing about, but I'm sure Reaper can do it.  With 6 instances, you can have full 88-note polyphony, each MIDI note number on a different track x channel combination.

(Personally I'm pleased that Pianoteq responds to pitch bends during a note, because it means I can play the electric distortion harpsichord with vibrato.  But an option to turn that behaviour on or off would certainly be useful.)

Re: Ignore pitch bends after striking note?

hanysz wrote:

Sorry to come late to the party.  I don't know if you're still looking for a solution...

I think your best option here is to use multiple instances of Pianoteq.  Send that 17th note to MIDI channel 1 routed to a different track with a separate Pianoteq instance.

As I scanned the thread not immediately realizing it was old, I had the same thought to use multiple instances of Pianoteq in a DAW, but to limit the response of each to a range of 16 MIDI Note Numbers. In Cakewalk by Bandlab this could be easily done using a Drum Map.