def __init__(self, release_time=0.1, release_order=0.75, duration=None): Generator.__init__(self) self.release_time = t2f(release_time) self.release_order = release_order self.release_frame = float('inf') self.allow_release = (duration is None) if duration: self.release_frame = t2f(duration) - self.release_time
def __init__(self, filepath): Generator.__init__(self) fluidsynth.Synth.__init__(self) self.num_channels = 2 fluidsynth.Synth() self.sfid = self.sfload(filepath) if self.sfid == -1: raise Exception('Error in fluidsynth.sfload(): cannot open ' + filepath) self.program(0, 0, 0)
def __init__(self, pitch, overtones=[(1, 1, 0)], detune=0): self.freq = pitch_to_frequency(pitch + detune/100.) def nyquist(overtone): return overtone[0] * self.freq < SAMPLING_RATE/2 self.overtones = filter(nyquist, overtones) self._factor = self.freq * 2.0 * np.pi / SAMPLING_RATE Generator.__init__(self)
def __init__(self, sequence=[], channels=2, live=True, loop=False, clip=True, max_size=0): Generator.__init__(self) self.max_size = max_size self._generators = PriorityQueue(max_size) self._finished = Queue() self._gain = 0.1 self._live = live self._length_cache = max([f+g.length() for (f, g) in sequence] + [0]) self.loop = loop self.clip = clip self.num_channels = channels self.num_gens = 0 if sequence: for (f, g) in sequence: self._append_gen(f, g) if live: assert(not loop) self.auto_reset = loop
def __init__(self, duration): Generator.__init__(self) self.duration = t2f(duration)
def __init__(self, steps, initial=0.0): Generator.__init__(self) self.steps = steps self.initial = initial
def __init__(self, pitch, modulator, detune=0): self.modulator = modulator self.freq = pitch_to_frequency(pitch + detune/100.) self._factor = self.freq * 2.0 * np.pi / SAMPLING_RATE Generator.__init__(self)
def __init__(self, table): self.table = table Generator.__init__(self)
def __init__(self, freq, phase, duty=0.5, amp=1.0): self.freq = freq self.phase = phase self.duty = duty self.amp = amp Generator.__init__(self)
def __init__(self, freq, phase, amp=1.0): self.freq = freq self.amp = amp self.phase = phase Generator.__init__(self)
def __init__(self, value): self.value = value Generator.__init__(self)
def __init__(self, data, num_channels, loop=False, speed=1.0): Generator.__init__(self) self.num_channels = num_channels self.data = data self.loop = loop self.speed = speed
def __init__(self, filepath, gain=1): Generator.__init__(self) self.wave_reader = WaveReader(filepath) self.num_channels = self.wave_reader.channels self.gain = gain self.paused = False