midievent


    Jun 18 2020 | 8:43 am
    MIDIevent seems like it might be a new command. Does it exist and if so, is there any documentation?

    • Jun 18 2020 | 10:44 am
      The 'midievent' message is used for midi input to [vst~], see reference page.
    • Jun 18 2020 | 12:05 pm
      Thanks. It was in reference to a patch using vst~. MIDI messages are generating an error msg "vst~ missing arguments for message "midievent". However, I can't see any reference to arguments for midievent.
    • Jun 18 2020 | 12:22 pm
      Quote from the [vst~] reference page: "The word midievent, followed by two to four numbers, sends a MIDI event to the plug-in. The first three number arguments are the bytes of the MIDI message. The fourth, optional, argument is a detune parameter used for MIDI note messages. The value ranges from -63 to 64 cents, with 0 being the default."
    • Jun 18 2020 | 12:31 pm
      or in other words, it is just to prepend "normal" midi messages.
    • Jun 18 2020 | 1:46 pm
      Edward, You use the "midievent" message to send midi notes, cc messages, etc. to a vst~ or other format plugins.
      Assume you have vst-instrument. If you send it the message: [midievent 144 60 100( , then the vst-instrument will execute a noteon on MIDI channel 1 (144). The note will be Middle-C (60), and the velocity will be 100.
      There are two ways to turn the notes off. Here is one: [midievent 144 60 0( . Technically this messages says play the note at zero velocity.
      If you want to turn on the note B (just below middle-C) on a different midi channel, then the message must be altered. [midievent 145 59 99( will turn on the B (just below middle-C) on MIDI channel 2 with a velocity or 99. [midievent 145 59 0( will turn the note off.
      Note on messages for the 16 MIDI channels are 144, 145, 146, ... 159.
      To make Continuous Controller changes, the first int after the word "midievent" is different. So, if you wanted to send Mod Wheel data to a vst plugin, then you might set up a message like this:
      [num-box] | [midievent 176 1 $1( | [vst~ <name of vst plug>]
      In the above message: 176 says send a CC message on MIDI channel 1, the 1 says send CC 1 (mod wheel), and the $1 is replaced by whatever number comes from the [num-box] object.
      The pictures below used to be in the Max Documentation. Not sure they are still there. However, they should help you format the midievent messages.
      Hope this helps, Mitch
    • Jun 18 2020 | 3:29 pm
      oh right, now that you say it, he probably forgot the channel (144), which you dont even get from live midi input when you use the usual [midiparse]
    • Jun 18 2020 | 3:57 pm
      The pictures I copied in my last post come from some old Max documentation. Not sure which version (maybe max/msp 4?). I wish I knew where these charts were in the new documentation. They were really helpful, to me.
    • Jun 18 2020 | 5:21 pm
      In recent versions of Max the rightmost outlet of [midiparse] and [midiformat] sends midievent messages. So generally you don't need to deal with midi bytes anymore.
    • Jun 18 2020 | 5:25 pm
      The old Max Help files were less "concise", which was very helpful at times... I understand the need to not be "overwhelming" for beginners, but there are alternatives to bring back some of that depth, be it through the tabs function inside the help patchers, or even through the "Extra Help" option when you right-click on an object. By the way, I don't think I've ever seen an object use it, is it a new feeature?
    • Jun 18 2020 | 6:18 pm
      @Broc: I did not think of using [midiformat]'s right outlet to make "midievent" messages. Thanks for posting that, it is so helpful.
      @Pedro: I don't know if it is a new feature.
    • Jun 19 2020 | 12:33 am
      Thank you for all your terrific responses. It seems it was a grammatical problem in sending messages to a vst~.
    • Jun 19 2020 | 4:12 pm
      "In recent versions of Max the rightmost outlet of [midiparse] and [midiformat] sends midievent messages. So generally you don't need to deal with midi bytes anymore " otoh, doing + 143 prepend midievent (also known as 110.notetovst) yourself is not too much asked from the user (of a programming enviroment) as soon as you want to transpose the input in max you have to use single numbers anway. (and btw, i would not have complained about a new rightmost inlet to vst, which takes "60 127", either)
    • Jun 19 2020 | 5:21 pm
      i would not have complained about a new rightmost inlet to vst, which takes "60 127"
      But then I would have complained about the missing channel data ;)
    • Jun 19 2020 | 5:39 pm
      ok then 16 new inlets. :D