|
@ -334,7 +334,8 @@ def convert_subdivisions(value, errorHandling): |
|
|
return result |
|
|
return result |
|
|
|
|
|
|
|
|
def set_numberOfMeasures(value): |
|
|
def set_numberOfMeasures(value): |
|
|
if session.data.numberOfMeasures == value: return |
|
|
if session.data.numberOfMeasures == value: |
|
|
|
|
|
return |
|
|
session.data.numberOfMeasures = value |
|
|
session.data.numberOfMeasures = value |
|
|
session.data.buildSongDuration() |
|
|
session.data.buildSongDuration() |
|
|
updatePlayback() |
|
|
updatePlayback() |
|
@ -342,7 +343,8 @@ def set_numberOfMeasures(value): |
|
|
callbacks._scoreChanged() #redundant but cheap and convenient |
|
|
callbacks._scoreChanged() #redundant but cheap and convenient |
|
|
|
|
|
|
|
|
def set_measuresPerGroup(value): |
|
|
def set_measuresPerGroup(value): |
|
|
if session.data.measuresPerGroup == value: return |
|
|
if session.data.measuresPerGroup == value: |
|
|
|
|
|
return |
|
|
session.data.measuresPerGroup = value |
|
|
session.data.measuresPerGroup = value |
|
|
#No playback change |
|
|
#No playback change |
|
|
callbacks._scoreChanged() |
|
|
callbacks._scoreChanged() |
|
@ -514,10 +516,16 @@ def setSwitchHalftoneTranspose(trackId, position, transpose): |
|
|
|
|
|
|
|
|
def insertSilence(howMany, beforeMeasureNumber): |
|
|
def insertSilence(howMany, beforeMeasureNumber): |
|
|
"""Insert empty measures into all tracks""" |
|
|
"""Insert empty measures into all tracks""" |
|
|
|
|
|
|
|
|
|
|
|
#In each track shift every switch to the right if it is before the dividing measure number |
|
|
|
|
|
#Keep the concept of a "group" even if there are multiplicators in the track. |
|
|
|
|
|
#If you insert 4 normal measures then a multiplicator-track of two gets only 2 new ones. |
|
|
for track in session.data.tracks: |
|
|
for track in session.data.tracks: |
|
|
track.structure = set( (switch + howMany if switch >= beforeMeasureNumber else switch) for switch in track.structure ) |
|
|
thisTrackWhere = beforeMeasureNumber // track.patternLengthMultiplicator #integer division |
|
|
track.whichPatternsAreScaleTransposed = { (k+howMany if k >= beforeMeasureNumber else k):v for k,v in track.whichPatternsAreScaleTransposed.items() } |
|
|
thisTrackHowMany = howMany // track.patternLengthMultiplicator #integer division |
|
|
track.whichPatternsAreHalftoneTransposed = { (k+howMany if k >= beforeMeasureNumber else k):v for k,v in track.whichPatternsAreHalftoneTransposed.items() } |
|
|
track.structure = set( (switch + thisTrackHowMany if switch >= thisTrackWhere else switch) for switch in track.structure ) |
|
|
|
|
|
track.whichPatternsAreScaleTransposed = { (k+thisTrackHowMany if k >= thisTrackWhere else k):v for k,v in track.whichPatternsAreScaleTransposed.items() } |
|
|
|
|
|
track.whichPatternsAreHalftoneTransposed = { (k+thisTrackHowMany if k >= thisTrackWhere else k):v for k,v in track.whichPatternsAreHalftoneTransposed.items() } |
|
|
callbacks._trackStructureChanged(track) |
|
|
callbacks._trackStructureChanged(track) |
|
|
session.data.buildAllTracks() |
|
|
session.data.buildAllTracks() |
|
|
updatePlayback() |
|
|
updatePlayback() |
|
|