02-08-2021, 03:03 AM | #1 |
Human being with feelings
Join Date: May 2018
Posts: 52
|
Sync reaper region and external gear pattern with program change
Hi,
I would like reaper to send Program change to my elektron digitakt (or any other external gear I have) with a reaper action. IS it possible to do this ? Digitakt actually send/receive program change on pattern change and I want to synchronise the digitakt patterns and the reaper regions. That way, if I change region in reaper, it changes pattern on the digitakt (and vice-versa). I made it work the other way around (that is changing reaper region when digitakt changes pattern), but now I want to do it the other way (when smooth seeking a region, it should send a program change to the digitakt) It is easy to do it with maschine, that also has the same functionnality...but with reaper it needs a bit of script and everything :-D |
02-08-2021, 08:38 AM | #2 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
What about placing a Midi Item at the beginning of any write a a program change in there ?
-Michael |
02-08-2021, 08:46 AM | #3 |
Human being with feelings
Join Date: May 2018
Posts: 52
|
@mschnell :
I get what you are saying, but I find it gross and a bit inconvenient, because the midi PC has to be sent a bit before the beginning of the region. What I mean by this, is that I want to be able to call the region in a "smooth seek" way from a midi controller for instance, and I want the digitakt to receive the PC to change accordingly. I started to create a script, but I didn't try it yet. It is supposed to send a program change (channel 10) based on region ID, not sure if that works : reaper.Undo_BeginBlock() local time = reaper.GetCursorPosition() local mark, reg = reaper.GetLastMarkerAndCurRegion(0,time) local msg = 12 -- 12 = program change -- local ch = 10 -- channel -- local device = 16 -- 0 for vbk, 16 for midi device 0, 17 for midi device 1,... -- reaper.StuffMIDIMessage(0, msg*16 + ch, reg + 1, 0); reaper.Undo_EndBlock("send PC to midi port according to region ID", -1) then I am going to make a bunch of custom actions containing each " go to region XX (smooth seek)" + that script. I hope, it will work as planned Last edited by baldo; 02-08-2021 at 08:54 AM. |
02-08-2021, 09:07 AM | #4 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
https://www.reaper.fm/sdk/reascript/...uffMIDIMessage ->
Mode : "16 for external MIDI device 0, 17 for external MIDI device 1, etc;" Hence you need to set the first parameter appropriately rather then Zero. -Michael |
02-08-2021, 09:33 AM | #5 |
Human being with feelings
Join Date: May 2018
Posts: 52
|
oopsy,
yeah, looks like I coded this too quickly without even trying it nah ? :-D |
02-09-2021, 01:29 AM | #6 |
Human being with feelings
Join Date: May 2018
Posts: 52
|
Well it does not work
Well it doesn't work
I gave the digitakt the ID 0, and with stuffMIDIMessage(16, 12*16 + 10 , 0, 0 ) It is supposed to send to the digitakt a PC 0 on channel 10 right ? Program change is 1100 cccc on the first byte and program number on the second no ? |
02-09-2021, 03:50 AM | #7 |
Human being with feelings
Join Date: May 2018
Posts: 52
|
Now it works
Ok, I made it work, so here is the correct code for this
local ch = 10 -- channel local device = 0 -- device output id -- sends a Program change on channel ch, for device, of value reg reaper.StuffMIDIMessage(16 + device, 192 + ch - 1, reg, 0); |
02-09-2021, 08:24 AM | #8 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
Yep. Midi Channels 1..16 are binary 0 ... 15
-Michael |
02-10-2021, 02:13 AM | #9 |
Human being with feelings
Join Date: May 2018
Posts: 52
|
yes, I am always switching from python, matlab, and a lot of languages, and sometimes I start from 0 and other time from 1 :-D.
|
Thread Tools | |
Display Modes | |
|
|