import FoxDot as fd fd.Root.default.set("Ab") fd.Clock.bpm = 90 sabi_notes = \ [0, 2, 1, 0, 1, 2, 3, 4, 0, -1, 0, 4, 7, 0, 4, 3, 2, 0, 2, 3, 4, -3, 0, 1, 0, 1, 2, 3, 4, 7, 6, 4, 0, 4, 7, 1, 2, 3, 0, 0] sabi_dur = \ [1, 1, 1, 0.5, 0.5, 0.5, 0.5, 0.5, 1.5, 0.5, 0.5, 1.5, 0.5, fd.rest(0.5), 0.5, 0.5, 0.5, fd.rest(0.5), 0.5, 0.5, 2.5, 1, 1, 1, 0.5, 0.5, 0.5, 0.5, 0.5, 1.25, 0.75, 0.5, fd.rest(1), 1, 1, 0.5, 0.5, 0.75, 0.75, 2.5] bass_notes = \ [0, 4, 5, 3, 0, 4, 3, 10, 0, 4, 5, 3, 0, 4, 3, 2, 1] bass_dur = \ [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2] guitar_notes = \ [fd.P(0, 2, 4, 8), fd.P(4, 6, 8), fd.P(5, 7, 9), fd.P(3, 5, 7), fd.P(0, 2, 4, 8), fd.P(4, 6, 8), fd.P(3, 5, 7), fd.P(3, 5, 7), fd.P(0, 2, 4, 8), fd.P(4, 6, 8), fd.P(5, 7, 9), fd.P(3, 5, 7), fd.P(0, 2, 4, 8), fd.P(4, 6, 8), fd.P(3, 5, 7), fd.P(0, 2, 4), fd.P(4, 6, 8)] guitar_dur = \ [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2]
def __init__(self): FoxDot.Clock.bpm = 92 self.key = ([0, "minor"], [-5, "minor"], [5, "minor"], [-2, "major"], [3, "major"], [-4, "major"], [1, "minor"]) FoxDot.Root.default.set(self.key[0][0]) FoxDot.Scale.default.set(self.key[0][1]) self.previous_time = time.clock() self.duration_to_bass_rhythm_dictionary = { 3: [ 0.25, 0.25, FoxDot.rest(0.5), 0.25, FoxDot.rest(0.25), 0.5, 0.25, 0.75 ], 4: [ 0.25, 0.25, FoxDot.rest(0.5), 0.25, FoxDot.rest(0.25), 0.25, 0.25, 0.5, 0.25 ], 6: [ 0.25, 0.25, FoxDot.rest(0.5), 0.25, FoxDot.rest(0.25), 0.25, 0.5, 0.75 ], 8: [1, 1, 0.25, 0.25, FoxDot.rest(0.25), 0.25, 0.25, 0.25] } self.letter_to_rhythm_dictionary = { "B": "$", "C": "E", "D": "%", "F": "G", "G": "A", "J": "L", "K": "#", "P": "P", "Q": "r", "S": "=", "T": "n", "V": "V", "X": "H", "Z": "W", "H": ".", "b": "D", "c": "k", "d": "i", "f": "l", "g": "M", "j": "j", "k": ":", "p": "p", "q": "T", "s": "~", "t": "-", "v": "R", "x": "h", "z": "g", "h": ".", ".": "X", "\"": "[xx]", "'": "v", ",": "v", ";": "[vx]", ":": "[xX]", "č": "S", "Þ": "@", "ṣ": "/", "ɸ": "\\\\", "ç": "I", "ð": "e", "ʃ": "o", " ": "" } # miscellaneous self.pos_to_chord_dictionary = { "``": 0, "''": 0, "$": 0, "(": 0, ")": 0, ",": 0, "--": 0, ".": 0, ":": 0, "CD": 1, "SYM": 2, "LS": 2, "#": 2, # nouns "NN": 3, "NNP": 4, "NNPS": 5, "NNS": 6, # genitive marker and pronouns "POS": 7, "PRP": 8, "PRP$": 9, "WP": 10, "WP$": 11, # adjectives, determiners "JJ": 12, "JJR": 13, "JJS": 14, "WDT": 15, "DT": 16, "PDT": 17, # adverbs "RB": 18, "RBR": 19, "RBS": 20, "WRB": 21, # verbs "VB": 22, "VBD": 23, "VBG": 24, "VBN": 25, "VBP": 26, "VBZ": 27, # fillers "TO": 28, "RP": 29, "EX": 30, # conjunction, modal auxiliary, prep "CC": 31, "IN": 32, "MD": 33, # foreign words and interjections "FW": 34, "UH": 35 } self.pos_to_chord_bass_dictionary = { "``": 0, "''": 0, "$": 0, "(": 0, ")": 0, ",": 0, "--": 0, ".": 0, ":": 0, "CD": 0, "SYM": 0, "LS": 0, "#": 0, # nouns "NN": -4, "NNP": 4, "NNPS": 5, "NNS": 5, # genitive marker and pronouns "POS": -4, "PRP": 4, "PRP$": -4, "WP": 4, "WP$": -4, # adjectives, determiners "JJ": 0, "JJR": 1, "JJS": -1, "WDT": 2, "DT": 3, "PDT": 3, # adverbs "RB": -2, "RBR": -2, "RBS": 0, "WRB": 5, # verbs "VB": -3, "VBD": 3, "VBG": -3, "VBN": -3, "VBP": -3, "VBZ": 3, # fillers "TO": 4, "RP": -2, "EX": -2, # conjunction, modal auxiliary, prep "CC": -2, "IN": -2, "MD": -4, # foreign words and interjections "FW": 0.5, "UH": -0.5 } self.chord_bass_to_bass_line_dictionary = { 0: [0, 0, 1, -1, 0, -4], 1: [1, 1, 1, 1, 0, 1, 4], 2: [2, 2, 2, 2, 1, 9, 8], 3: [3, 3, 4, 2, 3, 0, 1], 4: [4, 4, 2, 2, 4, 0, 1], 5: [5, 5, 3, 4, 5, 1], -1: [-1, -1, -3, -2, -1, 1], -2: [-2, -1, -4, 0, -1, 1], -3: [-3, -3, -3, -1], -4: [-4, -4, -4, 1, 2], 0.5: [0.5, 1.5, 2.5, 1.5, -0.5], -0.5: [-0.5, 1.5, 2.5, 1.5, 0.5] } self.chord_to_voicing_dictionary = { # symbols 0: (1, 2, 5), 1: (1, 2, 5, 6), 2: (-3, 0, 2, 4, 6), # nouns 3: (4, 5, 6, 8), 4: (4, 5, 6, 9), 5: (0, 4, 5, 9), 6: (0, 2, 4, 5), # genitive marker and pronouns 7: (-1, 0, 1, 5), 8: (-1, 0, 1, 5, 6), 9: (-1, 1, 5, 6, 8), 10: (-1, 0, 2, 4), 11: (-1, 0, 2, 4, 5), # adjectives, determiners 12: (0, 2, 4, 6, 8, 10), 13: (1, 3, 5, 7, 9, 11), 14: (-1, 1, 3, 5, 7, 9), 15: (2, 4, 6, 8, 10, 12), 16: (3, 5, 7, 9, 11, 13), 17: (3, 5, 7, 8, 9), # adverbs 18: (-5, -3, 0, 1, 2, 3, 4), 19: (-5, -3, 0, 1), 20: (-5, -3, 0, 2, 5), 21: (-5, -3, 0, 2, 5, 6, 11), # verbs 22: (-7, 0, 1, 2, 6), 23: (-7, 0, 1, 2, 6, 8), 24: (-7, 0, 1, 2, 6, 9), 25: (-7, -1, 1, 2, 6, 7), 26: (-7, -3, 1, 4, 6, 7), 27: (-7, -3, 0, 2, 4, 6, 10), # fillers 28: (3, 4, 5), 29: (3, 4, 5, 9), 30: (3, 4, 5, 10), # conjunctions, modal auxiliary, and prepositions 31: (5, 6, 7), 32: (5, 6, 7.5, 9), 33: (5, 6, 7, 10), # foreign words and interjections 34: (0.5, 2.5, 3.5, 5.5, 9.5), 35: (-0.5, 2.5, -3.5, 5.5, 12.5) }
import FoxDot as fd fd.Clock.bpm = 130 fd.Root.default.set("C") fd.SynthDefs fd.r1 >> fd.dirt([0, 3, 1.5, 3, 4, 1.5, 0, 0, 0, 1.5, 0, -1.5, 1.5, 0, 0], dur=[ fd.rest(1), 0.5, 0.5, 1, 0.5, 0.5, fd.rest(0.5), 3.5, fd.rest(2), 0.5, 0.5, 0.5, 0.5, fd.rest(0.5), 3.5 ], oct=7, amp=0.7) fd.r2 >> fd.fuzz([0, 3, 1.5, 3, 4, 1.5, 0, 0, 0, 1.5, 0, -1.5, 1.5, 0, 0], dur=[ fd.rest(1), 0.5, 0.5, 1, 0.5, 0.5, fd.rest(0.5), 3.5, fd.rest(2), 0.5, 0.5, 0.5, 0.5, fd.rest(0.5), 3.5 ], oct=5, amp=1.0) fd.b1 >> fd.sawbass([ -4, 0, 0, 1.5, 0, 4, 3, -1.5, -1, 0, 0, -1.5, 0, 1.5, -1.5, 0, -1.5, -3, -3.5 ], dur=[
import FoxDot as fd import numpy as np fd.Clock.bpm = 90 fd.Root.default.set("C") fd.SynthDefs fd.l1 >> fd.saw([0, -2, 5, 4, 3, 4, 2, 1, 3, 2, 1], dur=[fd.rest(2), 1, 1, 2, 1, 1, 2, 2, 2, 1, 1]) fd.l2 >> fd.fuzz([0, -2, 5, 4, 3, 4, 2, 1, 3, 2, 1], dur=[fd.rest(2), 1, 1, 2, 1, 1, 2, 2, 2, 1, 1], amp=0.2, oct=6) fd.b1 >> fd.bass( [-4, 0, 1, 0, 0, -4, 0, -4, -5, -3, -2.5, -2, -5, -2, -5.5] + [-6, -4, -3.5, -3, -3, -3, 0, -3, -7, -7, -7, -3.5, -3.5, 0, -3.5], dur=[ 1, 0.5, 0.5, 1, 0.33, 0.17, fd.rest(0.33), 0.17, 1, 0.5, 0.5, 1, 0.33, 0.17, 0.5 ], amp=0.6, oct=6) fd.p1 >> fd.orient([(-7 - 4, 0, 2, 5), (-7 - 5, -1, 1, 4), (-7 - 3, -3, 0.5, 3)] + [(-7 - 6, -4, -2, 0, 2), (-7 - 4, -4, -2, 0, 1), (-7 - 7, -3, -1.5, 1, 3), (-7 - 4.5, -4.5, -1.5, 0, 2)], dur=[4, 2, 2, 2, 2, 2, 2],
import FoxDot as fd import numpy as np fd.Clock.bpm = 90 fd.Root.default.set("C") fd.SynthDefs bp = [-3, -3, -3, -3, 0, 0, 3, 3, 0, 0] fd.l1 >> fd.pulse([ 0, -2, -2, 3, 2, 1, 0, 1, 2, -3, 0, -3, -3, -2, -2, 0, 0, 0, 0, -3, -3, -2, -2, 0, 0, 0 ], dur=[ fd.rest(1), 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1.5, 0.5, 2, fd.rest(0.25), 0.25, 0.5, 0.5, 0.5, 0.5, 0.5, fd.rest(1.0), fd.rest(0.25), 0.25, 0.5, 0.5, 0.5, 0.5, 0.5, fd.rest(1.0) ], oct=5) fd.b1 >> fd.jbass( [p - i for i in range(4) for p in bp], dur=[0.25, 0.25, 0.25, 0.25, 0.5, 0.5, 0.5, 0.5, fd.rest(0.5), 0.5] * 4, amp=0.6, oct=6) fd.p1 >> fd.bell([0, (0, 3, 5), 0] * 4 + [0, (-1, 2, 4), 0] * 4 +