MIDI translation - perhaps like "Disklavier XP"?

Greetings, folks.

I’m an occasional user of Cantabile Performer for playing a digital piano with VSTi at home.

I’ve noticed a particular effect that I can’t do with this setup. It’s a way of pre-setting a pedal tone.

For example - silently depress the lower F key. Catch it with the sostenuto pedal.
Then afterwards as you repeatedly hit that key (think the first few bars of Rachmaninoff Second) it will continue to ring out even as you change the sustain pedal for the chords.

My keyboard is a N3 Avant Grand, and apparently its MIDI output has some peculiarities.

Only one of my VSTi will produce this effect with my piano - Pianoteq, when I set the MIDI dialect to “Disklavier XP”.
My other VSTi do not register the silent keypress, so pre-grabbing with the sostenuto does nothing.

Looking at Pianoteq’s incoming MIDI (or looking at it raw with MIDI OX) - what I see is

  • Normal MIDI - the silent keypress is coming in as Note xx Aftertouch value:127, Note xx Aftertouch value:0
  • with the Disklavier XP translation - the silent keypress is coming in as Damper xx value:127, Damper xx value:0.

Is there some way I can reproduce this mapping (changing Aftertouch to Damper) within Cantabile for my other VSTi plugins?

I’m neither particularly Cantabile-savvy nor MIDI-savvy and haven’t found a way yet.

Thanks for any advice.

Cheers,

Jane

If I remember correctly a number of VSTs interpret a Note On with a 0 (zero) velocity as a Note Off. You may be able to confirm this by having Cantabile transform a Note On with velocity 0 to velocity 1.

Could be done with a midi filter, using the Velocity/Controller Curve:
image

And then set the minimum output to be 1.

I haven’t been able to test this, so it is purely guessing that it will work. Hope that it helps. Good luck.

Thanks, Torsten,

But my keyboard isn’t sending a note with velocity 0

It’s sending an AFTERTOUCH of 127 when the key is depressed silently and 0 when it’s subsequently released. It’s sending a Status byte of A0 (Expanded MIDI 1.0 Messages List (Status Bytes))

So I don’t need to remap a 0 velocity but probably need to do what the Pianoteq instrument does - translate it to a damper command.

MidiOx

Thanks, but doesn’t work for me, Dave.

As I said, I’m a newbie. I just googled Channel Pressure and apparently that’s the same as “Channel After Touch” in the Yamaha specification. D0h
The messages my keyboard is sending are “Polyphonic After Touch”. A0h.

So when I made your filter, the MIDI Monitor still shows the After Touch events unaltered. (The “settings” for the MIDI monitor also has different checkboxes for After Touch and Channel Pressure.)

One other newbie question… if your filter did work, would the CC Coarse 64 activate the actual damper pedal, or just the damper for the specific note?
If you look at the graphic in my original post, the keyboard at the bottom shows just the one key “depressed” by virtue of the message lifting its damper.

I do appreciate the input. Thank you!

Jane

1 Like

A few thoughts/questions:

  1. The MIDI OX screenshot, it was taken using the N3 Avant as input?
  2. Can you change midi dialect from the N3 Avant?
  3. Can you share your midi mappings in the Pedals set?

On this I respectfully disagree. At least in Cantabile, “Channel pressure” is the most common aftertouch (the message which register the pressure on the whole keyboard, which most controllers transmit) while “Aftert Touch” is the polyphonic “per note” aftertouch.
Cheers!

Gabriel

1 Like

Hi, Torsten,

  1. Yes, the N3 was the input for the screenshot.
  2. I haven’t found anything in the manual indicating a way to change the MIDI dialect. This is an older piano and lacks the sophistication of more modern devices.
  3. The MIDI mapping that works on the Pianoteq instrument is rather a black box. It’s just one of the drop-down choices in the device setup.

Thanks,

Jane

Hey Jane,

TBH, I have never heard of a MIDI command that is “Damper” per note - per the MIDI specification, there are only three note-specific channel messages: Note-On, Note-Off and Aftertouch (the polyphonic one). Usually “damper” is another word for the sustain pedal (CC 64), so I don’t know what this specific mapping in pianoteq does.

