|
|
@ -515,7 +515,8 @@ def setSwitchHalftoneTranspose(trackId, position, transpose): |
|
|
|
return True |
|
|
|
|
|
|
|
def insertSilence(howMany:int, beforeMeasureNumber:int): |
|
|
|
"""Insert empty measures into all tracks""" |
|
|
|
"""Insert empty measures into all tracks. |
|
|
|
Parameters are un-multiplied.""" |
|
|
|
|
|
|
|
#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. |
|
|
@ -531,6 +532,9 @@ def insertSilence(howMany:int, beforeMeasureNumber:int): |
|
|
|
updatePlayback() |
|
|
|
|
|
|
|
def duplicateSwitchGroup(startMeasureForGroup:int, endMeasureExclusive:int): |
|
|
|
"""startMeasureForGroup and endMeasureExclusive are in the global, un-multiplied measure counting |
|
|
|
format.""" |
|
|
|
|
|
|
|
groupSize = endMeasureExclusive-startMeasureForGroup |
|
|
|
insertSilence(groupSize, endMeasureExclusive) #insert silence handles multiplicator-tracks on its own |
|
|
|
|
|
|
@ -551,8 +555,12 @@ def duplicateSwitchGroup(startMeasureForGroup:int, endMeasureExclusive:int): |
|
|
|
updatePlayback() |
|
|
|
|
|
|
|
def clearSwitchGroupTranspositions(startMeasureForGroup:int, endMeasureExclusive:int): |
|
|
|
"""startMeasureForGroup and endMeasureExclusive are in the global, un-multiplied measure counting |
|
|
|
format.""" |
|
|
|
for track in session.data.tracks: |
|
|
|
for switch in range(startMeasureForGroup, endMeasureExclusive): |
|
|
|
thisTrackStartMeasure = startMeasureForGroup // track.patternLengthMultiplicator #integer division |
|
|
|
thisTrackEndMeasure = endMeasureExclusive // track.patternLengthMultiplicator |
|
|
|
for switch in range(thisTrackStartMeasure, thisTrackEndMeasure): |
|
|
|
if switch in track.whichPatternsAreScaleTransposed: |
|
|
|
del track.whichPatternsAreScaleTransposed[switch] |
|
|
|
if switch in track.whichPatternsAreHalftoneTransposed: |
|
|
|