ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray
Statistics: Posted by ethnix73 — 24 Nov 2010, 13:16
Statistics: Posted by 23fx23 — 24 Nov 2010, 13:05
Statistics: Posted by nay-seven — 24 Nov 2010, 11:29
CODE:
//////////////////////////// /////////////////////////// parameters declarationvar RowIn : Tparameter;var OnModeIn : Tparameter;var OffModeIn : Tparameter;var MidVolRangeIn : Tparameter;var BaseOctaveIn : Tparameter;var TickIn : Tparameter;var MidiOut : Tparameter;var BaseOctave : integer;var NbOfMidiNotes : integer;var OnMode : integer;var OffMode : integer;var PlayNotes : boolean;var CurrentNotes : array of single;var CurrentNotesLen : integer;var LastNotes : array of single;var MidVolRange : integer;CONST MID_NOTE_ON = 144;CONST MID_NOTE_OFF = 128;CONST OCTAVE_RANGE = 12;CONST ON_MODE = '"each","group"';CONST OFF_MODE = '"hold","cut"'; // initialisation : create parametersprocedure init;begin RowIn := CreateParam('row in',ptArray); SetIsOutput(RowIn,false); MidVolRangeIn := CreateParam('MidVolRange',ptDataFader); SetIsOutput (MidVolRangeIn,false); SetMin (MidVolRangeIn , 0); SetMax (MidVolRangeIn , 127); SetDefaultValue (MidVolRangeIn , 64); OnModeIn := CreateParam('on mode',ptListBox); SetIsOutput(OnModeIn,false); SetListBoxString(OnModeIn,ON_MODE); OffModeIn := CreateParam('off mode',ptListBox); SetIsOutput(OffModeIn,false); SetListBoxString(OffModeIn,OFF_MODE); BaseOctaveIn := CreateParam('octave',ptDataFader); SetIsOutput (BaseOctaveIn,false); SetMin (BaseOctaveIn , 1); SetMax (BaseOctaveIn , 10); SetDefaultValue(BaseOctaveIn , 5); SetFormat (BaseOctaveIn , '%.0f'); TickIn := CreateParam('tick',ptButton); SetIsOutput(RowIn,false); MidiOut := CreateParam('midi out',ptMidi); SetIsInput(MidiOut,false); BaseOctave := 5; MidVolRange :=64; NbOfMidiNotes := 0; OnMode := 0; OffMode := 0; PlayNotes := FALSE; SetArrayLength(CurrentNotes , 0); CurrentNotesLen := 0;end;// Global variablesvar Miditmp : TMidi;//////////////////////////////// callback proc//////////////////////////////procedure Callback(n:integer);var i : integer;var vol : single;begin if (n = RowIn) then begin CurrentNotesLen := GetLength(RowIn); SetArrayLength(CurrentNotes , CurrentNotesLen); SetArrayLength(LastNotes , CurrentNotesLen); i := 0; while i < CurrentNotesLen do begin vol := GetDataArrayValue(RowIn, i); CurrentNotes[i] := vol; i := i+1; end; end else if (n = OnModeIn) then begin OnMode := round( GetValue(OnModeIn) ); end else if (n = OffModeIn) then begin OffMode := round( GetValue(OffModeIn) ); end else if (n=MidVolRangeIn) then begin MidVolRange := round( GetValue(MidVolRangeIn) ); end else if (n = BaseOctaveIn) then begin BaseOctave := round( GetValue(BaseOctaveIn) ); end else if (n = TickIn) then begin NbOfMidiNotes := 0; i := 0; while i < CurrentNotesLen do begin if ((OnMode = 1) and (CurrentNotes[i] <> LastNotes[i]) and (CurrentNotes[i] > 0)) or ((OnMode = 0) and (CurrentNotes[i] > 0)) or ((OffMode = 1) and (CurrentNotes[i] = 0)) then begin Miditmp.Channel := byte(1); if currentNotes[i]>0 then begin Miditmp.Msg := MID_NOTE_ON; end else begin Miditmp.Msg := MID_NOTE_OFF; end; Miditmp.Data1 := byte( (BaseOctave * OCTAVE_RANGE) + i); Miditmp.Data2 := round(MidVolRange * CurrentNotes[i]); SetMidiArrayValue(MidiOut, NbOfMidiNotes ,Miditmp); // set output value NbOfMidiNotes := NbOfMidiNotes + 1; end; LastNotes[i] := CurrentNotes[i]; i := i+1; end; SetLength(MidiOut,NbOfMidiNotes); PlayNotes := TRUE; end;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;var i : integer;var len : integer;var vol : single;begin if PlayNotes then begin PlayNotes := FALSE; end else begin SetLength(MidiOut,0); end;end;Statistics: Posted by ethnix73 — 24 Nov 2010, 10:18
Statistics: Posted by 23fx23 — 24 Nov 2010, 01:23
Statistics: Posted by ethnix73 — 24 Nov 2010, 00:53
Statistics: Posted by ethnix73 — 24 Nov 2010, 00:49
CODE:
//////////////////////////// /////////////////////////// parameters declarationvar RowIn : Tparameter;var OnModeIn : Tparameter;var OffModeIn : Tparameter;var BaseOctaveIn : Tparameter;var TickIn : Tparameter;var MidiOut : Tparameter;var BaseOctave : integer;var NbOfMidiNotes : integer;var OnMode : integer;var OffMode : integer;var PlayNotes : boolean;var CurrentNotes : array of single;var CurrentNotesLen : integer;var LastNotes : array of single;CONST MID_NOTE_ON = 144;CONST MID_NOTE_OFF = 128;CONST MID_VOL_RANGE = 127;CONST OCTAVE_RANGE = 12;CONST ON_MODE = '"each","group"';CONST OFF_MODE = '"hold","cut"'; // initialisation : create parametersprocedure init;begin RowIn := CreateParam('row in',ptArray); SetIsOutput(RowIn,false); OnModeIn := CreateParam('on mode',ptListBox); SetIsOutput(OnModeIn,false); SetListBoxString(OnModeIn,ON_MODE); OffModeIn := CreateParam('off mode',ptListBox); SetIsOutput(OffModeIn,false); SetListBoxString(OffModeIn,OFF_MODE); BaseOctaveIn := CreateParam('octave',ptDataFader); SetIsOutput (BaseOctaveIn,false); SetMin (BaseOctaveIn , 1); SetMax (BaseOctaveIn , 10); SetDefaultValue(BaseOctaveIn , 5); SetFormat (BaseOctaveIn , '%.0f'); TickIn := CreateParam('tick',ptButton); SetIsOutput(RowIn,false); MidiOut := CreateParam('midi out',ptMidi); SetIsInput(MidiOut,false); BaseOctave := 5; NbOfMidiNotes := 0; OnMode := 0; OffMode := 0; PlayNotes := FALSE; SetArrayLength(CurrentNotes , 0); CurrentNotesLen := 0;end;// Global variablesvar Miditmp : TMidi;//////////////////////////////// callback proc//////////////////////////////procedure Callback(n:integer);var i : integer;var vol : single;begin if (n = RowIn) then begin CurrentNotesLen := GetLength(RowIn); SetArrayLength(CurrentNotes , CurrentNotesLen); SetArrayLength(LastNotes , CurrentNotesLen); i := 0; while i < CurrentNotesLen do begin vol := GetDataArrayValue(RowIn, i); CurrentNotes[i] := vol; i := i+1; end; end else if (n = OnModeIn) then begin OnMode := round( GetValue(OnModeIn) ); end else if (n = OffModeIn) then begin OffMode := round( GetValue(OffModeIn) ); end else if (n = BaseOctaveIn) then begin BaseOctave := round( GetValue(BaseOctaveIn) ); end else if (n = TickIn) then begin NbOfMidiNotes := 0; i := 0; while i < CurrentNotesLen do begin if ((OnMode = 1) and (CurrentNotes[i] <> LastNotes[i]) and (CurrentNotes[i] > 0)) or ((OnMode = 0) and (CurrentNotes[i] > 0)) or ((OffMode = 1) and (CurrentNotes[i] = 0)) then begin Miditmp.Channel := byte(1); if currentNotes[i]>0 then begin Miditmp.Msg := MID_NOTE_ON; end else begin Miditmp.Msg := MID_NOTE_OFF; end; Miditmp.Data1 := byte( (BaseOctave * OCTAVE_RANGE) + i); Miditmp.Data2 := round(MID_VOL_RANGE * CurrentNotes[i]); SetMidiArrayValue(MidiOut, NbOfMidiNotes ,Miditmp); // set output value NbOfMidiNotes := NbOfMidiNotes + 1; end; LastNotes[i] := CurrentNotes[i]; i := i+1; end; SetLength(MidiOut,NbOfMidiNotes); PlayNotes := TRUE; end;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;var i : integer;var len : integer;var vol : single;begin if PlayNotes then begin PlayNotes := FALSE; end else begin SetLength(MidiOut,0); end;end;Statistics: Posted by 23fx23 — 24 Nov 2010, 00:47
Statistics: Posted by martignasse — 24 Nov 2010, 00:15
Statistics: Posted by 23fx23 — 21 Nov 2010, 15:43
CODE:
//////////////////////////// /////////////////////////// parameters declarationvar RowIn : Tparameter;var OnModeIn : Tparameter;var OffModeIn : Tparameter;var BaseOctaveIn : Tparameter;var TickIn : Tparameter;var MidiOut : Tparameter;var BaseOctave : integer;var NbOfMidiNotes : integer;var OnMode : integer;var OffMode : integer;var PlayNotes : boolean;var CurrentNotes : array of single;var CurrentNotesLen : integer;var LastNotes : array of single;CONST MID_NOTE_ON = 144;CONST MID_VOL_RANGE = 127;CONST OCTAVE_RANGE = 12;CONST ON_MODE = '"each","group"';CONST OFF_MODE = '"hold","cut"'; // initialisation : create parametersprocedure init;begin RowIn := CreateParam('row in',ptArray); SetIsOutput(RowIn,false); OnModeIn := CreateParam('on mode',ptListBox); SetIsOutput(OnModeIn,false); SetListBoxString(OnModeIn,ON_MODE); OffModeIn := CreateParam('off mode',ptListBox); SetIsOutput(OffModeIn,false); SetListBoxString(OffModeIn,OFF_MODE); BaseOctaveIn := CreateParam('octave',ptDataFader); SetIsOutput (BaseOctaveIn,false); SetMin (BaseOctaveIn , 1); SetMax (BaseOctaveIn , 10); SetDefaultValue(BaseOctaveIn , 5); SetFormat (BaseOctaveIn , '%.0f'); TickIn := CreateParam('tick',ptButton); SetIsOutput(RowIn,false); MidiOut := CreateParam('midi out',ptMidi); SetIsInput(MidiOut,false); BaseOctave := 5; NbOfMidiNotes := 0; OnMode := 0; OffMode := 0; PlayNotes := FALSE; SetArrayLength(CurrentNotes , 0); CurrentNotesLen := 0;end;// Global variablesvar Miditmp : TMidi;//////////////////////////////// callback proc//////////////////////////////procedure Callback(n:integer);var i : integer;var vol : single;begin if (n = RowIn) then begin CurrentNotesLen := GetLength(RowIn); SetArrayLength(CurrentNotes , CurrentNotesLen); SetArrayLength(LastNotes , CurrentNotesLen); i := 0; while i < CurrentNotesLen do begin vol := GetDataArrayValue(RowIn, i); CurrentNotes[i] := vol; i := i+1; end; end else if (n = OnModeIn) then begin OnMode := round( GetValue(OnModeIn) ); end else if (n = OffModeIn) then begin OffMode := round( GetValue(OffModeIn) ); end else if (n = BaseOctaveIn) then begin BaseOctave := round( GetValue(BaseOctaveIn) ); end else if (n = TickIn) then begin NbOfMidiNotes := 0; i := 0; while i < CurrentNotesLen do begin if ((OnMode = 1) and (CurrentNotes[i] <> LastNotes[i]) and (CurrentNotes[i] > 0)) or ((OnMode = 0) and (CurrentNotes[i] > 0)) or ((OffMode = 1) and (CurrentNotes[i] = 0)) then begin Miditmp.Channel := byte(1); Miditmp.Msg := MID_NOTE_ON; Miditmp.Data1 := byte( (BaseOctave * OCTAVE_RANGE) + i); Miditmp.Data2 := round(MID_VOL_RANGE * CurrentNotes[i]); SetMidiArrayValue(MidiOut, NbOfMidiNotes ,Miditmp); // set output value NbOfMidiNotes := NbOfMidiNotes + 1; end; LastNotes[i] := CurrentNotes[i]; i := i+1; end; SetLength(MidiOut,NbOfMidiNotes); PlayNotes := TRUE; end;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;var i : integer;var len : integer;var vol : single;begin if PlayNotes then begin PlayNotes := FALSE; end else begin SetLength(MidiOut,0); end;end;Statistics: Posted by ethnix73 — 20 Nov 2010, 18:41
Statistics: Posted by ethnix73 — 24 Nov 2010, 13:16
Statistics: Posted by 23fx23 — 24 Nov 2010, 13:05
Statistics: Posted by nay-seven — 24 Nov 2010, 11:29
CODE:
//////////////////////////// /////////////////////////// parameters declarationvar RowIn : Tparameter;var OnModeIn : Tparameter;var OffModeIn : Tparameter;var MidVolRangeIn : Tparameter;var BaseOctaveIn : Tparameter;var TickIn : Tparameter;var MidiOut : Tparameter;var BaseOctave : integer;var NbOfMidiNotes : integer;var OnMode : integer;var OffMode : integer;var PlayNotes : boolean;var CurrentNotes : array of single;var CurrentNotesLen : integer;var LastNotes : array of single;var MidVolRange : integer;CONST MID_NOTE_ON = 144;CONST MID_NOTE_OFF = 128;CONST OCTAVE_RANGE = 12;CONST ON_MODE = '"each","group"';CONST OFF_MODE = '"hold","cut"'; // initialisation : create parametersprocedure init;begin RowIn := CreateParam('row in',ptArray); SetIsOutput(RowIn,false); MidVolRangeIn := CreateParam('MidVolRange',ptDataFader); SetIsOutput (MidVolRangeIn,false); SetMin (MidVolRangeIn , 0); SetMax (MidVolRangeIn , 127); SetDefaultValue (MidVolRangeIn , 64); OnModeIn := CreateParam('on mode',ptListBox); SetIsOutput(OnModeIn,false); SetListBoxString(OnModeIn,ON_MODE); OffModeIn := CreateParam('off mode',ptListBox); SetIsOutput(OffModeIn,false); SetListBoxString(OffModeIn,OFF_MODE); BaseOctaveIn := CreateParam('octave',ptDataFader); SetIsOutput (BaseOctaveIn,false); SetMin (BaseOctaveIn , 1); SetMax (BaseOctaveIn , 10); SetDefaultValue(BaseOctaveIn , 5); SetFormat (BaseOctaveIn , '%.0f'); TickIn := CreateParam('tick',ptButton); SetIsOutput(RowIn,false); MidiOut := CreateParam('midi out',ptMidi); SetIsInput(MidiOut,false); BaseOctave := 5; MidVolRange :=64; NbOfMidiNotes := 0; OnMode := 0; OffMode := 0; PlayNotes := FALSE; SetArrayLength(CurrentNotes , 0); CurrentNotesLen := 0;end;// Global variablesvar Miditmp : TMidi;//////////////////////////////// callback proc//////////////////////////////procedure Callback(n:integer);var i : integer;var vol : single;begin if (n = RowIn) then begin CurrentNotesLen := GetLength(RowIn); SetArrayLength(CurrentNotes , CurrentNotesLen); SetArrayLength(LastNotes , CurrentNotesLen); i := 0; while i < CurrentNotesLen do begin vol := GetDataArrayValue(RowIn, i); CurrentNotes[i] := vol; i := i+1; end; end else if (n = OnModeIn) then begin OnMode := round( GetValue(OnModeIn) ); end else if (n = OffModeIn) then begin OffMode := round( GetValue(OffModeIn) ); end else if (n=MidVolRangeIn) then begin MidVolRange := round( GetValue(MidVolRangeIn) ); end else if (n = BaseOctaveIn) then begin BaseOctave := round( GetValue(BaseOctaveIn) ); end else if (n = TickIn) then begin NbOfMidiNotes := 0; i := 0; while i < CurrentNotesLen do begin if ((OnMode = 1) and (CurrentNotes[i] <> LastNotes[i]) and (CurrentNotes[i] > 0)) or ((OnMode = 0) and (CurrentNotes[i] > 0)) or ((OffMode = 1) and (CurrentNotes[i] = 0)) then begin Miditmp.Channel := byte(1); if currentNotes[i]>0 then begin Miditmp.Msg := MID_NOTE_ON; end else begin Miditmp.Msg := MID_NOTE_OFF; end; Miditmp.Data1 := byte( (BaseOctave * OCTAVE_RANGE) + i); Miditmp.Data2 := round(MidVolRange * CurrentNotes[i]); SetMidiArrayValue(MidiOut, NbOfMidiNotes ,Miditmp); // set output value NbOfMidiNotes := NbOfMidiNotes + 1; end; LastNotes[i] := CurrentNotes[i]; i := i+1; end; SetLength(MidiOut,NbOfMidiNotes); PlayNotes := TRUE; end;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;var i : integer;var len : integer;var vol : single;begin if PlayNotes then begin PlayNotes := FALSE; end else begin SetLength(MidiOut,0); end;end;Statistics: Posted by ethnix73 — 24 Nov 2010, 10:18
Statistics: Posted by 23fx23 — 24 Nov 2010, 01:23
Statistics: Posted by ethnix73 — 24 Nov 2010, 00:53
Statistics: Posted by ethnix73 — 24 Nov 2010, 00:49
CODE:
//////////////////////////// /////////////////////////// parameters declarationvar RowIn : Tparameter;var OnModeIn : Tparameter;var OffModeIn : Tparameter;var BaseOctaveIn : Tparameter;var TickIn : Tparameter;var MidiOut : Tparameter;var BaseOctave : integer;var NbOfMidiNotes : integer;var OnMode : integer;var OffMode : integer;var PlayNotes : boolean;var CurrentNotes : array of single;var CurrentNotesLen : integer;var LastNotes : array of single;CONST MID_NOTE_ON = 144;CONST MID_NOTE_OFF = 128;CONST MID_VOL_RANGE = 127;CONST OCTAVE_RANGE = 12;CONST ON_MODE = '"each","group"';CONST OFF_MODE = '"hold","cut"'; // initialisation : create parametersprocedure init;begin RowIn := CreateParam('row in',ptArray); SetIsOutput(RowIn,false); OnModeIn := CreateParam('on mode',ptListBox); SetIsOutput(OnModeIn,false); SetListBoxString(OnModeIn,ON_MODE); OffModeIn := CreateParam('off mode',ptListBox); SetIsOutput(OffModeIn,false); SetListBoxString(OffModeIn,OFF_MODE); BaseOctaveIn := CreateParam('octave',ptDataFader); SetIsOutput (BaseOctaveIn,false); SetMin (BaseOctaveIn , 1); SetMax (BaseOctaveIn , 10); SetDefaultValue(BaseOctaveIn , 5); SetFormat (BaseOctaveIn , '%.0f'); TickIn := CreateParam('tick',ptButton); SetIsOutput(RowIn,false); MidiOut := CreateParam('midi out',ptMidi); SetIsInput(MidiOut,false); BaseOctave := 5; NbOfMidiNotes := 0; OnMode := 0; OffMode := 0; PlayNotes := FALSE; SetArrayLength(CurrentNotes , 0); CurrentNotesLen := 0;end;// Global variablesvar Miditmp : TMidi;//////////////////////////////// callback proc//////////////////////////////procedure Callback(n:integer);var i : integer;var vol : single;begin if (n = RowIn) then begin CurrentNotesLen := GetLength(RowIn); SetArrayLength(CurrentNotes , CurrentNotesLen); SetArrayLength(LastNotes , CurrentNotesLen); i := 0; while i < CurrentNotesLen do begin vol := GetDataArrayValue(RowIn, i); CurrentNotes[i] := vol; i := i+1; end; end else if (n = OnModeIn) then begin OnMode := round( GetValue(OnModeIn) ); end else if (n = OffModeIn) then begin OffMode := round( GetValue(OffModeIn) ); end else if (n = BaseOctaveIn) then begin BaseOctave := round( GetValue(BaseOctaveIn) ); end else if (n = TickIn) then begin NbOfMidiNotes := 0; i := 0; while i < CurrentNotesLen do begin if ((OnMode = 1) and (CurrentNotes[i] <> LastNotes[i]) and (CurrentNotes[i] > 0)) or ((OnMode = 0) and (CurrentNotes[i] > 0)) or ((OffMode = 1) and (CurrentNotes[i] = 0)) then begin Miditmp.Channel := byte(1); if currentNotes[i]>0 then begin Miditmp.Msg := MID_NOTE_ON; end else begin Miditmp.Msg := MID_NOTE_OFF; end; Miditmp.Data1 := byte( (BaseOctave * OCTAVE_RANGE) + i); Miditmp.Data2 := round(MID_VOL_RANGE * CurrentNotes[i]); SetMidiArrayValue(MidiOut, NbOfMidiNotes ,Miditmp); // set output value NbOfMidiNotes := NbOfMidiNotes + 1; end; LastNotes[i] := CurrentNotes[i]; i := i+1; end; SetLength(MidiOut,NbOfMidiNotes); PlayNotes := TRUE; end;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;var i : integer;var len : integer;var vol : single;begin if PlayNotes then begin PlayNotes := FALSE; end else begin SetLength(MidiOut,0); end;end;Statistics: Posted by 23fx23 — 24 Nov 2010, 00:47
Statistics: Posted by martignasse — 24 Nov 2010, 00:15
Statistics: Posted by 23fx23 — 21 Nov 2010, 15:43
CODE:
//////////////////////////// /////////////////////////// parameters declarationvar RowIn : Tparameter;var OnModeIn : Tparameter;var OffModeIn : Tparameter;var BaseOctaveIn : Tparameter;var TickIn : Tparameter;var MidiOut : Tparameter;var BaseOctave : integer;var NbOfMidiNotes : integer;var OnMode : integer;var OffMode : integer;var PlayNotes : boolean;var CurrentNotes : array of single;var CurrentNotesLen : integer;var LastNotes : array of single;CONST MID_NOTE_ON = 144;CONST MID_VOL_RANGE = 127;CONST OCTAVE_RANGE = 12;CONST ON_MODE = '"each","group"';CONST OFF_MODE = '"hold","cut"'; // initialisation : create parametersprocedure init;begin RowIn := CreateParam('row in',ptArray); SetIsOutput(RowIn,false); OnModeIn := CreateParam('on mode',ptListBox); SetIsOutput(OnModeIn,false); SetListBoxString(OnModeIn,ON_MODE); OffModeIn := CreateParam('off mode',ptListBox); SetIsOutput(OffModeIn,false); SetListBoxString(OffModeIn,OFF_MODE); BaseOctaveIn := CreateParam('octave',ptDataFader); SetIsOutput (BaseOctaveIn,false); SetMin (BaseOctaveIn , 1); SetMax (BaseOctaveIn , 10); SetDefaultValue(BaseOctaveIn , 5); SetFormat (BaseOctaveIn , '%.0f'); TickIn := CreateParam('tick',ptButton); SetIsOutput(RowIn,false); MidiOut := CreateParam('midi out',ptMidi); SetIsInput(MidiOut,false); BaseOctave := 5; NbOfMidiNotes := 0; OnMode := 0; OffMode := 0; PlayNotes := FALSE; SetArrayLength(CurrentNotes , 0); CurrentNotesLen := 0;end;// Global variablesvar Miditmp : TMidi;//////////////////////////////// callback proc//////////////////////////////procedure Callback(n:integer);var i : integer;var vol : single;begin if (n = RowIn) then begin CurrentNotesLen := GetLength(RowIn); SetArrayLength(CurrentNotes , CurrentNotesLen); SetArrayLength(LastNotes , CurrentNotesLen); i := 0; while i < CurrentNotesLen do begin vol := GetDataArrayValue(RowIn, i); CurrentNotes[i] := vol; i := i+1; end; end else if (n = OnModeIn) then begin OnMode := round( GetValue(OnModeIn) ); end else if (n = OffModeIn) then begin OffMode := round( GetValue(OffModeIn) ); end else if (n = BaseOctaveIn) then begin BaseOctave := round( GetValue(BaseOctaveIn) ); end else if (n = TickIn) then begin NbOfMidiNotes := 0; i := 0; while i < CurrentNotesLen do begin if ((OnMode = 1) and (CurrentNotes[i] <> LastNotes[i]) and (CurrentNotes[i] > 0)) or ((OnMode = 0) and (CurrentNotes[i] > 0)) or ((OffMode = 1) and (CurrentNotes[i] = 0)) then begin Miditmp.Channel := byte(1); Miditmp.Msg := MID_NOTE_ON; Miditmp.Data1 := byte( (BaseOctave * OCTAVE_RANGE) + i); Miditmp.Data2 := round(MID_VOL_RANGE * CurrentNotes[i]); SetMidiArrayValue(MidiOut, NbOfMidiNotes ,Miditmp); // set output value NbOfMidiNotes := NbOfMidiNotes + 1; end; LastNotes[i] := CurrentNotes[i]; i := i+1; end; SetLength(MidiOut,NbOfMidiNotes); PlayNotes := TRUE; end;end;//////////////////////////////// main proc//////////////////////////////Procedure Process;var i : integer;var len : integer;var vol : single;begin if PlayNotes then begin PlayNotes := FALSE; end else begin SetLength(MidiOut,0); end;end;Statistics: Posted by ethnix73 — 20 Nov 2010, 18:41