rorywalsh / cabbage_v1_old

Framework for developing virtual instruments using the Csound audio synthesis programming language.
http://www.cabbageaudio.com
115 stars 15 forks source link

Export as MIDI-filter option #3

Closed falkTX closed 10 years ago

falkTX commented 10 years ago

Hi there!

I think we should have a macro for midi-filters, like we have for synths already. (Cabbage_Plugin_Midi perhaps). I kinda need this for the lv2 versions, hosts are not happy when the plugins have extra stuff it doesn't need (a MIDI filter should not have audio ports).

This is what I've been using in my cabbage builds:

#if defined(Cabbage_Plugin_Midi)
 #define JucePlugin_IsSynth              0
 #define JucePlugin_MaxNumInputChannels  0
 #define JucePlugin_MaxNumOutputChannels 0
 #define JucePlugin_PreferredChannelConfigurations {0, 0}
 #define JucePlugin_WantsMidiInput       1
 #define JucePlugin_ProducesMidiOutput   1
#elif defined(Cabbage_Plugin_Synth)
 #define JucePlugin_IsSynth              1
 #define JucePlugin_MaxNumInputChannels  0
 #define JucePlugin_MaxNumOutputChannels 2
 #define JucePlugin_PreferredChannelConfigurations {0, 2}
 #define JucePlugin_WantsMidiInput       1
 #define JucePlugin_ProducesMidiOutput   0
 #define JucePlugin_LV2Category          "InstrumentPlugin"
#else
 #define JucePlugin_IsSynth              0
 #define JucePlugin_MaxNumInputChannels  2
 #define JucePlugin_MaxNumOutputChannels 2
 #define JucePlugin_PreferredChannelConfigurations {1, 1}, {2, 2}
 #define JucePlugin_WantsMidiInput       0
 #define JucePlugin_ProducesMidiOutput   0
#endif

A MIDI filter gets MIDI in + out and no audio. Synths get a MIDI in but no MIDI out, and 2 audio outs but no audio ins. If not MIDI or Synth (regular FX), the plugin gets 2 audio ins and outs but no MIDI.

See what you think its best. After this bug is closed I'll try to do a pull request for LV2 support.

thanks!

cabbageaudio commented 10 years ago

Sorry for not getting back to you sooner, I only just saw this now. I'm not sure this will handle all cases. None of these configs allows for both MIDI and audio which I think is a useful setup. Think vocoders for example. Users may want to control the pitch with the piano roll, but they still need to route some audio signal in. I looked into MIDI only filters before and came across this thread: http://www.juce.com/forum/topic/midi-only-plugin This lead me to believe that this is not possible with Juce based plugins, but perhaps you've already found a neat way around this?

falkTX commented 10 years ago

Juce-based MIDI plugins do work. If someone says otherwise it's because they are not very smart. I've been using pizmidi plugins which are exactly that, and tested your MIDI-Matrix csd with the midi-only configuration.

about the possible 3 export choices, understand you. perhaps having those 3 options (synth, fx, midi) plus a all-in-one option (both audio and midi in + out) can work?

cabbageaudio commented 10 years ago

Yeah, that sounds reasonable. So it is possible to have a Juce based plugin with no audio inputs or outputs, great. I shouldn't believe everything I read!