Ejemplo n.º 1
0
 def setMidi(self, midi, midi_skip):
     self.midi = midi
     self.midi_skip = 295
     self.midi_events = {
         "rhode": MidiMod(["epiano B76", "epiano high"], mod="one-off"),
         "drone": MidiMod("drone highdre@d", decay=3),
         "muffin": MidiMod(["muffin"], decay=4),
     }
Ejemplo n.º 2
0
 def setMidi(self, midi, midi_skip):
     self.midi = midi
     self.midi_skip = 123
     self.snare_mod = MidiMod("snare", decay=13)
     self.kick_mod = MidiMod("kick", decay=15)
     self.bass_mod = MidiMod("andy 67", decay=1)
     self.flute_mod = MidiMod("madflute", decay=3)
     self.rhode_mod = MidiMod("MIDI 08")
Ejemplo n.º 3
0
 def setMidi(self, midi, midi_skip):
     self.midi = midi
     self.midi_skip = 0
     self.midi_events = {
         "rhode":
         MidiMod("Combinator 1"),
         "perc":
         MidiMod(["Dr. Octo Rex 1", "Dr. Octo Rex 1 copy 2", "Kong 1"],
                 mod="one-off"),
         "bass":
         MidiMod(["Combinator 2 copy", "Combinator 2 copy"],
                 mod="one-off",
                 decay=30),
     }
Ejemplo n.º 4
0
 def setMidi(self, midi, midi_skip):
     self.midi = midi
     self.midi_skip = 0
     self.midi_events = {
         "hgh": MidiMod("perc high", mod="one-off", decay=20),
         "perc": MidiMod("perc low", mod="one-off", decay=5),
         "kick": MidiMod("kick", decay=15),
         "bass": MidiMod("BF sub", decay=23, mod="one-off"),
         "rhode": MidiMod("BF friend"),
         "bell": MidiMod("BF buttons", mod="one-off", decay=42),
         "flute": MidiMod("BFbendy lead"),
     }
Ejemplo n.º 5
0
 def setMidi(self, midi, midi_skip):
     self.midi = midi
     self.midi_skip = 0
     self.midi_events = {
         "dbass": MidiMod("DirtyBass", mod="one-off"),
         "bass": MidiMod("Rhodes bass", mod="one-off"),
         "rhode": MidiMod(["Rhodes mel"], mod="one-off", decay=20),
         "string": MidiMod("Strings", mod="one-off", decay=20),
         "kick": MidiMod("Kick", mod="one-off"),
         "snare": MidiMod("snare", mod="one-off"),
         "hats": MidiMod("Hats", mod="one-off"),
     }
Ejemplo n.º 6
0
 def setMidi(self, midi, midi_skip):
     self.midi = midi
     self.midi_skip = midi_skip
     self.midi_events = {
         "piano": MidiMod("Combinator 2", mod="pitch", decay=1),
         "bell": MidiMod("Thor 2", mod="one-off"),
         "kick": MidiMod("Kick", mod="one-off", decay=5),
         "hgh": MidiMod("Hats high", mod="one-off"),
         "reves": MidiMod("Reves", mod="pitch", decay=2),
         "drum": MidiMod("Dr. Octo Rex 1", mod="one-off"),
         "lead": MidiMod("Lead Hard", mod="pitch", decay=1)
     }
Ejemplo n.º 7
0
 def setMidi(self, midi, midi_skip):
     self.midi = midi
     self.midi_skip = 235
     self.midi_events = {
         "waldo": MidiMod("waldo A61", mod="one-off"),  #, decay=2),
         "guitar": MidiMod("andy 084", mod="one-off"),
         "bell": MidiMod("vti twinkle", mod="one-off"),
         "violon": MidiMod("vti violon", mod="one-off"),
         "tb": MidiMod("tracebackbass"),
         "kick": MidiMod(["kick", 'Copy of kick'], mod="one-off"),
         "bass": MidiMod(" andy  low 084", mod="one-off"),
     }
Ejemplo n.º 8
0
class Demo(Animation):
    def __init__(self):
        self.scenes = [
            [3600, None],
            [3376, self.zoom_out],
            [2937, self.end],
            [2688, self.tr],
            [1874, self.verse3],
            [1375, self.verse2],
            [375, self.verse1],
            [0, self.intro],
        ]
        super().__init__(yaml.load(p))


#    def setAudio(self, audio):
#        self.audio = audio
#        self.spectre = SpectroGram(audio.audio_frame_size)
#        self.hgh_mod = AudioMod((373, 800), "max")
#        self.mid_mod = AudioMod((25, 70), "avg")

#    def updateAudio(self, audio_buf):
#        self.spectre.transform(audio_buf)
#        self.hgh = self.hgh_mod.update(self.spectre)
#        self.mid = self.mid_mod.update(self.spectre)

    def setMidi(self, midi, midi_skip):
        self.midi = midi
        self.midi_skip = 123
        self.snare_mod = MidiMod("snare", decay=13)
        self.kick_mod = MidiMod("kick", decay=15)
        self.bass_mod = MidiMod("andy 67", decay=1)
        self.flute_mod = MidiMod("madflute", decay=3)
        self.rhode_mod = MidiMod("MIDI 08")

    def updateMidi(self, midi_events):
        self.snare = self.snare_mod.update(midi_events)
        self.kick = self.kick_mod.update(midi_events)
        self.bass = self.bass_mod.update(midi_events)
        self.flute = self.flute_mod.update(midi_events)
        self.rhode = self.rhode_mod.update(midi_events)
        if midi_events:
            print(midi_events)

    def zoom_out(self, frame):
        if self.scene_init:
            self.speed = 1.4
        self.speed /= 1.01
        self.bass -= self.bass / 20
        self.params["radius"] += self.params["radius"] / 20 * self.speed + \
                                 self.params["radius"] / 5 * self.bass

    def end(self, frame):
        self.params["c_imag"] += 7e-4 * self.kick
        self.params["c_real"] -= 5e-4 * self.snare
        self.params["grad_freq"] += 1e-3 * self.bass
        if self.rhode:
            self.rhode_mod.prev_val = 0
            self.params["max_iter"] += 4 * self.rhode

    def tr(self, frame):
        self.params["radius"] -= self.params["radius"] / 11 * self.flute
        self.params["grad_freq"] -= 2e-3 * self.bass

    def verse3(self, frame):
        self.params["c_imag"] += 4e-5 * self.kick
        #        self.params["c_real"] -= 1e-4 * self.snare
        self.params["grad_freq"] -= 3e-3 * self.bass
        self.params["radius"] -= self.params["radius"] / 30 * self.flute

    def verse2(self, frame):
        self.params["c_imag"] += 0.6e-4 * self.kick
        self.params["c_real"] -= 1e-4 * self.snare
        self.params["grad_freq"] += 2e-3 * self.bass
        self.params["radius"] += self.params["radius"] / 15 * self.flute

    def verse1(self, frame):
        self.params["c_imag"] += 4e-5 * self.kick
        self.params["c_real"] -= 5e-5 * self.snare
        self.params["grad_freq"] += 2e-3 * self.bass

    def intro(self, frame):
        #self.params["max_iter"] = 128 + 50 * self.bass
        self.params["grad_freq"] += 4e-3 * self.bass