01-05-2018, 03:03 PM | #1 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
OSC -> MMC script?
Has anyone written an OSC to MMC script?
It needs to just support play/stop and also very importantly to locate to a specific frame when stopped, so nudges work. I've got an external app that supports OSC and I want to sync with REAPER but it ignores locate, so I can't use OSC for it. |
01-05-2018, 04:38 PM | #2 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
I'm interested in this kind of stuff and I already successfully did some OSCII-Bot scripting, but I fail to understand what you mean by "MMC" and by "locate".
-Michael |
01-05-2018, 04:48 PM | #3 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
https://en.wikipedia.org/wiki/MIDI_Machine_Control Basically the issue is that just supporting transport operations such as play, stop, rewind isn't enough awlays. Sometimes you need to move the playhead to a specific place and have another app follow. For instance using an external video engine app (many support MMC but not OSC). You want nudge operations to also nudge the video player when editing and playback stopped, not only watch the video in sync while playing back. This is why 'locate to a specific frame' is necessary. So you can seek frame by frame. So while nudging REAPER sends commands like these. /frames/str ,s 0:01:02:00 But more typical transport are /stop ,f 1 /play ,f 0 So to translate REAPER's OSC output into MMC midi messages would be very useful. |
|
01-06-2018, 04:11 AM | #4 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
I was trying to sync my video machine with Reaper. But unfortunately Reaper only sends Start and stop, no frame nudging or forward/rewind with picture. I guess as long as Reaper does not support this natively, a OSC -> MMC translation isn't possible.
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-06-2018, 05:03 AM | #5 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
If Reaper does not send the appropriate messages via OSC or Midi, OSCII-Bot is out of luck.
But Reaper dopes feature additional interfaces, such as HTTP/HTML and "Beyond" (via OSC). Here an external program might be able to fetch the appropriate information via Network. Of course a Reaper extension (DLL done in C) might be another option. -Michael |
01-06-2018, 07:59 AM | #6 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
However I have checked listening to the OSC messages from reaper and it does seem to send a frame update when moving the cursor even when not playing. So in theory converting to MMC goto/locate messages should work better than using MTC. Moving the cursor in reaper when project stopped still produces frame updates in OSC. Code:
06.01.2018 14:56:49 - [9000] /time ,f 3.15286 06.01.2018 14:56:49 - [9000] /time/str ,s 0:03.152 06.01.2018 14:56:49 - [9000] /beat/str ,s 2.3.31 06.01.2018 14:56:49 - [9000] /samples ,f 151337 06.01.2018 14:56:49 - [9000] /samples/str ,s 151337 06.01.2018 14:56:49 - [9000] /frames/str ,s 0:00:03:03 Last edited by mrlimbic; 01-06-2018 at 08:04 AM. |
|
01-06-2018, 08:10 AM | #7 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
I didn't know that, that sounds brilliant. I'm still hoping for a native MMC solution, since I'm using the computer keyboard to control the transport and OSC won't work for non MIDI devices.
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-06-2018, 08:17 AM | #8 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
A native MMC support would be great, but it does seem possible to script this in the meantime. |
|
01-06-2018, 08:49 AM | #9 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Perhaps my knowledge is too limited in the OSC area, but I had the impression, that OSC commands can only be sent by MIDI devices (OSCIIbot). It would be awesome, if we were able to incorporate the MMC functionality via a script! This would finally solve my video machine issues.
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-06-2018, 08:54 AM | #10 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
But OSCII-BOT does allow creation of midi messages, so a converter seems possible. |
|
01-06-2018, 09:04 AM | #11 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
That would be awesome, are you able to pull off something like that?
Would love to help, but I'm new to OSC.
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-06-2018, 09:10 AM | #12 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
The format of each OSC line is <address> which is similar to a file path, then the <type of data>, then the <value>. So this is an example of hitting play for a while, then stop. Code:
06.01.2018 15:50:52 - [9000] /stop ,f 0 06.01.2018 15:50:52 - [9000] /play ,f 1 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:01:11 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:01:13 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:01:15 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:01:18 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:01:20 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:01:22 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:02:00 06.01.2018 15:50:52 - [9000] /frames/str ,s 0:00:02:02 06.01.2018 15:50:52 - [9000] /stop ,f 1 |
|
01-06-2018, 09:53 AM | #13 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
I've found some basic information on necessary midi messages for MMC here.
http://midi.teragonaudio.com/tech/mmc.htm http://www.somascape.org/midi/tech/spec.html#rusx_mmcc http://peterelsea.com/Maxtuts_advanced/Max&MMC.pdf Last edited by mrlimbic; 01-06-2018 at 11:32 AM. |
01-06-2018, 11:19 AM | #14 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
MMC requires sysex midi messages.
Is that possible in OSCII-bot? Anyone know how? Do you just send two messages? |
01-06-2018, 11:42 AM | #15 | |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
Quote:
See the OSCII-Bot documentation -> https://www.cockos.com/oscii-bot/oscii-bot-doc.html (Receive in OSCStr. Send: just a string.) -Michael |
|
01-06-2018, 11:49 AM | #16 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
In fact, one issue I can potentially see is that the MMC timecode for locate also requires the framerate encoded, but I don't see such an OSC message from reaper. So not sure how to get the info to translate that properly. Any ideas? Hours and Type : 0yyzzzzz yy = Type: 00 = 24 fps, 01 = 25 fps, 10 = 30 fps (drop frame), 11 = 30 fps (non-drop frame) zzzzz = Hours (0-23) Looking at the "goto/locate" message spec here.. http://www.somascape.org/midi/tech/spec.html#rusx_mmcc Last edited by mrlimbic; 01-06-2018 at 11:58 AM. |
|
01-07-2018, 09:50 AM | #17 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
OK. I am going to have an attempt at doing this but am a total OSCII-bot newbie.
How do you give a script parameters, or let the user select relevant settings when running? Mine is going to have to let the user select: 1. OSC port to listen on 2. MIDI device name / port to send to 3. frame rate to use for sending MMC timecode messages. Ideally this would be as a UI Last edited by mrlimbic; 01-07-2018 at 12:58 PM. |
01-07-2018, 02:38 PM | #18 | |
Human being with feelings
Join Date: Feb 2016
Posts: 189
|
Quote:
When you get going with the EEL2 code you can probably add these as changeable from a GUI or read them in from a configuration file: it depends on the ability to have variables or literal values in the code. Since the code reference is not clear on this you'll need to try it out: see http://cockos.com/oscii-bot/oscii-bot-doc.html The frame rate as a variable is no problem: that will be simply be a variable in your translation code. |
|
01-07-2018, 03:41 PM | #19 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
You always can ask here....
Anyway... Do you have some experience with programming (e.g. in C) ? EEL (and the OSCII-Bot framework) does have some specialties (and the documentation is a bit sparse), but it is a rather "normal" programming language after all. -Michael Last edited by mschnell; 01-08-2018 at 01:36 PM. |
01-08-2018, 08:19 AM | #20 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
@mrlimbic awesome man! Looking forward to it! I wish I could help somehow.
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-08-2018, 08:54 AM | #21 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
I'm actually going to try to do this as a JSFX.
It turns out I can get play state & position from a JSFX. Also position does update when not playing, so it should work. I've written a couple of JSFX before so it should be easier for me that way. The advantage of doing it as a JSFX is you get your parameters added to a UI automatically. No need to build one. |
01-08-2018, 09:15 AM | #22 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
That's even better! And to sync the two machines, we could add the JSFX to the master output?
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-08-2018, 09:18 AM | #23 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
I'll have to add a drop down for various frame rates as I don't seem to be able to get the current project frame rate from the JSFX api. Only position in seconds. |
|
01-08-2018, 09:22 AM | #24 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Awwww, that sounds awesome. I can't believe it, a dream comes true, I can finally sync Nuendo to Reaper!
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-08-2018, 11:39 AM | #25 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Won't happen. ReaScript cannot access midi ports directly. But, it's still doable with oscii-bot.
Something like this: @output midi_out MIDI "your_midi_port__exact_name" function mmcSend () ( deviceID = "yourID"; // you should know what this is command = "\x02"; // Play command, according to specs? strcpy(mmcCommand=#,""); // clear mmc variable strcat(mmcCommand, sprintf(#,"%s%s%s%s%s", "\xF0\x7F",deviceID,"\x06",command,"\xF7"; // construct (concatenate) final string from small strings midisend_str(midi_out, mmcCommand); // send string to the device ); Now, call this function from somewhere in your code. From @midimsg, @timer or from @oscmsg. I don't know. |
01-08-2018, 11:43 AM | #26 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
It doesn't need to access midi ports directly. It just generates the midi and the user can route the track midi somewhere sensible using a hardware output on the track.
|
01-08-2018, 12:03 PM | #27 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
If you don't mind using an extra track in your default project, this might be a solution.
|
01-08-2018, 01:42 PM | #28 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,789
|
He speaks of JSFX and not of ReaScript.
JSFX can use the Midi devices with normal Midi routing. I do this very excessively. If you want to send midi to another application you can use a loop midi device. AFAIK, also ReaScript can access a (singe) Midi Device: the "virual keyboard". Same can routed to the input of a track and from there to a midi output device. -Michael |
01-08-2018, 02:13 PM | #29 |
Human being with feelings
Join Date: May 2017
Posts: 981
|
Eagerly waiting for this..😀😀😀
|
01-08-2018, 04:40 PM | #30 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Damn. I've just discovered a reaper bug in JSFX API.
Reaper is reporting still being in the play state while it is actually paused. That is creating problems for my new plugin. |
01-08-2018, 04:47 PM | #31 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
This is exactly why I mentioned an extra track in the default project for it.
+Jackson Last edited by fundorin; 01-09-2018 at 01:17 AM. |
01-08-2018, 06:13 PM | #32 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Basically my plugin works now unless you pause the project (enter key) - then it goes crazy.
However if you only use the stop/start key (space bar) it all works as expected. I can't really do anything about the pause bug until cockos fix the api bug. Someone else confirmed it so I have reported it in the bug forum. https://forum.cockos.com/showthread.php?t=201727 BTW I tested against the two very nice external video sync apps here below.. Video Slave (which has some great ADR features) https://non-lethal-applications.com/.../video-slave-3 Mitti https://imimot.com/mitti/ |
01-08-2018, 06:55 PM | #33 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
That’s still great news, though! Any chance to test the plugin?
I hope we will see a fix from Cockos, soon.
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-09-2018, 09:36 AM | #34 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
Justin responded but not great news. I don't think I can get pause working properly. So I hinted at maybe supporting MMC locate natively. Fingers crossed. https://forum.cockos.com/showpost.ph...94&postcount=3 |
|
01-09-2018, 11:44 AM | #35 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
I'm also hoping, that Justin and schwa will take care of MMC, or a native Reaper to Reaper sync method, like VST System Link for Steinberg products.
I know this might be a bit convoluted, but to circumvent the pause issue: wouldn't it be possible to do the following? - create a cycle action - put a Reaper pause command 1st - then 2nd, add a custom script that sends the corresponding sysex MMC message for pause - assign it to your pause keys on your keyboard Would that work?
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-09-2018, 11:55 AM | #36 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
BTW A native custom sync method like steinberg's won't be that useful unless other apps out there also support it. They pretty much all assume MTC for playback, MMC for locate while no playback. |
|
01-09-2018, 12:34 PM | #37 | ||
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Quote:
Quote:
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
||
01-09-2018, 03:14 PM | #38 |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
The “MMC locate" plugin is now in my mrlimbic reapack repo.
https://github.com/mrlimbic/reascrip...ster/index.xml Apart from the pause issue it seems to be working for me with Video Slave 3 and Mitti demos. XJadeo doesn't support MMC locate yet but I have requested it. Limitations: Drop-frame timecodes are not yet supported, only Non-drop timecodes. |
01-09-2018, 07:11 PM | #39 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Just checking it, but no matter what setting I use, I get always 24 frames. Tested with Nuendo and Video Slave.
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-09-2018, 07:20 PM | #40 | |
Human being with feelings
Join Date: Nov 2009
Location: UK
Posts: 669
|
Quote:
So for 25fps you need to select 29.97DF. I'll fix it tomorrow! |
|
Thread Tools | |
Display Modes | |
|
|