Hi
I had the following question.
I want my plugin, upon initialization, to automatically map parameters to some keys on the keyboard (e.g. map “asdf” to 5 toggle buttons) or midi notes without the user having to map it themselves in the DAW. Is there a practical way to do this for most DAWs?
I’m working on an audio plugin (so goes on an audio track) that wants user input, and it’d be nice to eliminate this extra step for the user.
Your plugin can respond however it wants to keyboard key presses and MIDI messages. You can’t really communicate your mappings to the host, but you can write code to modulate parameters based on MIDI CCs etc
1 Like
So I put the plugin on an audio track. Yes it can receive MIDI messages, but for example in Ableton you need to route another midi track (which takes in the midi input) to the audio track with the plugin so that the plugin receives the midi input, which is what I’m trying to avoid. I want the user to immediately be able to input key presses/ midi notes into plug-in.
Alternatively, the user can bind keys (or midi notes) to parameters, but I want the plugin to do this binding automatically when the plug-in initializes.
Can the plug-in directly receive keyboard key presses and react to that? (The plug-in is sitting in an audio track).
That’s the particular way how Ableton has decided to make Live work, there probably isn’t anything you can do in your plugin to fix that.
2 Likes
Yes thank you. I’m asking about the following.
In Ableton a user can bind certain keys to parameters in the plugin. Can you program something inside JUCE which automatically binds certain keys to certain parameters whenever the plug-in is opened inside Ableton (or any other DAW).
Control via the computer keyboard is in principle possible but with some caveats : hosts may steal the keyboard strokes before they even get to your plugin and your plugin GUI would need to be visible and in keyboard focus. You cannot register keyboard shortcuts that would be always available and sent to your plugin.
I don’t remember how well it went when I’ve tried it, but basically you could attempt it as follows :
- In your plugin GUI constructor, call
setWantsKeyboardFocus(true);
- Override your GUI editor’s
keyPressed method, make it handle the keyboard presses you are interested in and return true for those and false for presses you are not handling.
If you get it working, I’d still recommend not making your plugin depend too deeply on this kind of functionality as it might not work ideally in all situations. You’d need to check how well, if at all, the functionality works in each host and plugin format.
2 Likes
Thank you! That makes sense, yeah that functionality isn’t make or break. I’ll try it out.