08-15-2014, 04:05 PM
|
#1 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
If the title caught your interest, you probably have a piece of hardware with a built-in sequencer that you'd like to synchronize with Reaper. For me, it's FutureRetro Revolution - a TB303 clone, where the internal sequencer is an essential part of the deal. Unfortunately, when using external sync from Reaper, it lags noticeably enough to kill all groove, and this led me on a quest for proper MIDI sync solution.
Reaper's option "shift output to MIDI device" didn't help - apparently, the shift time is limited to audio buffer size. My audio card has maximum buffer size of 8192 samples, which is not enough to compensate for a 10 msec lag. Even if it were possible, this would result in all audio being delayed by the same amount, which makes playing much less enjoyable. Next I considered hardware solutions - InnerClock SynGen and the ExpertSleepers suite of modules and plugins. SyncGen is close to perfect, but very expensive - on par with what I paid for the Revolution! The ES suite is better in that it provides not only MIDI clock, but 5 MIDI outputs with sample-accurate timing. This isn't cheap either, and to use it you need a modular case, two ES modules (one of which is currently out of stock) and their plugin; besides, you must work at 48 Khz. Back to square one. Problem with Reaper is that when playback starts, it sends MIDI Start immediately, and the device has no time to catch up. If we could give it a count-in (like the drummer counting "1,2,3,4" to other band members), it would have the time to compensate for the lag and start in sync. So I implemented this idea as JS plugin, and it works. Plugin page in Reaper stash: https://stash.reaper.fm/v/21479/adjus...20MIDI%20clock Direct download: https://stash.reaper.fm/21479/adjustable%20MIDI%20clock Important: Make sure to uncheck "Send clock/SPP to this device" in preferences, or your hardware will get two conflicting clocks and probably become very confused (I didn't try it )Parameters: slider1: count-in (0,1 or 2 bars). slider2: additional shift of the MIDI Start message (-10..+10 msec). slider3: shifts the MIDI clock messages (pulses) back or forward, in percent of a pulse duration. slider4: clock rate multiplier: normal, half-time or double time. This was added for completeness, and because it was trivial to do. I considered adding odd multipliers too (e.g. 2/3 or 3/2 clock are just as easy to do), but I'm not sure if that's really useful. I have achieved nearly perfect sync with the Revolution and MPC1000, using slider2=0 and slider3 at about -90%. Interestingly, I found that tempo-based shift works better at different tempos than time-based one. Please let me know if you find this useful! Suggestions for improvements are welcome too. |
|
|
08-15-2014, 07:15 PM
|
#2 |
|
Human being with feelings
Join Date: Mar 2010
Location: Adelaide, South Australia (originally from Geelong)
Posts: 5,670
|
Nice one! Just downloaded and will give it a shot later on.
I have a lot of MIDI hardware in my studio and often sync things to REAPER via MIDI (even two computers both running REAPER) and I have had timing issues with some configurations so this will certainly be worth a shot.
__________________
|
|
|
08-15-2014, 11:47 PM
|
#3 |
|
Human being with feelings
Join Date: Jan 2013
Location: Newcastle UK
Posts: 474
|
Excellent I will be trying this out later in the week.
All of my outboard gear and guitar racks are midi controlled/sequenced I have always had midi timing issues and normally have midi timing turned off and use my external sequencer to control timing except when I am creating sending sequences to it from reaper Last edited by 4x4uk; 08-15-2014 at 11:53 PM. |
|
|
08-16-2014, 02:23 AM
|
#4 |
|
Human being with feelings
Join Date: Feb 2006
Location: decepticon mothership in a hidden place inside a mountain
Posts: 3,771
|
Great, thank you !
|
|
|
08-16-2014, 05:18 AM
|
#5 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Excellent, really curious to know how it works for you.
|
|
|
08-17-2014, 09:59 AM
|
#6 |
|
Human being with feelings
Join Date: Jan 2011
Location: Zürich
Posts: 1,009
|
Hi,
this plug is based on the work of SUBZ (http://forum.cockos.com/showpost.php...87&postcount=9) very much like the one I had build some weeks ago. Code:
desc:simple MIDI clock generator even more Simple slider1:0<-32,32,1>Offset @init prev_count = 24; prev_play_state = 0; noteOnMsg = $x90; noteOffMsg = $x80; clockMsg = $xF8; startMsg = $xFA; stopMsg = $xFC; contMsg = $xFB; time_div = 24; pdc_midi = 0.0; @slider // time_div = slider3; offset_start = slider1; @block my_beat_position = beat_position; /* save the current beat_position so we can extrapolate it */ beats_per_sample = (tempo/60)/srate; /* get the beats per sample so we can track the beat position at a given sample */ //offset = 0; /* reset offset from current block start */ offset = offset_start; /* reset offset from current block start */ (play_state != prev_play_state) ? ( (play_state == 0) ? midisend(offset,stopMsg,0); (play_state == 1 || play_state == 5) ? midisend(offset,startMsg,0); prev_play_state = play_state; ); @sample _C = (my_beat_position*time_div)%time_div; prev_count != _C ? ( midisend(offset,clockMsg,0); prev_count = _C ; ); my_beat_position += beats_per_sample; /* advance the beat with the current known tempo so we are tracking it sample accurate */ offset += 1; /* advance offset so we send the midi notes at the correct time */ When the design of the Midi Sync features was done, it seemed to be a good idea to tie this clock to the audio clock directly. but the result is serious problems with PDC. In the meantime, audio latencies have been enourmously decreased, down to 2 msec, while midi latencies have increased (due to USB problems and awkward or non existing dedicate drivers), under windows. a major overhaul of this area of sync for reaper would be useful. But, as I see from the responses in the forum obviously the reaper community does not see sync as an issue. |
|
|
08-18-2014, 01:43 AM
|
#7 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Hi Mink99,
Of course I've studied all available implementations before making my own. While there's no escaping that the basic math remains the same, there are a few significant differences:
As for your last point, I don't think the MIDI sync problem is specific to Reaper - if it were, products like SyncGen wouldn't have appeared. IMHO, the problem is that pretty much all MIDI interfaces today work over USB, which was never designed for realtime data transmission. If anything, I'm grateful that Reaper gives me the tools to DIY a custom solution. |
|
|
08-18-2014, 12:35 PM
|
#8 |
|
Human being with feelings
Join Date: Jan 2011
Location: Zürich
Posts: 1,009
|
No doubt, it is one of the advantages of reaper that you can help yourself.
btw, tested your js against mine on my machine. Hardware : Win 7 64 : Motu 128 midi express : 360 Midi Patchbay : Volca Drums : audio recorded Audio : RME Hammerfall DSP on 6 ms latency, 44.1 2 ms difference, jours was 1 ms before the tick and mine was 1 ms behind the tick, both without shifting. Audio : RME Hammerfall DSP on 2 ms latency 44.1 1 ms difference, jours was 2 ms behind the tick and mine was only 1 ms behind the tick, both without shifting. I would say, mission accomplished..... Last edited by Mink99; 08-23-2014 at 07:45 AM. |
|
|
08-22-2014, 04:49 AM
|
#9 |
|
Human being with feelings
Join Date: Nov 2009
Posts: 3
|
Fantastic! you have solved my biggest gripe with Reaper!
Previously I defected to Studio One 2 - that worked spot on out of the box - but I prefer Reaper, now with this installed my R8 kicks off on time! Many thanks. PS. This really should have been addressed in the core software by now, I really can't understand why it's still not fixed. |
|
|
08-23-2014, 05:54 AM
|
#10 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Thanks norlee, glad to hear it!
Btw, I made a couple of minor changes (uploaded to stash, same link):
|
|
|
08-24-2014, 10:22 PM
|
#11 |
|
Human being with feelings
Join Date: Feb 2011
Posts: 217
|
excellent
__________________
midi will out live humanity |
|
|
09-15-2014, 03:29 PM
|
#12 | |
|
Banned
Join Date: Jul 2014
Location: United States of Europe, Germany, Mönchengladbach
Posts: 2,047
|
Quote:
|
|
|
|
11-12-2014, 05:03 AM
|
#13 |
|
Human being with feelings
Join Date: Jan 2011
Location: Zürich
Posts: 1,009
|
Not 64 Bit ?
|
|
|
11-12-2014, 08:30 AM
|
#14 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Hi TonE,
I wasn't aware of this plugin when I made mine. Of course, if it does the job for you, there's no reason to switch. For my needs, the crucial point is delaying the MIDI start message for a bar or two, thus allowing the external hardware to start in sync - this is a feature this plugin doesn't have. |
|
|
01-01-2020, 01:53 AM
|
#15 |
|
Human being with feelings
Join Date: Dec 2019
Posts: 6
|
How would i use this to affect an outboard midi sequencer ? I want it to affect the midi out clock to the sequencer but can't seem to get it to work.
|
|
|
01-01-2020, 05:21 AM
|
#16 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Hi Kron,
Can you elaborate what exactly isn't working? Does the sequencer start when you start playback in Reaper? Of course, the external sequencer should be configured for external MIDI sync. Other than that, it's hard to suggest anything without additional details. |
|
|
01-01-2020, 04:12 PM
|
#17 |
|
Human being with feelings
Join Date: Dec 2019
Posts: 6
|
The sequencer starts when I press play, but the the adjustable midi clock plugin doesn't seem to be doing anything to Reapers timing. Do I have to put it on the master track ?
|
|
|
01-02-2020, 10:45 AM
|
#18 |
|
Human being with feelings
Join Date: Feb 2017
Posts: 4,883
|
it's not supposed to do anything to Reaper's timing - it's just for adjusting the MIDI clock output
|
|
|
01-02-2020, 04:55 PM
|
#19 | |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Quote:
Hope this helps! |
|
|
|
01-03-2020, 03:26 AM
|
#20 |
|
Human being with feelings
Join Date: Dec 2019
Posts: 6
|
Wow ! This effect has saved Reaper for me, finally my entire studio now plays in sync !! Thanks so much Boreg.
|
|
|
01-03-2020, 10:30 AM
|
#21 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
You're welcome, glad to hear it helped.
|
|
|
05-11-2021, 09:43 PM
|
#22 |
|
Human being with feelings
Join Date: Jul 2020
Posts: 65
|
I'd been using Reaper as a Master with an external Korg Electribe. I set Reaper to do a 2 bar count in and it WAS working. The sequencer started when it was supposed to. Suddenly, for reasons I don't yet understand, it stopped working and now just starts immediately when I press play in Reaper.
Did something change in Reaper or is there a setting to control clock & playback with count in? I'm losing my mind |
|
|
05-12-2021, 03:56 PM
|
#23 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Hi deseipel,
Make sure Reaper is configured *not* to send MIDI clock and start/stop to this device. |
|
|
07-01-2022, 07:55 PM
|
#24 |
|
Human being with feelings
Join Date: Nov 2010
Posts: 3
|
Hey,
I'm sure i must be doing something stupid, but I'm finding my hardware doesn't seem to be synced with reaper at all when using this- I have set it up correctly I believe, as when I push play in reaper, it waits a bar and then starts the midi devices, clock send to the two devices is disabled in prefs and they each have their own instance of this plugin on their tracks being sent to the respective midi output, if i change the project tempo the devices follow that change right away, however if i turn on a metronome on my hardware devices and the metronome in reaper, they almost immediately start to drift out. if i just use reapers normal clock out, they obviously have that flam sound, but they don't drift out of sync. In the plugin I've tried changing the divisions, and adjusting offsets etc, but it seems like a fundamental issue somewhere, I have an oxi one and a tr-08 and they both seem to respond to the plugin properly, they are both locked together, start one bar into the project and follow tempo changes but they just aren't in time with reapers metronome, they are so far out in fact that every three or so bars the beat drifts into phase, then out again I've uninstalled reaper and reinstalled, and tried everything I can think of to troubleshoot. I'm a bit stumped I should mention if i plug both devices midi in to an elektron machine or even ableton, they are both rock solid and sync'd, as i mentioned even using the reaper default clock output they seem to stay sync'd, it's just got that annoying offset. can anyone suggest anything else I could try to troubleshoot this ? thanks |
|
|
07-21-2022, 04:01 PM
|
#25 |
|
Human being with feelings
Join Date: Jul 2009
Posts: 163
|
Hi pen_pen23,
I have no explanation for what you're describing, it sounds like the plugin is totally broken. I'll try to reproduce the problem here, although I don't have an oxi or tr08. What buffer size does your audio interface use? Does changing it make a difference? |
|
|
![]() |
| Thread Tools | |
|
|