Skip to content

Commit

Permalink
0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-bouffier committed Apr 16, 2018
1 parent e0daa75 commit b41a194
Show file tree
Hide file tree
Showing 293 changed files with 22,176 additions and 35 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
RACK_DIR ?= ../..
SLUG = Bidoo
VERSION = 0.6.1
VERSION = 0.6.2
DISTRIBUTABLES += $(wildcard LICENSE*) res

# Static libs
Expand All @@ -19,7 +19,9 @@ $(mpg123):
cd dep/mpg123-1.25.8 && $(MAKE)
cd dep/mpg123-1.25.8 && $(MAKE) install

FLAGS += -Idep/include -I./src/dep/audiofile -I./src/dep/filters -I./src/dep/freeverb
FLAGS += -DUSE_KISS_FFT -Idep/include -I./src/dep/audiofile -I./src/dep/filters -I./src/dep/freeverb -I./src/dep/gist/libs/kiss_fft130 -I./src/dep/gist/src \
-I./src/dep/gist/src/mfcc -I./src/dep/gist/src/core -I./src/dep/gist/src/fft \
-I./src/dep/gist/src/onset-detection-functions -I./src/dep/gist/src/pitch

include $(RACK_DIR)/arch.mk

Expand All @@ -35,6 +37,8 @@ ifeq ($(ARCH), win)
LDFLAGS += -L$(RACK_DIR)/dep/lib -lcurl dep/lib/libmpg123.a -lshlwapi
endif

