Korg padKontrol in Native mode?
Anybody using, or have hints on use a padKontrol in Native mode with Usine?
http://kpkproject.twoday.net/stories/3358632/
No problems sending sysex to put it in native mode and have it send data for all the pads and knobs, but what I'm wondering if anybodies gone further with processing the returned data in Usine for controlling things?
Or if you were going to what would be a good way to go. For example how to implement a lookup table to translate each little returned sysex into note-on, CC, etc.
Thanks for any pointers.
http://kpkproject.twoday.net/stories/3358632/
No problems sending sysex to put it in native mode and have it send data for all the pads and knobs, but what I'm wondering if anybodies gone further with processing the returned data in Usine for controlling things?
Or if you were going to what would be a good way to go. For example how to implement a lookup table to translate each little returned sysex into note-on, CC, etc.
Thanks for any pointers.
That would be interesting.
Sorry to say I have no answer to you.
So far I've only entertained a thought of getting Native Kontrol Custom, but not bought it because of doubts of it's usefulness for my applications:
http://www.nativekontrol.com/
Sorry to say I have no answer to you.
So far I've only entertained a thought of getting Native Kontrol Custom, but not bought it because of doubts of it's usefulness for my applications:
http://www.nativekontrol.com/
Yes I looked at Nativekontrol universal but Usine was not one of the target applications and it seems to make assumptions about what you should do with which button. It doesn't seem to allow personal customization.
Should be able to do much of the same right inside of Usine - I would think.
Should be able to do much of the same right inside of Usine - I would think.
I'm stuck.
After I put the padKontrol in Native mode it sends little sysex's for each pad and knob when touched.
Push Pad 01: F0 42 40 6E 08 45 40 61 F7
Release Pad 01: F0 42 40 6E 08 45 00 40 F7
For every pad, knob, etc it will always be 9 bytes. with F0 42 40 6E always at the beginning, and F7 at the end. The rest encode if it's a pad or a knob and the velocity, position, or increment/decrement, ...
So in the scripting language - how do I received these little sysex messages?
I see there's a type for TMidi - is there a type for Sysex?
Thanks for any pointers.
After I put the padKontrol in Native mode it sends little sysex's for each pad and knob when touched.
Push Pad 01: F0 42 40 6E 08 45 40 61 F7
Release Pad 01: F0 42 40 6E 08 45 00 40 F7
For every pad, knob, etc it will always be 9 bytes. with F0 42 40 6E always at the beginning, and F7 at the end. The rest encode if it's a pad or a knob and the velocity, position, or increment/decrement, ...
So in the scripting language - how do I received these little sysex messages?
I see there's a type for TMidi - is there a type for Sysex?
Thanks for any pointers.
I haven't dealt with sysex much (and never in Usine), but the MIDI input module has a sysex output of type array, so an input parameter in a script would be of type ptArray. Just remember that Usine arrays contain floats to be compatible with any kind of value while MIDI data is all integers. tMidi is a record type for "normal" MIDI messages.
You might not have to write a script instead of using modules, especially if all the sysex packages look similar with only four bytes changing values. (BTW, F0 at the beginning and F7 at the end is what defines a sysex message, and every byte between has to be within 0 and 127.)
You might not have to write a script instead of using modules, especially if all the sysex packages look similar with only four bytes changing values. (BTW, F0 at the beginning and F7 at the end is what defines a sysex message, and every byte between has to be within 0 and 127.)
Bjørn S
Thank You.
I got a basic script working.
It just has the 4 data changing values as outputs.
I'll rearrange the outputs to actually match those of the padKontrol.
I just don't know the scripting language (pascal like?) so I'm not sure how to best do lookup tables other than brute force "if" comparisons. Any hints would be appreciated.
//////////////////////////
//
/////////////////////////
// parameters declaration
var Input : Tparameter;
var Output : array of integer;
const D_START = 4;
const D_END = 7;
const SLENGTH = 9;
// initialisation : create parameters
procedure init;
var i : integer;
begin
Input := CreateParam('Midi in',ptMidi);
SetIsOutPut(Input,false);
setArrayLength(output,SLENGTH);
for i := D_START to D_END
do begin
Output := CreateParam('out '+inttostr(i),ptDataField);
SetIsInput(Output,false);
end;
end;
// Global variables
var nb : integer;
var Miditmp : TMidi;
//////////////////////////////
// main proc
//////////////////////////////
var i : integer;
begin
nb := GetLength(input);
if nb = SLENGTH
then begin
for i := D_START to D_END
do begin
GetMidiArrayValue(input,i,Miditmp);
SetMidiArrayValue(output,0,Miditmp);
SetLength(output,1);
end;
end;
end.
I got a basic script working.
It just has the 4 data changing values as outputs.
I'll rearrange the outputs to actually match those of the padKontrol.
I just don't know the scripting language (pascal like?) so I'm not sure how to best do lookup tables other than brute force "if" comparisons. Any hints would be appreciated.
//////////////////////////
//
/////////////////////////
// parameters declaration
var Input : Tparameter;
var Output : array of integer;
const D_START = 4;
const D_END = 7;
const SLENGTH = 9;
// initialisation : create parameters
procedure init;
var i : integer;
begin
Input := CreateParam('Midi in',ptMidi);
SetIsOutPut(Input,false);
setArrayLength(output,SLENGTH);
for i := D_START to D_END
do begin
Output := CreateParam('out '+inttostr(i),ptDataField);
SetIsInput(Output,false);
end;
end;
// Global variables
var nb : integer;
var Miditmp : TMidi;
//////////////////////////////
// main proc
//////////////////////////////
var i : integer;
begin
nb := GetLength(input);
if nb = SLENGTH
then begin
for i := D_START to D_END
do begin
GetMidiArrayValue(input,i,Miditmp);
SetMidiArrayValue(output,0,Miditmp);
SetLength(output,1);
end;
end;
end.
i don't understand a word,but i'm very interrested,as user of pad kontrol...
You're mixing up data types here as far as I can tell. TMidi is a record type containg 4 bytes: Msg, Data1, Data2 and Channel, but as Usine lets you put practically any type of data through its in- and outputs, it is "legal".
In my opinion, you should use the sysex output of the MIDI input module, and - since you're only interested in parts of the message - either declare your input as type ptArray and use something like SetValue(output, trunc(GetDataArrayValue(input, i))), or use GetArrayElementValue modules
instead of a script. If you're not going to have a lot of conditional statements, just translating input values to some other output values, there's also the Mapper (value) module to consider instead of a (potentially heavy) script. That way you can also use the Preset Manager (and probably also the Conductor) to save different translations - if that is of any interest.
A tip: as long as the length of an output will never change, put the SetLength in the Init procedure; it's out of the way in the main program logic, and you save CPU.
Another tip (something that confused me when I started messing with arrays in Usine): SetLength/GetLength are for parameters, while SetArrayLength/GetArrayLength are for internal arrays, eg.:
VAR arr ARRAY OF INTEGER;
...
SetArrayLength(arr, 10);
...
FOR i := 0 TO 9 DO arr := some_value;
And yes: It's very Pascal-like.
In my opinion, you should use the sysex output of the MIDI input module, and - since you're only interested in parts of the message - either declare your input as type ptArray and use something like SetValue(output, trunc(GetDataArrayValue(input, i))), or use GetArrayElementValue modules
instead of a script. If you're not going to have a lot of conditional statements, just translating input values to some other output values, there's also the Mapper (value) module to consider instead of a (potentially heavy) script. That way you can also use the Preset Manager (and probably also the Conductor) to save different translations - if that is of any interest.
A tip: as long as the length of an output will never change, put the SetLength in the Init procedure; it's out of the way in the main program logic, and you save CPU.
Another tip (something that confused me when I started messing with arrays in Usine): SetLength/GetLength are for parameters, while SetArrayLength/GetArrayLength are for internal arrays, eg.:
VAR arr ARRAY OF INTEGER;
...
SetArrayLength(arr, 10);
...
FOR i := 0 TO 9 DO arr := some_value;
And yes: It's very Pascal-like.
Bjørn S
And another tip I forgot to mention that comes in handy especially for MIDI messages: When creating lookup tables either as array modules or arrays in a script, make them have the length of the maximum input value+1 (typically 127+1=128), and use the data value itself as the index. With a little bit of math you can also reduce the number of arrays needed; arrays in Usine have a max length of 512, so you can put 4*128 into the same array, and you can have larger arrays in scripts as well. Not very practical when your entering values manually, but can be handy (or at least more CPU-friendly) when it's handled automatically at runtime.
Bjørn S
Thanks for the help.
I gave up on the scripting as there's not much documentation and somethings just didn't seem to work.
The good news is I got it mostly working in a patch.
But What I can't get to work is the X/Y pad. I think the problem is Unsine isn't getting the midi fast enough.
If I look at the output in Midi-Ox I'll see:
TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT
SYSX: F0 42 40 6E 08 48 20 7F F7
000010A8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4C 4A F7
000010A8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4C 48 F7
000010AB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010AB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4A 48 F7
000010AB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4A 46 F7
000010AF pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010AF pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 49 46 F7
000010AF pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 49 44 F7
000010B2 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010B2 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 47 44 F7
000010B2 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 47 42 F7
000010B5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010B5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 46 42 F7
000010B5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 46 3E F7
000010B8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010B8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 45 3E F7
000010B8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 45 3C F7
000010BA pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010BA pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 43 3C F7
000010BA pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 43 39 F7
000010BE pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010BE pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 42 39 F7
000010BE pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 42 36 F7
000010C1 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010C1 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 40 36 F7
000010C1 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 40 35 F7
000010C5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010C5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3E 35 F7
000010C5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3E 34 F7
000010C8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010C8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3C 34 F7
000010C8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3C 33 F7
000010CB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010CB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3A 33 F7
000010CB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3A 32 F7
000010D5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 00 F7
Usine's trace window window will only see the lines with "48" (4-eight):
F0 42 40 6E 08 48 20 7F F7 (Note-on for X-Y pad - it sends out a bunch of these)
F0 42 40 6E 08 48 20 00 F7 (Note-off for X-y pad)
It never sees any of the "4B" (4-Be lines)
i.e.
F0 42 40 6E 08 4B 3A 33 F7
None of these show up in Unsine, it's like they are too fast to get captured.
They show up fine in Midi-Ox, and other hosts.
I gave up on the scripting as there's not much documentation and somethings just didn't seem to work.
The good news is I got it mostly working in a patch.
But What I can't get to work is the X/Y pad. I think the problem is Unsine isn't getting the midi fast enough.
If I look at the output in Midi-Ox I'll see:
TIMESTAMP IN PORT STATUS DATA1 DATA2 CHAN NOTE EVENT
SYSX: F0 42 40 6E 08 48 20 7F F7
000010A8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4C 4A F7
000010A8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4C 48 F7
000010AB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010AB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4A 48 F7
000010AB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 4A 46 F7
000010AF pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010AF pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 49 46 F7
000010AF pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 49 44 F7
000010B2 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010B2 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 47 44 F7
000010B2 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 47 42 F7
000010B5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010B5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 46 42 F7
000010B5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 46 3E F7
000010B8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010B8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 45 3E F7
000010B8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 45 3C F7
000010BA pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010BA pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 43 3C F7
000010BA pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 43 39 F7
000010BE pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010BE pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 42 39 F7
000010BE pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 42 36 F7
000010C1 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010C1 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 40 36 F7
000010C1 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 40 35 F7
000010C5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010C5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3E 35 F7
000010C5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3E 34 F7
000010C8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010C8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3C 34 F7
000010C8 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3C 33 F7
000010CB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 7F F7
000010CB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3A 33 F7
000010CB pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 4B 3A 32 F7
000010D5 pad -- F0 Buffer: 9 Bytes System Exclusive
SYSX: F0 42 40 6E 08 48 20 00 F7
Usine's trace window window will only see the lines with "48" (4-eight):
F0 42 40 6E 08 48 20 7F F7 (Note-on for X-Y pad - it sends out a bunch of these)
F0 42 40 6E 08 48 20 00 F7 (Note-off for X-y pad)
It never sees any of the "4B" (4-Be lines)
i.e.
F0 42 40 6E 08 4B 3A 33 F7
None of these show up in Unsine, it's like they are too fast to get captured.
They show up fine in Midi-Ox, and other hosts.
Since Usine can't handle the rapid sysex.
Now the question is, I can use midi-ox or bome's to transform the sysex's into regular midi, note on's, CC, etc. Either seems light enough that I can load it without much CPU or memory load. But what's best to remap these to? What do people do with other controllers?
There's not too many controls on the padKontrol, Two knobs, one Rotary encorder, one X-Y pad, and 16 velocity pads, and the rest buttons.
I'm thinking of sending the Rotary as two notes - one for up and the other for down.
The two knobs would be CC's
The X-Y as PitchBender V1 V2
The pads and buttons as Notes
Then in Usine you transform these anyway you want.
A separate patch would be setup to send sysex to controls the lights on the padKontrol. For example if you hit Pad 01, it would send a message to flash the light on Pad 01.
Or do stuff like flash on the pad what step in a sequency you're currently in.
Now the question is, I can use midi-ox or bome's to transform the sysex's into regular midi, note on's, CC, etc. Either seems light enough that I can load it without much CPU or memory load. But what's best to remap these to? What do people do with other controllers?
There's not too many controls on the padKontrol, Two knobs, one Rotary encorder, one X-Y pad, and 16 velocity pads, and the rest buttons.
I'm thinking of sending the Rotary as two notes - one for up and the other for down.
The two knobs would be CC's
The X-Y as PitchBender V1 V2
The pads and buttons as Notes
Then in Usine you transform these anyway you want.
A separate patch would be setup to send sysex to controls the lights on the padKontrol. For example if you hit Pad 01, it would send a message to flash the light on Pad 01.
Or do stuff like flash on the pad what step in a sequency you're currently in.
As I've said earlier, I haven't dealt much with SysEx at all, but I'm fairly sure that Usine treats these messages as a special kind of array. The trace/console window as well as the list output you get by selecting a wire between modules will always just show the first value of the array - at least I think so.
Have you tried to connect the sysex output of the MidiIn module to the SysExEditor module to see what comes in?
Have you tried to connect the sysex output of the MidiIn module to the SysExEditor module to see what comes in?
Bjørn S
Yes - tried it, they randomly get through.
Midi-ox and others - they all get through.
I captured and saved the output of the padKontrol from Midi-ox in a sysex file. Then told Midi-ox to send the file to Unsine - they all got through.
But this is much slower than the padKontrol directly sends.
Midi-ox and others - they all get through.
I captured and saved the output of the padKontrol from Midi-ox in a sysex file. Then told Midi-ox to send the file to Unsine - they all got through.
But this is much slower than the padKontrol directly sends.
Who is online
Users browsing this forum: No registered users and 20 guests