Also, I have never heard of a keyboard not sending note-on information on silent key-presses - usually, they send a note-on with a very low velocity (1 or 2). The aftertouch commands will certainly also be sent if you apply pressure to the keys after pressing them down, but they shouldn’t be used as triggers for silent notes.

Lastly: what other VST instruments are you trying to get this “silent-key-sostenuto” technique with? It really depends on the specific VSTi if they actually support this technique or not - you’ll need to check the manuals for that. Usually, instruments (if they support this) will expect a very low-velocity Note-On followed by the sostenuto pedal (CC 66) to execute this technique.

Can you do one thing for us to clarify what your keyboard actually does: can you activate the MIDI monitor in Cantabile for your Avant Grand input (Menu: View–>MIDI Monitor–>Input: whatever your piano is on) and then execute this technique as you play it? Then take a screenshot of the whole output and share it here? Will help us better diagnose what is going on here…

Cheers,

Torsten

1 Like

Hey Dave,

Cantabile definitely does process poly aftertouch, but not in the Controller Map dialog (won’t work, that one is just for non-note-specific commands, including channel pressure). There are other filters that apply to poly aftertouch, like “velocity curve” or “aftertouch to controller map” or “suppress events” - these work nicely with poly aftertouch.

But converting poly aftertouch to e.g. notes will probably require a little reaJS script.

Cheers,

Torsten

2 Likes

Thanks for the help, Torsten.

Yeah, my limited knowledge led me to think that a Damper event would activate the damper pedal, not the damper for an individual note. Google turns up this link: International Piano-e-Competition which says,

MIDI Files in Yamaha’s XP Format
This format captures extensive details on the nuances of the pianist’s playing, and is intended for playback on Disklavier Pro pianos.
The XP format includes the traditional Note-On and Note-Off events describing the piano’s hammer and damper movements, but measures these on a scale from 0 to 1023 (rather than the more-usual 0-to-127). Additional MIDI events describe the position of the key itself, allowing sensitive repetition. The movement of the sustain and una-corda pedals are captured continuously, on a scale from 0 to 255.
For the highest-quality playback results, we recommend playing MIDI files directly on your Disklavier Pro or Disklavier, rather than using a MIDI cable connection. Also, avoid editing these MIDI files in XP format, as many computer sequencers alter the order of the added events.

Someone on another forum also suggested trying to translate to a note-on with velocity 1.
As you say, it seems more likely that other VSTi will support that, rather than the mystery damper command.
I have several others that I play with - a few Ivory II pianos, VSL’s old Boesendorfer Imperial and their Synchron Bluethner, Garritan CFX, VI Modern U.

Screenshot of MIDI monitor shows first normally playing a note and catching/releasing sostenuto.
Then depressing the note silently (“after-touch”) and doing the same with the pedal.

Again, I appreciate the brain power! I can certainly live without the functionality (I have so far) but it would be fun to make it work.

Jane
(edited to add RAW screen for one event).

CantabileMidiMonitorRaw

There is also a little information to be found in this article, the main take away for me was the remark “The XP data specification is unpublished at this time. XP data cannot be effectively edited or created using standard MIDI editing tools.”.

More pragmatically, there was a suggestion that:

removing the following from the piano track:

  • polyphonic aftertouch messages
  • controllers 16 and 81
  • any SysEx messages recorded on the Disklavier other than GM reset and XG reset

There are more comments in the article, but it gets slightly complicated …

Hi Jane,

from your screen shots, it looks like what you did was:

  • strike a key (audibly)
  • press & hold sostenuto
  • release key
  • release sostenuto

so far so good, but the next is interesting, because it seems your piano sends poly aftertouch for “silent” key presses instead of low-velocity keystrokes.

  • depress a key silently - no keystroke sent, just aftertouch
  • hold sostenuto
  • release silent key (aftertouch value 0 sent)
  • release sostenuto

Is this the only way your keyboard sends aftertouch? Or does it actually send pressure information after you’ve pressed keys, and the “silent” key output is just a special case of that?

