dunland / muscle Goto Github PK
View Code? Open in Web Editor NEWenhancing my drumset to trigger samples + FX with piezo mics and a teensy
enhancing my drumset to trigger samples + FX with piezo mics and a teensy
aber nur ohne wackel!
Rename Score class to Songs, maybe, and make them non-static! this will simplify the addition of new songs.
ARPs müssen am Ende von RandomSelect Song gestoppt werden!
//TODO: setup(){} should be bool-function that automatically turns itself off!
instrument->set_effect(tapTempo, 5000);
Tabellarische Textdateien sollen score-steps aufbauen.
Score-assignment as follows:
Beispielfunktionen:
song1.set_instr(instr, step, function); // (set step X of instrument Y to function Z)
song1.set_goal(variable, threshold); // when reaching threshold, proceed to next step
... öffnet Menü:
INSTR | THRESH | CROSSINGS | DELAY |
---|---|---|---|
snare | 50 | 100 | 20 |
push: toggle edit mode
turn: either scroll or change val
hold: leave menu
Alle songs sollten individuell programmierbare tidyUp functions haben, sodass z.b. in RandomSelect #23 am Ende die Arps ausgestellt werden können oder bei alhambra das TouchPad Off
there should be a vector of event listeners for the pushbutton. modes, instruments etc should be able to create a listener with a callback function.
e.g. calibration mode can use pushButtonHold to call sth like ascend_menu, while running mode would do save_cc_allocation oder so
like so:
Instruments.h:
// sensitivity and instrument calibration
struct SENSITIVITY
{
int threshold;
int crossings;
int noiseFloor;
int countTimeAfterStroke = 10;
int timeOutAfterLastHit = 500;
} sensitivity;
struct TIMING
{
volatile unsigned long lastPinActiveTime;
volatile unsigned long firstPinActiveTime;
unsigned long lastPinActiveTimeCopy;
unsigned long firstPinActiveTimeCopy;
unsigned long lastHitMillis = 0;
boolean countAfterFirstStroke = false; // start counting after first threshold crossing or using countTimeAfterStroke
...
Instruments.cpp:
bool Instrument::stroke_detected()
{
noInterrupts();
timing.lastPinActiveTimeCopy = timing.lastPinActiveTime;
timing.firstPinActiveTimeCopy = timing.firstPinActiveTime;
interrupts();
boolean stroke_criterion = false;
if (!timing.countAfterFirstStroke && millis() > timing.lastPinActiveTimeCopy + sensitivity.countTimeAfterStroke) // get counts for X ms after LAST hit
stroke_criterion = true;
if (timing.countAfterFirstStroke && millis() > timing.firstPinActiveTimeCopy + sensitivity.countTimeAfterStroke) // get counts for X ms after FIRST hit ??
stroke_criterion = true;
if (stroke_criterion)
{
static int countsCopy;
noInterrupts();
countsCopy = timing.counts;
timing.counts = 0;
interrupts();
// ---------------------------- found significant count!
if (countsCopy >= sensitivity.crossings)
{
return true;
}
else // timing ok but no significant counts
{
return false;
}
}
else // not enough millis elapsed yet
{
{
return false;
}
}
}
unfortunately, with this implementation, the machine seems to "remember" strokes that have been detected in the meantime and runs the trigger function right after the timeOut hast elapsed..
...maybe generally provide presets for the different types?
Display shall show which MIDI-Channels are altered!
So lässt sich besser nachvollziehen, was gerade intern abgeht
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.