Welcome to %s forums

BrainModular Users Forum

Login Register

Midi Learn: Relative - with M-audio Axiom

General Discussion about whatever fits..
Post Reply
antwan
Member
Posts: 164
Contact:

Unread post by antwan » 28 Nov 2007, 20:14

Hi,

I'm just learning to change the mode of the rotary encoders on my m-audio axiom 61 to increment/decrement mode.
I can't get them to work though, it seems Usine can't understand the inc/dec messages correctly.

Here's the link to the manual (this part is covered on page 19 of the PDF):
http://www.m-audio.com/images/global/ma ... G_EN01.pdf

I guess I could make a subpatch to correct this but am I missing something?

Any insights?

antwan

User avatar
cmodica
Member
Posts: 606
Location: Pélissanne
Contact:

Unread post by cmodica » 29 Nov 2007, 09:01

Did you select relative in the Mode remote setup of Usine ?

(see P45 of the Usine Manuel)

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 29 Nov 2007, 10:34

Yes, the midi learn for the fader in question was on relative. What was happening (depending on the inc/dec setup on axiom) was that:

1) the fader was increasing when rotating the encoder either way
or
2) the fader was increasing when the encoder was rotating one way and nothing happened when it was rotated the other way.

antwan

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 29 Nov 2007, 20:16

Strange, because I have also an AXIOM 61 and it works fine with Usine.
I'll take a look.

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 29 Nov 2007, 22:02

ok, now I remember.

If you assign a rotary controller as endless control (for example n°150) the axiom sends CC96 when it goes up and CC95 when down!!!!
Can you believe it? It's so stupid !
In usine it's impossible to assign an increase value to a CC and a decrease to another.
So use 'normal' control with CC values from 0 to 127.

PS:
personal opinion:
The axiom is the worst keyboard I've never had.
- totally non-ergonomic.
- the doc is a 'collector', in the category 'why make simple if can make it complex?'
- very limited compare to the behringer BCF2000 or Roland PCR serie

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 14 Jan 2008, 19:45

Hi,

returning to this question. I made a script for myself which (together with some fancy "pass if has changed" -patching) works nicely with the endless rotary knobs of the axiom, controlling VSTs.
The only problem is that suddenly sometimes the script starts giving a continuous never-ending error message:
"Script Error: Out of Record Fields Range in 0"
I think it might be initiated by some other controllers on the axiom unrelated to the script.
It doesn't really stop the script from working but i am nontheless interested as to what this error message is about.

Here's the script:
For your information i have an endless rotary setup in Axiom that gives out a controller 96 for an increase and 97 for a decrease.

Code: Select all

//////////////////////////
// Receives endless rotary encoder data and turns it into a fader
// Also takes into account mouse-operated changes if fader is routed back into input
// Note: Change constants fad_min and fad_max for fader range
/////////////////////////
// parameters declaration

var input   : Tparameter;
var fader   : Array of Tparameter;
var first   : integer;
var i       : integer;

const num_ch = 8;
const fad_min = 0;
const fad_max = 1;

// initialisation : create parameters

procedure init;
begin  
 
 input := CreateParam('In',ptMidi);
 first := CreateParam('First CC', ptdataFader);
 
 SetArrayLength(fader, num_ch); 

 SetIsOutPut(Input,false);
 SetIsOutPut(first,false);

 SetMax(first, 127);

 for i := 0 to (num_ch - 1) do begin
    fader[i] := CreateParam('fader'+IntToStr(i+1), ptdataFader);
    SetMin(fader[i], fad_min);
    SetMax(fader[i], fad_max);
 end;

end;

// Global variables

var j,
    nbOfMidi,
    active,
    cc_first       : integer;
var ReceivedMidi : TMidi;
var fader_val    : Array of Single;

//////////////////////////////
// main proc
//////////////////////////////

