Skip to content

Feature: Midi Follow Mode with Midi Feedback - #889

Merged
m-m-adams merged 264 commits into
SynthstromAudible:communityfrom
seangoodvibes:Midi-Mapping-Viewless
Jan 3, 2024
Merged

Feature: Midi Follow Mode with Midi Feedback#889
m-m-adams merged 264 commits into
SynthstromAudible:communityfrom
seangoodvibes:Midi-Mapping-Viewless

Conversation

@seangoodvibes

@seangoodvibes seangoodvibes commented Dec 27, 2023

Copy link
Copy Markdown
Collaborator

MIDI Follow Mode with MIDI Feedback

image

Description:

Master MIDI follow mode whereby after setting a master MIDI follow channel for Synth/MIDI/CV clips, Kit clips, and for Parameters, all MIDI (notes + cc’s) received will be directed to control the active view (e.g. arranger view, song view, audio clip view, instrument clip view).

  • Note: although there are three types of MIDI follow channel's, all three channels will control the instrument of the active context. The three follow channel's allows you to learn different devices to MIDI follow, should you require device specific channel settings.

Comes with a MIDI feedback mode to send updated parameter values on the MIDI follow channel for mapped MIDI cc's. Feedback is sent whenever you change context on the deluge and whenever parameter values for the active context are changed.

Comes with an XML file with default CC to Deluge parameter mappings. You can customize this XML file to map CC's differently as required.

Simple summary: Set your channel(s), set your MIDI Controller(s) to the same channel(s), set a root note for your kits, confirm that your controller cc's are mapped to the parameters you want (via MIDIFollow.XML) and then play and control the deluge instruments and parameters with ease!

No more re-learning your MIDI controllers every time you start a new song, add new clips or change instrument presets.

  • Note: Your existing MIDI learnings will remain untouched and can be used together with the master MIDI follow mode.

Usage:

Set Master MIDI Follow Channel(s), Set Kit Root Note, Enable/Disable Pop-ups and Enable/Disable MIDI Feedback

To use MIDI follow mode, you will need to configure the various MIDI Follow Mode settings by entering the settings menu and going to the sub menu for MIDI -> MIDI-Follow

  • In the MIDI-Follow > Channel submenu, set the channel between 1 and 16 for Non-MPE or MPE Lower/Upper for MPE, for Synths (will apply to Synth Clips, MIDI Clips, and CV Clips), Kits and Params.
  • In the MIDI-Follow > Kit Root Note submenu, set the root note for kits between 1 and 127 in order to map MIDI Notes received to Kit rows. The root note corresponds to the bottom row in a Kit.
  • In the MIDI-Follow > Display Param submenu, enable or disable param pop-ups
  • In the MIDI-Follow > Feedback > Feedback submenu, enable or disable MIDI follow feedback
  • In the MIDI-Follow > Feedback > Automation Feedback submenu, enabled or disable MIDI follow feedback for automated parameters and set the rate at which feedback for automated parameters is sent
  • In the MIDI-Follow > Feedback > Filter Responses submenu, enable or disable filtering of responses received within 1 second of sending a MIDI feedback value update.

Input Device Differentiation

If you wish to use Input Device Differentiation with MIDI Follow Mode, you will need to learn your device to the required MIDI Follow Channel(s).

To learn the device, you need to enter the MIDI Follow Channel submenu, hold the Learn button and then send a Note or CC.

For example, if you enter the channel submenu for a Synth or Kit (e.g. MIDI-Follow > Channel > Synth or MIDI-Follow > Channel > Kit) and then press and and hold the Learn button and then send a Note to the deluge, the Deluge will update the the Synth channel to match the device and, if you are using an OLED Deluge, it will display the Device that has been learned on the screen.

Learning a Channel / Root Note

As explained above, in the MIDI-Follow Channel submenu's you can hold learn to learn a device for input differentiation. You can also use this same functionality with input differentiation off to quickly update the MIDI-Follow channel's to match the channel used by your device. Simply hold Learn and send a Note or CC for any of the channels.

