Browse Source

fix playback note durations in mixed chords

master
Nils 5 years ago
parent
commit
a51b38240d
  1. 12
      engine/items.py

12
engine/items.py

@ -492,7 +492,7 @@ class Duration(object):
return value
def noteOnAndOff(self, trackState, completeDuration):
"""For GUI and Midi
"""Midi only.
return a tick value, the offset from an imaginary
starting point on the tick/time axis, which needs to be
added later. Think t=0 during this function.
@ -593,8 +593,11 @@ class DurationGroup(object):
Is compatible to Duration() methods and parameters.
For the representation and calculation always the minimum
note duration counts for the whole chord."""
Midi will send the actual note durations, per-note.
For the representation (GUI) and logical calculations always the minimum
note duration counts for the whole chord.
"""
def __init__(self, chord):
self.chord = chord
self.group = True
@ -1347,7 +1350,6 @@ class Chord(Item):
#newTicks = complDur / newparts
note.duration = Duration.createByGuessing(Fraction(complDur, newparts))
#Now we have one note with the duration the user wants to have. Make n-1 copies-
spawnedNotes = []
@ -1652,7 +1654,7 @@ class Chord(Item):
for note in self.notelist:
velocity = note.dynamic.velocity(trackState)
midipitch = pitchmath.toMidi[note.pitch]
onOffset, offOffset = note.duration.noteOnAndOff(trackState, dur)
onOffset, offOffset = note.duration.noteOnAndOff(trackState, note.duration.completeDuration())
if note.pitch in trackState.EXPORTtiedNoteExportObjectsWaitingForClosing: #this is the last or the middle in a tied note sequence (but not the first).
exportNoteList.append(note.exportObject(trackState))

Loading…
Cancel
Save