To make the distinction clear: on practically all other MIDI keyboards, aftertouch is sent when putting pressure on the key after striking it, so normally, the sequence is:

  • note on
  • (multiple) aftertouch events after the key has been struck (that’s why it’s called after touch :wink: )
  • note off

But it seems your keyboard has a somewhat quirky implementation of aftertouch

If the poly aftertouch is only sent on silent keypresses, what you will need is some mechanism to convert polyphonic aftertouch to low-velocity keystrokes, so essentially converting A0 xx 7F to 90 xx 01, and A0 xx 00 to 90 xx 00, with xx being the note number. That would be a pretty basic reaJS script to put between your MIDI input from the piano to any VSTi. Now it only depends on the ability of that VSTi to actually process sostenuto.

If I find the time in the next couple of days, I can knock together a reaJS script to do that.

Cheers,

Torsten

Here’s a little reaJS script that should do the trick:

desc:MIDI AT to note
//tags: MIDI processing filter
//author: Torsten


@init

NOTE_OFF = 8;
NOTE_ON = 9;
AFTERTOUCH = 10;

@block

   while (midirecv(mpos,msg1,msg2,msg3)) (
      statusHi = (msg1/16)|0;
      statusLo = (msg1-(statusHi*16))|0;
     
      // now check for poly aftertouch = 0
      statusHi == AFTERTOUCH && msg3 == 0 ? (
         statusHi = NOTE_OFF; // convert to note off
      );

      // check poly aftertouch > 0
      statusHi == AFTERTOUCH ? (
         statusHi = NOTE_ON;
         msg3 = 1; // note on with minimal velocity
      );
      midisend(mpos,statusHi*16|statusLo,msg2,msg3); 
  ); // while loop

midi_AT_to_note.zip (490 Bytes)

Once you’ve installed reaJS (part of the free reaPlugs plugin suite), put the script file from the zip into the /midi script directory and load it inside reaJS (Here’s how to find the reaJS script directory).

Route the MIDI input from your piano to reaJS, then from reaJS MIDI output to your VSTi of choice. This should convert poly aftertouch to note-on and note-off commands and pass everything else through unchanged. You might want to review the reaJS output with the MIDI monitor.

Let me know if this works!

Cheers,

Torsten

1 Like

Indeed it does, a quote from the article that I linked to states:

Poloyphonic Aftertouch Messages

MIDI polyphonic aftertouch messages are note-specific messages that are generally used in certain keyboards to enable the performer to modulate the sound of a note by varying the finger-pressure on a fully-depressed key. Recordings made on a Disklavier sometimes include polyphonic aftertouch messages but for different reasons.

When these messages occur in a Disklavier recording, they have one of the following functions:

  • These messages can indicate silent notes, that is, notes whose keys were depressed without the hammers striking the strings.
  • […]

So you are right, this is what is happening, and it is intentionally.

1 Like

OMG.
THANK YOU, Torsten! Wow! Magic!!!

Installed the reaPlugs (just the ReaJS element for now) after I got off work.
Your script works like magic!

So far, I’ve only tried with Ivory.
I did find that Ivory insisted on sounding the velocity=1, even if I moved the Vel Min on its velocity curve.
But setting its “Slient Key Vel” to 2 did the trick perfectly.

MIDI monitors (top is keyboard, bottom is script output) show “silent” after-touch coming in and converting to Note On.
Then I caught it with the sostenuto and released the key.
Then whacked the key with a quick staccato note.
And released the sostenuto pedal a few seconds later.
Perfect.

Also works with the sympathetic resonance - hold down some keys silently and hit some harmonically-related key(s).

I can follow what you’re doing in the script, but never would have figured out the syntax.
Thank you so much for your time and experience.

And also thanks @TorstenH for the link to the Disklavier MIDI info. While my Avant Grand isn’t a Disklavier, it does seem that a lot of its syntax is the same. Including the fact that looking at a MIDI monitor I don’t see key velocities below about 25 or above ~95 (so I typically tweak the VSTi’s velocity curve… or do it with Cantabile).

Jane

Great that it works for you! Keep having fun with Cantabile :wink: