Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDI timing issues and hanging notes when routing to hardware synth directly (without ReaInsert) #1202

Closed
johnsamuelson opened this issue Sep 16, 2024 · 24 comments
Labels
bug Something isn't working playtime Related to Playtime
Milestone

Comments

@johnsamuelson
Copy link

johnsamuelson commented Sep 16, 2024

Describe the bug
Playtime displays a warning issue in the bottom right saying 'may be unstable, high severity, needs Reaper 7.23. But the latest version of Reaper downloadable via the official site is 7.22... and I've got all sorts of weird MIDI timing and lack of note-off message business going on. All very odd!

To Reproduce
Should be easy enough!

Expected behavior
Ditto

Screenshots
Screenshot 2024-09-16 at 17 31 24
Screenshot 2024-09-16 at 17 32 07

Desktop (please complete the following information):
MacOS, 12.6.1, M1 Max

@helgoboss
Copy link
Owner

REAPER 7.23 will exist. Hopefully soon. Until then, you can ignore the warning. It should only affect the points in the changelog that say "needs REAPER 7.23+).

Tell me more about the MIDI timing issues though. Video with sound would be very welcome. Plus the complete project files. Thanks.

@helgoboss helgoboss added need more info Further information is requested playtime Related to Playtime labels Sep 16, 2024
@helgoboss helgoboss changed the title Playtime is asking for Reaper v 7.23 - which doesn't seem to exist! MIDI timing issues and hanging notes Sep 16, 2024
@johnsamuelson
Copy link
Author

I really can't work out what's going on here.

I've recorded a loop into Playtime. The following are all true:

Exporting the recorded loop to the timelines plays fine both to external hardware synth outputs as well as internal VSTi synths.

Routing the Playtime looped MIDI to external hardware synth outputs results in stuck notes / hanging notes, even though I can see that note off messages are being properly sent.

Routing the Playtime looped MIDI to internal VSTi synth outputs results in no stuck notes or hanging notes.

What could be different between internal routing and external routing that would cause these notes? And why was it not doing this in any previous version of Playtime 2, including old projects I reload?! It's driving me up the wall!

https://we.tl/t-bAluqg1Ou1

@johnsamuelson
Copy link
Author

Is there a way for me to roll back to a previous build of Playtime 2? I wasn't having any of these issues about 6 or 7 days ago, whatever version that was... Thanks

@johnsamuelson
Copy link
Author

I think it might be related to tempo. This project is at 156bpm. I get stuck notes sending these recorded Playtime regions to external synths, but if I do it slower at, say, 120bpm, I don't get stuck notes. Very, very odd.

@helgoboss
Copy link
Owner

Which version of Playtime do you use?

Yes, of course, you can downgrade to a previous version at any time. Right click the package in ReaPack and install the previous version.

@johnsamuelson
Copy link
Author

This is the most recent one. I've tried to reinstall a previous version but the Playtime icon goes missing when I do / I get a script error box popping up.

I do think this may be tempo related though. The main variable between the projects that work and those that don't, in sending well-timed / not hanging note midi to external synth, is a tempo over 140bpm. Last night I recorded a midi loop at 120bpm and sent to an external midi output - all fine. Set to 130bpm, all fine. Set to 140bpm, hanging / stuck notes galore.

@helgoboss
Copy link
Owner

To which version did you downgrade? And which REAPER version do you use?

The icon should not disappear when downgrading to at least 2.16.x. Is the menu Extensions => Helgobox still there? What does the script error box say? I suppose it's a warning that you are loading a project that has been saved with a newer version of Helgobox?

Sorry, I will not be able to test this until next Monday. So we have to analyze this thing blindly, if it's urgent.

@johnsamuelson
Copy link
Author

I tried a couple - I think 2.15.x though. I am on 7.22 but tried moving that down too but no luck. I am heading in soon so will try it shortly from 2.16 and see if it's any different. It is quite urgent yes as I'm programming for a tour coming up in early October. I wouldn't normally rely on a beta test but there's so little midi-based looping software out there with this kind of flexibility that I decided to take the plunge - and all has been OK until now!

@helgoboss
Copy link
Owner

Playtime was not yet part of Helgobox in 2.15. You need at least 2.16.0. Best try 2.16.4, 2.16.3, 2.162, 2.16.1 and 2.16.0 in this order. It would be good to know the exact version in which the problem started.

@johnsamuelson
Copy link
Author

johnsamuelson commented Sep 17, 2024

The issue persists all the way back to 2.16.0. It doesn't change in any of them, tackled in that order.

