def preset(self, instrumentNumber): if instrumentNumber >= 0 and instrumentNumber <= 8: osc.sendMsg("/inst/modalbar/preset", [int(instrumentNumber)])
def setPlaybackRate(self, rate): if rate > 0: osc.sendMsg("/inst/sndbuf/rate", [rate * 1.0])
def __init__(self): self.name = "mandolin" osc.sendMsg("/init", [self.name]) time.sleep(0.5)
def setAttackRate(self, seconds): if seconds > 0: osc.sendMsg("/inst/blowhole/rate", [seconds * 1.0])
def noteOff(self, velocity): if self.name == "sinosc" or self.name == "sndbuf": osc.sendMsg("/inst/" + self.name + "/gain", [0.0]) else: osc.sendMsg("/inst/" + self.name + "/noteOff", [velocity * 1.0])
def __init__(self): self.name = "blowhole" osc.sendMsg("/init", [self.name]) time.sleep(0.5)
def setVent(self, vent): if vent >= 0 and vent <= 1: osc.sendMsg("/inst/blowhole/vent", [vent * 1.0])
def setReedStiffness(self, stiffness): if stiffness >= 0 and stiffness <= 1: osc.sendMsg("/inst/blowhole/reed", [stiffness * 1.0])
def setVibrato(self, vibratoFreq, vibratoGain, noiseGain): if vibratoGain >= 0 and vibratoGain <= 1 and noiseGain >= 0 and noiseGain <= 1: osc.sendMsg( "/inst/blowbotl/vibrato", [vibratoFreq * 1.0, vibratoGain * 1.0, noiseGain * 1.0])
def setFrequency(self, freq): osc.sendMsg("/inst/" + self.name + "/freq", [freq * 1.0])
def setMode(self, mode, ratio, radius, gain): if mode >= 0 and mode <= 1 and radius >= 0 and radius <= 1 and gain >= 0 and gain <= 1: osc.sendMsg("/inst/modalbar/mode", [int(mode), ratio * 1.0, radius * 1.0, gain * 1.0])
def damp(self, amount): if amount >= 0 and amount <= 1: osc.sendMsg("/inst/modalbar/damp", [amount * 1.0])
def strike(self, strength): if strength >= 0 and strength <= 1: osc.sendMsg("/inst/modalbar/strike", [strength * 1.0])
def setNoiseGain(self, gain): if gain >= 0 and gain <= 1: osc.sendMsg("/inst/blowhole/noiseGain", [gain * 1.0])
def setToneHoleSize(self, size): if size >= 0 and size <= 1: osc.sendMsg("/inst/blowhole/tonehole", [size * 1.0])
def startBlowing(self, strength): if strength >= 0 and strength <= 1: osc.sendMsg("/inst/blowhole/startBlowing", [strength * 1.0])
def setPressure(self, pressure): if pressure >= 0 and pressure <= 1: osc.sendMsg("/inst/blowhole/pressure", [pressure * 1.0])
def setVibrato(self, freq, gain): if gain >= 0 and gain <= 1: osc.sendMsg("/inst/bowed/vibratoFG", [freq * 1.0, gain * 1.0])
def setFile(self, filename): osc.sendMsg("/inst/sndbuf/read", [filename])
def stopBlowing(self, floatValue): if floatValue >= 0 and floatValue <= 1: osc.sendMsg("/inst/blowhole/stopBlowing", [floatValue * 1.0])
def setLoopRate(self, loopsPerSecond): if loopsPerSecond > 0: osc.sendMsg("/inst/sndbuf/loopRate", [loopsPerSecond * 1.0])
def __init__(self): self.name = "fmvoices" osc.sendMsg("/init", [self.name]) time.sleep(0.5)
def setBow(self, pressure, position): if pressure >= 0 and pressure <= 1 and position >= 0 and position <= 1: osc.sendMsg("/inst/bowed/bow", [pressure * 1.0, position * 1.0])
def setVolume(self, volume): if volume >= 0 and volume <= 1: osc.sendMsg("/inst/bowed/volume", [volume * 1.0])
def setVibrato(self, vibratoFreq, vibratoGain, noiseGain): if vibratoGain >= 0 and vibratoGain <= 1 and noiseGain >= 0 and noiseGain <= 1: osc.sendMsg("/inst/blowbotl/vibrato", [vibratoFreq * 1.0, vibratoGain * 1.0, noiseGain * 1.0])
def stopBowing(self, floatValue): if floatValue >= 0 and floatValue <= 1: osc.sendMsg("/inst/bowed/stopBowing", [floatValue * 1.0])
def setReadPosition(self, position): if position >= 0: osc.sendMsg("/inst/sndbuf/position", [int(position)])
def setLooping(self, doLoop): if doLoop >= 0: osc.sendMsg("/inst/sndbuf/loop", [int(doLoop)])
def __init__(self): self.name = "sinosc" osc.sendMsg("/init", [self.name]) time.sleep(0.5)
def pluck(self, strength): if strength >= 0 and strength <= 1: osc.sendMsg("/inst/mandolin/pluck", [strength * 1.0])
def setVowel(self, vowel): if vowel >= 0 and vowel <= 1: osc.sendMsg("/inst/fmvoices/vowel", [vowel * 1.0])
def setGain(self, gain): if gain >= 0: # and gain <= 1: osc.sendMsg("/inst/" + self.name + "/gain", [gain * 1.0])