#1078 Some notes are misaligned after pasting

closed
nobody
matrix (53)
8
2012-09-16
2007-08-26
Juuso Alasuutari
No

When pasting anything in the matrix and percussion matrix editors, occasionally some some notes will be offset by a small amount. This will sometimes happen even with a short snippet. If the pasted section is long, the chance of some notes being misaligned seems to increase towards the end. The misbehaving notes always seem to slip forward in time, and the offset is usually less than 1/16.

This keeps bugging the bejesus out of me, because it forces me to manually inspect everything I paste. Even quantizing the pasted area doesn't work because the misaligned notes may be closer to the next note position than the correct one.

Just so that you know: I have paid close attention to actually pasting in the correct place, for instance by zooming in 1000% and then setting the cursor position. This bug isn't the result of sloppy mouse usage.

To reproduce create a short drumbeat, copy it, and paste it successively until you observe the bug. If you want me to trace what the program does when this happens I'll be glad to, just tell me how.

Discussion

1 2 3 > >> (Page 1 of 3)
  • Logged In: YES
    user_id=663564
    Originator: NO

    I haven't tried to reproduce it here and now, but this sounds like an old ghost I thought I was imagining, which I chalked up to user error.

     
  • Logged In: YES
    user_id=1707301
    Originator: YES

    I kept an eye out for this bug yesterday as I was editing a song. It seems that I was wrong when I said, "the chance of some notes being misaligned seems to increase towards the end". In fact, it looks more like a random occurrence. But the notes do always slip forward, never backwards.

    As I said I'd be happy to trace this. Are there any tools that I could use to produce meaningful debug info?

     
  • Logged In: YES
    user_id=663564
    Originator: NO

    I'm not sure what would be useful. I've never played around with any of that code, and I'm not familiar with it.

    I'm afraid I can't suggest anything better than rebuilding with full debugging enabled, run from a terminal, and sift through the stream of traces to see if a pattern emerges. I'm not even sure any relevant traces are enabled in the code. We tend to comment out noisy traces after fixing a problem, so there are tons of traces that won't be built even with full debugging. Not being familiar with any of this code, I can only speak in general terms.

     
  • Logged In: YES
    user_id=1707301
    Originator: YES

    File Added: good_paste.txt

     
  • Full debug from a flawless paste

     
    Attachments
  • Logged In: YES
    user_id=1707301
    Originator: YES

    File Added: bad_paste.txt

     
  • Full debug from a misaligned paste

     
    Attachments
  • Logged In: YES
    user_id=1707301
    Originator: YES

    I managed to reproduce the bug while capturing debug messages. I uploaded the data captured during both succesful and misaligned pastings. I couldn't see anything alarming in them, though. Perhaps I couldn't interpret the data or there indeed isn't enough debug output available.

    If this gives you more clues about where to search, and you can write up a patch for outputting more detailed debug info, I'll gladly apply the patch and do a re-run.

     
  • Logged In: YES
    user_id=663564
    Originator: NO

    I don't see anything standing out, except different paste times. Makes me suspect something going wrong on the clicking end. We're interpreting what to you seems to be an identical click slightly differently, and sliding the events over a hair.

    Or something. Is it the same mechanism in all cases? I seem to remember an old bug where there was a difference between click pasting and ^V pasting.

    Chris would be the best person to offer the insight here, but he's not around this week.

    I'll see if I can even reproduce it for starters, and we'll go from there. Maybe I'll have time to think more by the weekend. I hope.

     
  • Logged In: YES
    user_id=1707301
    Originator: YES

    I used ^V pasting (after carefully aligning the bar with the mouse, of course). What in my opinion would seem to contradict the "slip of the mouse" hypothesis is that not all of the notes become misaligned. It's most often only one or two in a short selection.

    Also, I zoomed in so close that the smallest possible bar movement was several pixels wide. That makes it seem unlikely that the focus could be off by a hair. (But if that sort of thing is indeed possible, I would consider it a bug.)

     
1 2 3 > >> (Page 1 of 3)