Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can set MIDI Channel for MIDI mappings #393

Open
danngreen opened this issue Sep 26, 2024 · 2 comments
Open

Can set MIDI Channel for MIDI mappings #393

danngreen opened this issue Sep 26, 2024 · 2 comments

Comments

@danngreen
Copy link
Member

This would be to support filtering MIDI events by channel for each jack mapping.

Rough TODO list:

  • The MIDI channel would need to be baked into the patch format.

    • The jack ID is a uint16_t, and MIDI jacks occupy 0x100 - 0x500 currently, which is All Channels (aka Omni mode). We could use the top four bits to indicate channel, and have the fifth bit set to indicate channel filtering? So 0x0900 - 0x0E00 would be channel 0, up to 0xF900 - 0xFE00 would be channel 16.
    • I believe this would be the same for MIDI param mappings (check this?)
    • Or, we could add a new field to all mappings as a sibling to the jack_id/param_id. This would cause more refactoring.
  • The VCV Hub would need to decipher what MIDI channel each MIDI module is set to and put that into the patch file.

  • Controls would need to pass along the MIDI channel to the audio stream (trivial change)

  • Patch Player would need to keep track of the channels allowed for each midi event. Maybe the midi_*_conns arrays of Jack vectors would need the channel added to the Jack:

struct MidiJackMap { 
    Jack jack;
    MidiChan chan;
};
    std::array<std::vector<MidiJackMap>, MaxMidiPolyphony> midi_note_pitch_conns;
  • Add the MIDI Channel (1-16 and All) to the MIDI Input Map page
  • Somehow handle knob mappings. Maybe when sending a CC it shows the channel detected and you can click "CC## on Chan X" or "CC## on All Chans"?
  • Display the MIDI Channel in the mapping pane when you click on a mapped jack/knob
@danngreen
Copy link
Member Author

Another option that solves the same issue:

  • Send Raw MIDI events from the M4 to A7, and allow modules to map to the raw MIDI stream.

To try it out without breaking the API, we could push the MIDI values as a float.

  • Add a special jack_id to indicate it's the raw MIDI stream
  • Add a Midi Mapping id (in midi_def.hh) for raw MIDI stream, this is the panel_jack_id
  • MM ported/plugin modules using this would get the stream via CoreProcessor::set_input(RAW_MIDI_JACK_ID, float value)
    • eventually we could drop the special jack_id and add CoreProcessor::send_midi_event(Midi::RawEvent)
  • Add Params::raw_midi_event
  • M4 Controls populates raw_midi_event with whole MIDI packet (2-3 bytes), just the raw bytes (not parsed)

@danngreen
Copy link
Member Author

Raw MIDI is working the raw_midi branch, and the MIDI->CV module from Rack Core is ported and functioning. This is also part of v2.0-dev branch

TODO is to add MIDI channel selection to the MIDI->CV module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant