You are here

Copy/Paste midi clips on a changed tempo (or zoom/unzoom)


This thing (bug?) happened to me a few times before, and I couldn't repeat it, but now I can describe it precisely.

1. song starts in 120 bpm tempo (4/4)
2. midi track (drums) created and kick recorded for 1 bar
3. that bar is then copied and pasted 9 times (ctrl+shift+V)
4. tempo change 11th bar to 130 bpm
5. copy first 10 bars of midi track, paste into next 10 bars
6. pasted midi is out of sync, as pasted length of separate midi clips is now longer than the length of first 10 midi clips

Similar scenario:
Steps 1 to 4 as before
5. copy first bar only
6. paste it anywhere after the 11th bar
7. notes are in perfect sync (place), but length of clip is slightly longer then bar itself

All this because when tempo is changed, Qtractor adjusts the view and makes the bars with faster tempo a bit shorter in length, which is logical.

But then the pasted midi bars should also auto-adjust their length.

This is really important in two scenarios of making a song.
1a. drums are created and edited per bar for the first half of song
1b. tempo is slightly faster in second half of song
1c. complete drum arrangement is just copied into second part of song
2a (especially in folk music) same drum pattern, but tempo gets faster every bar (usually end of song)

Similar to this is another copy-paste error which I get from time to time:
1. copy a few tracks (audio/midi)
2. zoom or unzoom
3. paste

The shape and notes of the pasted material keep their previous zoom-state shape (thus totally out of sync)

As I said, this doesn't happens always, but 50% of time I would say



Ok, I remove the tempo change from the song, copy/paste the first 10 bars into the second 10 bars, add the tempo change on the 11th bar but the pasted content is still out of sync. The display of the clips is fine, but the playback is out-of-time

Or, I copy/paste the first 10 bars in to the changed tempo part of the song, and manually, one-by-one, adjust the length of each clip and quantize each clip. Now, the midi notes on the clip are shown in the right place, every clip is just one bar long, but during playback, the track plays in the 'old tempo'. A bit strange, as I can see the midi notes on the proper place, but when the head moves over them, it plays them slightly later, as the clip was not being quantized or edited.

rncbc's picture

ACK! Good catch!

Please confirm whether the playback related out-of-sync trouble still applies after you reload (re-open) the session altogether, ie. after you save, close and open it again. Question is, does it indict a temporary bug that only happens in-flght while right after making some changes, specially if those changes are made on the tempo map structure, or is it horrifyingly permanent ?

No sweat. This one has been promoted to the very first top priority on my desk, as is one hell of a good and nasty bug report :P

Keep them coming!

Yes, it does stay like that after re-opening Qtractor. Both in the zoom and changed tempo options. It seems it follows the 'graphic' logic, as opposed to the 'bar' logic.
I am afraid, it is "horrifyingly permanent". I even restarted the computer, just in case, but no joy, the bars are shifted permanently.

"..Keep them coming!..." Off to a holiday for a couple of weeks. Back mid-April.

rncbc's picture

Got it.

This is all just annoying and you might say plain wrong. What's actually happening is that the material that is stored in the clipboard (via copy) takes time reference as from its original position. Big problem is that base references are temporarily stored in sample and/or graphic units, frames or pixels respectively. Now, when you try to paste that material onto a new location, things get wrong if that new location has a different tempo from the original one or the zoom level got changed in the meanwhile. Bummer!

I'll try to cope with this in the next weeks. Until then, you'll get best results if you don't paste across tempo nor (horizontal) zoom changes ;)


Hi Rui,
I've had some time this week to play around with the latest CVS version. I was attempting to edit two files together, using two tracks. Track one 's clip starts at the beginning, while track two's clip begins between bars 64 and 65, and track one's clip slightly overlays where track 2's clip starts.

While zoomed in tightly, the edit point is perfect, well it becomes perfect after playing from bar 60-70, but at first, it's not. Each time I play that range, it gets closer until about the third time, then it's perfect from then on. Now, once I zoom out, the edit is no longer perfect, but off quite a bit. Zoom back in, and it's fine again.

Next, when I go to export the track, qtractor segfaults exactly at the edit point.

If I drag the track 2 clip up to track 1, it will render it out without crashing. However, the resulting file's edit point is waaaay off.

The two files in being used here are .mp3 format, and probably not the same bitrate. Could that have something to do with it?


I just converted both of the mp3 files to .wav format, and I'm still getting the same it's not an mp3 issue.


rncbc's picture

Hi Jim,

Can you be a bit more specific on this? Is it the audio playback that gets out of sync or is it the graphical waveform display that gets a bit skewed through zooming ? The latter is indeed an expected artifact, the former is pretty serious and intolerable.

Re. crash on export, I'm yet failing to reproduce that and oh, did I try. Maybe there's something you missed to mention. Anyway, please, take the chance to grab a crash stack-trace. It's a recent feature, have a try... ;)

nb. Stack traces are now automagically spitted out on a debug build (cf. ./configure --enable-debug) or can be enabled explicitly (--enable-stacktrace); no need for post-mortem core-dump trickery anymore; stack/back-traces should appear on terminal console output or written to the messages log file if enabled (as in View/Options.../Display/Logging).


Hey Rui, sorry to revive an old thread but I'm having a similar issue and it sounds like it might be related to this. I created a song using 90bpm tempo across the song. I then inserted some tempo changes using the tempo map window and now it looks like this: Bar 1 90bpm, bar 18 100bpm, bar 58 90bpm.

Everything looks okay visually but when playing something between bars 18 and 57, it sounds out of sync... :(

Would it help if I send you my Qtractor project?

rncbc's picture

yes, please. send me the simplest session where you can isolate the symptom (in .qtz format)


I made it as simple as possible:

Please notice the following:
* Everything before bar 21 sounds fine. After that, it's out of sync (turn the metronome on).
* If you remove the tempo mapping on bar 21, you can then set the tempo on bar 1 to whatever you want and everything will sound just fine.

Also, look at this screenshot:
This happened when copy-pasting a clip from the 100bpm region into the 90bpm region.

Version info:
Version: 0.5.3
Build: Jan 4 2012 15:14:13
VeSTige header support enabled.
LV2 Plug-in support (liblilv) enabled. (NEW)
LV2 Plug-in UI instantiation support (libsuil) enabled. (NEW)


Add new comment