I did upload a project here (https://we.tl/t-bAluqg1Ou1) but you can test yourself maybe as long as you have an external synth or MIDI hardware output. Anything over 140bpm sent to a hardware MIDI output (via USB or via DIN) starts dropping notes / sticking notes, and after about 6 or 7 loops all the notes are hung. Drop the tempo to 120bpm and it's fine again.

VSTis seem fine at any tempo. I think I just hadn't encountered this issue yet because the projects I'd worked on were at 97, 83 and 120bpm, and this one is 156 so the problem was likely there all along but only noticeable now. As I said, it's really odd because if you export the MIDI from the slot in Playtime and play that instead at 156bpm it plays fine on a loop. Something odd must be going on...

@helgoboss
Copy link
Owner

Okay. Thanks for the report. I will have a look as soon as I'm back home, which will be next Monday. There's not much I can do before that, I'm afraid.

@johnsamuelson
Copy link
Author

johnsamuelson commented Sep 17, 2024

Ok. For the time being I have (after a lot of trial and error!) found a workaround - if I add JS MIDI Duplicate Note filter on the output to the hardware, it plays properly. It must be sending extraneous data. Very very odd!

(edit: it's definitely the Duplicate note filter plugin solving the issue - if I bypass it, it instantly drops notes again, and if I re-engage it plays all day long with no issue)

@johnsamuelson
Copy link
Author

(if it's any help, looking at the log via ReaControl MIDI with Duplicate note eater on / off, it looks like there are a few duplicate note off messages being sent by Playtime compared to with the plugin being active)

@helgoboss
Copy link
Owner

One more idea: Are you using ReaInsert to control the hardware synth? Or just route the track output to the synth?

You could try to switch strategies here and see if it changes something about the issue.

@johnsamuelson
Copy link
Author

No, because these are live shows the audio doesn't come back into the computer at all - Reaper acts like a glorified MIDI router / co-ordinator for us, with some extra occasional bits of track. But I could send MIDI via ReaInsert I suppose. The Duplicate Note JS trick is still holding up though so I'm not in quite such a flap about it....!

@johnsamuelson
Copy link
Author

One more idea: Are you using ReaInsert to control the hardware synth? Or just route the track output to the synth?

You could try to switch strategies here and see if it changes something about the issue.

I have just tried this now and it also appears to solve the issue. How strange! Sending from Column 1 direct to the hardware out = issues, sending from Column 1 to ReaInsert to the same hardware out = no issues!

@helgoboss
Copy link
Owner

@johnsamuelson I just tried it with your project an could reproduce the issue. Will look into it.

I can also confirm that it works when using ReaInsert. I would recommend that as workaround for the time being because so far I have no clue what causes this and when I can fix it.

@helgoboss helgoboss added bug Something isn't working and removed need more info Further information is requested labels Sep 24, 2024
@helgoboss helgoboss changed the title MIDI timing issues and hanging notes MIDI timing issues and hanging notes when routing to hardware synth directly (without ReaInsert) Sep 24, 2024
@helgoboss
Copy link
Owner

I dropped Justin an email, asking him what this could be. Maybe he has an idea.

@helgoboss helgoboss added the wait Not actionable at the moment. Waiting for something. label Sep 24, 2024
@johnsamuelson
Copy link
Author

Cool, thanks. At least it proves I'm not going mad. Very odd though!

@helgoboss
Copy link
Owner

The nice thing about computers is that all things that appear odd at the end turn out to not be odd ;)

@helgoboss
Copy link
Owner

Funny. Putting a ReaControlMIDI into the chain also fixes the issue. It shouldn't do anything else than letting the MIDI pass through, yet it somehow fixes it.

I did a comparison of the MIDI stream. The problem with the "hanging notes" stream is that it just doesn't contain some of the original events (both note-offs and note-ons).

@helgoboss
Copy link
Owner

Yeah! With some debugging and a hint from Justin, I found the issue. It's really good that you discovered this.

It's actually an intra-block timing issue with MIDI tempos other than 120. Hard to detect, especially if the block size is small. The reason this bug revealed itself so obviously in this case is a combination of "lucky" circumstances:

  • Your tempo was higher than 120bpm, which had the effect that some MIDI event intra-block offsets exceeded the block size (due to the bug).
  • You sent it directly to a hardware device. Which just skips those events with invalid offsets. When using a VSTi instead or some MIDI effect, it would clamp the offset into the block boundaries and things appear to work.

Fixing.

@helgoboss helgoboss moved this from Todo to In Progress in Helgobox Development Sep 25, 2024
@helgoboss helgoboss added this to the 2.16.9 milestone Sep 25, 2024
@helgoboss helgoboss removed the wait Not actionable at the moment. Waiting for something. label Sep 25, 2024
helgoboss added a commit that referenced this issue Sep 25, 2024
… tempos < or > 120

... that can even cause skipped notes when sent directly to a hardware output
@github-project-automation github-project-automation bot moved this from In Progress to Done in Helgobox Development Sep 25, 2024
@johnsamuelson
Copy link
Author

Yeah! With some debugging and a hint from Justin, I found the issue. It's really good that you discovered this.

It's actually an intra-block timing issue with MIDI tempos other than 120. Hard to detect, especially if the block size is small. The reason this bug revealed itself so obviously in this case is a combination of "lucky" circumstances:

  • Your tempo was higher than 120bpm, which had the effect that some MIDI event intra-block offsets exceeded the block size (due to the bug).
  • You sent it directly to a hardware device. Which just skips those events with invalid offsets. When using a VSTi instead or some MIDI effect, it would clamp the offset into the block boundaries and things appear to work.

Fixing.

Awesome! Glad to be of some vague help! Thanks for your assistance too

@helgoboss
Copy link
Owner

2.16.9 and 2.16.10 are out now. You can try it. It works here with my synth ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working playtime Related to Playtime
Projects
Archived in project
Development

No branches or pull requests

2 participants