MIDI generator plugin using Juice?


#1

Dear all,

I’m just about to implement a cross-platform generative music engine plugin, with a complex GUI.

I want to figure-out if I should do this with wxWidgets, Juce, or some alternative (maybe even write my own simple layer). I have done many years of cross-platform coding, both audio and GUI, and would like to be able to take advantage of pre-written cross-platform GUI layer to accelerate development if at all possible. :slight_smile:

It looks like I have a couple of basic options, including writing an MFX for Cakewalk (MIDI sub-variant of DXi), or a MIDI effect for VST-compatible hosts. I’ve looked at the various SDKs, and
http://www.midiplugins.com/faq.aspx
amongst other places.

If I want to write a generative MIDI plugin for VST, then as far as I can tell, that requires me to implement the plugin as a “MIDI effect” using the “Steinberg MIDI Effect API” that is part of the “VST Module Architecture”. If anybody is interested, this is all documented here:

http://ygrabit.steinberg.de/~ygrabit/public_html/vstsdk/OnlineDoc/VST_Module_Architecture_SDK/index.html

Now then… on to the meat of this post. Juce looks like an interesting alternative to wxWidgets, which raises the following questions:

  1. It is not clear to me whether or not Juce supports the implementation of MIDI effect components as outlined above. Can anybody please clarify this?
  2. Similarly, has anybody implemented an MFX (or DXi !) using Juce? I’m not sure if that would be at all easy, the MFX/DXi APIs are highly Windows-specific…
  3. Has anybody figured-out if you can write a pure MIDI event generator or event responder) plugin as a VSTi? Maybe I don’t need to write an “MIDI effect” at all, but could do this as a type of VSTi? If the answer to 1. was “No”, but 3 was “Yes”, then that might mean that Juce is OK to use.
  4. I presume that multiple instances of the same Juce-based plugin (dll) can be launched at the same time by the host sequencer… without interfering with each other?
  5. Does anybody happen to know if MIDI Effect plugins (VST Module Architecture) are fully supported by modern Cakewalk tools?
  6. Am I missing something, but do AU units really not allow units to generate (or modify) MIDI events that can be passed down-stream to other AU plugins (e.g. to downstream synth units)?
  7. I know this final question isn’t Juce-specific, but I’d be interested to hear if anybody has an opinion on the future of MFX/DXi as compared to VST MIDI effects…

A lot of questions, but I need to be sure that Juce would take me where I need to go! :slight_smile:

Thank you for your time! :slight_smile:

Pete


#2

Hi there

I’ve never bothered trying to do a wrapper for MFX plugins with Juce because I can’t really see the point of them - any juce VST can act as a pure midi in/out plugin and it’ll work in pretty much any VST host.

And yes, as far as I can tell, AUs can’t output midi… Maybe one day Apple will sort that out, it seems a bit of a limitation.


#3

Hi Jules,

Many thanks for the comment!

  1. I see this in juce_AudioUnitWrapper.cpp:

#if JucePlugin_ProducesMidiOutput

… which leaves me a little puzzled, if AUs can’t produce MIDI output? Or is that code there just to discard any internally generated MIDI events (and not actually do anything with them)?

  1. For the avoidance of doubt, can you have multiple instances of the same Juce-based VST GUI active at the same time within the same host, without them interfering with each other? I ask this as I see this in the DllMain… which made me wonder if one GUI closing might accidentally bring down other GUI instances for the same VST…

    else if (dwReason == DLL_PROCESS_DETACH)
    {
    shutdownJuce_GUI();
    }

With best regards,

Pete


#4

I put that code in the AU stuff while trying to figure out if there was a way of getting midi out, and maybe one day it’ll come in handy. And yes, of course it’s possible to have multiple instances open.

I’d suggest not looking inside the platform specific code unless you actually hit any problems with it!


#5

Thanks Jules. :slight_smile:


#6

Right, I give in. I’m using Cubase SE 3 (Win / Mac) and can’t for the life of me figure-out how to connect the MIDI output from my candidate MIDI-generating Juce-based VSTi into the input of another VSTi. Am I missing something, is this even possible within Cubase? Is it a feature that arrives in some version after mine?

TIA!!

Pete


#7

Haven’t the faintest idea how to use cubase. In tracktion you just stick the plugins next to each other and the midi follows the same path as the audio. Wouldn’t have thought cubase would be much different.


#8

Many thanks for the suggestion Jules, I’ll take another look! I’m calling-in favours from Cubase-using friends to see if they can help me figure it out (lucky them!).

Question time:

  • has anybody created a MIDI Effect with Juce? (using the VST Module Architecture)
  • has anybody got a “hello-world” example of this that they’d be willing to share?
  • failing that, would some kind sould please suggest how I should go about binding-in a Juce component to the VST Module Architecture request for a UI…???

Similarly for MFX control (or DXi!!!) using Juce:

  • has anybody created an MFX for Juce? (Cakewalk SDK)
    (or even a DXi!)
  • has anybody got a “hello-world” example of this that they’d be willing to share?
  • any ideas how I would go about creating a Juce component that provides a UI for the MFX?

I’m ever the optimist. :slight_smile:

Thanks folks,

Pete


#9

Honestly, it’s really a no-brainer to do a midi-to-midi plug - in your processBlock method you just pull the incoming messages out of the midiBuffer, and if you want to send any messages, you leave them in the midiBuffer.

That’s all there is to it, but you seem to be finding it far more complex!?


#10

Hi Jules,

Yes, totally understood, you’re entirely correct that the MIDI-generation mode in the VST plugin is a piece-of-cake. And I doff my hat to your very nicely engineered audio filter hierarchy, which makes it very simple indeed. :slight_smile:

My problem rather is that I can’t figure-out how to get the MIDI output from my VST (Juce-based, or otherwise for that matter!) into another VST; under either Cubase SE 3 or Sonar 4 [my two sequencers]. However, I can do it trivially as a Midi Effect [n Cubase] [or as MFX in Sonar]; albeit without a Juce-based GUI (as I can’t see how to do that for either of these two “pure-MIDI” approaches).

So, to summarise, I need to find-out if the sequencers I have are both missing this capability, or am I simply failing in figuring-out how to achieve what I want with them; if it turns out that for some reason I really can’t do this with Cubase SE/Sonar 4 [but maybe can with other sequencers as you mention] then it’d make sense for me create Midi Effect / MFX to hit a larger market. And that raises the Juce GUI questions (i.e. how to construct a GUI for such a component with Juce).

HTH! :slight_smile:

Pete


#11

most (or some) DAWs like Live! or FLstudio or Tracktion (i think) have internal routing capabilities. witch enables you to connect any input to any output of any plugin and create any sort of MIDI chain. I don’t know about CIbase SX as i only worked with the old VST versions and i definetly don’t know about Sonar cause i never touched it. But others do have it and it’s a no problem with VST.


#12

Cheers atom!!! that confirms what I’d suspected.

My problem is that I don’t want to create a plugin that works under some sequencers and not others. :frowning: If you do happen to hear a magic way to do what I want with Cubase SX or Sonar, please let me know!! Meantime, I’ll keep on trying. :frowning:

One thing I’ve learned from all this is how much variation there is in terms of implementation, not just in sequencers but also in plugin frameworks. Like, who’d have thought that AU plugins don’t support MIDI generation?! :shock:

Pete


#13

Hi folks,

Right, thanks to a friend, I found a tool that lets me get
a MIDI-generating VSTi playing. I downloaded the following tool for
Windows (“REAPER is uncrippled unexpiring shareware. Be sure to
purchase a license if you use it past the evaluation period. The full
license agreement will be presented to you when you run the installer.”):

http://www.reaper.fm/download.php

Close the start-up project.
Create a new project.
Select Insert -> New MIDI Item (automatically creates an empty MIDI track)
Press the FX button on the track that is created
Add the MIDI generating VSTi of your choice (… if the one you want
is not listed automatically, then select Options->FX Plugin Settings
from the FX windows menu, then Plugins -> VST and press the Add button
to find the folder with your plugin, and then rescan).

Add another :slight_smile: VSTi after the MIDI-generating VSTi, e.g. your
favourite MIDI synth. This is used to actually render the MIDI output
from the previous plugin.

Get it all playing. You’ll hear music playing through your synth. Woo
hoo! :slight_smile:

This still leaves the question, of how to do the same thing with with
Cubase SE 3, and Sonar Home Studio 4!!! Maybe it just isn’t possible
with those tools … hoping one of you can advise!

Question: are there any “cheap” Reaper-equivalent tools for the Mac
that one could use?

Pete


#14

Hi Folks,

I’ve just been asked via PM what I ended up doing to implement a midi generator plugin with a GUI to work with Cubase…

So, to answer that as best I can…

VSTi - works directly with hosts such as Reaper, but in some hosts you have to route via an external MIDI device (e.g. IAC or MIDI Yoke); there are tutorial videos on YouTube/Vimeo (linked to from the Intermorphic website) showing you how to do this hooking-up from the user perspective http://www.intermorphic.com/tools/noatikl/doc/noatiklUG_general_16.html.

Audio Unit - can’t emit MIDI events due to limitation of AU spec. :slight_smile:

VST MIDI Effect - we wrote a Juce-based adaptor for this; got it working for Windows, but couldn’t get it “found” by Mac Cubase despite a lot of effort trying!

DXI/MFX MIDI Effect - we wrote a Juce-based adaptor for this; you can use it from Sonar etc.

More info from http://www.intermorphic.com/tools/noatikl/index.html

With best wishes to all Jucers! :slight_smile:

Pete


#15

Hey, is there any news on that?

We’d desperately want to be able to do a pure MIDI plugin, which is recognized as such (and not as an audio effect), to avoid confusion for the users and to avoid confusing routings with some hosts.


#16

Hi Jakob,

Very unusual to be creating a MIDI plug-in, there aren’t many of those around it would seem apart from our own Noatikl! :slight_smile: What are you trying to create?

The solution we adopted is a hybrid: in VST mode, you can deliver MIDI events through the Sequencer pipeline, or via e.g. an IAC port if necessary. In AU mode, the only option is to deliver through e.g. an IAC port. You can download a copy Noaitikl to have a play, from the Intermorphic site, if you’re interested to see what we did. The older MIDI plug-in formats referred to earlier in this thread (VST MIDI Effect, DXI/MFX MIDI Effect) really don’t exist any more. VST and AU are where its at!

Of course, both VST and AU accept incoming MIDI data. it is the onward-delivery of MIDI data that is problematic: AU is useless in this regards, and not all VST hosts are equal!

Best wishes,

Pete


#17

[quote=“peteatjuce”]Hi Jakob,
Very unusual to be creating a MIDI plug-in, there aren’t many of those around it would seem apart from our own Noatikl! :slight_smile: What are you trying to create?[/quote]
Hi Pete, we’d like to do a MIDI effect that outputs MIDI CC values for modulating effects and instruments.

It’s an interesting approach that you took with offering IAC ports. I did not know that VST MIDI Effect has been dropped. You mean, almost no hosts are supporting it?


#18

Hi Jakob,

Our customers use Noatikl for a lot of things - MIDI event generation is one of its applications. :slight_smile:

Yep, that is right, so far as I know.

Best of luck creating your product - Juce is a great tool for you to have chosen!

Pete


#19