Browse Source

update cbox

master
Nils 3 years ago
parent
commit
5f3c075613
  1. 1
      template/calfbox/py/nullbox.py
  2. 6
      template/calfbox/sampler.c
  3. 6
      template/calfbox/sampler_api_example2.py

1
template/calfbox/py/nullbox.py

@ -58,4 +58,3 @@ sys.modules["calfbox"] = sys.modules["calfbox.nullbox"]
import calfbox
cbox = NullCalfbox("fake cbox null client")

6
template/calfbox/sampler.c

@ -344,12 +344,10 @@ static gboolean load_program_at(struct sampler_module *m, const char *cfg_sectio
return FALSE;
if (index != -1)
{
swap_program(m, index, pgm, TRUE);
return TRUE;
}
else
sampler_register_program(m, pgm);
sampler_register_program(m, pgm);
if (ppgm)
*ppgm = pgm;
return TRUE;

6
template/calfbox/sampler_api_example2.py

@ -14,6 +14,12 @@ 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')
# 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))

Loading…
Cancel
Save