SOURCES = $(wildcard src/*.cpp src/dep/audiofile/*cpp src/dep/filters/*cpp src/dep/freeverb/*cpp)
SOURCES = $(wildcard src/*.cpp src/dep/audiofile/*cpp src/dep/filters/*cpp src/dep/freeverb/*cpp src/dep/gist/src/*cpp \
src/dep/gist/libs/kiss_fft130/*c src/dep/gist/src/mfcc/*cpp src/dep/gist/src/core/*cpp src/dep/gist/src/fft/*cpp \
src/dep/gist/src/onset-detection-functions/*cpp src/dep/gist/src/pitch/*cpp)

include $(RACK_DIR)/plugin.mk
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ You can find information on that plugins pack in the [wiki](https://github.com/s

## Last changes

15/04/2018 : cANARd's waveform display can zoom. Left mouse pressed => up (zoom in) & down (zoom out).
16/04/2018 :

0.6.2

cANARd's zoom by drag up and down is 10% by default and 100% when Shift is pressed. Added a transient detection tool (via menu) the threshold is set by the knob under the End Of Cycle output. Needs improvements.

15/04/2018 : cANARd's waveform display is able to zoom. Left mouse pressed => up (zoom in) & down (zoom out).

04/04/18 : A big thanks to all the people who helped and supported for the 0.6 transition. Let's make music now!!!

Expand Down
4 changes: 0 additions & 4 deletions res/CANARD.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 3 additions & 8 deletions res/CANARDtemp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Bidoo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ void init(rack::Plugin *p) {
p->addModel(modelZINC);
p->addModel(modelDFUZE);
p->addModel(modelVOID);
//p->addModel(modelLAZAGNE);
p->addModel(modelLAZAGNE);
}
2 changes: 1 addition & 1 deletion src/Bidoo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ extern Model *modelVOID;
extern Model *modelCANARD;
extern Model *modelLOURDE;
extern Model *modelDFUZE;
//extern Model *modelLAZAGNE;
extern Model *modelLAZAGNE;
46 changes: 32 additions & 14 deletions src/CANARD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <sstream> // stringstream
#include <algorithm>
#include "window.hpp"
#include "Gist.h"

using namespace std;

Expand All @@ -23,6 +24,7 @@ struct CANARD : Module {
MODE_PARAM,
SLICE_PARAM,
CLEAR_PARAM,
THRESHOLD_PARAM,
NUM_PARAMS
};
enum InputIds {
Expand Down Expand Up @@ -80,7 +82,6 @@ struct CANARD : Module {
PulseGenerator eocPulse;
std::mutex mylock;
bool newStop = false;
float transientThreshold = 0.0f;

CANARD() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {
recordBuffer.setBitDepth(16);
Expand Down Expand Up @@ -206,10 +207,6 @@ void CANARD::step() {
waveExtension = "";
}

if (transientThreshold>0.0f) {
transientThreshold = 0.0f;
}

if ((selected>=0) && (deleteFlag)) {
int nbSample=0;
if ((size_t)selected<(slices.size()-1)) {
Expand Down Expand Up @@ -441,7 +438,6 @@ struct CANARDDisplay : OpaqueWidget {
if (module->slices.size()>0) {
refX = e.pos.x;
refIdx = ((e.pos.x - zoomLeftAnchor)/zoomWidth)*(float)module->playBuffer.getNumSamplesPerChannel();
printf("%f - %f - %f\n",e.pos.x, zoomLeftAnchor, zoomWidth);
module->addSliceMarker = refIdx;
auto lower = std::lower_bound(module->slices.begin(), module->slices.end(), refIdx);
module->selected = distance(module->slices.begin(),lower-1);
Expand All @@ -463,12 +459,12 @@ struct CANARDDisplay : OpaqueWidget {
void onDragMove(EventDragMove &e) override {
float zoom = 1.0f;
if (e.mouseRel.y > 0.0f) {
zoom = 1.0f/1.1f;
zoom = 1.0f/(windowIsShiftPressed() ? 2.0f : 1.1f);
}
else if (e.mouseRel.y < 0.0f) {
zoom = 1.1f;
zoom = windowIsShiftPressed() ? 2.0f : 1.1f;
}
zoomWidth = clamp(zoomWidth*zoom,width,zoomWidth*1.1f);
zoomWidth = clamp(zoomWidth*zoom,width,zoomWidth*(windowIsShiftPressed() ? 2.0f : 1.1f));
zoomLeftAnchor = clamp(refX - (refX - zoomLeftAnchor)*zoom + e.mouseRel.x, width - zoomWidth,0.0f);
OpaqueWidget::onDragMove(e);
}
Expand Down Expand Up @@ -670,12 +666,13 @@ CANARDWidget::CANARDWidget(CANARD *module) : ModuleWidget(module) {
addParam(ParamWidget::create<BidooBlueKnob>(Vec(portX0[1]-7, 245), module, CANARD::FADE_PARAM, 0.0f, 10.0f, 0.0f));
addParam(ParamWidget::create<BidooBlueKnob>(Vec(portX0[2]-7, 245), module, CANARD::SLICE_PARAM, 0.0f, 10.0f, 0.0f));
addParam(ParamWidget::create<BlueCKD6>(Vec(portX0[3]-6, 245), module, CANARD::CLEAR_PARAM, 0.0f, 1.0f, 0.0f));
addOutput(Port::create<PJ301MPort>(Vec(portX0[4]-4, 247), Port::OUTPUT, module, CANARD::EOC_OUTPUT));

addInput(Port::create<PJ301MPort>(Vec(portX0[0]-4, 277), Port::INPUT, module, CANARD::SPEED_INPUT));
addInput(Port::create<PJ301MPort>(Vec(portX0[1]-4, 277), Port::INPUT, module, CANARD::FADE_INPUT));
addInput(Port::create<PJ301MPort>(Vec(portX0[2]-4, 277), Port::INPUT, module, CANARD::SLICE_INPUT));
addInput(Port::create<PJ301MPort>(Vec(portX0[3]-4, 277), Port::INPUT, module, CANARD::CLEAR_INPUT));
addOutput(Port::create<PJ301MPort>(Vec(portX0[4]-4, 277), Port::OUTPUT, module, CANARD::EOC_OUTPUT));
addParam(ParamWidget::create<BidooBlueTrimpot>(Vec(portX0[4]-1, 280), module, CANARD::THRESHOLD_PARAM, 0.0001f, 0.05f, 0.05f));

addParam(ParamWidget::create<CKSS>(Vec(90, 325), module, CANARD::MODE_PARAM, 0.0f, 1.0f, 0.0f));

Expand Down Expand Up @@ -713,7 +710,25 @@ struct CANARDTransientDetect : MenuItem {
CANARDWidget *canardWidget;
CANARD *canardModule;
void onAction(EventAction &e) override {
canardModule->transientThreshold = 0.3;
canardModule->slices.clear();
canardModule->slices.push_back(0);
int i = 0;
int size = 256;
Gist<float> gist = Gist<float>(size,engineGetSampleRate());
vector<float>::const_iterator first;
vector<float>::const_iterator last;
while (i+size<canardModule->playBuffer.getNumSamplesPerChannel()) {
first = canardModule->playBuffer.samples[0].begin() + i;
last = canardModule->playBuffer.samples[0].begin() + i + size;
vector<float> newVec(first, last);
gist.processAudioFrame(newVec);
if (((gist.energyDifference()/size)>canardModule->params[CANARD::THRESHOLD_PARAM].value)
&& ((gist.complexSpectralDifference()/size)>canardModule->params[CANARD::THRESHOLD_PARAM].value)
&& ((gist.zeroCrossingRate()/size)>canardModule->params[CANARD::THRESHOLD_PARAM].value)) {
canardModule->slices.push_back(i);
}
i+=size;
}
}
};

Expand Down Expand Up @@ -777,16 +792,19 @@ Menu *CANARDWidget::createContextMenu() {
addSliceItem->canardWidget = this;
addSliceItem->canardModule = canardModule;
menu->addChild(addSliceItem);
}

if (canardModule->playBuffer.getNumSamplesPerChannel()>=0) {
CANARDDeleteSliceMarker *deleteSliceItem = new CANARDDeleteSliceMarker();
deleteSliceItem->text = "Delete slice marker";
deleteSliceItem->canardWidget = this;
deleteSliceItem->canardModule = canardModule;
menu->addChild(deleteSliceItem);
}

CANARDTransientDetect *trnsientItem = new CANARDTransientDetect();
trnsientItem->text = "Search transients";
trnsientItem->canardWidget = this;
trnsientItem->canardModule = canardModule;
menu->addChild(trnsientItem);
}

spacerLabel = new MenuLabel();
menu->addChild(spacerLabel);
Expand Down
33 changes: 30 additions & 3 deletions src/LAZAGNE.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "Bidoo.hpp"
#include "BidooComponents.hpp"
#include "dsp/samplerate.hpp"
#include "dsp/ringbuffer.hpp"
#include "dsp/frame.hpp"

using namespace std;

Expand All @@ -9,6 +11,7 @@ struct LAZAGNE : Module {
NUM_PARAMS
};
enum InputIds {
INPUT,
NUM_INPUTS
};
enum OutputIds {
Expand All @@ -17,7 +20,7 @@ struct LAZAGNE : Module {
enum LightIds {
NUM_LIGHTS
};

DoubleRingBuffer<float,128> dataRingBuffer;

LAZAGNE() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {

Expand All @@ -28,18 +31,42 @@ struct LAZAGNE : Module {


void LAZAGNE::step() {

dataRingBuffer.push(inputs[INPUT].value);
if (dataRingBuffer.full()) {
dataRingBuffer.clear();
}
}

struct LAZAGNEDisplay : TransparentWidget {
LAZAGNE *module;
std::shared_ptr<Font> font;
LAZAGNEDisplay() {
font = Font::load(assetPlugin(plugin, "res/DejaVuSansMono.ttf"));
}

void draw(NVGcontext *vg) override {


}
};

struct LAZAGNEWidget : ModuleWidget {
LAZAGNEWidget(LAZAGNE *module) : ModuleWidget(module) {
setPanel(SVG::load(assetPlugin(plugin, "res/LAZAGNE.svg")));

addChild(Widget::create<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
LAZAGNEDisplay *display = new LAZAGNEDisplay();
display->module = module;
display->box.pos = Vec(12.0f, 40.0f);
display->box.size = Vec(110.0f, 70.0f);
addChild(display);

addChild(Widget::create<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
addChild(Widget::create<ScrewSilver>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));

addInput(Port::create<PJ301MPort>(Vec(25, 322), Port::INPUT, module, LAZAGNE::INPUT));

}
};

Expand Down
6 changes: 6 additions & 0 deletions src/dep/gist/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test/Build
*.xcuserstate
xcuserdata
python-module/build
max-externals/project/Build
*.xccheckout

0 comments on commit b41a194

Please sign in to comment.