How to remap all incoming MIDI notes to one note

Hi all,
For one of my software instruments I have a very unusual requirement - every note played needs a single sample (of a hand slap) played along with the note.

In other words, the note functions normally for the pitch element, with each note mapped to a tuned sample (using Kontakt in this case), but the slap sound is completely separate and never changes pitch (i.e. it is the same no matter which note is played or which MIDI channel is used)

For multiple reasons (which probably don’t require explanation) I’m wanting to achieve this by running two parallel chains in GP: one for the normal Kontakt instrument, plus another for the “slap” instrument (which at this point uses Stupid Simpler Sampler instead of Kontakt to play the slap sample).

Here’s my question:

Is it possible to script GP to remap all incoming MIDI notes (on all MIDI channels) to a single note so the sampler plays the slap without changing its pitch?

(Note: I’ve already worked out how to use GP to make this easier by remapping all MIDI channels to Channel 1 for the ‘slap’ instrument but I now need to do the same with MIDI notes)

The above would ONLY apply to the ‘slap’ instrument, which will always be played simultaneously with the pitched instrument.

Thanks!

Diggo

Yep, this is possible.

1 Like

Ha ha - thanks. Would you mind giving me more clues?
I’m new to scripting GP…

OK, please upload a small gig with your plugins and describe which plugin should only get 1 note independent of the played notes and I can write you a script.

Here you go.
The idea is to use a Widget and Map it to you MIDI In Block
In the parameters you can use a Note Number to be sent when the widget goes on.
And with a little script the widget is set to in when any note on message is received and the widget goes off when any Note off message is received.

This is the used script

var MIN : MidiInBlock
    FNOTE : Widget
    
    
//Called when a NoteOn message is received at some MidiIn block
On NoteOnEvent(m : NoteMessage) from MIN
 FNOTE.SetWidgetValue(1.0)
End

On NoteOffEvent(m : NoteMessage) from MIN
 FNOTE.SetWidgetValue(0.0)
End

And this is the example gig
AllwaysSameNote.gig (5.1 KB)

This is a very simple solution, the generate Note has always the same velocity.
When you need the velocity from the played note then a different script would be necessary, but that all is not really difficult.

2 Likes

thanks!

I’ll look at uploading the gig if I cant figure things out via the script you just supplied.
I really appreciate the help!

GP is truly awesome.

Diggo

2 Likes

Improved version, now you can set the outgoing velocity and Midi channel by 2 additional widgets
AllwaysSameNote.gig (7.0 KB)

2 Likes

With this the velocity of the incoming note set the velocity of the outgoing.

AllwaysSameNoteVel.gig (7.1 KB)

2 Likes