Audacity Bug Summary
••• Introduction •••
••• Keywords •••
    Audacity 3.0.3 development began 19th April 2021

Audacity Bugzilla



Bug 1688 - MIDI Note tracks can be stretched beyond the Note track boundary - making notes inaccessible
MIDI Note tracks can be stretched beyond the Note track boundary - making not...
Status: RESOLVED QUICKFIXED
Product: Audacity
Classification: Unclassified
Component: MIDI
2.2.0
Per OS All
: P1 Repeatable
Assigned To: Default Assignee for New Bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-16 08:01 UTC by Peter Sampson
Modified: 2018-08-20 11:51 UTC (History)
9 users (show)

See Also:
Steps To Reproduce:
1) New project 2) import a MIDI file into a Note Track with File>Import MIDI 3) zoom to "fit in window" 4) zoom out one level (so project fits in left half of window) 5) select from half-way in the Note track to the right end of the window 6) hover cursor over the vertical center of the note track to get the cross-hairs stretch cursor 7) Click and drag the stretch cursor into the empty space to the right of the note track 8) Note that the MIDI "notes" now extend beyond the horizontal ruled lines of the note track - see image. 9) Ctrl+A to select all 10) Observe that only the Note track is selected not the "stray "notes" at the right 11) Play the Note track 12) Observe that only the Note track is played, playing stops at the end of the note track, not the "stray "notes" at the right 13) try to select in the "notes" and observe that you cannot 14) the only way to fix this now is to use Undo to revert the stretch
Release Note:
First Git SHA:
Group: ---
Workaround:
Closed: 2018-08-20 00:00:00
petersampsonaudacity: Test‑OK‑Win+
petersampsonaudacity: Test‑OK‑Mac+
stevethefiddle: Test‑OK‑Lin+


Attachments
Overstretched Note track (12.17 KB, image/png)
2017-07-16 08:01 UTC, Peter Sampson
Details
ra9a6f01 moonphase fault (12.88 KB, image/png)
2017-07-18 06:48 UTC, Peter Sampson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Sampson 2017-07-16 08:01:06 UTC
Created attachment 729 [details]
Overstretched Note track

As per the steps to reproduce MIDI Note tracks can be stretched beyond the Note track boundary - making notes inaccessible, uneditable and unplayable.  

You can however select there in the overstretched "notes" region - you just can't do anything with that selection.

The only escape is to use Undo to revert the stretch

See also Bug #1646
Comment 1 Peter Sampson 2017-07-16 08:08:00 UTC
In contrast if yoe enable scrolling left of zero, you do not apppear to be able stretch the "notes" into blank negative time space at the left of the note track - not even if you have time shifted part of the Note track into negative time.
Comment 2 Steve Daulton 2017-07-16 18:16:44 UTC
On Linux, when commencing the drag in step 7, the Note track collapse to about 1/3rd of its original duration.

The crucial step in "steps to reproduce" appears to be making a selection that exceeds the length of the Note track.
Comment 3 Paul L 2017-07-17 10:08:43 UTC
Fixed at https://github.com/audacity/audacity/commit/e86fd3c9907a7945b6dde78ca16c69a36cb99c26

I found more than one problem here in fact:  please try out not just the center stretch cursor but also the start an end cursors, for a time selection going past the end of track.
Comment 4 Steve Daulton 2017-07-17 11:09:55 UTC
It still doesn't look right here.

1) Import MIDI file into new project
2) Zoom to fit (bug 1687)
3) Click near the vertical middle about 3/4 of the way along the track and drag slightly to the right.
The notes collapse into the left hand 1/3 of the track.

