"Blues":[0,-2,-1,0,-1,-2,-1], #blues is a special case. It has less notes than we offer. Set a full scale and another script will mute/hide those extra steps.
"Blues":[0,+1,+1,+1,0,+1],
#"Blues": [0,-2,-1,0,-1,-2,-1], #blues is a special case. It has less notes than we offer.
"Blues":[0,+1,+1,+1,0,+2,+1],#broden. Needs double octave in the middle. better than completely wrong.
"Hollywood":[0,0,0,0,0,-1,-1],#The "Hollywood"-Scale. Stargate, Lord of the Rings etc.
#self.scale = scale if scale else (72+ 12, 71+12, 69+12, 67+12, 65+12, 64+12, 62+12, 60+12, 71, 69, 67, 65, 64, 62, 60) #Scale needs to be set first because on init/load data already depends on it, at least the default scale. The scale is part of the track meta callback.
self.scale=scaleifscaleelse(72,71,69,67,65,64,62,60)#Scale needs to be set first because on init/load data already depends on it, at least the default scale. The scale is part of the track meta callback.
self.data=dataifdataelselist()#For content see docstring. this cannot be the default parameter because we would set the same list for all instances.
self.simpleNoteNames=simpleNoteNamesifsimpleNoteNameselseself.parentTrack.parentData.lastUsedNotenames[:]#This is mostly for the GUI or other kinds of representation instead midi notes
assertself.simpleNoteNames
#Extended Pitch
#Explanation: Why don't we just do 12 steps per ocatve and then leave steps blank to create a scale?
#We still want the "User set steps, not pitch" idiom.
#self.mutedSteps = set()
#self.stepsPerOctave = 7 # This is not supposed to go below 7! e.g. Pentatonic scales are done by leaving steps out with self.blankSteps.
#self.nrOfSteps = 8 # Needs to be >= stepsPerOctave. stepsPerOctave+1 will, by default, result in a full scale plus its octave. That can of course later be changed.
#self.blankSteps = [] # Finally, some of the steps, relative to the octave, will be left blank and mute. This should create a visible gap in the GUI. Use this for pentatonic.
self._processAfterInit()
def_prepareBeforeInit(self):
@ -120,11 +109,11 @@ class Pattern(object):
self._simpleNoteNames=tuple(value)#we keep it immutable, this is safer to avoid accidental linked structures when creating a clone.
self.parentTrack.parentData.lastUsedNotenames=self._simpleNoteNames#new default for new tracks
@property
defnumberOfSteps(self):
returnlen(self.scale)
deffill(self):
"""Create a 2 dimensional array"""
l=len(self.scale)
@ -258,7 +247,10 @@ class Pattern(object):
"""Called by the api directly and once on init/load"""
self.exportCache=[]#only used by parentTrack.export()
forpatternin(pforpinself.dataifp["index"]<self.parentTrack.parentData.howManyUnits*self.parentTrack.patternLengthMultiplicator):# < and not <= because index counts from 0 but howManyUnits counts from 1
patternOnlyCurrentHowManyUnits=(pforpinself.dataifp["index"]<self.parentTrack.parentData.howManyUnits*self.parentTrack.patternLengthMultiplicator)# < and not <= because index counts from 0 but howManyUnits counts from 1
result=[widget.spinBox.value()forwidgetinself.pitchWidgetsifwidget.isVisible()]#hidden pitchwidgets are old ones that are not present in the current pattenrns scale.
#Not working. the translation generate works statically. translatedScales = [QtCore.QT_TRANSLATE_NOOP("Scale", scale) for scale in api.schemes]
#No choice but to prepare the translations manually here. At least we do not need to watch for the order.
@ -752,6 +775,8 @@ class TransposeControls(QtWidgets.QWidget):
self.parentScene=parentScene
super().__init__()
self.exportDict=None
layout=QtWidgets.QHBoxLayout()
layout.setSpacing(0)
layout.setContentsMargins(0,0,0,0)
@ -794,6 +819,26 @@ class TransposeControls(QtWidgets.QWidget):
self._comboBoxNoteNames.setToolTip(QtCore.QCoreApplication.translate("TransposeControls","Use this scheme as note names."))
layout.addWidget(self._comboBoxNoteNames)
self._numberOfStepsChooser=QtWidgets.QSpinBox()
self._numberOfStepsChooser.setToolTip(QtCore.QCoreApplication.translate("TransposeControls","Choose how many different notes does this pattern should have."))