Sending and changing note messages

I want to send a note event when the rackspace activates. Not a big deal:

var DMX: MidiOutBlock

// Called when rackspace is activated
On Activate
var note: NoteMessage
  
    // Send C3 with Velocity 100 on channel 1
    note = MakeNoteMessageEx(C3, 100, 0)
    DMX.SendNowExternal(note)

    // Send NoteOff (Velocity = 0)
    note = MakeNoteMessageEx(C3, 0, 0)
    DMX.SendNowExternal(note)
End

Two issues/bugs/FRs:

1.) Instead of using MakeNoteMessageEx for the NoteOff I wanted to use WithVelocity, but WithVelocity doesn’t work. Well, it does work, but it does exactly the same as WithNoteNumber :smiley: (copy and paste? :)) and won’t change the velocity.

2.) There’s a SendLater function (for MIDI In Blocks) but no SendLaterExternal so I don’t know how to delay the NoteOff for some milliseconds. Do you consider adding such a function?

Not that easily. However, what you’re trying to accomplish is easy already. Create a new MidiInBlock (make it an unused OSC block so it’s not tied to an existing MIDI device), give it a script name, and connect it to a MidiOutBlock.

Now just refer to that MidiInBlock in your script :slight_smile:

Test.