Pattern::changeTimeSignature(), off by one #2959

Merged
merged 1 commit into from Aug 7, 2016

Projects

None yet

2 participants

@zonkmachine
Member
zonkmachine commented Aug 3, 2016 edited

Fixes #2926

OK. This is bit deeper in the code than I usually go...

I didn't manage to wrap my head around MidiTime positions, but it looks like it's supposed to go from 0, as that's the way it's done in other places ( Pattern::ensureBeatNotes() , so the last position must be one lower.

With this fix the last note will instead be first in a new second beat.

Edit: Fixed links...

@zonkmachine
Member
zonkmachine commented Aug 3, 2016 edited

Yeah, it goes from 0. Here is what a note at the first and last positions at max resolution looks like in the .mmp

<pattern steps="16" muted="0" type="0" name="Kicker" pos="0" len="384">
  <note pan="0" key="57" vol="100" pos="0" len="-192"/>
  <note pan="0" key="57" vol="100" pos="191" len="-192"/>
</pattern>
@zonkmachine
Member

Merge?

@Umcaruje
Member
Umcaruje commented Aug 7, 2016

Yes from me 👍

@zonkmachine zonkmachine merged commit 54a9aa6 into LMMS:master Aug 7, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zonkmachine zonkmachine deleted the zonkmachine:miditimeoffbyone branch Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment