Posted: 09 May 2009, 07:40
Hi All!
I can't find a script that actually generates midi values. I want to just send 24 very low volume very short notes to Mr. Ray every time I do a patch change, so I don't get a bunch of clicks (known bug in the VSTi....)
Here's the script I tried. I thought it should work, but it sends out values constantly, after recieving the first trigger. What am I doing wrong. I only see the 'in loop' message once.....
thanks for any tips.....
-eric
I can't find a script that actually generates midi values. I want to just send 24 very low volume very short notes to Mr. Ray every time I do a patch change, so I don't get a bunch of clicks (known bug in the VSTi....)
Here's the script I tried. I thought it should work, but it sends out values constantly, after recieving the first trigger. What am I doing wrong. I only see the 'in loop' message once.....
Code: Select all
//////////////////////////
// send out 24 notes
/////////////////////////
// parameters declaration
var output : Tparameter;
var trigger : Tparameter;
var start : integer;
// initialisation : create parameters
procedure init;
begin
Output := CreateParam('Out',ptMidi); SetIsInput(Output,false);
trigger := CreateParam('trig',ptButton); SetIsOutput(Trigger,false);
end;
// Global variables
var i : integer;
var noteOn : TMidi;
var noteOff : TMidi;
//////////////////////////////
// main proc
//////////////////////////////
begin
start := trunc(getValue(Trigger));
if start = 1 then
begin
writeln('in loop');
SetLength(outPut,48); // set the number of output codes
for i := 0 to 23 // loop for all input codes, for polyphonic data (chords)
do begin
noteOn.data1 := i + 12;
noteOn.data2 := 1;
noteOn.msg := 128;
SetMidiArrayValue(output,i,noteOn); // set output value
end
for i := 24 to 47
do begin
noteOff.data1 := i - 12;
noteOff.data2 := 0;
noteOff.msg := 128;
SetMidiArrayValue(output,i,noteOff); // set output value
end;
end
else
begin
end;
end.-eric