# Making K2 remember controller data after program change?



## lee (Dec 22, 2006)

Is there a workaround/solution for this? Workaround in Cubase?

(Using program change in banks -> K2 doesnt "remember" controller data.)

This is the thing stopping me from using banks instead of keyswitching.

I´m using Cubase Sl3 btw.

/Johnny


----------



## Thonex (Dec 22, 2006)

Interesting post... I was thinking about this too. I usually play any CC stuff before I even touch a key so it's not a big issue for me, but I can see how this could be a problem. I think there could be a fairly simple script that would "remember the last state of all your CC's and then recall them with a trigger CC

hhmmmm... I'll have to think about it when I have some time in January.

Cheers,

T


----------



## lee (Dec 22, 2006)

You think it could be fairly simple Thonex?  Would be great if a script could "fix" it. I guess you´d run that script on every instrument in the bank then. There is no such thing as bank in the scripting language right?

Peace,

/Johnny


----------



## Thonex (Dec 22, 2006)

There are no "bank" commands in the ksp language.

But yes, ultimately, you would have to put this on any patch in the bank that you wanted to remember it's CCs... and you'd have to send a trigger CC to have it "recall" it's previous settings.

The only thing about a script like this is... I've run into CC anomalies in KSP and I don't 100% trust it's execution.

T


----------



## Thonex (Dec 22, 2006)

I just tried creating an Instrument bank with a few instruments and sent them different CC for vol, Freq-off etc... and all the instruments inside the bank "remembered" their settings..... so I think you don't need a script.
:?:


----------



## lee (Dec 22, 2006)

Oh, I think you misunderstood me. (or?)

I meant, if you have several instruments inside a bank, and you´ve recorded, say expression, or something to control volume of one instrument, when you switch (change program), that expression controller value wont be remembered for the "new" instrument that you switched to. You´d have to reinput it.

See?

/Johnny


----------



## kotori (Dec 22, 2006)

It should be possible to implement this as a MIDI plugin in ones sequencer using MfxScript or some other solution. The plugin could automatically resend MIDI CCs on program change.

Multi scripts can already do this in Kontakt, but it seems NI thinks that exposing this functionality is more trouble than it's worth so they only use it for internal stuff in Bandstand and such. It would be nice if Kontakt implemented some option for this on banks. The CCs wouldn't have to be broadcast (this could be inefficient in the general case). Rather, some user-specified set of MIDI CCs could be resent on program change.


----------



## lee (Dec 28, 2006)

*Re: Making K2 carry controller data across program change?*

Interesting, thanx for the replies.

Thought nr 1:
Nils, you´re a cubase sl/sx user right? Do you think it could be done using the input transformer/transformer midi plug? I´m no programmer (yes, I should be ashamed of myself :oops: ) but it seems quite advance and perhaps capable of a thing like that, if you know how to program and write your own preset.

Thought nr 2:
There is a way of using keyswitching to send program changes when using banks. Would it be possible to keep the program change "triggering" in the form of keyswitches, even in the recorded tracks? Maybe using scripts on every instrument in the bank or by using a midiplug? I agree with what Nils has written before: Editing keyswitches is more intuitive in Cubase, than editing program changes.

Edit: Maybe one can use a script (mfx?) that translates keys into program changes, and then make cubase filter the actual program change message, so that it´s only the keys that trigger it, in the recorded track?

Hm..

/Johnny


----------



## lee (Jan 5, 2007)

Bump

Mfxscript isnt available anymore, I´m afraid.

