Sampled Instrument Player with static and monolithic design. All instruments are built-in.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

from calfbox import cbox
def cmd_dumper(cmd, fb, args):
print ("%s(%s)" % (cmd, ",".join(list(map(repr,args)))))
cbox.init_engine()
cbox.start_audio(cmd_dumper)
global Document
Document = cbox.Document
scene = Document.get_scene()
scene.clear()
instrument = scene.add_new_instrument_layer("test_sampler", "sampler").get_instrument()
pgm_no = instrument.engine.get_unused_program()
pgm = instrument.engine.load_patch_from_file(pgm_no, 'synthbass.sfz', 'SynthBass')
3 years ago
# This is not needed, it's here to test for a bug where reloading a program at
# the same slot didn't return the newly loaded program object.
pgm = instrument.engine.load_patch_from_file(pgm_no, 'synthbass.sfz', 'SynthBass')
assert pgm
instrument.engine.set_patch(1, pgm_no)
print (instrument.engine.get_patches())
print (instrument.get_output_slot(0))
print (instrument.get_output_slot(0).status())
instrument.get_output_slot(0).set_insert_engine("reverb")
print (instrument.get_output_slot(0).status())
instrument.get_output_slot(0).engine.cmd("/wet_amt", None, 1.0)
for i in pgm.get_global().get_children()[0].get_children():
print ("<group>", i.as_string())
for j in i.get_children():
print ("<region>", j.as_string())
print("Ready!")
while True:
cbox.call_on_idle(cmd_dumper)