prototype = { "fLow" : 400, "fHigh" : 1200, "bwScale" : 1.0, "gainLow" : 0, "gainCenter" : 0, "gainHigh" : 0} class Prism(Program): def __init__(self,name): super(Prism,self).__init__(name,Prism,prototype) self.performance = performance() program_bank = ProgramBank(Prism("Init")) program_bank.enable_undo = False def prism(slot, name, fLow = 400, fHigh = 1200, bwScale = 1.0, gainLow = 0, gainCenter = 0, gainHigh = 0): p = Prism(name) p["fLow"] = int(fLow) p["fHigh"] = int(fHigh) p["bwScale"] = float(bwScale) p["gainLow"] = int(gainLow) p["gainCenter"] = int(gainCenter)
"modDepth" : 1.0, # norm "attack" : 0.01, # 0..4 "release" : 0.01, # 0..4 "envelopeSelect" : 0, # int 0->env follower, 1->ASR "wetAmp" : 1.0, # volume "dryAmp" : 1.0 # volume } class QMod(Program): def __init__(self,name): super(QMod,self).__init__(name,QMod,prototype) self.performance = performance() program_bank = ProgramBank(QMod("Init")) program_bank.enable_undo = False def qmod(slot, name, keyTrack = 0.0, fixedFrequency = 1.0, inputFilter = 5000, inputGain = 1.0, modDepth = 1.0, attack = 0.01, release = 0.01, envelopeSelect = 0, wetAmp = 1.0, dryAmp = 1.0,): p = QMod(name) p["keyTrack"] = float(keyTrack)
"op%dBreakKey": 60, "op%dLeftKeyScale": 0, "op%dRightKeyScale": 0, "op%dAmp": 1.0, "op%dX": 0.0 }.items(): prototype[p % op] = v class Io(Program): def __init__(self, name): super(Io, self).__init__(name, Io, prototype) self.performance = performance() program_bank = ProgramBank(Io("Init")) program_bank.enable_undo = False def vibrato(freq=7.0, lock=1, noise=0.3, delay=0.0, sens=0.1, depth=0.0, x=0.0, tremRatio=1.0): a = { "vfreq": freq, "vlock": lock, "vnoise": noise,
"pulseWidth": 0.5, "pulseAmp": 1.0, "pulseBleed": 0.0, "lag": 0.0, "sawBias": 0, "pulseBias": 0 } class Lfo2(Program): def __init__(self, name): super(Lfo2, self).__init__(name, "LFO2", prototype) self.performance = performance() program_bank = ProgramBank(Lfo2("Init")) program_bank.enable_undo = False def _fill(lst, template): acc = [] for i, dflt in enumerate(template): try: v = lst[i] except IndexError: v = dflt acc.append(float(v)) return acc def lfo2(
"filterMix": 0.0, # Filter mode mix [-1=lowpass, +1=bandpass]. "filterMix_lfo": 0.0, # Filter mix mod by lfo. "filterMix_env1": 0.0, # Filter mix mod by env1. "bandpassOffset": 1.0, # Bandpass filter frequency offset (ratio) "bandpassLag": 0.0, # Bandpass frequency mod lag time. "xToPitch": 0.0, # External control signal to pitch [0.0, 1.0] "xToFilterFreq": 0.0 # External control signal to filter [0.0, 1.0] } class Saw3(Program): def __init__(self, name): super(Saw3, self).__init__(name, "Saw3", prototype) program_bank = ProgramBank(Saw3("Init")) program_bank.enable_undo = False def nclip(v): return float(clip(v, 0.0, 1.0)) def pclip(v): return float(clip(v, -1.0, 1.0)) def vibrato(freq, delay=0.0, depth=0.0, sens=0.1): return { "vfreq": float(clip(freq, 0.001, 15)), "vsens": nclip(sens),
"polarityComp": 0, # int [0,1,2] -> [none, ->bipolr ->polar] "clipMin": -1.0, # float, range -/+ 10 "clipMax": 1.0, # floaT, range -/+ 10 "lag": 0.0, # float, 0..1 "scale": 1.0, # float, -/+ 10 "bias": 0.0 # float, -/+ 10 } class CUtil(Program): def __init__(self, name): super(CUtil, self).__init__(name, CUtil, prototype) self.performance = performance() program_bank = ProgramBank(CUtil("Init")) program_bank.enable_undo = False def cutil(slot, name, wave=0, polarityComp=0, clipMin=-1.0, clipMax=1.0, lag=0.0, scale=1.0, bias=0.0): p = CUtil(name) p["wave"] = int(wave) p["polarityComp"] = int(polarityComp)
"delay" : 0.01, "modDepth" : 0.5, "feedback" : 0.0, "lowpass" : 16000, "dryMix" : 0.5, "wet1Mix" : 0.5, "wet2Mix" : 0.5, "xmodDepth" : 0.0} class Scanner(Program): def __init__(self,name): super(Scanner,self).__init__(name,Scanner,prototype) self.performance = performance() program_bank = ProgramBank(Scanner("Init")) program_bank.enable_undo = False def scanner(slot, name, scanRate = 5.0, wave = 0.5, delay = 0.01, modDepth = 0.5, feedback = 0.0, lowpass = 16000, dryMix = 0.5, wet1Mix = 0.5, wet2Mix = 0.5, xmodDepth = 0.0): def fval(x): return round(float(x),4)
"filterFreq": 1000, # msb [...] "res": 0.5, # norm "modDepth": 0.0, # bi-polar "xmod": 0.0, # bi-polar "dryamp": 1.0, # volume "wetamp": 1.0 } # volume class Hund(Program): def __init__(self, name): super(Hund, self).__init__(name, Hund, prototype) self.performance = performance() program_bank = ProgramBank(Hund("Init")) program_bank.enable_undo = False def hund( slot, name, pregain=1, attack=0.01, release=0.01, filterFreq=1000, # int res=0.5, modDepth=0.0, xmod=0.0, dryamp=1.0, wetamp=1.0):
"threshold": 1.0, # feedback clipping threshold, normalized "lowcut": 10000, # feedback lowpass cutoff, Hertz "highcut": 100, # feedback highpass cutoff, Hertz "efxMix": 0.5, # wet/dry signal mix, 0 -> dry, 1 -> wet "xEfxMix": 0.0, # external efx-mix modulation, normalized "amp": 1.0 } # overall gain class CarnalDelay(Program): def __init__(self, name): super(CarnalDelay, self).__init__(name, "CarnalDelay", prototype) self.performance = performance() program_bank = ProgramBank(CarnalDelay("Init")) program_bank.enable_undo = False MAX_DELAY = 1.5 def carnal( slot, name, amp=-12, delayTime=0.125, xDelay=0.0, wow=0.0, wowFreq=1.0, flutter=0, feedback=0.5,
"filterAAmp" : 1.0, # amp slider "filterBAmp" : 1.0, # amp slider "dryPan" : 0.0, # bEDi slider "filterAPan" : 0.0, # bi slider "filterBPan" : 0.0, # bi slider "xscale" : 1.0, # linear slider (0,4) "xbias" : 0.0, # linear slider (-4,4) "amp" : 1.0} # amp slider class XOver(Program): def __init__(self, name): super(XOver, self).__init__(name, "XOver", prototype) self.performance = performance() program_bank = ProgramBank(XOver("Init")) program_bank.enable_undo = False def xover(slot, name, lfoFreq = 1.0, lfo2Ratio = 1.0, lfo2Wave = 0.0, lfoEnable = 1.0, res = 0, xover = 800, lfoToXover = 0.0, externToXover = 0.0, minXover = 200, maxXover = 20000, filterBMix = 0.0, filterBRatio = 1.0,
prototype = { "lfoFreq" : 5.0, "modDepth" : 0.0, "limit" : 1.0, "xDepth" : 0.0, "xLfoAmp" : 0.0, "xLfoFreq" : 0.0, "amp" : 1.0} class Tremolo(Program): def __init__(self, name): super(Tremolo, self).__init__(name, "Tremolo", prototype) self.performance = performance() program_bank = ProgramBank(Tremolo("Init")) program_bank.enable_undo = False def trem(slot, name, amp=0, lfo = [5.0, 0.0], # [freq, amp] xtern = [0.0, 0.0, 0.0], # [modDepth, x->lfoFreq, x->lfoAmp] limit = 1): p = Tremolo(name) p["lfoFreq"] = abs(float(lfo[0])) p["modDepth"] = clip(abs(float(lfo[1])), 0, 2) p["limit"] = abs(float(limit)) p["amp"] = clip(abs(float(db_to_amp(amp))), 0, 2) p["xDepth"] = float(xtern[0]) p["xLfoFreq"] = float(xtern[1]) p["xLfoAmp"] = float(xtern[2]) program_bank[slot] = p
"delay": 1.0, "feedback": 0.0, "lagDelay": 0.0, "enableHpDelay": 0, "scaleDelay": 1.0, "biasDelay": 0.0 } class Ghostbus(Program): def __init__(self, name): super(Ghostbus, self).__init__(name, "GHOSTBUS", prototype) self.performance = performance() program_bank = ProgramBank(Ghostbus("Init")) program_bank.enable_undo = False def ghostbus(slot, name, enableMod=0, enableHpA=0, lagA=0.0, scaleA=1.0, biasA=0.0, delay=1.0, feedback=0.0, lagDelay=0.0, enableHpDelay=0, scaleDelay=1.0,
"gainD" : 1.0, "muteD" : 0, "modD" : 0.0, "panD" : 0.0, "gain1" : 1, "gain2" : 1} class Mixer(Program): def __init__(self, name): super(Mixer, self).__init__(name, "Mixer", prototype) self.performance = performance() program_bank = ProgramBank(Mixer("Init")) def mixer(slot, name, chanA = [-99, 0.0, 0.0, 0], # [gain(db), mod-depth, pan, mute] chanB = [-99, 0.0, 0.0, 0], chanC = [-99, 0.0, 0.0, 0], chanD = [-99, 0.0, 0.0, 0], main = [0,0]): program=Mixer(name) def fill_channel_list(lst): acc = [] for i,dflt in enumerate([-99.0, 0.0, 0.0, 0]): try: acc.append(float(lst[i])) except (IndexError,ValueError,TypeError):
"cFreqX": 0, # External -> freq "q": 1, # Filter Q "qLfo": 0, # LFO -> Q "qX": 0, # External -> Q "filterGain": 0, # Filter gain in db "bleed": 0.0 } # dry signal bypass 0 -> filter 1 -> no filter class Bandpass(Program): def __init__(self, name): super(Bandpass, self).__init__(name, Bandpass, prototype) self.performance = performance() program_bank = ProgramBank(Bandpass("Init")) program_bank.enable_undo = False def bandpass(slot, name, lfoFreq=1.0, cFreq=1000, cFreqLfo=0, cFreqX=0, q=1, qLfo=0, qX=0, filterGain=0, bleed=0.0): p = Bandpass(name)
"p2" : 0.00, "p3" : 0.00, "p4" : 0.00, "p5" : 0.00, "p6" : 0.00, "p7" : 0.00, "p8" : 0.00, "p9" : 0.00} class Masa(Program): def __init__(self, name): super(Masa, self).__init__(name, "MASA", prototype) program_bank = ProgramBank(Masa("Init")) program_bank.enable_undo = False def _fill_xbus(prog, xmap): prog["xBias"] = float(xmap.get("bias", 1.0)) prog["xScale"] = float(xmap.get("scale", 0.5)) prog["xToFreq"] = float(xmap.get("freq", 0.0)) def _fill_vibrato(prog, vmap): prog["vfreq"] = float(vmap.get("freq", 5.0)) prog["vdelay"] = float(vmap.get("delay", 0.0)) prog["vsens"] = float(vmap.get("sens", 0.1)) prog["vdepth"] = float(vmap.get("depth", 0.0)) prog["vibrato"] = 0.0 def _fill_amps(prog, alst):
"noiseRatio" : 1.000, # noise filter track, 0 <= track <= 16 "noiseBias" : 0, # noise filer floor, HZ, 0 <= bias 9999 "noiseAttack" : 0.001, # noise attack time, 0 <= attack <= 6 "noiseDecay" : 0.500, # noise decay time, 0 <= decay <= 6 "noiseAmp" : 0.000, # noise relative linear amplitude, 0 <= amp <= 1 "noiseRes" : 0, # noise filter resonance, 0 <= res <= 1 "noiseBend" : 0.00, # noise filter modulation, -1 <= bend <= +1 "noiseVelocity" : 0.000, # noise velocity sensitivity 0 <= vsens <= 1 } class Rdrum(Program): def __init__(self, name): super(Rdrum, self).__init__(name, "Rdrum", prototype) program_bank = ProgramBank(Rdrum("Init")) program_bank.enable_undo = False def fget(d, key, default, mn=0.0, mx=1): v = d.get(key, default) return float(clip(v, mn, mx)) def _envTime(d, param, default): v = clip(float(d.get(param, default)), 0, 6) return v def _freq_ratio(d, param, default): v = abs(float(d.get(param, default))) return v
"bDecay2": 0.0, "bRelease": 0.0, "bBreakpoint": 1.0, "bSustain": 1.0, "bEnvmode": 0, "bInvert": 0 } class Envgen(Program): def __init__(self, name): super(Envgen, self).__init__(name, Envgen, prototype) self.performance = performance() program_bank = ProgramBank(Envgen("Init")) program_bank.enable_undo = False def envgen(slot, name, aAttack=0.0, aDecay1=0.0, aDecay2=0.0, aRelease=0.0, aBreakpoint=1.0, aSustain=1.0, aEnvmode=0, aInvert=0, bAttack=0.0, bDecay1=0.0,
"filterLFO": 0, "filterEnv": 0, "xFilter": 0, "filterRes": 0.0, "gateMode": 0, "amp": 0.3 } class SS1(Program): def __init__(self, name): super(SS1, self).__init__(name, SS1, prototype) self.performance = performance() program_bank = ProgramBank(SS1("Init")) program_bank.enable_undo = False def ss1(slot, name, port=0.0, vsens=0.1, vdepth=0.0, xPitch=0.0, chorus=0, lfoFreq=7.0, lfoWave=0, lfoDelay=0.0, lfoAmp=0.0, attack=0.0,
"pulseWidth": 0.5, "lfoDelay": 0.0, "lfoHold": 0.5, "lfoBleed": 0.0, "lfoScale": 1.0, "lfoBias": 0 } class LFO1(Program): def __init__(self, name): super(LFO1, self).__init__(name, "LFO1", prototype) self.performance = performance() program_bank = ProgramBank(LFO1("Init")) program_bank.enable_undo = False def lfo1(slot, name, freq=1.0, sineRatio=1.0, sineAmp=1.0, sawRatio=1.0, sawWidth=0.0, sawAmp=0.0, pulseRatio=1.0, pulseWidth=0.5, pulseAmp=0.0, delay=0.0,
"imodfreq": 1000, # internal modulator frequency "imodamp": 1.0, # internal modulator linear amp "xmodamp": 0.0, # external modulator amp "xmodbleed": 0.0, # external mod bleed to output "carbleed": 0.0, # carrier bleed to output "amp": 1 } # main linear amplitude class RingModulator(Program): def __init__(self, name): super(RingModulator, self).__init__(name, "RingModulator", prototype) self.performance = performance() program_bank = ProgramBank(RingModulator("Init")) program_bank.enable_undo = False def rm(slot, name, imodfreq=1000, imodamp=1.0, xmodamp=1.0, xmodbleed=0.0, carbleed=0.0, amp=1.0): p = RingModulator(name) p["imodfreq"] = int(imodfreq) p["imodamp"] = float(imodamp) p["xmodamp"] = float(xmodamp)
"dryAmp": 1.0, # 0..2 "psAmp": 1.0, # 0..2 "delayAmp": 0.0, # 0..2 "dryPan": 0.0, # -1..+1 "psPan": 0.0, # -1..+1 "delayPan": 0.0 } # -1..+1 class PitchShifter(Program): def __init__(self, name): super(PitchShifter, self).__init__(name, "PitchShifter", prototype) self.performance = performance() program_bank = ProgramBank(PitchShifter("Init")) program_bank.enable_undo = False def pitchshifter(slot, name, **pmap): p = PitchShifter(name) for param, dflt in prototype.items(): try: value = pmap[param] except KeyError: value = dflt p[param] = float(value) program_bank[slot] = p return p
"gain" : 1.0, # fold/wrap pregain 0..10? "wave" : 0, # wave select [0,1,2] -> [None,Soft, Distort,Fold,Wrap] "clockFreq" : 10000, # sample clock frequency "resampleEnable" : 1, # 0 -> bypass, 1 -> resample "low" : 20000, # low pass filter cutoff "wet" : 0.5, # wet signal amp "dry" : 0.5, # dry signal amp "amp" : 1.0} # overall amp class Crusher(Program): def __init__(self, name): super(Crusher, self).__init__(name, "Crusher", prototype) self.performance = performance() program_bank = ProgramBank(Crusher("Init")) program_bank.enable_undo = False def crusher(slot, name, gain = 1.0, wave = 0, clockFreq = 16000, resampleEnable = 1, low = 20000, wet = 0.5, dry = 0.5, amp = 1.0): p = Crusher(name) p["gain"] = float(gain) p["wave"] = int(wave) p["clockFreq"] = int(clockFreq)
"scaleD": 1.0, "biasD": 0.0, "muteD": 0, "masterScale": 1.0, "masterBias": 0.0, "masterMute": 0 } class Controlmixer(Program): def __init__(self, name): super(Controlmixer, self).__init__(name, "ControlMixer", prototype) self.performance = performance() program_bank = ProgramBank(Controlmixer("Init")) program_bank.enable_undo = False def controlmixer(slot, name, scaleA=1.0, biasA=0.0, muteA=0, scaleB=1.0, biasB=0.0, muteB=0, scaleC=1.0, biasC=0.0, muteC=0, scaleD=1.0,
"res": 0.5, # norm (0,1) "noiseAmp": 0.0, # linear noise amp (0,1) "xScale": 1.0, # external input scale factor "xBias": 0.0, "xToSpread": 0.0, # xternal signal to spread amount "xToNoise": 0.0, "xToFilter": 0.0 # external to filter, normalized } class Klstr(Program): def __init__(self, name): super(Klstr, self).__init__(name, "Klstr", prototype) program_bank = ProgramBank(Klstr("Init")) program_bank.enable_undo = False def fget(d, key, default, mn=0.0, mx=1): v = d.get(key, default) return float(clip(v, mn, mx)) def klstr( slot, name, amp=-12, lfo={ "freq": 1.00, "ratio": 1.00,
"cFreqX": 0, # External -> freq "q": 1, # Filter Q "qLfo": 0, # LFO -> Q "qX": 0, # External -> Q "filterGain": 0, # Filter gain in db "bleed": 0.0 } # dry signal bypass 0 -> filter 1 -> no filter class Notch(Program): def __init__(self, name): super(Notch, self).__init__(name, Notch, prototype) self.performance = performance() program_bank = ProgramBank(Notch("Init")) program_bank.enable_undo = False def notch(slot, name, lfoFreq=1.0, cFreq=1000, cFreqLfo=0, cFreqX=0, q=1, qLfo=0, qX=0, filterGain=0, bleed=0.0): p = Notch(name)
"f4": 1200, "q4": 1, "gain4": 0, "enable4": 1, "bleed": 0, "amp": 0 } class Formant(Program): def __init__(self, name): super(Formant, self).__init__(name, Formant, prototype) self.performance = performance() program_bank = ProgramBank(Formant("Init")) program_bank.enable_undo = False def band(n, freq=None, q=1, gain=0, enable=1): freq = freq or (n * 440) if enable: flag = 1 else: flag = 0 rs = { "f%d" % n: int(freq), "q%d" % n: float(q), "gain%d" % n: int(gain), "enable%d" % n: flag }
"mattack": 2.0, "mdecay": 0.0, "msustain": 1.0, "mrelease": 4.0, "modulationDepth": 1.0, "xToModulationDepth": 0.0, "xToPitch": 0.0 } class Orgn(Program): def __init__(self, name): super(Orgn, self).__init__(name, "Orgn", prototype) program_bank = ProgramBank(Orgn("Init")) program_bank.enable_undo = False def _fill(lst, template): acc = [] for i, d in enumerate(template): try: v = lst[i] except IndexError: v = d acc.append(v) return acc def orgn(
from __future__ import print_function from llia.program import Program from llia.bank import ProgramBank from llia.performance_edit import performance prototype = {"delayScale": 0.01, "delay": 0.50, "phase": -1, "wet": 1.0} class Comb(Program): def __init__(self, name): super(Comb, self).__init__(name, Comb, prototype) self.performance = performance() program_bank = ProgramBank(Comb("Init")) program_bank.enable_undo = False def comb( slot, name, delayScale=0.01, # 0.001|0.010|0.100 delay=0.50, # 0.0 .. 1.0 phase=-1, # -1 .. +1 wet=1.0): # 0.0 .. 2.0 def fval(x): return round(float(x), 4) p = Comb(name) p["delayScale"] = fval(delayScale)
"lpcutoff" : 16000, "hpcutoff" : 10, "gatted" : 0, "modDepth" : 0.0, "wetAmp" : 1.0, "wetPan" : 0.75, "dryAmp" : 1.0, "dryPan" : 0.25} class Rumklang(Program): def __init__(self, name): super(Rumklang,self).__init__(name, "Rumklang", prototype) self.performance = performance() program_bank = ProgramBank(Rumklang("Init")) program_bank.enable_undo = False MAX_DELAY = 0.33 def rumklang(slot, name, delay = 0.0, roomSize = 0.5, damp = 0.5, eq = [16000, 20], # [lp hp] in Hz gatted = 0, modDepth = 0.0, # external wet signal modulation wet = [0, 0.25], # [db, pan] dry = [0, 0.75]): # [db, pan] p = Rumklang(name)
"flangerLfoDepth": 0.0, # (0..1) "flangerFeedback": 0.0, # (-1..+1) "psRatio": 2.0, # (0..4) "psPDispersion": 0.0, # (0..1) "psTDispersion": 0.0, # (0..1) "psLfoDepth": 0.0 # (0..1) lfo -> pitch shift amp } class FM2(Program): def __init__(self, name): super(FM2, self).__init__(name, "FM2", prototype) self.performance = performance() program_bank = ProgramBank(FM2("Init")) program_bank.enable_undo = False def _fill_external_params(d): rs = { "xPitch": float(d.get("pitch", 0.0)), "xModDepth": float(d.get("mod", 0.0)), "xScale": float(d.get("scale", 1.0)), "xBias": float(d.get("bias", 0.0)) } return rs def _fill_lfo_params(d): rs = {