-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add midi_chorderizer V2 (replaces octaver), Set Envelope Points script
- Loading branch information
Showing
3 changed files
with
168 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
desc:MIDI Chorderizer | ||
//tags: MIDI processing | ||
|
||
slider1:5<0,24,1>Voice 1 Offset (st) | ||
slider2:0<0,24,1>Voice 2 Offset (st) | ||
slider3:0<0,24,1>Voice 3 Offset (st) | ||
slider4:0<0,24,1>Voice 4 Offset (st) | ||
slider5:1<0,1>Velocity Scale @ 1 | ||
slider6:1<0,1>Velocity Scale @ 4 | ||
slider7:0<0,127,1>Lowest Key (MIDI Note #) | ||
slider8:127<0,127,1>Highest Key (MIDI Note #) | ||
|
||
in_pin:none | ||
out_pin:none | ||
|
||
@init | ||
|
||
@slider | ||
slider1=slider1; | ||
|
||
|
||
@block | ||
|
||
while ( | ||
midirecv(ts,msg1,msg23) ? | ||
( | ||
m=msg1&240; | ||
note=msg23&127; | ||
|
||
(m == 8*16 || m==9*16) && note >= slider7 && note <= slider8 ? | ||
( | ||
|
||
slider1 > 0 ? ( | ||
note2 = note+slider1; | ||
) : note2=-1; | ||
|
||
slider2 > 0 ? ( | ||
note3 = note+slider2; | ||
) : note3=-1; | ||
|
||
slider3 > 0 ? ( | ||
note4 = note+slider3; | ||
) : note4=-1; | ||
|
||
slider4 > 0 ? ( | ||
note5 = note+slider4; | ||
) : note5=-1; | ||
|
||
(m == 9*16 && msg23>=256) ? | ||
( | ||
vel=(msg23/256)|0; | ||
vel<0?vel=0:vel>=127?vel=127:vel|=0; | ||
ov=vel; | ||
vel *= 256.0; | ||
|
||
|
||
note >= 0 && note < 128 ? midisend(ts,9*16,note+vel); // send note on | ||
note2 >= 0 && note2 < 128 ? ( | ||
sc=slider5; vel2=ov*sc; vel2<0?vel2=0:vel2>=127?vel2=127:vel2|=0; vel2 *= 256.0; | ||
// vel2=127; | ||
midisend(ts,9*16,note2+vel2); // send note on | ||
); | ||
note3 >= 0 && note3 < 128 ? ( | ||
sc=slider5*0.75 + slider6*0.25; vel2=ov*sc; vel2<0?vel2=0:vel2>=127?vel2=127:vel2|=0; vel2 *= 256.0; | ||
midisend(ts,9*16,note3+vel2); // send note on | ||
); | ||
note4 >= 0 && note4 < 128 ? ( | ||
sc=slider5*0.25 + slider6*0.75; vel2=ov*sc; vel2<0?vel2=0:vel2>=127?vel2=127:vel2|=0; vel2 *= 256.0; | ||
midisend(ts,9*16,note4+vel2); // send note on | ||
); | ||
note5 >= 0 && note5 < 128 ? ( | ||
sc=slider6; vel2=ov*sc; vel2<0?vel2=0:vel2>=127?vel2=127:vel2|=0; vel2 *= 256.0; | ||
midisend(ts,9*16,note5+vel2); // send note on | ||
); | ||
) : (m == 8*16 || m == 9*16) ? ( | ||
note >= 0 && note < 128 ? midisend(ts,8*16,note); // send note off | ||
note2 >= 0 && note2 < 128 ? midisend(ts,8*16,note2); // send note off | ||
note3 >= 0 && note3 < 128 ? midisend(ts,8*16,note3); // send note off | ||
note4 >= 0 && note4 < 128 ? midisend(ts,8*16,note4); // send note off | ||
note5 >= 0 && note5 < 128 ? midisend(ts,8*16,note5); // send note off | ||
); | ||
) : | ||
( | ||
midisend(ts,msg1,msg23); | ||
); | ||
bla=1; | ||
); | ||
); | ||
|
||
|
||
@sample | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
desc="Stretch & lock files depending on BPM of project & file. Length correction may be buggy" | ||
by="junh1024" | ||
|
||
from reaper_python import * | ||
from contextlib import contextmanager | ||
|
||
@contextmanager | ||
def undoable(message): | ||
RPR_Undo_BeginBlock2(0) | ||
try: | ||
yield | ||
finally: | ||
RPR_Undo_EndBlock2(0, message, -1) | ||
|
||
debug = True | ||
|
||
def msg(m): | ||
if 'debug' in globals(): | ||
RPR_ShowConsoleMsg(m) | ||
|
||
# msg(RPR_CountSelectedMediaItems(0)) | ||
|
||
with undoable(desc): | ||
# code from https://github.com/X-Raym/REAPER-ReaScripts/blob/1a0d13ebcef3efe32f18ef213aa70673dc2d6bbe/Envelopes/X-Raym_Set%20selected%20envelope%20points%20value.eel | ||
|
||
# RPR_ShowConsoleMsg(BPM_proj) | ||
|
||
#get file BPM | ||
retval= envelope= ptidx= timeOut= valueOut= shapeOut= tensionOut= selectedOut=0 | ||
new_value = RPR_GetUserInputs("Point",1,"What to set these point(s) to?","",64)[4] | ||
new_value=float(new_value.strip()) | ||
|
||
# RPR_ShowConsoleMsg(BPM_file) | ||
envelope = RPR_GetSelectedEnvelope(0) | ||
#get items | ||
for i in range ( RPR_CountEnvelopePoints( envelope ) ): | ||
|
||
( retval, envelope, ptidx, timeOut, valueOut, shapeOut, tensionOut, selectedOut) = RPR_GetEnvelopePoint(envelope, i, timeOut, valueOut, shapeOut, tensionOut, selectedOut) | ||
|
||
if ( selectedOut == 1 ): | ||
RPR_SetEnvelopePoint(envelope, i, timeOut, new_value, shapeOut, tensionOut, 1, True ); |