import dlal, os sonic=dlal.Sonic() vst=dlal.Component('vst') system=dlal.SimpleSystem([sonic, vst]) vst_path=dlal.tunefish_path() if 'DLAL_VST_PLUGIN_PATH' in os.environ: vst_path=os.environ['DLAL_VST_PLUGIN_PATH'] vst.load(vst_path) go, ports=system.standard_system_functionality()
import dlal #components network=dlal.Component('network'); network.port(9130) commander=dlal.Commander() s_voice=dlal.Sonic(); s_voice.i(0, 0, 0.25); s_voice.s(0, 1); s_voice.midi(0x90, 40, 0x7f) s_noise=dlal.Sonic(); s_noise.i(0, 0, 4.00); s_noise.i(0, 1, 4.00) s_noise.i(1, 0, 4.00); s_noise.i(1, 1, 4.00) s_noise.m(1, 0.01) s_noise.midi(0x90, 41, 0x7f) f_voice=dlal.Fir(); f_voice.resize(128) f_noise=dlal.Fir(); f_noise.resize(128) multiplier=dlal.Component('multiplier'); multiplier.offset(1); multiplier.set(0.5); multiplier.gate(-0.001); buffer_voice=dlal.Buffer(); buffer_voice.clear_on_evaluate('y') buffer_noise=dlal.Buffer(); buffer_noise.clear_on_evaluate('y') #system network.connect(commander) s_voice.connect(buffer_voice); f_voice.connect(buffer_voice) s_noise.connect(buffer_noise); f_noise.connect(buffer_noise) multiplier.connect(buffer_voice); multiplier.connect(buffer_noise) system=dlal.SimpleSystem( [network, commander, s_voice, s_noise, f_voice, f_noise, multiplier, buffer_voice, buffer_noise], [s_voice, s_noise], [buffer_voice, buffer_noise] ) #phonetic interface def phonetic(text): key, pressed=text.decode('utf-8').split() if int(pressed): f_voice.phonetic_voice(key)
def add_metronome(): track=dlal.MidiTrack(inputs[input].midi, dlal.Sonic()) track.synth.load(os.path.join(dlal.root, 'components', 'sonic', 'settings', 'snare.txt')) looper.add(track) track.drumline()
def soundfont(): r=dlal.Component('soundfont') r.set_samples_per_evaluation(looper.samples_per_evaluation()) r.set_sample_rate(looper.sample_rate) r.load(os.path.join('..', '..', 'components', 'soundfont', 'deps', '32MbGMStereo.sf2')) return r def soundboard(): r=dlal.Buffer() r.render_sonic_drums() r.set_sample_rate(looper.sample_rate) r.load_sounds() return r synths=[ ('sonic', lambda: dlal.Sonic()), ('soundfont', soundfont), ('soundboard', soundboard), ] looper.system.set('synth', synths[synth][0]) #network if '-l' not in sys.argv: network=dlal.Component('network') network.connect(looper.commander) looper.system.add(network) #commands def add_input(): looper.system.set('input {}'.format(len(inputs)), 'port {}'.format(dlal.Qweboard.port)) inputs.append(Input())
import midi import sys def sys_arg(i, f=str, default=None): if len(sys.argv) > i: return f(sys.argv[i]) return default # init audio = dlal.Audio() liner = dlal.Liner() sonic1 = dlal.Sonic() sonic2 = dlal.Sonic() lpf = dlal.Lpf() buf = dlal.Buf() tape = dlal.Tape(1 << 17) gain = dlal.Gain() # add audio.add(liner) audio.add(sonic1) audio.add(sonic2) audio.add(lpf) audio.add(buf) audio.add(tape) audio.add(gain)
import dlal import sys audio = dlal.Audio() sonics = [dlal.Sonic() for i in range(8)] liner = dlal.Liner() liner.load(sys.argv[1]) audio.add(liner) for sonic in sonics: sonic.i1(0, 1) sonic.o(0, 0.1) audio.add(sonic) liner.connect(sonic) sonic.connect(audio) dlal.typical_setup()