You can also use this method for updating the Kit Root Note. In the Kit Root Note menu, hold Learn and send a note from your device to update the Kit Root Note.

Notes:

Notes received on the master MIDI channel will play the instrument in the active clip (e.g. a synth, MIDI clip, cv clip, or all kit rows).

  • Note 1: You can play a synth, kit, MIDI or cv clip without entering the clip from arranger or song view. Simply press and hold the clip in arranger or song view to preview the clip (as you would to change the parameters of that clip with the gold encoders) and then send notes from your MIDI controller.

  • Note 2: For Kit's, the bottom Kit row is mapped by default to the root note C1 (note # 36). All kit rows above are mapped to note's incrementally (e.g. 36, 37, 38, etc.). This kit root note # is configurable (from 0 to 127) through the Kit Root Note submenu.

  • Note 3: MIDI Follow mode will always send notes to the active clip. This means that if you leave or unselect a clip, you can still send notes to that clip because in the Deluge, that clip is still recognized as the last active clip.

CC's:

CC's received on the master MIDI channel that have been mapped to a parameter will change the value of that parameter in the active context (e.g. song, arranger, audio clip, instrument clip).

The parameters are controlled only in the current context.

  • So if you are controlling filter, for example, while in song view it will only control the song’s filter. If you enter a specific synth clip, it will only control that synths filter. If you are in a kit clip it will either control the entire kit or a specific row in that clip (depending on whether you have affect entire enabled or not)
  • In other words it checks what context you’re in and controls the parameters of that context.

Note: You can control the parameters of a synth or kit clip without entering the clip from arranger or song view. Simply press and hold the clip in arranger or song view to preview the clip (as you would to change the parameters of that clip with the gold encoders) and then send MIDI cc's from your MIDI controller to adjust the parameters.

Default MIDI CC Mappings

A default set of MIDI CC # to Deluge Parameter mappings has been created for MIDI Follow Mode. When you launch the Deluge after installing the firmware with MIDI Follow Mode, an XML file will be created to the root folder of the SD card titled "MIDIFollow.XML"

The default mappings have taken into account standard MIDI CC to parameter mappings and usages. It has also taken into account reserving of MIDI CC's for future Deluge functionality / feature implementations.

The default MIDI CC to parameter mappings, as mapped the to the parameter shortcuts on the Deluge grid are as follows:

image

  • See Appendix for detailed listing and description of default CC # to Parameter mappings.

Here are the MIDI CC #'s that have been reserved for other purposes:

image

Adjust MIDI CC Mappings

MIDI CC mappings for MIDI Follow Mode are saved to the root of your SD card in an XML file called MIDIFollow.XML

Within MIDIFollow.XML, all Parameters that can mapped to a MIDI CC are listed. The MIDI CC value is enclosed between a Parameter XML tag - e.g. <lpfFrequency>74</lpfFrequency> indicates that MIDI CC 74 is mapped to the LPF Frequency parameter. Conversely when a value of 255 is entered (e.g. <hpfFrequency>255</hpfFrequency>) it indicates that no MIDI CC value has been mapped to that parameter.

image
You can manually edit the MIDIFollow.XML to enter your MIDI CC mappings to each Parameter.

The defaults from MIDIFollow.XML are loaded automatically when you start the Deluge so you can begin controlling the deluge with your MIDI controller right away.

Note: A parameter can only be mapped to one MIDI CC. Conversely, a MIDI CC can be mapped to multiple parameters.

Display Parameter Names and Values on Screen

Note: MIDI pop-up's can be disabled in the MIDI Follow Display Param submenu.

For mapped MIDI CC's, a pop up is shown on the display whenever MIDI CC's are received to indicate the name of the parameter that is being controlled by that MIDI CC and the current value being set for that parameter.

Screen Shot 2023-12-04 at 2 32 25 AM

