View Issue Details

IDProjectCategoryView StatusLast Update
0007978ardourbugspublic2020-04-05 19:49
ReporterTremeschin Assigned Tox42  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSArch LinuxOS Version(Rolling)
Product Version6.0-pre1 
Summary0007978: Tiny, tiny, tiny misalignments in Ardour's 6 MIDI regions starts / ending
DescriptionMore often than not when I'm looping regions, the beginning of some MIDI tracks don't play audio so whenever I zoom in to check what's going on, I see really tiny misalignments on the midi regions compared to the grid itself. This is really annoying as you can see this extreme case image attached here.

It looks like it happens more whenever I'm using the "Mouse" mode within the editor and duplicating lots and lots of regions / resizing regions but this isn't an universal rule, it happens on the edit points as for Marker and Playhead as well, less worse misalignments on Marker mode as it looks like it (can be placebo but whatever).

Those are usually tiny, tiny, tiny misalignments, about a pixel at max zoom in level but they eventually sum up.

More detailed info and a demo video at the end of Additional Information section.

This looks like some rounding error? Quantizing the regions after creation could solve that? Only let "broken" numbers (region position) whenever ALT key is pressed i.e. moving voice samples or FX to a "not-aligned part of the beat?
Steps To ReproduceCreate new session, create MIDI track with any instrument (can be none), set Snap mode to on (any Grid Mode looks like), create a MIDI regions on any zoom level (make sure you place both ending / start on a Grid vertical line as for reference later on), zoom in real close up to the max zoom in level, now three things can happen:

1. The ending of the MIDI region IS aligned a single pixel to more or less
2. The ending of the MIDI region IS aligned a considerable bit to more or less
3. The ending of the MIDI is aligned PERFECTLY (do not happen for me, at best number 1)

To really get the wrongness of it, select the midi region in the Grab Mode, duplicate let's say 10, 20, 50 times the MIDI region to its right and do the same, zoom in really close. The effect is worsened by a lot depending on how much the track is misaligned from the start.

Seems to be always reproducible as far as I can tell at least locally.
Additional InformationArdour compiled from master as of April 3th 2020, commit a6d1890
Default waf configurations
I'm not using Smart mode, I do use Snap mode when doing this.
"Snap to" option only checked GRID option, all other are disabled

There's one interesting bit and that's when you zoom in really close to the end of the region and try to resize it, on all Edit modes as far as I can tell two things can happen:

1. The region ending will be snapped to the right place on any position of your mouse within the Pixel Snap Threshold option
2. The region ending will be either kept the same if the mouse is to the opposite side of the misalignment or correctly aligned if on the side of the misalignment (see video)

Another thing is that when you select a few tracks that have this problems in variations of the original problem (i.e. misaligned differently), and duplicate them a bunch of times you eventually end up with the image attached here.

Another strange thing is that the start of the regions seems like aligned every time on creation but not always when resizing (can't completely reproduce though).

But whenever you align the tracks perfectly and duplicate them a lot of times they are perfectly aligned as they should be.

After all this explanation, here's a demo video of the issue happening locally:

https://www.youtube.com/watch?v=l2jabAAnzTU

[ CPU couldn't handle 720p without everything dying, sorry but the problem can be seen clearly AFAIK ]

I really don't know if this is everything about it it's such an strange issue but welp, here goes nothing :)
TagsEditor, MIDI region, region, resize, snap, zoom

Activities

Tremeschin

2020-04-05 04:37

reporter  

extreme-case-misalign.png (57,108 bytes)   
extreme-case-misalign.png (57,108 bytes)   

paul

2020-04-05 14:52

administrator   ~0021182

please clarify what you mean by ""mouse" mode within the editor", since there is no mode called "mouse" ....

paul

2020-04-05 14:58

administrator   ~0021184

OK, the video makes clear what you mean by ""mouse" mode" ... this is the definition of the edit point.

Will attempt to reproduce locally later today.

x42

2020-04-05 18:29

administrator   ~0021187

Ardour 6.0-pre1-153-gfbc48bdf34 has a fix for

3. The ending of the MIDI is aligned PERFECTLY (do not happen for me, at best number 1)

Could it be that 1, 2 are follow up errors? e.g. Preferences > Editor > Snap also snaps to region-start/end.
So when you create the 2nd region, Ardour snaps to the already incorrect region-end from a prior created region (and another off-by-one is accumulated)?

Tremeschin

2020-04-05 18:56

reporter   ~0021188

x42, I don't think that's the case as when I recorded the video I only had "When 'Snap' is enabled, snap to:" [Grid] mode checked, so it should snap to the grid perfectly? See screenshot
only-snap-grid.png (55,697 bytes)   
only-snap-grid.png (55,697 bytes)   

x42

2020-04-05 19:27

administrator   ~0021189

> so it should snap to the grid perfectly?

It should snap the end to 1 sample before the grid, so that when you duplicate the region the next one starts at the grid line.

Can you still reproduce this issue with current git (6.0-pre1-153-gfbc48bdf34), because I cannot.

Tremeschin

2020-04-05 19:41

reporter   ~0021191

(took a while to compile, I should've waited to post the last feedback post, that was on the old commit the issue was still on)

After pulling master and compiling (commit fbc48bd), looks like region creations and snapping are working properly now, tried on a few different zoom levels, all "Edit Points", snap options only Grid in "snap to", all option in "snap to" (region end, start, markers, grid, sync points) and by the look of things this is fixed.

Duplicated a couple hundred of times a few midi regions just to be sure that everything was aligned from the beginning to the end and that was completely true, everything aligned correctly!!

Will use Ardour casually and if this happens again I'll message back (I don't think it will)

Thanks guys, that was faster than I expected!!

x42

2020-04-05 19:49

administrator   ~0021192

Fixed in 6.0-pre1-153-gfbc48bdf34 - closing

Issue History

Date Modified Username Field Change
2020-04-05 04:36 Tremeschin New Issue
2020-04-05 04:37 Tremeschin Tag Attached: Editor
2020-04-05 04:37 Tremeschin Tag Attached: MIDI region
2020-04-05 04:37 Tremeschin Tag Attached: region
2020-04-05 04:37 Tremeschin Tag Attached: resize
2020-04-05 04:37 Tremeschin Tag Attached: snap
2020-04-05 04:37 Tremeschin Tag Attached: zoom
2020-04-05 04:37 Tremeschin File Added: extreme-case-misalign.png
2020-04-05 14:52 paul Note Added: 0021182
2020-04-05 14:58 paul Note Added: 0021184
2020-04-05 18:29 x42 Note Added: 0021187
2020-04-05 18:33 x42 Assigned To => x42
2020-04-05 18:33 x42 Status new => feedback
2020-04-05 18:56 Tremeschin File Added: only-snap-grid.png
2020-04-05 18:56 Tremeschin Note Added: 0021188
2020-04-05 18:56 Tremeschin Status feedback => assigned
2020-04-05 19:27 x42 Note Added: 0021189
2020-04-05 19:28 x42 Assigned To x42 =>
2020-04-05 19:41 Tremeschin Note Added: 0021191
2020-04-05 19:49 x42 Assigned To => x42
2020-04-05 19:49 x42 Status assigned => closed
2020-04-05 19:49 x42 Resolution open => fixed
2020-04-05 19:49 x42 Note Added: 0021192