Connect with us

MIDI Specifications for AllNotesOff

Discussion in 'Audio' started by Anard, Nov 14, 2018.

  1. Anard

    Anard

    47
    1
    Feb 21, 2018
    Hi.

    I'm creating a MIDI SD reader, which send a MIDI Signal via Usart.
    It now works well but there are numbers of things in the specifications that are not clear.

    One of these is how to send a correct AllNotesOff message.
    Specifications says that, even if these specific is addressed to a specific channel, it extends to all channels... To prevent ununderstanded messages, I send it to all channels, one by one.

    There are several ways to send this message, main types are these ones :
    • AllNotesOff, sending 0xB0(ControlChange), 0x7B, 0x00. I understand that this method stops all notes but let them finish (they are not instantly cutted). I use this mode if end of file appears, to prevent an eventuel unclosed note in a corrupted file.
    • AllSoundsOff, sending 0xB0, 0x78, 0x00. Documentation says "all oscillators are stopped". I understand that notes are stop with instant sound cut. I use it if user press "pause" or "stop" buttons to instantly cut the output

    Although, it seems to work but for both messages, my MIDI softwares (I tried with diffent ones) interprets this event as a short C0 (note n° 00, the first C). Here is the end of my generated MIDI file (in hexa):
    Code:
    90            00            7f
    NoteOn        C0            MaxVelocity
    0c            80            00            7f
    Wait12ticks   NoteOff        C0            MaxVelocity
    Is anybody have ever tried to work on Midi files and have ever encountered this problem ?
    What should be the best way to fastly initialize all notes of all controllers ?

    Thanks for your help.

    EDIT : I tried to send just the messages to channel 0 and it's OK (it seems to cut every channels).
    The difference between AllNotesOff and AllSoundsOff doesn't seem to be implemented, or I didn't understand correctly this difference.
    But your reviews and feedbacks are welcome...
     
    Last edited: Nov 14, 2018
  2. Alec_t

    Alec_t

    2,693
    712
    Jul 7, 2015
    Why are you sending 'maximum velocity' messages in your code if you are trying to turn the notes off? In MIDI-land 'velocity' means loudness, not speed of response of the command.
    If I understand you correctly the 'reset all controllers' command (0xB0 0x79 0x00) should do that.
     
    Last edited: Nov 14, 2018
  3. Anard

    Anard

    47
    1
    Feb 21, 2018
    It depends of the software which created the midi file.
    Some of them don't take account of expression. There are 2 ways to close a note in MIDI :
    • NoteOff (0x80) - Pitch (0-127) - Velocity (0-127), here the velocity doesn't care
    • NoteOn (0x90) - Pitch (0-127) - NoVelocity (0x00)

    And these last characters where written by my PC (with HarmonyAssistant) when my instrument sent AllNotesOff to every channels
    Code:
    for (i=0; i<16; i++) {
        Uart_Write (0xB0 & i); // ControlChange for each channel
        Uart_Write (0x7B); // or 0x78 // | AllNotesOff
        Uart_Write (0x00);            // |
    }
    But I don't understand why and resul is the same with "AllNotesOff" and "AllSoundsOff"... It's OK (this last note doesn't appear) if I only send it to channel 1 (0xB0)
    o_O
    AllNotesOff and AllSoundsOff makes no difference in no way.
     
  4. tedstruk

    tedstruk

    475
    7
    Jan 7, 2012
    All notes off is a general midi command that has 2 states..ON and OFF. It was originally called All off.
    The first midi machines were hard to keep from overloading, and when they did, they simply stuck the last note....

    When On, any stuck midi notes are shut off , when OFF,
    stick notes can happen if the size of the Initiated packet is exceeded.
    All sounds off is a way to shut e everything off..
    They are completely different settings with special uses for each.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-