Note: if the MIDI CC being received is for a Parameter that cannot be controlled in the current context (e.g. trying to control Attack while in Song View), the pop-up message will say "Can't Control: Parameter Name".

Screen Shot 2023-12-04 at 2 32 03 AM

Re-cap of functionality

  1. Added new MIDI submenu for MIDI-Follow where you can:
  • Set the MIDI Follow Channel and Device for Synth Notes (which also applies to MIDI and CV clips)
  • Set the MIDI Follow Channel and Device for Kit Notes
  • Set the MIDI Follow Channel and Device for Param CC's
  • Set the MIDI Follow Root Note for Kits
  • Enable or Disable MIDI Follow Param Pop-up's
  • Enable or Disable MIDI Follow Feedback
  • Enable or Disable MIDI Follow Feedback for Automated Parameters and set the MIDI Feedback Update Rate
  • Enable or Disable MIDI Follow Feedback Filtering of MIDI CC responses received within 1 second of sending feedback
  1. When MIDI Follow Mode is enabled, a MIDI Follow Channel has been set, and you have mapped your MIDI CC's, your external controller's Notes and MIDI CC's will be automatically directed to control the Notes of the Active Instrument (e.g. Synth, Kit, MIDI, CV) or the Parameters of the Active View (e.g. Song View, Arranger View, Audio Clip View, Instrument Clip View).
  2. By default, the root note for kit's is C1 for the bottom kit row but this can be configured in the MIDI Follow menu.
  3. Pop-up's are shown on the display for mapped MIDI CC's to show the name of the parameter being controlled and value being set for the parameter. This can be disabled in the menu.
  4. MIDI feedback is sent for mapped CC's when the active context changes, change presets, or you change the value of a mapped parameter on the deluge (e.g. using mod encoders or select encoder if you're int he menu). MIDI feedback can be disabled in the menu.
  5. MIDI feedback for automated parameters can also be sent and can be enabled or disabled in the MIDI feedback sub menu. When enabled, you choose between 3 speeds at which to send feedback for automated parameters: Low (500 ms), Medium (150 ms), High (40 ms). Sending automated parameter feedback can be taxing on the deluge MIDI output system, so depending on the amount of automation you do, you may want to adjust the speed (e.g. slow it down) to not affect the performance of the Deluge.
  6. MIDI feedback can cause an undesirable result with certain applications when the application responds back to the Deluge after the Deluge has sent it an updated value (Loopy Pro and Drambo on iPad are known to do this). This can cause lag in the deluge and potential feedback loops. To handle this, a toggable filter was added which ignores messages received for the same ccNumber within 1 second of sending a MIDI feedback update. If the application receiving the MIDI feedback update does not send responses back to the Deluge, then this setting should be set to Disabled in the MIDI Feedback Filter Responses sub menu.

Appendix - List of Deluge Parameters with Default Mapped CC's

image

Fixed a bug whereby stutter was going back to previous value when you were using the quantized stutter community feature
Broke padAction into two sub-functions: padPressAction and padReleaseAction
clean up of padPressAction and padReleaseAction functions so that they can be called to reset/erase grid.
- Added press <> + back combo to clear changed values and reset them back to original values before changes were made
- Renamed "Performance Mode" to "Performance View" on the display
Just a quick function name change reference that was forgotten
<> + back now clears stutter also
Added code to enable you to leave performance view when stutter is enabled by first disabling stutter
Added ability to load and save default FX values for each column and row in the deluge grid by using the Load and Save buttons.

Still work to do to clean up the code and load defaults at run-time.

Also considering a UX for setting defaults directly on the deluge.
Refactoring of code to read/write default FX values from PerformanceView.XML

Implemented changes to XML structure per advice from dev team.
- Some updates to rendering of display

- Started work on editing mode for performance view
- Added editing mode so you can edit default values assigned to each pad on the grid
- Enter/Exit Editing mode by pressing Select encoder
- In Editing Mode, press and hold a pad or select the pad (white) and turn select encoder to adjust value
- When changes have been made, the Save button will flash to indicate unsaved changes.
- Pressing Load/Save will stop save button from flashing
- Load button loads defaults previously saved
- Save button saves your changes
- Defaults are loaded when the view is opened

