#1426 Slow note-off velocity

None
closed
Ted Felix
None
1
2014-06-04
2014-05-26
Craig McQueen
No

I'm using Rosegarden (the version that comes with Ubuntu 14.04) connected via MIDI to a Yamaha Clavinova CLP-430. When recording and playing back, the ends of notes are being prolonged, seemingly decaying slowly (something like ~600 ms). But the duration varies; occasionally a note decays quickly.

One strange thing is, in a particular music session, it may either happen or not occur at all. So far in 6 sessions, the issue has been present 4 times, and the other 2 times it didn't occur at all.

I haven't investigated the data going over the MIDI bus, but my guess is that Rosegarden may be fiddling with note-off velocity.

If I take out Rosegarden, and just use QJackCtl to connect MIDI in directly to out, then it doesn't happen.

I've tried it with both the piano's in-built USB MIDI interface, and also with a separate MidiSport USB-MIDI converter. The problem occurs with either one.

The problem seems to only affect live MIDI playback. If I record, then export the recording as a MIDI file, and then load the MIDI file onto a USB memory stick and plug that into the piano, then play that MIDI file on the piano, there is no problem with note-off velocity.

Related

Bugs: #1427

Discussion

  • Ted Felix
    Ted Felix
    2014-05-26

    Can you provide a small sample .rg file that exhibits the problem?

     
  • Craig McQueen
    Craig McQueen
    2014-05-29

    The plot thickens. Now I'm finding that the bug is only present during live MIDI playing/recording, but it's not present during playback. Now I'm thinking its possible I was wrong in my original report (that it occurs also during playback). I'm not entirely sure.

    I'm attaching a small .rg file with just 5 staccato notes. I'm also attaching recordings of the piano's sound during recording, and then later during playback. Observe that the playback sounds stoccato, but recording has long note decays.

    I've never tried using a program that sniffs MIDI data, but I imagine that could be useful. Let me know if you want me to try it. I see Ubuntu has packages midisnoop, gmidimonitor, kmidimon.

     
    Last edit: Craig McQueen 2014-05-29
  • Ted Felix
    Ted Felix
    2014-05-29

    The MIDI Thru code might be causing the issue somehow. It is separate from the playback code. Try turning off MIDI Thru. Studio > MIDI Thru Routing. That might render it silent, so it's not necessarily a useful workaround. Although usually you can set up the keyboard to do MIDI Thru internally. If both ways are turned on, that can cause trouble. Though usually it's just the duplicate note-ons that are noticeable.

    Some MIDI snooping might indeed be helpful.

     
  • Craig McQueen
    Craig McQueen
    2014-06-01

    Thanks for your message. You're right, I could try turning off MIDI Thru, and re-enable local control on my piano. I'd rather hear the output after it's gone through Rosegarden, to get a better sense of what I'm recording.

    I've used midisnoop, and discovered that it is indeed doing funny things to note-off velocities. I'm attaching 3 midisnoop screen captures:

    • MIDI live input from the piano
    • Rosegarden's MIDI thru live output
    • Rosegarden's MIDI output when playing back a recorded track

    (Note the outputs are not of exactly the same input notes, but similar enough for a comparison.)

    For MIDI thru, see how Rosegarden changes the note-off velocity to 0. THat seems to be the essence of the problem.

    For MIDI playback of a recorded track, see how Rosegarden generates two note-off events, with two different note-off-velocities. That seems odd. Why is it doing that? Although it seems to sound okay I guess. Still, it would be good to preserve what is coming from the piano.

     
  • Craig McQueen
    Craig McQueen
    2014-06-01

    By the way, my initial bug report was with Rosegarden 13.06 which comes with Ubuntu 14.04. But I also compiled version 14.02, to see if it's any different. Version 14.02 doesn't sound any different--same problem. The midisnoop results from my previous post are with 14.02.

     
  • Ted Felix
    Ted Felix
    2014-06-02

    rg does not support note-off velocity. Even so, it should be setting note-off velocity to 127 instead of 0. I've made this change and committed as r13709. If you can pull down the latest svn and build/test, that would be great. I've got some instructions here:

    http://www.rosegardenmusic.com/wiki/dev:eclipse

    The first part of that page walks through checking out the repo and building. The building part should look familiar.

     
  • Craig McQueen
    Craig McQueen
    2014-06-02

    Thanks for your work on this. I will try to do a build from Subversion soon.

    According to this reference, "MIDI devices that can generate Note Off messages, but don't implement velocity features, will transmit Note Off messages with a preset velocity of 64." So should Rosegarden be setting the note-off velocity to 64, instead of 0 or 127?

     
  • Ted Felix
    Ted Felix
    2014-06-02

    The actual MIDI spec says, "a value of 64 (40H) is recommended" for those that do not support "Release Velocity" as they call it. So, yeah, it sounds like we really should go with 64 for note-off velocity. However, both rg and my controller keyboard send 127. It would be nice to know why 127 is so popular.

     
  • Craig McQueen
    Craig McQueen
    2014-06-03

    Yesterday I compiled Rosegarden from the latest in Subversion. It sounds much better!

    I wondered if maybe the note-off velocity would sound too abrupt with a velocity value of 0, but it sounded okay to me. Still, 64 would probably be better since the MIDI spec says so.

    I seem to remember in the past (when I tried using Rosegarden 6 months ago) hearing note-off velocities being too abrupt, though I didn't persist with debugging it then. But I didn't hear that now. I'll listen for it though, and test with all reverb turned off.

     
  • Craig McQueen
    Craig McQueen
    2014-06-03

    A related question is, why is the playback (not thru) generating pairs of note-off events, one with velocity 0 and another with velocity 127? That doesn't seem right. See the image Rosegarden-midi-recorded-playback.png above.

     
  • Still? I built Ted's changes and ran it through KMidimon. I see pairs of note-off events, but they both have velocity 127.

    Why we have pairs... Well, if it isn't hurting anything, does it really matter? It's impossible to solve all the mysteries of the universe, and I have more interesting ones to solve. (Mysteries involving a very special girl. :-P )

     
    • Craig McQueen
      Craig McQueen
      2014-06-03

      My apologies, I assumed that was outside the scope of Ted's change. I will double-check that in midisnoop.

      As a programmer who has debugged many bugs caused by myself and others... much life is wasted in debugging untidy cruft. It is good to proactively remove cruft, thus saving some future programmer some time spent debugging some bug that will be related to that... thus giving that future programmer more time with the more interesting mysteries of life!

       
  • Ted Felix
    Ted Felix
    2014-06-03

    The latest svn (r13710) now sends velocity 64 for note-off in all cases. Give the latest a spin and see if it's ok.

    I looked at the double note-off issue briefly. I'll open a new bug report for it and track it separately since it isn't causing trouble for anyone right now.

     
  • Craig McQueen
    Craig McQueen
    2014-06-04

    I've tried the latest. Yes, that seems to be working nicely. I see with midisnoop that the note-offs are all velocity 64. With playback of a recording, I see that both of the note-off pairs have velocity 64. It sounds fine with my piano.

    Thanks very much for your work on this. I'm happy with this, so I think it can be closed.

     
  • Ted Felix
    Ted Felix
    2014-06-04

    • status: open --> closed
    • assigned_to: Ted Felix