Add status bar to explain possible user actions (like "use shift + mousewheel to transpose measure")
Streamline mousewheel behaviour in song editor. It now always scrolls without shift / alt key, no more accidental transpositions.
Add non-destructive step delay for individual measures. Shift an individual measures forwards or backwards in time, within the boundaries of the measure.
Add track-switch to choose step-delay wrap-around behaviour, if delayed notes end up outside the pattern
Add non-destructiv pattern augmentation/scaling. Make an individual measure shorter or longer overall, with the same GUI as transpositions.
Add track-switch to choose repeat-to-fill behaviour if scaling a pattern shorter, which creates empty space.
"""Halftone transposition is not flipped. Higher value means higher pitch
Defaultvalueis0.
"""
track=session.data.trackById(trackId)
ifnottrack:return
session.history.register(lambdatr=trackId,v=track.whichPatternsAreHalftoneTransposed.copy():_setSwitchHalftoneTranspose(trackId,v),descriptionString="Set Half Tone Shift")
session.history.register(lambdatrId=trackId,v=track.whichPatternsAreHalftoneTransposed.copy():_setSwitchHalftoneTranspose(trId,v),descriptionString="Set Half Tone Shift")
#If uncertain if the cache works print cacheHash to see what is really different. This function is called more than once per pattern sometimes, which is correct.
oneMeasureInTicks=howManyUnits*whatTypeOfUnit
oneMeasureInTicks/=subdivisions#subdivisions is 1 by default. bigger values mean shorter durations, which is compensated by the user setting bigger howManyUnits manually.
@ -61,11 +66,15 @@ class Track(object): #injection at the bottom of this file!
#2.1
self.group=""# "" is a standalone track, the normal one which existed since version 1.0. Using a name here will group these tracks together. A GUI can use this information. Also all tracks in a group share a single jack out port.
self.visible=True#only used together with groups. the api and our Datas setGroup function take care that standalone tracks are never hidden.
self.stepDelayWrapAround=False#every note that falls down on the "right side" of the pattern will wrap around to the beginning.
self.repeatDiminishedPatternInItself=False# if augmentationFactor < 1: repeat the pattern multiple times, as many as fit into the measure.
self.structure=structureifstructureelseset()#see buildTrack(). This is the main track data structure besides the pattern. Just integers (starts at 0) as switches which are positions where to play the patterns. In between are automatic rests.
self.whichPatternsAreScaleTransposed=whichPatternsAreScaleTransposedifwhichPatternsAreScaleTransposedelse{}#position:integers between -7 and 7. Reversed pitch, row based: -7 is higher than 7!!
self.whichPatternsAreHalftoneTransposed=whichPatternsAreHalftoneTransposedifwhichPatternsAreHalftoneTransposedelse{}#position:integers between -7 and 7. Reversed pitch, row based: -7 is higher than 7!!
#First clean all modifications from the default value.
#We test for k in self.structure to not have modifications for measures that will be switched on later
#TODO: Can this possibly lead to a race condition where we load modifications first and then load the structure, which results in the mods getting perma-deleted here. e.g. we could not set default value in init, even for testing purposes.
self.whichPatternsHaveAugmentationFactor={k:vfork,vinself.whichPatternsHaveAugmentationFactor.items()ifv!=1.0andkinself.structure}#default is 1.0
oneMeasureInTicks=(self.parentData.howManyUnits*self.parentData.whatTypeOfUnit)/self.parentData.subdivisions#subdivisions is 1 by default. bigger values mean shorter values, which is compensated by the user setting bigger howManyUnits manually.
@ -434,7 +434,7 @@ class TrackStructure(QtWidgets.QGraphicsRectItem):
(QtCore.QCoreApplication.translate("SongStructure","Exchange group with right neigbour"),lambda:api.exchangeSwitchGroupWithGroupToTheRight(startMeasureForGroup,endMeasureExclusive)),
(QtCore.QCoreApplication.translate("SongStructure","Duplicate whole group including measures"),lambda:api.duplicateSwitchGroup(startMeasureForGroup,endMeasureExclusive)),
(QtCore.QCoreApplication.translate("SongStructure","Clear all group transpositions"),lambda:api.clearSwitchGroupTranspositions(startMeasureForGroup,endMeasureExclusive)),
(QtCore.QCoreApplication.translate("SongStructure","Clear all group transpositions"),lambda:api.clearSwitchGroupModifications(startMeasureForGroup,endMeasureExclusive)),