- Also disabled Horizontal and Vertical encoder button actions
- Also disabled Back button action as undo doesn't work well in this view (at the moment)
Accidentally removed ability to clear performance effects using the horizontal encoder button and back button in previous commit

This commit fixes that
Fixed issue where select encoder might reduce knobPos < 0 or increase knobPos > 128
Fixed bug where you couldn't disable stutter after triggering it with stutter pads
Changed editing mode shortcut from pressing on select encoder to learn / input button
This is a work in progress, still a lot of changes to be made and still bugs to fix.

Just committing so I don't lose my work!!

Summary:

- Created new menu for song/performance view FX
- Created new editor mode toggle in the menu to switch between editing mode and non-editing mode
- When in editing mode, pressing pads on the grid will open the sound editor menu where you can use the select encoder to fine tune pad values

Known bugs:
- disabling a held pad does not switch the menu
- pressing stutter pad does not open menu
- active stutter makes menu unusable / cant open menu
- glitching between old display and menu display
More improvements to editor mode

- allowed stutter to remain enabled while using the menu
- allowed back button and save button to be used while stutter is enabled
- allowed pad shortcuts to be used while stutter is enabled
- Refactored strings to l10n

- Added shortcut for stutter menu to paramShortcuts array in menus.cpp to allow for jumping into stutter menu. It was slotted into the dev shortcut pad on the grid (not intended to be used as an actual shortcut)

- Fixed bug that wouldn't permit the settings menu from opening

- Replaced pair std array of songParamsForPerformance with a struct that includes the x, y coords of the param shortcuts on the grid (used for jumping into menu by feeding x,y to the shortcuts function in soundEditor

- Minor change to quantize stutter code as the previous implementation was causing problems displaying the accurate "stutter rate" value in the menu's because it worked by temporarily change the stutter rate parameter to 0 for use in calculations. Instead of changing the actual parameter's value to 0, I simply substituted 0 into the variable used in the quantize stutter calculation. The result is the same and the menu continues to display the stutter rate that was set before stutter was activated.
Expanded menu to include other FX attributes (e.g. modes, types, reverb room size, etc.)

Re-ordered mod-fx on the performance grid to: Rate, Depth, Feedback, Offset
Not finished yet, pushing changes to save my work :). Do not use this latest commit as it will not work yet (see below).

- Expanded PerformanceView.XML to include tag for Param for each FX column. Mapping of these Param strings to Param's has not been completed. So the view will not work at the moment.

- If you enter the wrong Param name in the XML or remove a Param from an FX column, that FX column in Performance View will not be rendered grey and unusable. Still work to be done to allow the user to assign a Param to these grey columns in Editor Mode.

- Created new struct LayoutForPerformance which is updated on XML read with the Parameter to FX column assignments

- Refactored more strings to l10n

- Added view display for Song VIew and Arranger View to render "Song View" when in song and "Arranger View" when in Arranger

- Added Song FX menu to Song View, accessed by pressing down on Select Encoder

- Replaced a bunch of "Buttons::isShiftButtonPressed()" checks with Buttons::isButtonPressed(deluge::hid::button::SHIFT) to check if Shift is actually pressed (and not sticky shift pressed)

- Changed way of getting into Performance View. You now get into Performance View by using the Song button and cycling through Song-Arranger-Performance

- Fix bug where if a pad was held in Performance View and you updated the Param value using mod encoder, the value displayed on the screen wouldn't match the updated mod encoder value. New function was added "getParameterValue" to solve this bug.

- After letting go of a pad, the screen continues to display the last held pad and the current value. If however, you change that value with mod encoder, that screen would become out of date. So instead, if you let go of a pad and then subsequently use a mod encoder, the display will now reset to just display "Performance View"

