Statistics: Posted by senso — 15 Jan 2008, 13:56
Statistics: Posted by antwan — 15 Jan 2008, 13:49
Statistics: Posted by antwan — 15 Jan 2008, 11:19
CODE:
active := ReceivedMidi.data2 - cc_first;CODE:
GetValue(fader[active])CODE:
active := ReceivedMidi.data2 - cc_first; if (active>=0)and (active<=7)then begin if (ReceivedMidi.data1 = 96) and (GetValue(fader[active]) <> fad_max) then begin fader_val[active] := (GetValue(fader[active]) + 0.01); SetValue(fader[active], fader_val[active]); end; if (ReceivedMidi.data1 = 97) and (GetValue(fader[active]) <> fad_min) then begin fader_val[active] := (GetValue(fader[active]) - 0.01); SetValue(fader[active], fader_val[active]); end;endelse writeln('error ACTIVE out of range');Statistics: Posted by senso — 15 Jan 2008, 11:12
Statistics: Posted by antwan — 15 Jan 2008, 10:42
Statistics: Posted by bsork — 15 Jan 2008, 08:40
Statistics: Posted by senso — 15 Jan 2008, 07:59
CODE:
//////////////////////////// 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 declarationvar 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 parametersprocedure 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 variablesvar 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 (ReceivedMidi.msg = 176) and (ReceivedMidi.data2 >= cc_first) and (ReceivedMidi.data2 <= (cc_first + num_ch)) then begin active := ReceivedMidi.data2 - cc_first; if (ReceivedMidi.data1 = 96) and (GetValue(fader[active]) <> fad_max) then begin fader_val[active] := (GetValue(fader[active]) + 0.01); SetValue(fader[active], fader_val[active]); end; if (ReceivedMidi.data1 = 97) and (GetValue(fader[active]) <> fad_min) then begin fader_val[active] := (GetValue(fader[active]) - 0.01); SetValue(fader[active], fader_val[active]); end; end; end; end;end.Statistics: Posted by antwan — 14 Jan 2008, 19:45
Statistics: Posted by senso — 29 Nov 2007, 22:02
Statistics: Posted by senso — 29 Nov 2007, 20:16
Statistics: Posted by antwan — 29 Nov 2007, 10:34
Statistics: Posted by cmodica — 29 Nov 2007, 09:01
Statistics: Posted by antwan — 28 Nov 2007, 20:14
Statistics: Posted by senso — 15 Jan 2008, 13:56
Statistics: Posted by antwan — 15 Jan 2008, 13:49
Statistics: Posted by antwan — 15 Jan 2008, 11:19
CODE:
active := ReceivedMidi.data2 - cc_first;CODE:
GetValue(fader[active])CODE:
active := ReceivedMidi.data2 - cc_first; if (active>=0)and (active<=7)then begin if (ReceivedMidi.data1 = 96) and (GetValue(fader[active]) <> fad_max) then begin fader_val[active] := (GetValue(fader[active]) + 0.01); SetValue(fader[active], fader_val[active]); end; if (ReceivedMidi.data1 = 97) and (GetValue(fader[active]) <> fad_min) then begin fader_val[active] := (GetValue(fader[active]) - 0.01); SetValue(fader[active], fader_val[active]); end;endelse writeln('error ACTIVE out of range');Statistics: Posted by senso — 15 Jan 2008, 11:12
Statistics: Posted by antwan — 15 Jan 2008, 10:42
Statistics: Posted by bsork — 15 Jan 2008, 08:40
Statistics: Posted by senso — 15 Jan 2008, 07:59
CODE:
//////////////////////////// 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 declarationvar 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 parametersprocedure 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 variablesvar 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 (ReceivedMidi.msg = 176) and (ReceivedMidi.data2 >= cc_first) and (ReceivedMidi.data2 <= (cc_first + num_ch)) then begin active := ReceivedMidi.data2 - cc_first; if (ReceivedMidi.data1 = 96) and (GetValue(fader[active]) <> fad_max) then begin fader_val[active] := (GetValue(fader[active]) + 0.01); SetValue(fader[active], fader_val[active]); end; if (ReceivedMidi.data1 = 97) and (GetValue(fader[active]) <> fad_min) then begin fader_val[active] := (GetValue(fader[active]) - 0.01); SetValue(fader[active], fader_val[active]); end; end; end; end;end.Statistics: Posted by antwan — 14 Jan 2008, 19:45
Statistics: Posted by senso — 29 Nov 2007, 22:02
Statistics: Posted by senso — 29 Nov 2007, 20:16
Statistics: Posted by antwan — 29 Nov 2007, 10:34
Statistics: Posted by cmodica — 29 Nov 2007, 09:01
Statistics: Posted by antwan — 28 Nov 2007, 20:14