FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 

UPDATED ChucK controlling VST in Cubase
MUFF WIGGLER Forum Index -> Music Software  
Author UPDATED ChucK controlling VST in Cubase
hi, I've asked this in the ChucK forum but so far no joy.

I'd like to be able to use ChucK to create sequencers / sequences which are then played by VSTs within Cubase.

I'd like to check first by sending some simple MIDI from ChucK just to test the set up

I looked at the code in the Kadenze course and also some elsewhere and the simplest example I came up with is;

MidiOut mout;
MidiMsg msg;

if( ! 0 ) ) me.exit();

144 => msg.data1;
52 => msg.data2;
100 => msg.data3;
mout.send( msg );

1::second => now;

I've set the MIDI out in Chuck as LoopMidi Port and in Cubase I have LoopMidi Port as the MIDI in.

I hit shred it plays. Hurrah! Then I hit play again and it all locks up and I get a "Programme not working" message for the miniAudicle.

Then I realise it's not playing the VST. It seems to be playing a GM piano - even if I don't have Cubase running - or even LoopMIDI - not sure how that's happening.

I haven't had the same issue using PureData or Reaktor (standalone) - they all route the MIDI via loopMIDI ok.

Any ideas?
Only thing i'd say you're missing is any kind of time passing. I think even MIDI communication needs some kind of manipulation of 'now'...

Could be wrong, but as Chuck uses 'atomic' computation that means that all MIDI would be sent at the exact same timepoint unless you move forward in time in some way. MIDI is also an extension of the Event class, which explicitly causes 'now' to advance and wait for input, so they must have some relation.
hi, yes, I thought of that this morning! I've just amended my original post

Unfortunately what happens is that the miniAudicle plays once - then if you hit it again you get the "Programme is not working" message from windows.
i havent used windows for anything in years, so sorry, i have no clue what you can do now
i have not used chuck to send midi to other programs, but I input midi from controllers all the time so maybe my comment will apply here

the way chuck handles time the basic code you posted will run for 1 second and then stop.

usually you need to explicitly make time run in a chuck script. so almost all my chuck code has something like:

//some code

so with the above the code in the brackets will evaluate, 1 second will pass, and because the while loop continues to be true (i.e. the conditional of the while loop is true) the code will run again...and again every 1 second. you only hit 'add shred' once.

probably your next troubleshooting step is put your basic midi example in a while loop which will send the midi data every second, or every 100 samples or whatever.
MUFF WIGGLER Forum Index -> Music Software  
Page 1 of 1
Powered by phpBB © phpBB Group