def fib_song(): fluidsynth.init('soundfonts/grand_piano.sf2') comp = Composition() comp.add_track(fib_seq()) comp.add_track(fib_seq(offset=4)) comp.add_track(fib_seq(offset=8)) fluidsynth.play_Composition(comp)
def main(): comp = Composition() with open('out.txt', 'r') as f: lines = f.readlines() for line in lines: tb = TrackBuilder() symbols = line.rstrip().split(' ')[1:] print(symbols) for symbol in symbols: tb.add_symbol(symbol) track = tb.flush() comp.add_track(track) fluidsynth.init('../sfs/soundfont.sf2', 'alsa') fluidsynth.play_Composition(comp)
def test_composition(self): m = MidiInstrument("Vibraphone") b = Bar() b + Note("C") b + Note("E") b + Note("A") b + "E" c = Bar() c + Note("G") c + "C" c + "E" c + Note("C", 5) t = Track() t + b t + c t2 = Track() t2 + b t2 + b t2.instrument = m c = Composition() c+ t c+ t2 self.assert_(fluidsynth.play_Composition(c))
def test_composition(self): m = MidiInstrument("Vibraphone") b = Bar() b + Note("C") b + Note("E") b + Note("A") b + "E" c = Bar() c + Note("G") c + "C" c + "E" c + Note("C", 5) t = Track() t + b t + c t2 = Track() t2 + b t2 + b t2.instrument = m c = Composition() c + t c + t2 self.assertTrue(fluidsynth.play_Composition(c))
def test_composition(self): m = MidiInstrument('Vibraphone') b = Bar() b + Note('C') b + Note('E') b + Note('A') b + 'E' c = Bar() c + Note('G') c + 'C' c + 'E' c + Note('C', 5) t = Track() t + b t + c t2 = Track() t2 + b t2 + b t2.instrument = m c = Composition() c + t c + t2 self.assert_(fluidsynth.play_Composition(c))
def test_composition(self): m = MidiInstrument('Vibraphone') b = Bar() b + Note('C') b + Note('E') b + Note('A') b + 'E' c = Bar() c + Note('G') c + 'C' c + 'E' c + Note('C', 5) t = Track() t + b t + c t2 = Track() t2 + b t2 + b t2.instrument = m c = Composition() c + t c + t2 self.assert_(fluidsynth.play_Composition(c))