-
Notifications
You must be signed in to change notification settings - Fork 404
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
SurgeXT plays notes stuttery vs. Surge #5830
Comments
Audio example would be welcome. Since this doesn't happen in any other DAW that I have over here, I would suggest this might be a VST3 issue in Ardour. |
Can already see when comparing them in Audacity that with Surge XT some notes trigger a little late: Note transitions are... different. Both use the same patch and midi, but in some cases it looks like notes would have an extra attack / fade out time with Surge XT (red), where in other cases Surge and Surge XT sound the same (green).
Can't test this as the LV2 version of Surge XT currently crashes Ardour. Meanwhile VST3 and LV2 of Surge work fine. |
This could occur if ardour sets the timestamps on vst3 midi incorrectly. In our old vst3 I don’t think we did a very good job of interleaving midi with processing based on that I’m curious if you set your ardour block size to 64 or 32 if it still happens |
The block size really makes a difference here. Smaller ones make the problem less noticeable while higher ones make it more problematic. |
We've also heard this might be fixed in Ardour 7, since they're overhauling their MIDI handling. |
PS. It may still be Ardour's fault or a combination of Surge/JUCE/Ardour. |
@x42 as shown in my screenshots above, it does not happen with all notes. Some play fine in the right time. It seems mainly between some note transitions, when one note goes directly over into another. |
I was able to test the LV2 now. Because, while Surge XT LV2 crashes Ardour on two of my machines, it works on a third one xD |
hmm lemme try here in logic and see. |
So here's the logic from surge
this will land midi items on exactly the right spot IF their sample position starts at 0 relative to the buffer. If the sample has an offset, then they end up all the way at the end. Surge 1.9 crammed them at the start of the buffer so they will be 'early' but didn't try to land them at the appropriate inter-block So I guess my question is: does ardour label its midi from block-relative samples. I checked in reaper and it does (with block size 512 I get the first midi location at various values between 0 and 512). If Ardour is providing an offset, how do I get it? @Bleuzen do you have an ability to build and test in ardour? If so I can share with you the patch I added to debug in reaper. |
MIDI even-timestamps are relative to the current plugin process cycle. The Sample positions perfectly match the audio-buffers provided to the plugin's process function. |
Yes I can do that |
Try that patch and see what stdout you get while playing with ardour with reaper i never get the overflow and get sample accurate application |
Well xD
|
huh ok.so then it's not midi sample offset. hmm. i wonder what else could be mis-aligning buffers. |
And just to be sure I tried the vst3 in reaper using @x42 's test on my mac and saw this exact alignment (which is within the 32 sample block size alignment). Hmmm. @selenologist you are running a recent ardour right? Can you see anything like this if you happen to be online? |
@Bleuzen Could you try https://github.com/x42/host-synth-test.lv2 as replacement synth in the same session? That will produce a 1 sample spike on each MIDI note event: Just to rule out somethin is wrong with the session itself. |
@x42 looks fine to me:
That's not the case, can reproduce in any new session. |
and if you just sub surge xt onto that with a sine blip (basically just take the sustain on the envelope down to zero) it misses? why on earth would it miss in ardour for you and not in reaper for me? @x42 have you run surge in ardour and seen this? I guess I could give you another patch which makes surge run exactly like that blip plugin. |
Yes, I just tried, and yes it's offset: It's an older version which I had installed: "Copy" does not work hence a screenshot: |
right so that makes some sense. the old version didn't interleave into the block properly the new version should not do that and should be much closer. If we apply this patch to head the synth sends a blip downstream on note on and note off and in reaper it lines up perfectly. Wanna give that a try @Bleuzen ? |
@baconpaul the blip patched Surge XT does not have those delays: |
wow. |
@Bleuzen just one more if you have a chance and based on this let me think. This one mixes the surge signal and the blip. the blip is sample accurate to the midi the surge signal should be delayed an amortized 16 samples with a min of 0 and max of 31. I am curious if that is what you see in ardour. Thank you for these tests. I am not sure what is happening but each one is at least ruling stuff out. |
|
Right so that is what I would expect - our finest midi resolution is our block size which is 32 samples. Surge 19 just put everything at the top of the next block so should be more latent but will be differently renderer especially with large block sizes but I think xt is more correct so I guess now I’m unsure what the problem is. |
oh that's very interesting. |
oh i see one potential bug - that's very useful. |
Does this patch improve the situation? I think surge xt has a bug when two midi events occur with exactly the same sample which will push the items to the end of the block. |
by the way if that does improve the situation, along with a few other bugs we found, we may include it in 1.0.1 release. But I'd make a nightly first. |
Aha! Yes that would happen with the MIDI data shown the the screenshot above after the first note. |
makes it much better. After / with the latest patch: Great, thanks :) That said there are still little delays for each note: Seems small, probably not audible in most cases. |
Yeah that's the amortized 32 delay from the block size. No getting rid of that. OK so cool this is a real honest to goodness bug Let me patch this and then if you can confirm the code at head we can put together a 1.0.1 Thanks for your patience and sorry for blaming ardour :) |
If two midi events arrived with the exact sample sample timestep, they would push to the end of the block along with the rest of the midi in that block. Fix it with an if/while switch on processing the midi list. Addresses surge-synthesizer#5830
No worries. Wow, from bug-report to solution in under 12 hours. Great work everyone! |
If two midi events arrived with the exact sample sample timestep, they would push to the end of the block along with the rest of the midi in that block. Fix it with an if/while switch on processing the midi list. Addresses #5830
@baconpaul works from latest git main :) |
Awesome. Thank you. We will ship that with a few there bug fixes as a 1.0.1 release this weekend sometime (maybe Monday at the outside) Appreciate the help here. |
Bug Description:
I tried porting my patches from Surge to Surge XT and let them run with some midi notes in Ardour for testing. I noticed that while Surge plays my midi just fine and smooth, Surge XT sometimes sounds a little different and stutters.
Surge Version
Reproduction Steps:
Steps to reproduce the behavior:
1.) Load Surge and Surge XT and play the same midi notes
Expected Behavior:
With the same patch they should sound the same and Surge XT should play the notes as smooth as original Surge.
Video:
https://www.youtube.com/watch?v=BHz8VhpC7fM
Computer Information (please complete the following information):
Additional Information:
Happens with the initial patch and "Nastyfication". Haven't tested others yet, but all could be affected.
The text was updated successfully, but these errors were encountered: