Browse Source

Update to Rack API

tags/v0.6.0
Andrew Belt 7 years ago
parent
commit
ca234c523b
9 changed files with 24 additions and 29 deletions
  1. +4
    -9
      Makefile
  2. +1
    -1
      src/Braids.cpp
  3. +1
    -1
      src/Branches.cpp
  4. +4
    -4
      src/Clouds.cpp
  5. +2
    -2
      src/Elements.cpp
  6. +3
    -3
      src/Frames.cpp
  7. +4
    -4
      src/Rings.cpp
  8. +3
    -3
      src/Tides.cpp
  9. +2
    -2
      src/Warps.cpp

+ 4
- 9
Makefile View File

@@ -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

+ 1
- 1
src/Braids.cpp View File

@@ -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();


+ 1
- 1
src/Branches.cpp View File

@@ -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;


+ 4
- 4
src/Clouds.cpp View File

@@ -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);


+ 2
- 2
src/Elements.cpp View File

@@ -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);


+ 3
- 3
src/Frames.cpp View File

@@ -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();
}




+ 4
- 4
src/Rings.cpp View File

@@ -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);


+ 3
- 3
src/Tides.cpp View File

@@ -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() {


+ 2
- 2
src/Warps.cpp View File

@@ -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;
}


Loading…
Cancel
Save