- Added back button shortcut to enter/exit Editor Mode - use the Affect Entire button while in Performance View to enter/exit Editor Mode. When in Editor Mode, the Affect Entire button will flash and when not in Editor Mode, it won't flash.
Added ability to convert Param ID to Param Name and write it to XML

Added ability to read Param Name from XML and convert it to Param ID

Added default Layout of Parameters to FX Columns that is loaded when no PerformanceView.XML file is present.
Fixed bug whereby sidechain volume in a kit with affect entire enabled was showing the same value range as pan (-25 to +25)

Fixed rounding bug whereby value displayed on popup may be off by 1 compared to value displayed in menu. Fixed this by changing to float math.
Undid previous change that replaced Buttons::isShiftButtonPressed() with Buttons::isButtonPressed(deluge::hid::button::SHIFT) to check if shift button was really pressed
Undo changes which enabled entry into performance view from arranger view.
Switched to keyboard button to enter/exit performance view

Added shift + keyboard shortcut within performance view to get into editor mode
Comment thread src/deluge/model/mod_controllable/mod_controllable_audio.cpp Outdated
Comment thread src/deluge/storage/flash_storage.cpp Outdated
Comment thread src/deluge/io/midi/midi_engine.cpp Outdated
Comment thread src/deluge/gui/ui/menus.cpp Outdated
Comment thread src/deluge/io/midi/midi_engine.cpp Outdated
Comment thread src/deluge/io/midi/midi_follow.cpp Outdated
Comment thread src/deluge/io/midi/midi_follow.cpp Outdated
Comment thread src/deluge/io/midi/midi_follow.cpp Outdated
@m-m-adams
m-m-adams enabled auto-merge January 3, 2024 19:48
@m-m-adams
m-m-adams added this pull request to the merge queue Jan 3, 2024
Merged via the queue into SynthstromAudible:community with commit 5e88ec7 Jan 3, 2024
@kleinstar1

Copy link
Copy Markdown
Contributor

Hey...Happy new years and OMG! today is christmas again :) It`s sooo much fun and just ..wow! I am probably the first after you active-programming guys who tried it :) Used your build from here as its not in the nightly. I used the midi fighter twister and also the led feedback is really adapting to what I press..it works like charm. Such a big day today :) Also in kit affect entire or row, updating, can record automations and the leds are flickering :) Thank you very much sir!
Why did you decide against the learning view - you already had it done.
One last thing I wanted to know: why did you close the snake game weeks before?
Would you participate from the donations? :)
Greetings, Roland from germany

@seangoodvibes

Copy link
Copy Markdown
Collaborator Author

Hey...Happy new years and OMG! today is christmas again :) It`s sooo much fun and just ..wow! I am probably the first after you active-programming guys who tried it :) Used your build from here as its not in the nightly. I used the midi fighter twister and also the led feedback is really adapting to what I press..it works like charm. Such a big day today :) Also in kit affect entire or row, updating, can record automations and the leds are flickering :) Thank you very much sir! Why did you decide against the learning view - you already had it done. One last thing I wanted to know: why did you close the snake game weeks before? Would you participate from the donations? :) Greetings, Roland from germany

Hey! Great to hear that its s working for you :D! Makes me want to get a midi fighter twister ahah.

As for removing learning view - I know it was done and I really liked it, but we're trying to keep the deluge performance as high as possible which means reducing the size impact of new features. The learning view wasn't regarded as a "must have" in this case and by removing it, it simplified the feature's code quite a bit. I know it was definitely useful for learning your controllers, but alas it is gone :).

As for the snake game, I just closed it for now because I don't have the time to work on it. I focused my time on performance view, this feature, automation view for audio clips and other things improvements :).

I'm sure I'll get back to snake game one of these days ahah.

@sapphire-arches sapphire-arches added this to the Release 1.1 milestone Jan 11, 2024
@seangoodvibes
seangoodvibes deleted the Midi-Mapping-Viewless branch February 22, 2024 23:26
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

Successfully merging this pull request may close these issues.

4 participants