Пока искал, набрёл на это (4.60pre13):StuffMIDIMessage(integer mode, integer msg1, integer msg2, integer msg3)
Stuffs a 3 byte MIDI message into either the Virtual MIDI Keyboard queue, or the MIDI-as-control input queue. mode=0 for VKB, 1 for control (actions map etc), 2 for VKB-on-current-channel.
Видать, забили они на это, а зря)Justin:
Scheduling of MIDI events is really better off done within JSFX or VST plug-ins, ReaScripts are for higher level UI/project type stuff. We could possibly add support for ReaScript<-->JSFX communication, though.
desc:Pre Record Audio
// V alfa 0.01
//slider1:0<0,1,1{Mono,Stereo}>Channel Mode
slider1:1<1,99,1>Track (#)
@init
buf=0
@slider
nch = 1; //+ (slider1 >= 0.5);
track_idx = slider1 - 1;
@block
@sample
trigger == 1 ? (s=10;a=1);
play_state == 1 ? (buf[i]=spl0; i=i+1):(len=i);
spl0=spl0;
spl1=spl1;
@gfx
a == 1 ? (a=0;export_buffer_to_project(buf, len, nch, srate, track_idx, 0, tempo));
StuffMIDIMessage(0, 176,119,0)
StuffMIDIMessage(0, 176,119,1)
StuffMIDIMessage(0, 176,119,2)...
desc:Pre Record Audio
// V 0.02 alfa
//slider1:0<0,1,1{Mono,Stereo}>Channel Mode
slider1:1<1,99,1>Track (#)
@init
buf=0
@slider
nch = 1; //+ (slider1 >= 0.5);
track_idx = slider1 - 1;
@block
while (midirecv(offset,msg1,msg2,msg3)) ( // REAPER 4.59+ syntax while()
msg1==176 && msg2==119 ? (
noteon_cnt+=1; // count note-ons
// ) : (
midisend(offset,msg1,msg2,msg3); // passthrough other events
a=1
)
);
@sample
trigger == 1 ? (s=10;a=1);
play_state == 1 ? (buf[i]=spl0; i=i+1):(len=i);
spl0=spl0;
spl1=spl1;
@gfx
a == 1 ? (a=0;export_buffer_to_project(buf, len, nch, srate, track_idx, 0, tempo));