def __play_music(self, dictionary): if time.clock() - self.previous_time > 15: self.__set_root_and_scale() FoxDot.r0 >> FoxDot.play("X...o...X..Xo...", sample=1, amp=1.2) FoxDot.r1 >> FoxDot.play(dictionary["consonants"], amp=0.8) notes = [] for c in dictionary["pos"]["chords"]: notes.append(c) durations = [] for d in dictionary["pos"]["chord_durations"]: durations.append(d) FoxDot.c1 >> FoxDot.scatter(notes, dur=durations) FoxDot.b1 >> FoxDot.dirt(dictionary["pos"]["bass_line"], dur=dictionary["pos"]["bass_durations"])
import FoxDot as fd fd.Clock.bpm = 110 fd.Root.default.set("Gb") print(fd.SynthDefs) fd.p1 >> fd.SynthDef('bass')([3, -1, 3, 4, 2, 0, 3, 4, 5, 0], dur=[1.25, 0.25, 0.5, 2, 2, 2, 2, 2, 2, 2], amp=0.5) fd.p2 >> fd.saw( [4, 0, 0, 0, 1, 4, 3, 2, 1, 0, 0, 2, 1, 0, 0, 4, 3, 2, 3, 2, 1] + [4, 0, 0, 0, 1, 4, 3, 2, 1, 0, 0, 2, 1, 0, -1, 0], dur=[ 1.5, 1, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 1.5, 1, 0.5, 1, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 1, 1 ] + [1.5, 1, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 1.5, 1, 0.5, 1, 0.5, 0.5, 4.5], amp=0.5) fd.p3 >> fd.viola( [2, 1, 2, 1, 0, 1, 3, 2, 0], dur=[4, 2, 1, 1, 2, 2, 1, 1, 2], amp=0.5) fd.d1 >> fd.play("x o [xo]xo( =)") fd.p1.stop() fd.p2.stop() fd.p3.stop() fd.d1.stop()
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] print(fd.SynthDefs) fd.p1 >> fd.SynthDef('saw')( sabi_notes, dur=sabi_dur, amp=0.75, fmod=0.5, vib=6, vibdepth=0.01).spread() fd.p2 >> fd.SynthDef('bass')(bass_notes, dur=bass_dur, amp=0.4, pshift=-12) fd.p3 >> fd.SynthDef('nylon')( guitar_notes, dur=guitar_dur, amp=0.2, pshift=-12) fd.d1 >> fd.play( "<x x x (x[xx])( [xxxx])><------(-#)(- )>< o[-o][ o] (o )( )>", amp=0.5) fd.p4 >> fd.SynthDef('saw')( [0, 0, 1, 0, 0, 0], dur=[0.5, fd.rest(0.5), 0.5, fd.rest(0.5), 0.5, fd.rest(1.5)], amp=0.3, oct=8, pan=-1) fd.p5 >> fd.SynthDef('bell')([0, 0, 0, 0, 0, 0], dur=[0.5, 0.25, 0.25, 0.25, 0.25, 0.5], amp=0.1, oct=7, pan=1) fd.d2 >> fd.play("xx o o o", amp=0.2, sample=4)
import FoxDot as fd fd.Root.default.set("E") fd.Clock.bpm = 120 main_melody_notes = [4, 1, 0, -3, -1, 0, 2, 1, 0, -1] main_melody_dur = [1.5, 1.5, 1.5, 1.5, 2.0, 1.5, 1.5, 1.5, 1.5, 2.0] print(fd.FxList) print(fd.SynthDefs) print(fd.SynthDef('play2')) fd.m1 >> fd.SynthDef('nylon')( main_melody_notes, dur=main_melody_dur, amp=0.2, echo=1.0, delay=(0, 1.0)) fd.m2 >> fd.SynthDef('saw')((-3, 0), dur=8, amp=0.5, lpf=2000) fd.d1 >> fd.play("<- - - - - - - - ><x xo x xx o >", sample=3) fd.d2 >> fd.play(" x xo") fd.m1.stop() fd.m2.stop() fd.d1.stop() fd.d2.stop()
(-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], amp=0.2, oct=4, pan=-0.6) fd.p2 >> fd.pluck([(-4, 2, 5, 7), (-5, 1, 4, 6), (-3, 0.5, 3, 5)] + [(-4, 0, 2, 5), (-4, 0, 1, 5), (-7, 1, 3, 5.5), (-3.5, 0, 2, 5.5)], dur=[4, 2, 2, 2, 2, 2, 2], amp=0.4, oct=6, pan=0.8) fd.d1 >> fd.play( "-[- -]-[- -]-(=[- -])-([- -][---][- -][- -])", sample=2, amp=0.5, pan=0.3) fd.d2 >> fd.play("x x x x ", sample=6) fd.d3 >> fd.play(" o o ", sample=3, pan=-0.2) fd.l1.stop() fd.l2.stop() fd.b1.stop() fd.p1.stop() fd.p2.stop() fd.d1.stop() fd.d2.stop() fd.d3.stop()
import FoxDot as fd import numpy as np fd.Clock.bpm = 170 fd.Root.default.set("C") fd.SynthDefs fd.d1 >> fd.play("x x ") fd.d2 >> fd.play("= = = = ") fd.d3 >> fd.play("--------") fd.d4 >> fd.play(" o ", sample=3) fd.d5 >> fd.play(" -[ -][ -] - ", sample=2) fd.d1.stop() fd.d2.stop() fd.d3.stop() fd.d4.stop() fd.d5.stop()
1, fd.rest(2.5), 0.5, 0.5, 0.5, 0.5, 1.5, 0.5, 0.5, 1, fd.rest(2.5), 0.5, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5 ], oct=5) fd.s1 >> fd.saw( [0, (0, 3, 5), 0, 0, (0, 3, 5), 0, 0, (0, 2, 4), 0, 0, (0, 2, 4), 0], dur=[ fd.rest(1), 1, fd.rest(2), fd.rest(1.5), 1, fd.rest(1.5), fd.rest(1), 1, fd.rest(2), fd.rest(1.5), 1, fd.rest(1.5) ]) fd.s2 >> fd.creep([(-4, -2, 0), (-5, -3, 0)], dur=[8, 8], amp=0.3) fd.d1 >> fd.play("<x o xx xx o xx >", amp=0.5, sample=4) fd.d2 >> fd.play("=-=-=-=-", amp=0.3, sample=2) fd.r1.stop() fd.r2.stop() fd.b1.stop() fd.s1.stop() fd.s2.stop() fd.d1.stop() fd.d2.stop()
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 + [0, (-2, 1, 3), 0] * 4 + [0, (-3, 0, 2), 0] * 4, dur=[fd.rest(0.5), 0.25, fd.rest(0.25)], amp=0.3) fd.p2 >> fd.swell([(-2, 0, 3), (-3, -1, 2), (-4, -2, 1), (-5, -3, 0), (-5, -3, 1), (-3, 0, 2)], dur=[4, 4, 4, 2.5, 0.5, 1], amp=0.3) fd.d1 >> fd.play( "<x o xo x o xo x o xo x [[o ][ o]][[ ][o ]] x[[o ][ o]][[ ][o ]]>", amp=0.4, sample=2) fd.d2 >> fd.play("[--][- ][- ][--]", sample=3) fd.l1.stop() fd.b1.stop() fd.p1.stop() fd.p2.stop() fd.d1.stop() fd.d2.stop()