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 buffer = dlal.Buffer() lfo = dlal.Buffer() multiplier = dlal.Component('multiplier') lfo.connect(buffer) multiplier.connect(buffer) system = dlal.SimpleSystem([buffer, lfo, multiplier], outputs=[multiplier]) system.audio.connect(system.audio) buffer.clear_on_evaluate('y') lfo.lfo(system.sample_rate // 30) lfo.midi(0x90, 0, 0x40) go, ports = system.standard_system_functionality()
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) f_noise.phonetic_noise(key) for p in dlal.Fir.phonetics: commander.register_command(p, phonetic) commander.register_command('Space', phonetic) #go go, ports=system.standard_system_functionality()
peak_buffer = dlal.Buffer() output_buffer = dlal.Buffer() output_filea = dlal.Component('filea') input_filea.connect(peak_buffer) input_filea.connect(output_buffer) peak.connect(peak_buffer) multiplier.connect(peak_buffer) multiplier.connect(output_buffer) output_buffer.connect(output_filea) dlal.SimpleSystem.sample_rate = 8000 dlal.SimpleSystem.log_2_samples_per_evaluation = 12 system = dlal.SimpleSystem( [input_filea, peak, multiplier, peak_buffer, output_filea, output_buffer], midi_receivers=[], outputs=[], raw=True, ) input_filea.open_read(input_file_path) peak.invert_coefficient(1) peak.coefficient(0) peak_buffer.clear_on_evaluate('y') output_buffer.clear_on_evaluate('y') x = input_file_path.split('.') x[-1] = 'out.' + x[-1] output_filea.open_write('.'.join(x)) system.audio.duration(1000.0 * int(input_filea.samples()) / int(input_filea.sample_rate())) system.audio.set_print('y') system.audio.do_file('n')
import dlal, os filei = dlal.Component('filei') file_path = 'file.txt' if 'DLAL_REPLAY_FILE_PATH' in os.environ: file_path = os.environ['DLAL_REPLAY_FILE_PATH'] filei.name(file_path) system = dlal.SimpleSystem([filei]) go, ports = system.standard_system_functionality()
#soundfont import dlal soundfont = dlal.Component('soundfont') system = dlal.SimpleSystem([soundfont], test=True) go, ports = system.standard_system_functionality()
#lpf import dlal sonic=dlal.Sonic() lpf=dlal.Component('lpf') system=dlal.SimpleSystem([sonic, lpf], test=True) go, ports=system.standard_system_functionality()
#buffer repeat-sound and pitch-sound, multiply two signals import dlal pitcher=dlal.Buffer() buffer=dlal.Buffer() lfo=dlal.Buffer() multiplier=dlal.Component('multiplier') lfo.connect(buffer) multiplier.connect(buffer) system=dlal.SimpleSystem( [pitcher, buffer, lfo, multiplier], midi_receivers=[], outputs=[pitcher, multiplier], test=True, test_duration=1000 ) pitcher.lfo(int(system.sample_rate/8.1757989156)) pitcher.pitch_sound('y') pitcher.midi(0x90, 60, 0x40) buffer.clear_on_evaluate('y') lfo.lfo(system.sample_rate//30) lfo.midi(0x90, 0, 0x40) go, ports=system.standard_system_functionality()
#vst import dlal vst = dlal.Component('vst') system = dlal.SimpleSystem([vst], test=True) vst.load(dlal.tunefish_path()) #Travis and AppVeyor don't have screens or something... #vst.show_test(100, os.path.join(file_path, 'expected.png')) go, ports = system.standard_system_functionality()
import dlal, os soundfont=dlal.Component('soundfont') system=dlal.SimpleSystem([soundfont]) soundfont.load(os.path.join('..', '..', 'components', 'soundfont', 'deps', '32MbGMStereo.sf2')) go, ports=system.standard_system_functionality()
import dlal sonic = dlal.Sonic() lpf = dlal.Component('lpf') system = dlal.SimpleSystem([sonic, lpf]) sonic.show_controls() go, ports = system.standard_system_functionality()
#converter, sonic pitch slide import dlal lfo = dlal.Buffer() converter = dlal.Component('converter') sonic = dlal.Sonic() lfo.connect(converter) converter.connect(sonic) system = dlal.SimpleSystem([lfo, converter, sonic], outputs=[sonic], test=True) lfo.lfo(system.sample_rate) lfo.midi(0x90, 0, 0x40) sonic.control_set('m', 0, 0, 127) go, ports = system.standard_system_functionality()
#buffer, multiplier import dlal sonic = dlal.Sonic() multiplier = dlal.Component('multiplier') buffer = dlal.Component('buffer') multiplier.set(0.5) buffer.periodic_resize(256) sonic.connect(buffer) multiplier.connect(buffer) system = dlal.SimpleSystem([sonic, multiplier, buffer], outputs=[buffer], test=True) go, ports = system.standard_system_functionality()
import dlal delay = dlal.Buffer() multiplier = dlal.Component('multiplier') system = dlal.SimpleSystem([delay, multiplier], outputs=[delay]) system.audio.connect(delay) multiplier.connect(delay) delay.periodic_resize( dlal.round_up(system.sample_rate // 100, system.samples_per_evaluation)) multiplier.set('0.85') go, ports = system.standard_system_functionality()
#fir import dlal sonic = dlal.Sonic() sonic.i(0, 0, 0.25) sonic.s(0, 1) fir = dlal.Fir() fir.resize(128) fir.phonetic_voice('q') system = dlal.SimpleSystem([sonic, fir], test=True) go, ports = system.standard_system_functionality()