Also, if an audio track exists that is longer than the Note track and "all" is selected, clicking on the Note track shrinks the selection to the length of the Note track.
Comment 5 Paul L 2017-07-17 11:26:55 UTC
(In reply to Steve Daulton from comment #4)

I do not observe #3.  Your steps to reproduce don't tell me what length of time is selected before stretching.  Did this happen with the left, right, or center stretch cursor?

What priority level ought this bug retain now?
Comment 6 Steve Daulton 2017-07-17 11:32:05 UTC
(In reply to Paul L from comment #5)
Sorry, missed a step:

1a) Select All
Comment 7 Steve Daulton 2017-07-17 11:39:28 UTC
(In reply to Paul L from comment #5)
> What priority level ought this bug retain now?

On Linux the MIDI functionality appears totally broken, so it's like holding up a fragment of eggshell and asking "how broken is this piece?"

How important would you say that note stretching is?
Note stretching is unstable and unusable here.
Comment 8 Paul L 2017-07-17 12:03:07 UTC
(In reply to Steve Daulton from comment #6)

I have built at 17c964e39262346e3eda65f061e910b407968fe6
which is after the fix at e86fd3c9907a7945b6dde78ca16c69a36cb99c26

I do as you say, and I do not see the collapse of the notes.
Comment 9 Steve Daulton 2017-07-17 12:47:10 UTC
(In reply to Paul L from comment #8)
It does not happen every time, just most times.
Here's a video of commit 64ce79fef to demonstrate:
https://www.youtube.com/watch?v=ZfNOoVbHa-M&feature=youtu.be
Comment 10 Peter Sampson 2017-07-18 06:48:22 UTC
Created attachment 730 [details]
ra9a6f01 moonphase fault
Comment 11 Peter Sampson 2017-07-18 06:48:50 UTC
Testing on W10-CE audacity-win-ra9a6f01-2.2.0-alpha-18-jul-17

The fix for the full-box cursor now has gone moonphase - sometimes workks and sometimes doesn't.

At step 7 in the Steps to reproduce (clicking at the cross-hais cursor) the selection shrinks to just the length of the MIDI Note track removing the empty space selection.  Dragging the cross-hairs cursor to the right up to the selection boundary sometimes will comprees the "notes" up to the selection boundaty correctly.

But sometimes it will collapse the Note track back from the right selection edge and leave some "notes" standed and unusable out in now empty space that occupies where the Note track used to extend to - see Image ra9a6f01.
Comment 12 Peter Sampson 2017-07-18 06:53:52 UTC
Testing on W10-CE audacity-win-ra9a6f01-2.2.0-alpha-18-jul-17

1) The right half-box stretches to the right correctly, extending te selection - and compresses to the left within the selection correctly.

2) The left half-box cursor compresses to the right within the selection correctly.  When moving it to the left it extends the selection, but can extend the selction and the Note track into negative time before zero.
Comment 13 Paul L 2017-07-20 10:23:56 UTC
More fixes at https://github.com/audacity/audacity/commit/bb4a1b862a88a7e76a680dfd507b1d32cd7ee6a1

I think the condition for seeing the "moonphase" may depend on the MIDI file and your screen resolution.  If the file is longer and zoomed to fit I think the bug is more likely.  The bug may also depend on how fast you drag the mouse.

I had an example where I could make the problem reliably on Mac and I fixed it.  It was over 6 minutes with many notes and channels (third movemment of Beethoven's 7th).
Comment 14 Peter Sampson 2017-07-22 12:20:41 UTC
Testing on W10 audacity-win-ra45f3bb-2.2.0-alpha-22-jul-17
and on macOS Sierra 10.12.5 Cliff's 21Jul17 build

Now looking good on both platforms.

When you have a selection that extends beyond the Note track into empt space, invoking the full square cross-hairs cursor trims the selection to the extent of the Note track (after or before) so now you don't get the inaccessible notes strung out in empty space.

The left and right cross-hairs cursors work fine too.
Comment 15 James Crook 2017-07-31 11:14:39 UTC
RESOLVED QUICKFIXED
I tried various selections and combinations of left/right/center stretching.  The stretched notes stayed within their expected bounds.