begin
 SetArrayLength(fader_val, num_ch);
 nbOfMidi := GetLength(input);  // get the number of incoming midi codes 
 if nbOfMidi > 0
 then begin
   for j := 0 to nbOfMidi-1 
   do begin
     cc_first := trunc(GetValue(first));
     GetMidiArrayValue(input, j, ReceivedMidi); 
     if &#40;ReceivedMidi.msg = 176&#41; and &#40;ReceivedMidi.data2 >= cc_first&#41; and &#40;ReceivedMidi.data2 <= &#40;cc_first + num_ch&#41;&#41; then begin
       active &#58;= ReceivedMidi.data2 - cc_first;
       if &#40;ReceivedMidi.data1 = 96&#41; and &#40;GetValue&#40;fader&#91;active&#93;&#41; <> fad_max&#41; then begin
         fader_val&#91;active&#93; &#58;= &#40;GetValue&#40;fader&#91;active&#93;&#41; + 0.01&#41;;
         SetValue&#40;fader&#91;active&#93;, fader_val&#91;active&#93;&#41;;
       end;
       if &#40;ReceivedMidi.data1 = 97&#41; and &#40;GetValue&#40;fader&#91;active&#93;&#41; <> fad_min&#41; then begin
         fader_val&#91;active&#93; &#58;= &#40;GetValue&#40;fader&#91;active&#93;&#41; - 0.01&#41;;
         SetValue&#40;fader&#91;active&#93;, fader_val&#91;active&#93;&#41;;
       end;
     end;
   end;
 end;
end.
Thanks for any insights.

antwan

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Jan 2008, 07:59

cool,
The add-on section is a good place for your script ??!!!

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 15 Jan 2008, 08:40

Nice script, and I agree that it belongs in the add-ons!

Can't say I understand why you get the error message, but I have a suggestion for a (small!) improvement CPU-wise: Put "cc_first := trunc(GetValue(first));" outside of the loop, or drop the first parameter alltogether and use a constant instead.
Bjørn S

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 15 Jan 2008, 10:42

Hi,

thanks for the suggestions - makes sense!
I'll make those improvements and prepare it for upload to the add-ons section.
The error message is really annoying though because it basically makes it impossible to use the trace window for anything else. I'll try and have another look today if I can give a specific moment when the error starts.

antwan

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Jan 2008, 11:12

the error comes from the 'active' vaule
you have

Code: Select all

active &#58;= ReceivedMidi.data2 - cc_first;
and after

Code: Select all

GetValue&#40;fader&#91;active&#93;&#41;
in that case you have to verify that active is >= 0 and <= 7.
add a test line like

Code: Select all

active &#58;= ReceivedMidi.data2 - cc_first;  
if &#40;active>=0&#41;
and &#40;active<=7&#41;
then begin       
       if &#40;ReceivedMidi.data1 = 96&#41; 
       and &#40;GetValue&#40;fader&#91;active&#93;&#41; <> fad_max&#41; 
       then begin
         fader_val&#91;active&#93; &#58;= &#40;GetValue&#40;fader&#91;active&#93;&#41; + 0.01&#41;;
         SetValue&#40;fader&#91;active&#93;, fader_val&#91;active&#93;&#41;;
       end;
       if &#40;ReceivedMidi.data1 = 97&#41; 
      and &#40;GetValue&#40;fader&#91;active&#93;&#41; <> fad_min&#41; 
      then begin
         fader_val&#91;active&#93; &#58;= &#40;GetValue&#40;fader&#91;active&#93;&#41; - 0.01&#41;;
         SetValue&#40;fader&#91;active&#93;, fader_val&#91;active&#93;&#41;;
       end;
end
else writeln&#40;'error ACTIVE out of range'&#41;;

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 15 Jan 2008, 11:19

hi,

cheers! i'll give it a try in a couple of hours. thanks.

antony

antwan
Member
Posts: 164
Contact:

Unread post by antwan » 15 Jan 2008, 13:49

Hi,

I have now uploaded this package to the add-ons. Give it a try if you have endless encoders...

antwan

User avatar
senso
Site Admin
Posts: 4424
Location: France
Contact:

Unread post by senso » 15 Jan 2008, 13:56

Perfect!
By default, midi learn of Usine works fine with endless controllers, if you choose the learn mode "relative".
There is only a problem with the Axiom keyboard.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests