FADER module to send MIDI Notes

Hello :))

I’m running into an issue that I suppose is solvable.

I would like to send those MIDI notes with a FADER UI element :
F4, F#/4, G4, G#/4, A4, A#/4, B4, C5, C#/5, D5, D#/5, E5, F5, F#/5, G5, G#/5, A5, A#/5, B5, C6, C#/6, D6, D#/6, E6, F6, F#/6, G6, G#/6, A6, A#/6, B6, C7

I cannot select Note in the MESSAGE TYPE dropdown menu.

Thank you!

You need to be more specific.
A MIDI note on itself is just a value between 0 and 127. And to show a note on the screen is just a format function. So these are easy to show and select.

But with just one fader…, how exactly do you want to send? when should the MIDI note on happen? When should the MIDI note off happen?

What is the purpose?

In that particular case I want to control pitch value of a Sequential TOM.
It’s an old MIDI implementation and they used MIDI notes for most of it.
The list of notes I shared correspond to the 32 pitches at which a drum hit can be played.
MIDI note on/off should happen when the FADER value changes (note duration can stay minimal).
I am thinking of testing with a velocity of 0 (which might work to keep that pitch control silent).

Clear. The way I’d do it:

  1. you create a virtual fader with a range covering the note values you need.

  2. To the fader you assign a function you call ‘sendTomNote’.

In lua you create that function, receiving the note value from the fader , that does the following:

  • execute midi.sendNoteOn (port, channel, value, velocity)
    (you can try with replacing velocity by 0, but some instuments see this as equal to a note off. you’ll need to test)
  • If the test with velocity = 0 fails, send the NoteOn with velocity = 1. In that case , also execute
    midi.sendNoteOff (port, channel, value, 0) afterwards. The duration will then be the time for the 2 commands to follow each other. It can’t be any shorter :slight_smile:

By the way don’t forget to set the variables ‘port’ and ‘channel’ so the E1 knows what to execute!

  1. For the formatting, you could add a formatter function to the fader you call ‘displayNotes’

In lua you’ll need to add a table and the formatting function. You can use the following as inspiration (you may have to change the constants in the formula to make it result in the right note).

notes = {
    "C %d ",
    "D %d ",
    "E %d ",
    "F %d ",
    "G %d ",
    "A %d ",
    "B %d "

function displayNotes (valueObject, value)
  return (string.format(notes[math.fmod(value, 12) +1], (value// 12)-1))
1 Like

Thank you very much I will test that!

1 Like

It worked nicely!
Big improvement for that characterful drum machine!
Thanks a lot for the quick help @NewIgnis

1 Like