Oops, don't enable timestretching on all samples by default.
[calfbox.git] / sampler_api_example4.py
blob38cb8f3b27948dc0ad2842a4a0062df68870e3ed
1 from calfbox import cbox
3 def cmd_dumper(cmd, fb, args):
4 print ("%s(%s)" % (cmd, ",".join(list(map(repr,args)))))
6 cbox.init_engine()
7 cbox.start_audio(cmd_dumper)
9 global Document
10 Document = cbox.Document
12 scene = Document.get_scene()
13 scene.clear()
14 instrument = scene.add_new_instrument_layer("test_sampler", "sampler").get_instrument()
15 pgm_no = instrument.engine.get_unused_program()
16 pgm = instrument.engine.load_patch_from_tar(pgm_no, 'sonatina.sbtar', 'Brass - Horn Solo.sfz', 'HornSolo')
17 pgm.add_control_init(7, 127)
18 pgm.add_control_init(10, 0)
19 print (pgm.load_file('Brass - Horn Solo.sfz').readlines())
20 print (pgm.status())
21 print (list(pgm.get_control_inits()))
22 instrument.engine.set_patch(1, pgm_no)
24 print("Ready!")
26 while True:
27 cbox.call_on_idle(cmd_dumper)