exec(open("./default_settings.py").read()) # Script below. comp = Composition(2, 100) strings = comp.buildVoice(50, 'Strings') cello = comp.buildVoice(43, 'Cello') melodyVol = 100 backgroundVol = 60 cello.adjustPitchOffset(-12) baseKey = 58 comp.setKey(baseKey) comp.setScale(Voice.MAJOR) # Functions def motive01(voice): voice.scaledNote(0, 4) voice.scaledChord([0, 2, 4], 4) voice.scaledChord([0, 2, 5], 4) voice.scaledChord([-1, 1, 3], 4) voice.scaledChord([0, 2, 4], 4) def motive02(voice, offset):
# Script below. comp = Composition(2, 80) orgInd = 20 #orgInd = 1 # Piano makes it easier to hear while testing. organHigh = comp.buildVoice(orgInd, 'Organ High') organMid = comp.buildVoice(orgInd, 'Organ Mid') organLow = comp.buildVoice(orgInd, 'Organ Low') organMid.adjustPitchOffset(-12) organLow.adjustPitchOffset(-24) defKey = 68 comp.setKey(defKey) # Functions def main(voice, durMult = 1): # 12 * durMult beats. voice.scaledNote(0, 1 * durMult) voice.scaledNote(1, 1 * durMult) voice.scaledNote(2, 1 * durMult) voice.scaledNote(0, 1 * durMult) for _ in range(0,2): voice.scaledNote(3, 1 * durMult) voice.scaledNote(2, .5 * durMult) voice.scaledNote(1, .5 * durMult) voice.scaledNote(2, 1 * durMult) voice.scaledNote(0, 1 * durMult)
# Source common settings. exec(open("./default_settings.py").read()) # Script below. comp = Composition(2, 110) guitar = comp.buildVoice(25, 'Guitar') violin = comp.buildVoice(41, 'Violin') flute = comp.buildVoice(74, 'Flute') perc = comp.buildVoice(116, 'Woodblock') violin.adjustPitchOffset(-12) violin.setVolume(127) comp.setKey(58) # Functions def stacEighth(voice, note): '''Staccato eighth note.''' voice.scaledNote(note, .25) voice.rest(.25) def guitarBackground(voice): voice.scaledChord([-1, -5], .5) voice.scaledChord([2, -1], .5) voice.rest(.5) voice.scaledChord([2, -2], .5)
tuba = comp.buildVoice( 61, 'Tuba' ) # 61 is actually french horn, because it's the only brass that doesn't sound terrible. tuba.adjustPitchOffset(-24) # Tweak volume, because some voices are really low for some reason. violin.setVolume(80) guitar.setVolume(80) horn.setVolume(127) tuba.setVolume(127) cello.setVolume(90) lowStringSec.setVolume(90) timpani.setVolume(127) key = 61 comp.setKey(key) # Functions def main(voice): voice.scaledNote(5, 1) # Pickup. voice.scaledNote(8, 2) voice.scaledNote(7, 1) voice.scaledNote(6, 1) voice.scaledNote(7, 2) voice.scaledNote(6, 1) voice.scaledNote(5, 1) voice.scaledNote(6, 2)
brass.setVolume(80) lowBrass = comp.buildVoice(62, 'Low Brass') lowBrass.adjustPitchOffset(-24) lowBrass.setVolume(100) bariSax = comp.buildVoice(68, 'Baritone Sax') bariSax.adjustPitchOffset(-24) bariSax.setVolume(127) tenorSax = comp.buildVoice(67, 'Tenor Sax') tenorSax.adjustPitchOffset(-12) tenorSax.setVolume(127) baseKey = 67 comp.setKey(baseKey) modScale = [0, 3, 5, 6, 7, 9, 10] # 0 1 2 3 4 5 6 comp.setScale(Voice.HEXATONIC_BLUES) # Functions def mainTheme(voice): for _ in range(0, 2): voice.scaledNote(0, 1.5) voice.scaledNote(6, .5) voice.rest(1) voice.scaledNote(5, 1.5)
exec(open("./default_settings.py").read()) # Script below. comp = Composition(2, 110) guitar = comp.buildVoice(25, 'Guitar') flute = comp.buildVoice(74, 'Flute') guitar.adjustPitchOffset(-12) flute.adjustPitchOffset(12) guitar.setVolume(80) comp.setKey(64) strumSp = .03 # Functions def guitarChord(voice, chordArr, dur): ''' The top note of the guitar chords really need to be heard more. I generally very strongly dislike making functions specifically for one voice, but this time it really gets out of a problem. (I actually thought of a better way to do this later, but, too late now.) '''
# Piano exists because my original idea of implementing an instrumental version # involved replacing voice with piano. That didn't work out, but I left it here # since I did do some work on it. rPiano = comp.buildVoice(1, 'Piano Right Hand') rPiano.adjustPitchOffset(-12) rPiano.setVolume(110) rPiano.mute(True) lPiano = comp.buildVoice(1, 'Piano Left Hand') lPiano.adjustPitchOffset(-24) #lPiano.setVolume(110) lPiano.mute(True) baseKey = 67 #baseKey = 70 comp.setKey(baseKey) #modScale = [0,1,3,5,7,8,10] # 0 1 2 3 4 5 6 bridgeScale = [0, 2, 3, 5, 7, 10, 11] # 0 1 2 3 4 5 6 comp.setScale(Voice.DORIAN) # Functions def counterTheme(voice): def dummyFunc(): voice.scaledNote(0, .5)
#tuba = comp.buildVoice(34, 'Electric Bass') #timpani = comp.buildVoice(117, 'Bass drum') # This is actually a "Taiko drum", whatever that is. #cello = comp.buildVoice(30, 'Overdriven Guitar') violin.setVolume(80) strings.setVolume(80) cello.setVolume(90) tuba.setVolume(120) timpani.setVolume(120) timpani.adjustPitchOffset(-30) cello.adjustPitchOffset(-12) tuba.adjustPitchOffset(-24) violin.adjustPitchOffset(12) comp.setKey(60) mode = [0,2,3,5,7,9,10] comp.setScale(mode) # This is some kind of mode or something. # Functions def intro(voice): voice.scaledNote(-3, 2) voice.scaledNote(2,2) voice.scaledNote(1, 2) voice.scaledNote(0, 1) voice.scaledNote(-1, 1) voice.scaledNote(0, 2) voice.scaledNote(-2, 2) voice.scaledNote(-3, 3) voice.rest(1)