Been searching the web for a midi plug that resends midi cc after program change, but havent found anything. Maybe I`ll have to find a mfx programmer and ask for help.

/Johnny


----------



## mbncp (Jan 5, 2007)

You have 24 hours to download it from here :
http://homepage.hispeed.ch/mbncp/download/MfxScript.zip
(see the readme file for installation)

Make sure to download my updated wrapper as well, to be placed in the Components folder of Cubase:
http://homepage.hispeed.ch/mbncp/download/mfxwrapper.zip

If I get you right, you want to:
1) Be able to send a note message that will be converted to a given Patch Change event.
2) Whenever a patch change occurs, re-send current state of certain/all CC, Pitch Bend, Aftertouch,...

Correct ?


----------



## lee (Jan 5, 2007)

Thank you mbncp!

You´re right about nr 2.

The nr 1, I´m trying to figure out exactly how I want it. Yes, I want to trigger program change with note messages, but I dont want the program change to be recorded, but rather triggered. So not converted, but rather on the fly triggered by the notes (chosen for the "keyswitch"-program change) so that it works during recording and after (in the track).

I´m so thankful! Any mfxscript resources/documentation you think I should have a look on?
/Johnny


----------



## mbncp (Jan 5, 2007)

That's the way mfx plugs (MIDI inserts) work in Cubase or Sonar.
If you use keyswitch to record patch changes, only the key will be recorded, not the patch change. The conversion is done anytime by the plug, either when playing live or on track playback.
It is possible to use Merge MIDI in loop, if you want data changed by the plug to appear in the track, though that's not what you want in this case.
Even with the resend CC thing, so you can move, add, remove a keyswitch whenever you want without having to worry about the CC change, as this is always handled by the plug.
Note that it is important to have Chase Events( at least for CC) checked in the Cubase prefs (MIDI).


----------



## mbncp (Jan 5, 2007)

Ok, you can give it a try.

Insert an instance of MfxScript in your Cubase track.
In MfxScript, click Edit, delete everything in the editor and paste the content of the script.
Adjust the different settings :


> ' Create key number ("C-2" - "G8"), Patch number (1-128) pairs
> KeySwitch = Array("C0", 1, "D0", 2, "E0", 3, "F0", 4)
> CC = Array(1, 7, 10) ' CCs to Resend (0-127, 0-127,..)
> PitchWheel = True ' Re-send Pitch Wheel -> True or False
> ...


When done, close the editor, click on the blue arrow to start the script.
I didn't test everything combi, but it seems to work .
Let me know if you have a problem.


----------



## Thonex (Jan 5, 2007)

mbncp @ Fri Jan 05 said:


> Ok, you can give it a try.
> 
> Insert an instance of MfxScript in your Cubase track.
> In MfxScript, click Edit, delete everything in the editor and paste the content of the script.
> ...



Dude... I think you are my hero.... I'm just sort of casually watching this thread and all of a sudden you are talking about copy/pasting code into Cubase (therefore Nuendo too) via a midi plugin called mfx plugs.... am I reading this right???

Where can I find out more about these plugs and how to program for them??
Thanks for any help.

Cheers,

T


----------



## mbncp (Jan 5, 2007)

Hi Thonex, there are different tools to write MIDI or AUDIO plug for Cubase/Nuendo.

First you have the SDKs, VST, VST Module Architect or the Mfx SDK. VST is for MIDI and audio while the later are for MIDI only.
All 3 require good C/C++ knowledge though you can write VST plugs using Delphi.

Then you have tools like Synthedit, Synthmaker that allow the creation of VSt plugs without programming knowledge.

MfxScript is a MIDI only plug (windows only) that I created some time ago which is based on the Mfx SDK from Cakewalk (Sonar). To work in Cubase it needs the MfxWrapper (actually a VST-MA plug).
MfxScript uses vbscript (very close to VBA) as the main language with the Mfx extension needed for the MIDI stuff. It can also read/write MIDI files and has a bunch of macro functions (sendkey, mouse,..).
The bad thing is that there is no doc, but by looking at the examples and using the vbscript help file from MS:
http://www.microsoft.com/downloads/...48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en
This is the latest vbscript file:
http://www.microsoft.com/downloads/...43-7e4b-4622-86eb-95a22b832caa&DisplayLang=en


----------



## Thonex (Jan 5, 2007)

mbncp @ Fri Jan 05 said:


> Hi Thonex, there are different tools to write MIDI or AUDIO plug for Cubase/Nuendo.
> 
> First you have the SDKs, VST, VST Module Architect or the Mfx SDK. VST is for MIDI and audio while the later are for MIDI only.
> All 3 require good C/C++ knowledge though you can write VST plugs using Delphi.
> ...



Thanks man!!!

There is a lot of info there... I guess I should slowly start getting into C++. I've always sort of wanted to get into it anyway.... one day.... but finding the time is the problem :lol: 

Thanks again.

Cheers,

T


----------



## lee (Jan 6, 2007)

Thank you a thousand, mbncp!

Will try your suggestion out as soon as I can.

 

/Johnny

mbncp: How are your new projects going? If I understand correctly you removed the mfxscript from public and desided to do something commercial? no?


----------



## mbncp (Jan 6, 2007)

lee @ Sat Jan 06 said:


> mbncp: How are your new projects going? If I understand correctly you removed the mfxscript from public and decided to do something commercial? no?



No, I'm trying to go away from making dependent plugs (VST, VSTMA, MFX,..). Too many bugs that never get fixed on the host side, ending up spending more time in workarounds than having fun with the tools.

Currently I'm not using a DAW at all, but use excel and vba scripting for composing and playing along.
I made an ocx derived from mfxscript that I can use for the MIDI stuff in excel or actually any dev tool or application supporting COM objects.

Lot's of fun


----------



## lee (Jan 8, 2007)

mbncp: Ah, so you have moved away from the big companies. Interesting! But why did you remove the mfxscript from being public? Is it still "freeware", but with no homesite? I wont pass it forward, if it´s not allowed by you. However, I´m sure this script you wrote for me would be interesting to other people like me.

Your script works like a charm btw. Thanx! (again)

Am I right when I think that if the cc values are changing "during" the programchange, the cc values just before and after the PC will be identical in spite of the actual recorded change of cc? Could that become a problem? Maybe not. I will try things out a little more.

/Johnny


----------



## mbncp (Jan 8, 2007)

Hi Johnny, glad it works. Actually I set the delay to 1 tick in the code, but it should be set to 0, unless you have problems with k2. Midi is normally serial, and there should be nothing like events being triggered at the same time.
Even if 2 events have the exact same timestamp, k2 should deal with them one by one. So, if k2 doesn't try to set priorities on events, the CCs should be always correct.

About mfxscript, hmm, well the answer to your second pm is yes :lol:


----------



## lee (Jan 12, 2007)

mbncp: I think I know what you meant about my second pm.. 

Just to be clear. Can I give this "Making K2 remember controller data after program change"-script (with mfxscript) to other people? Or do you want it to stay in my hands/computer/usage. Just want to make sure there is no misunderstanding.
/Johnny


----------



## mbncp (Jan 12, 2007)

If you want, but be aware (and let others know) that there is not warranty of any kind of support. Also it may not work with all Cubase/Nuendo versions.


----------



## lee (Jan 12, 2007)

Great! I think I´ll start a new thread about my current setup/template, which might be interesting to other people. Yes, I´ll let people know there´s no support.

I think I may have written this before but...

THANX mbncp!

 

/Johnny


----------



## JustinW (Jun 23, 2007)

This script sounds great.

Is MFXscript + the wrapper available in any way anymore mbncp? I have been searching for something like that script for some time.

Sorry for bringing back a an old topic.


----------



## lee (Jun 23, 2007)

PM me, Justin W.



/Johnny


----------



## JustinW (Jun 25, 2007)

Thanks Johnny. Sent you a PM.


----------

