def __init__( self, sink, sheet, oscillator=sine, duration=0.3, get_frequency=lambda n: constant(get_frequency_from_name(n)) ): self.sink = sink self.parsed = parse_sheet(sheet) self.oscillator = oscillator self.get_frequency = get_frequency self.duration = duration
import krach from krach.source import frequency, oscillator from krach.sink.alsa import AlsaSink from krach.ext.plot import plot osc = oscillator.square( frequency.periodic(0.5, [ frequency.oscillating(frequency.constant(110), 3, 2), frequency.constant(220) ]) ) sink = AlsaSink() sink.sink([osc])