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"])
Ejemplo n.º 2
0
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=[