Disabling global transpose for midi player

I have a midi file with a bunch of tracks. One of these tracks is a drum track for which I would like to ignore the global transpose.

Tried everything but couldn’t seem to get it done

Any suggestions?

A scriptlet should get your MIDI output sorted.

//Called when a NoteOn or NoteOff message is received
//Note: this will NOT be called for NoteOn/NoteOff messages if you have explicit
//NoteOnEvent/NoteOffEvent respectively callbacks defined
On NoteEvent(m : NoteMessage)
    var note : integer = GetNoteNumber(m)
    if GetChannel(m) == 10 then
        note = note - GetGlobalTranspose() 
        m = WithNoteNumber(m,note)
    end
    SendNow(m)
End

But I agree this is a common requirement and should be an option in the player.

3 Likes

Thanks. This definitely unblocks me !
Since I already have a midi channel constrainer, I can even place this scriptlet after it and then it becomes generic (no need to use the midi channel condition).

Nice - for efficiency I would simplify it slightly by just writing

On NoteEvent(m : NoteMessage)
    if GetChannel(m) == 10 
       then SendNow(WithNoteNumber(m, GetNoteNumber(m) - GetGlobalTranspose() ))
    end   
End

That way you don’t get the NoteNumber unless it’s actually needed and you also save a few assignments