diff --git a/Makefile b/Makefile index e636d26..a64a612 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ +SLUG = AudibleInstruments +VERSION = 0.5.0 FLAGS += \ -DTEST \ -I./eurorack \ -Wno-unused-local-typedefs - SOURCES += $(wildcard src/*.cpp) SOURCES += eurorack/stmlib/utils/random.cc SOURCES += eurorack/stmlib/dsp/atan.cc @@ -47,13 +48,7 @@ SOURCES += eurorack/frames/keyframer.cc SOURCES += eurorack/frames/resources.cc SOURCES += eurorack/frames/poly_lfo.cc - -include ../../plugin.mk +DISTRIBUTABLES += $(wildcard LICENSE*) res -dist: all - mkdir -p dist/AudibleInstruments - cp LICENSE* dist/AudibleInstruments/ - cp $(TARGET) dist/AudibleInstruments/ - cp -R res dist/AudibleInstruments/ - cd dist && zip -5 -r AudibleInstruments-$(VERSION)-$(ARCH).zip AudibleInstruments +include ../../plugin.mk diff --git a/src/Braids.cpp b/src/Braids.cpp index 8d73879..388ea8a 100644 --- a/src/Braids.cpp +++ b/src/Braids.cpp @@ -163,7 +163,7 @@ void Braids::step() { for (int i = 0; i < 24; i++) { in[i].samples[0] = render_buffer[i] / 32768.0; } - src.setRatio(engineGetSampleRate() / 96000.0); + src.setRates(96000, engineGetSampleRate()); int inLen = 24; int outLen = outputBuffer.capacity(); diff --git a/src/Branches.cpp b/src/Branches.cpp index 8355872..8b93415 100644 --- a/src/Branches.cpp +++ b/src/Branches.cpp @@ -40,7 +40,7 @@ struct Branches : Module { Branches() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {} void step() override; - void reset() override { + void onReset() override { for (int i = 0; i < 2; i++) { mode[i] = false; outcome[i] = false; diff --git a/src/Clouds.cpp b/src/Clouds.cpp index 0ce210c..a1428ac 100644 --- a/src/Clouds.cpp +++ b/src/Clouds.cpp @@ -74,7 +74,7 @@ struct Clouds : Module { ~Clouds(); void step() override; - void reset() override { + void onReset() override { freeze = false; blendMode = 0; playback = clouds::PLAYBACK_MODE_GRANULAR; @@ -119,7 +119,7 @@ Clouds::Clouds() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { memset(processor, 0, sizeof(*processor)); processor->Init(block_mem, memLen, block_ccm, ccmLen); - reset(); + onReset(); } Clouds::~Clouds() { @@ -154,7 +154,7 @@ void Clouds::step() { clouds::ShortFrame input[32] = {}; // Convert input buffer { - inputSrc.setRatio(32000.0 / engineGetSampleRate()); + inputSrc.setRates(engineGetSampleRate(), 32000); Frame<2> inputFrames[32]; int inLen = inputBuffer.size(); int outLen = 32; @@ -219,7 +219,7 @@ void Clouds::step() { outputFrames[i].samples[1] = output[i].r / 32768.0; } - outputSrc.setRatio(engineGetSampleRate() / 32000.0); + outputSrc.setRates(32000, engineGetSampleRate()); int inLen = 32; int outLen = outputBuffer.capacity(); outputSrc.process(outputFrames, &inLen, outputBuffer.endData(), &outLen); diff --git a/src/Elements.cpp b/src/Elements.cpp index 80a476d..69daea0 100644 --- a/src/Elements.cpp +++ b/src/Elements.cpp @@ -140,7 +140,7 @@ void Elements::step() { // Convert input buffer { - inputSrc.setRatio(32000.0 / engineGetSampleRate()); + inputSrc.setRates(engineGetSampleRate(), 32000); Frame<2> inputFrames[16]; int inLen = inputBuffer.size(); int outLen = 16; @@ -191,7 +191,7 @@ void Elements::step() { outputFrames[i].samples[1] = aux[i]; } - outputSrc.setRatio(engineGetSampleRate() / 32000.0); + outputSrc.setRates(32000, engineGetSampleRate()); int inLen = 16; int outLen = outputBuffer.capacity(); outputSrc.process(outputFrames, &inLen, outputBuffer.endData(), &outLen); diff --git a/src/Frames.cpp b/src/Frames.cpp index 8cc0969..5f9a575 100644 --- a/src/Frames.cpp +++ b/src/Frames.cpp @@ -117,7 +117,7 @@ struct Frames : Module { } } - void reset() override { + void onReset() override { poly_lfo_mode = false; keyframer.Clear(); for (int i = 0; i < 4; i++) { @@ -125,7 +125,7 @@ struct Frames : Module { keyframer.mutable_settings(i)->response = 0; } } - void randomize() override { + void onRandomize() override { // TODO // Maybe something useful should go in here? } @@ -138,7 +138,7 @@ Frames::Frames() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { memset(&poly_lfo, 0, sizeof(poly_lfo)); poly_lfo.Init(); - reset(); + onReset(); } diff --git a/src/Rings.cpp b/src/Rings.cpp index 1bcc96c..8a24dac 100644 --- a/src/Rings.cpp +++ b/src/Rings.cpp @@ -97,12 +97,12 @@ struct Rings : Module { } } - void reset() override { + void onReset() override { polyphonyMode = 0; model = rings::RESONATOR_MODEL_MODAL; } - void randomize() override { + void onRandomize() override { polyphonyMode = randomu32() % 3; model = (rings::ResonatorModel) (randomu32() % 3); } @@ -155,7 +155,7 @@ void Rings::step() { float in[24] = {}; // Convert input buffer { - inputSrc.setRatio(48000.0 / engineGetSampleRate()); + inputSrc.setRates(engineGetSampleRate(), 48000); int inLen = inputBuffer.size(); int outLen = 24; inputSrc.process(inputBuffer.startData(), &inLen, (Frame<1>*) in, &outLen); @@ -223,7 +223,7 @@ void Rings::step() { outputFrames[i].samples[1] = aux[i]; } - outputSrc.setRatio(engineGetSampleRate() / 48000.0); + outputSrc.setRates(48000, engineGetSampleRate()); int inLen = 24; int outLen = outputBuffer.capacity(); outputSrc.process(outputFrames, &inLen, outputBuffer.endData(), &outLen); diff --git a/src/Tides.cpp b/src/Tides.cpp index 508c6f8..54f4a2b 100644 --- a/src/Tides.cpp +++ b/src/Tides.cpp @@ -57,13 +57,13 @@ struct Tides : Module { void step() override; - void reset() override { + void onReset() override { generator.set_range(tides::GENERATOR_RANGE_MEDIUM); generator.set_mode(tides::GENERATOR_MODE_LOOPING); sheep = false; } - void randomize() override { + void onRandomize() override { generator.set_range((tides::GeneratorRange) (randomu32() % 3)); generator.set_mode((tides::GeneratorMode) (randomu32() % 3)); } @@ -101,7 +101,7 @@ Tides::Tides() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { memset(&generator, 0, sizeof(generator)); generator.Init(); generator.set_sync(false); - reset(); + onReset(); } void Tides::step() { diff --git a/src/Warps.cpp b/src/Warps.cpp index 1c1b0ff..af5932d 100644 --- a/src/Warps.cpp +++ b/src/Warps.cpp @@ -58,12 +58,12 @@ struct Warps : Module { } } - void reset() override { + void onReset() override { warps::Parameters *p = modulator.mutable_parameters(); p->carrier_shape = 0; } - void randomize() override { + void onRandomize() override { warps::Parameters *p = modulator.mutable_parameters(); p->carrier_shape = randomu32() % 4; }