Merge branch 'MusicallyEmbodiedML:main' into main
This commit is contained in:
commit
e12eaab9cb
28 changed files with 1957 additions and 467 deletions
|
|
@ -9,7 +9,6 @@
|
|||
#include <memory> // Added for std::shared_ptr
|
||||
|
||||
#include "src/memllib/synth/maxiPAF.hpp"
|
||||
#include "src/memllib/synth/ADSRLite.hpp"
|
||||
#include "src/memllib/interface/InterfaceBase.hpp" // Added missing include
|
||||
|
||||
#include <span>
|
||||
|
|
@ -132,294 +131,6 @@ private:
|
|||
// float runningRMS=0;
|
||||
// };
|
||||
|
||||
class maxiDynamicsLite {
|
||||
|
||||
public:
|
||||
|
||||
enum ANALYSERS {PEAK, RMS};
|
||||
|
||||
static constexpr float maxRMSSizeMS = 300.f;
|
||||
|
||||
maxiDynamicsLite() {
|
||||
//define detector functions
|
||||
inputPeak = [](float sig) {
|
||||
return abs(sig);
|
||||
};
|
||||
|
||||
rms.setup(maxRMSSizeMS,300);
|
||||
inputRMS = [&](float sig) {
|
||||
return rms.play(sig);
|
||||
};
|
||||
|
||||
//default RMS
|
||||
inputAnalyser = inputRMS;
|
||||
|
||||
//setup envelopes
|
||||
arEnvHigh.setup(10,0,1.f,10.f, maxiSettings::sampleRate);
|
||||
arEnvLow.setup(10,0,1.f,10.f, maxiSettings::sampleRate);
|
||||
|
||||
lookAheadDelay.setup(maxiSettings::sampleRate * 0.1); //max 0.1s
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This functions compands the signal, providing download compression or upward expansion above an upper thresold, and
|
||||
* upward compression or downward expansion below a lower threshold.
|
||||
* \param sig The input signal to be companded
|
||||
* \param control This signal is used to trigger the compander. Use it for sidechaining, or if no sidechain is needed, use the same signal for this and the input signal
|
||||
* \param thresholdHigh The high threshold, in Dbs
|
||||
* \param ratioHigh The ratio for companding above the high threshold
|
||||
* \param kneeHigh The size of the knee for companding above the high threshold (in Dbs)
|
||||
* \param thresholdLow The low threshold, in Dbs
|
||||
* \param ratioLow The ratio for companding below the low threshold
|
||||
* \param kneeLow The size of the knee for companding below the low threshold (in Dbs)
|
||||
* \returns a companded signal
|
||||
*/
|
||||
__attribute__((always_inline)) __attribute__((hot)) float play(float sig, float control,
|
||||
float thresholdHigh, float ratioHigh, float kneeHigh,
|
||||
float thresholdLow, float ratioLow, float kneeLow
|
||||
) {
|
||||
const float inputEnv = inputAnalyser(control) + 0.00001f; //avoid log of zero
|
||||
const float controlDB = maxiConvert::ampToDbs(inputEnv);
|
||||
float outDB = controlDB;
|
||||
const float halfKneeHigh = kneeHigh * 0.5f;
|
||||
//companding above the high threshold
|
||||
if (ratioHigh > 0) {
|
||||
if (kneeHigh > 0) {
|
||||
float lowerKnee = thresholdHigh - (kneeHigh*0.5f);
|
||||
float higherKnee = thresholdHigh +(kneeHigh*0.5f);
|
||||
//attack/release
|
||||
float envRatio = 1.f;
|
||||
if (controlDB >= lowerKnee) {
|
||||
arEnvHigh.triggerIfReady(1.f);
|
||||
float envVal = arEnvHigh.play();
|
||||
envRatio = envToRatio(envVal, ratioHigh);
|
||||
}else {
|
||||
arEnvHigh.release();
|
||||
}
|
||||
if ((controlDB >= lowerKnee) && (controlDB < higherKnee)) {
|
||||
float kneeHighOut = ((higherKnee - thresholdHigh) / envRatio) + thresholdHigh;
|
||||
float kneeRange = (kneeHighOut - lowerKnee);
|
||||
float t = (controlDB - lowerKnee) / kneeHigh;
|
||||
//bezier on x only
|
||||
float curve = ratioHigh > 1.f ? 0.8f : 0.2f;
|
||||
float kneex = (2.f * (1.f-t) * t * curve) + (t*t);
|
||||
outDB = lowerKnee + (kneex * kneeRange);
|
||||
}
|
||||
else if (controlDB >= higherKnee) {
|
||||
outDB = ((controlDB - thresholdHigh) / envRatio) + thresholdHigh;
|
||||
}else{
|
||||
outDB = controlDB;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//no knee
|
||||
if (controlDB > thresholdHigh) {
|
||||
arEnvHigh.trigger(1.f);
|
||||
}else {
|
||||
arEnvHigh.release();
|
||||
}
|
||||
float envVal = arEnvHigh.play();
|
||||
// const float envVal = arEnvHigh.play(controlDB > thresholdHigh ? 1.f : 0.f);
|
||||
const float envRatio = envToRatio(envVal, ratioHigh);
|
||||
outDB = ((controlDB - thresholdHigh) / envRatio) + thresholdHigh;
|
||||
|
||||
}
|
||||
}
|
||||
// //companding below the low threshold
|
||||
// if (ratioLow > 0) {
|
||||
// if (kneeLow > 0) {
|
||||
// float lowerKnee = thresholdLow - (kneeLow*0.5f);
|
||||
// float higherKnee = thresholdLow +(kneeLow*0.5f);
|
||||
// //attack/release
|
||||
// float envRatio = 1;
|
||||
// if (controlDB < lowerKnee) {
|
||||
// float envVal = arEnvLow.play(1.f);
|
||||
// envRatio = envToRatio(envVal, ratioLow);
|
||||
// }else {
|
||||
// float envVal = arEnvLow.play(-1.f);
|
||||
// }
|
||||
// if ((controlDB >= lowerKnee) && (controlDB < higherKnee)) {
|
||||
// float kneeLowOut = thresholdLow - ((thresholdLow-lowerKnee) / ratioLow);
|
||||
// float kneeRange = (higherKnee - kneeLowOut);
|
||||
// float t = (controlDB - lowerKnee) / kneeLow;
|
||||
// //bezier on x only
|
||||
// float curve = ratioLow > 1.f ? 0.2f : 0.8f;
|
||||
// float kneex = (2.f * (1.f-t) * t * curve) + (t*t);
|
||||
// outDB = kneeLowOut + (kneex * kneeRange);
|
||||
// }
|
||||
// else if (controlDB < lowerKnee) {
|
||||
// outDB = thresholdLow - ((thresholdLow-controlDB) / ratioLow);
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// //no knee
|
||||
// if (controlDB < thresholdLow) {
|
||||
// float envVal = arEnvLow.play(1.f);
|
||||
// // float envRatio = envToRatio(envVal, ratioLow);
|
||||
// outDB = thresholdLow - ((thresholdLow-controlDB) / ratioLow);
|
||||
// }else {
|
||||
// float envVal = arEnvLow.play(-1.f);
|
||||
// outDB = maxiConvert::ampToDbs(fabsf(sig));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//scale the signal according to the amount of compansion on the control signal
|
||||
float outAmp = maxiConvert::dbsToAmp(outDB);
|
||||
// float ctrlAmp = maxiConvert::dbsToAmp(controlDB);
|
||||
float sigOut = sig;
|
||||
if (outAmp > 0.f) {
|
||||
if (lookAheadSize > 0.f) {
|
||||
lookAheadDelay.push(sig);
|
||||
sigOut = lookAheadDelay.tail(lookAheadSize);
|
||||
}
|
||||
// sigOut = sigOut * fabsf(control / outAmp);
|
||||
float gainReduction = outAmp / inputEnv;
|
||||
sigOut = sig * gainReduction;
|
||||
// PERIODIC_DEBUG(1000,
|
||||
// Serial.printf("%f %f %f %f %f\n",controlDB, outDB, control, outAmp, gainReduction);
|
||||
// )
|
||||
}else{
|
||||
// printf("Warning: maxiDynamicsLite output amplitude is zero or negative!\n");
|
||||
}
|
||||
return sigOut;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compress a signal (using downward compression)
|
||||
* \param sig The input signal to be compressed
|
||||
* \param threshold The threshold, in Dbs
|
||||
* \param ratio The compression ratio (>1 provides compression, <1 provides expansion)
|
||||
* \param knee The size of the knee (in Dbs)
|
||||
* \returns a compressed signal
|
||||
*/
|
||||
__attribute__((always_inline)) __attribute__((hot)) float compress(float sig, float threshold, float ratio, float knee) {
|
||||
return play(sig, sig, threshold, ratio, knee, 0.f, 0.f, 0.f);
|
||||
}
|
||||
/**
|
||||
* Compress a signal with sidechaining (using downward compression)
|
||||
* \param sig The input signal to be compressed
|
||||
* \param control The sidechain signal
|
||||
* \param threshold The threshold, in Dbs
|
||||
* \param ratio The compression ratio (>1 provides compression, <1 provides expansion)
|
||||
* \param knee The size of the knee (in Dbs)
|
||||
* \returns a compressed signal
|
||||
*/
|
||||
float sidechainCompress(float sig, float control, float threshold, float ratio, float knee) {
|
||||
return play(sig, control, threshold, ratio, knee, 0, 0, 0);
|
||||
}
|
||||
/**
|
||||
* Compand a signal, using detection above a threshold (provides downward compression or upward expansion)
|
||||
* \param sig The input signal to be compressed
|
||||
* \param control The sidechain signal
|
||||
* \param threshold The threshold, in Dbs
|
||||
* \param ratio The compression ratio (>1 provides compression, <1 provides expansion)
|
||||
* \param knee The size of the knee (in Dbs)
|
||||
* \returns a companded signal
|
||||
*/
|
||||
float compandAbove(float sig, float control, float threshold, float ratio, float knee) {
|
||||
return play(sig, control, threshold, ratio, knee, 0, 0, 0);
|
||||
}
|
||||
/**
|
||||
* Compand a signal, using detection below a threshold (provides upward compression or downward expansion)
|
||||
* \param sig The input signal to be compressed
|
||||
* \param control The sidechain signal
|
||||
* \param threshold The threshold, in Dbs
|
||||
* \param ratio The compression ratio (>1 provides compression, <1 provides expansion)
|
||||
* \param knee The size of the knee (in Dbs)
|
||||
* \returns a companded signal
|
||||
*/
|
||||
float compandBelow(float sig, float control, float threshold, float ratio, float knee) {
|
||||
return play(sig, control, 0, 0, 0, threshold, ratio, knee);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the attack time for the high threshold. This is the amount of time over which the ratio moves from 1 to its full value, following the input analyser going over the threshold.
|
||||
* \param attack The attack time (in milliseconds)
|
||||
*/
|
||||
__attribute__((always_inline)) void setAttackHigh(float attack) {
|
||||
arEnvHigh.setAttackTime(attack, maxiSettings::sampleRate);
|
||||
}
|
||||
/**
|
||||
* Set the release time for the high threshold. This is the amount of time over which the ratio moves from its full value to 1, following the input analyser going under the threshold.
|
||||
* \param release The release time (in milliseconds)
|
||||
*/
|
||||
__attribute__((always_inline)) void setReleaseHigh(float release) {
|
||||
arEnvHigh.setReleaseTime(release, maxiSettings::sampleRate);
|
||||
}
|
||||
/**
|
||||
* Set the attack time for the low threshold. This is the amount of time over which the ratio moves from 1 to its full value, following the input analyser going under the threshold.
|
||||
* \param attack The attack time (in milliseconds)
|
||||
*/
|
||||
__attribute__((always_inline)) void setAttackLow(float attack) {
|
||||
arEnvLow.setAttackTime(attack, maxiSettings::sampleRate);
|
||||
}
|
||||
/**
|
||||
* Set the release time for the low threshold. This is the amount of time over which the ratio moves from its full value to 1, following the input analyser going over the threshold.
|
||||
* \param release The release time (in milliseconds)
|
||||
*/
|
||||
__attribute__((always_inline)) void setReleaseLow(float release) {
|
||||
arEnvLow.setReleaseTime(release, maxiSettings::sampleRate);
|
||||
}
|
||||
|
||||
/**
|
||||
* The look ahead creates a delay on the input signal, meaning that that the signal is compressed according to event that have already happened in the control signal. This can be useful for limiting and catching fast transients.
|
||||
* \param length The amount of time the compressor looks ahead (in milliseconds)
|
||||
*/
|
||||
void setLookAhead(float length) {
|
||||
lookAheadSize = maxiConvert::msToSamps(length);
|
||||
lookAheadSize = std::min(lookAheadSize, lookAheadDelay.size());
|
||||
}
|
||||
/**
|
||||
* \returns the look ahead time (in milliseconds)
|
||||
*/
|
||||
float getLookAhead() {
|
||||
return maxiConvert::sampsToMs(lookAheadSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the size of the RMS window. Longer times give a slower response
|
||||
* \param winSize The size of the window (in milliseconds)
|
||||
*/
|
||||
void setRMSWindowSize(float winSize) {
|
||||
rms.setWindowSize(std::min(winSize, maxRMSSizeMS));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the method by which the compressor analyses the control input
|
||||
* \mode maxiDynamics::PEAK for peak analysis, maxiDynamics::RMS for rms analysis
|
||||
*/
|
||||
void setInputAnalyser(ANALYSERS mode) {
|
||||
if (mode == PEAK) {
|
||||
inputAnalyser = inputPeak;
|
||||
}else{
|
||||
inputAnalyser = inputRMS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
ADSRLite arEnvHigh, arEnvLow;
|
||||
maxiRingBuf lookAheadDelay;
|
||||
size_t lookAheadSize = 0;
|
||||
maxiRMS rms;
|
||||
std::function<float(float)> inputPeak;
|
||||
std::function<float(float)> inputRMS;
|
||||
std::function<float(float)> inputAnalyser;
|
||||
// maxiPoll poll;
|
||||
|
||||
//mapping from attack/release envelope to ratio
|
||||
inline float envToRatio(float envVal, float ratio) {
|
||||
float envRatio = 1.f;
|
||||
if (ratio > 1.f) {
|
||||
envRatio = 1.f + ((ratio-1.f) * envVal);
|
||||
}else {
|
||||
envRatio = 1.f - ((1.f-ratio) * envVal);
|
||||
}
|
||||
return envRatio;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
template<size_t NPARAMS=24>
|
||||
|
|
|
|||
|
|
@ -31,16 +31,18 @@
|
|||
#include "modes/MEMLNautModeBreakOr.hpp"
|
||||
#include "modes/MEMLNautModeVerbFX.hpp"
|
||||
#include "modes/MEMLNautModeElysiamorfs.hpp"
|
||||
#include "modes/MEMLNautModeMEMLCelium.hpp"
|
||||
|
||||
//hook up the memlnaut mode
|
||||
|
||||
// #define MEMLNAUT_MODE_TYPE MEMLNautModeSoundAnalysisMIDI
|
||||
// #define MEMLNAUT_MODE_TYPE MEMLNautModeXIASRI
|
||||
#define MEMLNAUT_MODE_TYPE MEMLNautModeVerbFX
|
||||
// #define MEMLNAUT_MODE_TYPE MEMLNautModeVerbFX
|
||||
// #define MEMLNAUT_MODE_TYPE MEMLNautModeBreakOr
|
||||
// #define MEMLNAUT_MODE_TYPE MEMLNautModeElysiamorfs
|
||||
// #define MEMLNAUT_MODE_TYPE MEMLNautModeChannelStrip
|
||||
// #define MEMLNAUT_MODE_TYPE MEMLNautModePAFSynth
|
||||
#define MEMLNAUT_MODE_TYPE MEMLNautModeMEMLCelium
|
||||
|
||||
MEMLNAUT_MODE_TYPE AUDIO_MEM MEMLNautModeHub;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory> // Added for std::shared_ptr
|
||||
#include <memory>
|
||||
|
||||
#include "../../src/memllib/interface/InterfaceBase.hpp"
|
||||
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
#include "../../voicespaces/VoiceSpaces.hpp"
|
||||
|
||||
#include "RatioSeq.hpp"
|
||||
#include "RatioSeqEngine.hpp"
|
||||
|
||||
|
||||
template<size_t NPARAMS=56, size_t NSEQUENCES=8>
|
||||
|
|
@ -37,11 +38,12 @@ public:
|
|||
MIDI_CLOCK
|
||||
} sequencerClockMode = INTERNAL;
|
||||
|
||||
|
||||
bool sequencerPlaying = false;
|
||||
|
||||
std::shared_ptr<MIDIInOut> midiIO;
|
||||
|
||||
RatioSeqEngine<NSEQUENCES> seqEngine;
|
||||
|
||||
std::array<VoiceSpace<NPARAMS>, nVoiceSpaces> voiceSpaces;
|
||||
|
||||
VoiceSpaceFn<NPARAMS> currentVoiceSpace;
|
||||
|
|
@ -61,7 +63,6 @@ public:
|
|||
}
|
||||
|
||||
BreakOrAudioApp() : AudioAppBase<NPARAMS>() {
|
||||
// currentVoiceSpace = voiceSpaces[0].mappingFunction;
|
||||
queue_init(&bpmQueue, sizeof(float), 1);
|
||||
queue_init(&sequencerControlQueue, sizeof(int), 1);
|
||||
queue_init(&i2cOutQueue, sizeof(float) * 8, 1);
|
||||
|
|
@ -70,7 +71,6 @@ public:
|
|||
|
||||
bool __force_inline euclidean(float phase, const size_t n, const size_t k, const size_t offset, const float pulseWidth)
|
||||
{
|
||||
// Euclidean function
|
||||
const float fi = phase * n;
|
||||
int i = static_cast<int>(fi);
|
||||
const float rem = fi - i;
|
||||
|
|
@ -86,54 +86,30 @@ public:
|
|||
{
|
||||
if (sequencerPlaying) {
|
||||
if (sequencerClockMode == INTERNAL){
|
||||
midiClockPhasor += midiClockPhasorInc;
|
||||
if (midiClockPhasor >= 1.f) {
|
||||
midiClockPhasor -= 1.f;
|
||||
seqEngine.midiClockPhasor += seqEngine.midiClockPhasorInc;
|
||||
if (seqEngine.midiClockPhasor >= 1.f) {
|
||||
seqEngine.midiClockPhasor -= 1.f;
|
||||
midiIO->queueClock();
|
||||
midiIO->flushQueue();
|
||||
}
|
||||
}
|
||||
if (sequencingSampleCounter==0) {
|
||||
|
||||
barPhasor += barPhasorInc;
|
||||
if (barPhasor >= 1.f) {
|
||||
barPhasor -= 1.f;
|
||||
}
|
||||
if (sequencerClockMode == MIDI_CLOCK) {
|
||||
int phasorResetValue=0;
|
||||
if (queue_try_remove(&barPhaseResetQueue, &phasorResetValue)) {
|
||||
barPhasor = 0.f;
|
||||
seqEngine.resetBar();
|
||||
}
|
||||
}
|
||||
int i2cIdx=0;
|
||||
for(auto &seq: ratioSeqStates) {
|
||||
//update phasor
|
||||
float seqPhasor = barPhasor * seq.phasorMul;
|
||||
seqPhasor = fmodf(seqPhasor + seq.phaseOffset, 1.f); // Wrap phasor to [0,1]
|
||||
|
||||
bool trig = ratioSeq<3>(seqPhasor, seq.phaseOffset, seq.ratioSum, seq.ratios, seq.pulseWidth);
|
||||
bool highAmp = ratioSeq<2>(seqPhasor, seq.phaseOffset, seq.ampRatioSum, seq.ampRatios, 0.5f);
|
||||
if (trig && !seq.lastTrig) {
|
||||
if (trig) {
|
||||
midiIO->queueNoteOn(seq.midiNote, highAmp ? 127 : 64);
|
||||
}else{
|
||||
midiIO->queueNoteOff(seq.midiNote, 0);
|
||||
}
|
||||
}
|
||||
seq.lastTrig = trig;
|
||||
i2cValues[i2cIdx++] = trig;
|
||||
if (seqEngine.tick()) {
|
||||
// Capture trigger state for I2C after tick
|
||||
for (size_t i = 0; i < NSEQUENCES; i++) {
|
||||
i2cValues[i] = seqEngine.states[i].lastTrig;
|
||||
}
|
||||
midiIO->flushQueue();
|
||||
queue_try_add(&i2cOutQueue, &i2cValues);
|
||||
}
|
||||
|
||||
sequencingSampleCounter ++;
|
||||
if (sequencingSampleCounter >= sequencingSampleDiv) {
|
||||
sequencingSampleCounter = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
stereosample_t ret { 0.f,0.f };
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -144,12 +120,21 @@ public:
|
|||
maxiSettings::sampleRate = sample_rate;
|
||||
sampleRatef = static_cast<float>(sample_rate);
|
||||
sequencerClockMode = clockMode;
|
||||
updateBPM(90.f);
|
||||
const size_t midiNotes[NSEQUENCES] = {36,37,38,39,40, 42,43,45/*,47,48*/};
|
||||
size_t midiNote = 0;
|
||||
for(auto &seq: ratioSeqStates) {
|
||||
seq.midiNote = midiNotes[midiNote++];
|
||||
|
||||
const size_t midiNotes[NSEQUENCES] = {36,37,38,39,40, 42,43,45};
|
||||
for (size_t i = 0; i < NSEQUENCES; i++) {
|
||||
seqEngine.states[i].midiNote = midiNotes[i];
|
||||
}
|
||||
|
||||
seqEngine.setup(sample_rate);
|
||||
seqEngine.updateBPM(90.f);
|
||||
|
||||
seqEngine.onNoteOn = [this](size_t seqIdx, int velocity) {
|
||||
midiIO->queueNoteOn(seqEngine.states[seqIdx].midiNote, velocity);
|
||||
};
|
||||
seqEngine.onNoteOff = [this](size_t seqIdx) {
|
||||
midiIO->queueNoteOff(seqEngine.states[seqIdx].midiNote, 0);
|
||||
};
|
||||
}
|
||||
|
||||
void setupMIDI(std::shared_ptr<MIDIInOut> new_midi_interf) {
|
||||
|
|
@ -162,105 +147,37 @@ public:
|
|||
|
||||
void ProcessParams(const std::array<float, NPARAMS>& params)
|
||||
{
|
||||
// if (sequencerPlaying) {
|
||||
// }
|
||||
firstParamsReceived = true;
|
||||
if (queue_try_remove(&bpmQueue, &bpm)) {
|
||||
// bpm = 30.f + (bpm * 200.f); // Scale BPM from [0,1] to [30,230]
|
||||
updateBPM(bpm);
|
||||
float newBPM;
|
||||
if (queue_try_remove(&bpmQueue, &newBPM)) {
|
||||
seqEngine.updateBPM(newBPM);
|
||||
}
|
||||
int sequencerControl;
|
||||
if (queue_try_remove(&sequencerControlQueue, &sequencerControl)) {
|
||||
sequencerPlaying = sequencerControl == 1;
|
||||
seqEngine.setPlaying(sequencerPlaying);
|
||||
if (!sequencerPlaying) {
|
||||
midiIO->queueClockStop();
|
||||
// Send note offs for all sequences when stopping
|
||||
for(auto &seq: ratioSeqStates) {
|
||||
midiIO->queueNoteOff(seq.midiNote, 0);
|
||||
seq.phasor = 0.f; // Reset phasor to start when stopping
|
||||
}
|
||||
midiIO->flushQueue();
|
||||
midiClockPhasor = 0.f; // Reset MIDI clock phasor when stopping
|
||||
sequencingSampleCounter = 0; // Reset sequencing sample counter
|
||||
|
||||
} else {
|
||||
midiIO->queueClockStart();
|
||||
midiIO->flushQueue();
|
||||
}
|
||||
Serial.printf("Sequencer %s\n", sequencerPlaying ? "Playing" : "Stopped");
|
||||
}
|
||||
// currentVoiceSpace(params);
|
||||
size_t paramIdx = 0;
|
||||
for(auto &v: ratioSeqStates) {
|
||||
float sum=0.f;
|
||||
for(size_t i=0; i < v.ratios.size(); i++) {
|
||||
v.ratios[i] = (float)(int)(params[paramIdx++] * 3.f) + 1.f;
|
||||
sum += v.ratios[i];
|
||||
}
|
||||
v.ratioSum = sum;
|
||||
// static float muls[7] = {0.25f, 0.33f, 0.5f, 1.f, 1.5f, 2.f, 3.f};
|
||||
// v.phasorMul = muls[(int)(params[paramIdx++] * 6.999999f)];
|
||||
static float muls[4] = {1.f, 2.f, 4.f, 8.f};
|
||||
v.phasorMul = muls[(int)(params[paramIdx++] * 3.999999f)];
|
||||
v.phaseOffset = ((int)(params[paramIdx++] * timeSigBeats)) * timeSigBeatsInv;
|
||||
|
||||
sum=0.f;
|
||||
for(size_t i=0; i < v.ampRatios.size(); i++) {
|
||||
v.ampRatios[i] = (float)(int)(params[paramIdx++] * 3.f) + 1.f;
|
||||
sum += v.ampRatios[i];
|
||||
}
|
||||
v.ampRatioSum = sum;
|
||||
}
|
||||
// Serial.printf("pm: %f", ratioSeqStates[0].phasorMul);
|
||||
|
||||
}
|
||||
|
||||
void updateBPM(float newBPM) {
|
||||
bpm = newBPM;
|
||||
float beatLengthInSeconds = 60.f / bpm;
|
||||
float barLengthInSeconds = beatLengthInSeconds * timeSigBeats;
|
||||
float barLengthInSamples = barLengthInSeconds * (sampleRatef/ sequencingSampleDiv);
|
||||
barPhasorInc = 1.f/ barLengthInSamples;
|
||||
// for(auto &v: ratioSeqStates) {
|
||||
// v.phasorInc = barPhasorInc;
|
||||
// }
|
||||
float midiClockLengthInSeconds = beatLengthInSeconds / 24.f;
|
||||
float midiClockLengthInSamples = midiClockLengthInSeconds * sampleRatef;
|
||||
midiClockPhasorInc = 1.f / midiClockLengthInSamples;
|
||||
seqEngine.updateParams(params, 0);
|
||||
}
|
||||
|
||||
void setTimeSignature(float beats, float division) {
|
||||
timeSigBeats = beats;
|
||||
timeSigDivision = division;
|
||||
updateBPM(bpm); // Recalculate phasor increment with new time signature
|
||||
seqEngine.setTimeSignature(beats, division);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
float i2cValues[8] = {0,0,0,0,0,0,0,0};
|
||||
|
||||
float sampleRatef;
|
||||
bool firstParamsReceived = false;
|
||||
|
||||
float bpm=90.f;
|
||||
float timeSigBeats=4.f;
|
||||
float timeSigBeatsInv=1.f/timeSigBeats;
|
||||
float timeSigDivision=4.f;
|
||||
|
||||
float barPhasorInc=0.f;
|
||||
float barPhasor;
|
||||
|
||||
size_t sequencingSampleDiv = 400;
|
||||
size_t sequencingSampleCounter = 0;
|
||||
|
||||
std::array<ratioSeqState, NSEQUENCES> ratioSeqStates;
|
||||
|
||||
float midiClockPhasor=0;
|
||||
float midiClockPhasorInc=0;
|
||||
|
||||
};
|
||||
|
||||
#endif // __BREAKOR_AUDIO_APP_HPP__
|
||||
|
||||
|
|
|
|||
519
modes/AudioApps/MEMLCeliumAudioApp.hpp
Normal file
519
modes/AudioApps/MEMLCeliumAudioApp.hpp
Normal file
|
|
@ -0,0 +1,519 @@
|
|||
#ifndef __MEMLCELIUM_AUDIO_APP_HPP__
|
||||
#define __MEMLCELIUM_AUDIO_APP_HPP__
|
||||
|
||||
#include "../../src/memllib/audio/AudioAppBase.hpp"
|
||||
#include "../../src/memllib/synth/maximilian.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#include "../../src/memllib/synth/maxiPAF.hpp"
|
||||
#include "../../src/memllib/synth/ADSRLite.hpp"
|
||||
#include "../../src/memllib/interface/InterfaceBase.hpp"
|
||||
|
||||
#include <span>
|
||||
|
||||
#include "../../voicespaces/VoiceSpaces.hpp"
|
||||
|
||||
#include "RatioSeqEngine.hpp"
|
||||
|
||||
static constexpr size_t kMEMLCeliumNSequences = 2;
|
||||
|
||||
// MIDI notes assigned to each sequencer index
|
||||
// static constexpr uint8_t kMEMLCeliumSeqNotes[kMEMLCeliumNSequences] = {60};
|
||||
|
||||
template<size_t NPARAMS=56>
|
||||
class MEMLCeliumAudioApp : public AudioAppBase<NPARAMS>
|
||||
{
|
||||
public:
|
||||
static constexpr size_t kN_Params = NPARAMS;
|
||||
static constexpr size_t nFREQs = 17;
|
||||
static constexpr float frequencies[nFREQs] = {100, 200, 400,800, 400, 800, 100,1600,100,400,100,50,1600,200,100,800,400};
|
||||
static constexpr size_t nVoiceSpaces=7;
|
||||
|
||||
// Focus group bitmasks
|
||||
static constexpr uint32_t kFocusSeq = (1u << 0);
|
||||
static constexpr uint32_t kFocusSyn = (1u << 1);
|
||||
|
||||
// Per-param group membership: params 0-13 = sequencer, 14-55 = synthesis
|
||||
static constexpr std::array<uint32_t, NPARAMS> kParamGroupMask = {
|
||||
// 0-13: sequencer (14 entries)
|
||||
kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq,
|
||||
kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq, kFocusSeq,
|
||||
// 14-55: synthesis (42 entries)
|
||||
kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn,
|
||||
kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn,
|
||||
kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn,
|
||||
kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn,
|
||||
kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn,
|
||||
kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn, kFocusSyn,
|
||||
};
|
||||
|
||||
std::array<VoiceSpace<NPARAMS>, nVoiceSpaces> voiceSpaces;
|
||||
|
||||
VoiceSpaceFn<NPARAMS> currentVoiceSpace;
|
||||
|
||||
RatioSeqEngine<kMEMLCeliumNSequences> seqEngine;
|
||||
|
||||
queue_t sequencerControlQueue;
|
||||
|
||||
std::array<String, nVoiceSpaces> getVoiceSpaceNames() {
|
||||
std::array<String, nVoiceSpaces> names;
|
||||
for(size_t i=0; i < voiceSpaces.size(); i++) {
|
||||
names[i] = voiceSpaces[i].name;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
void setVoiceSpace(size_t i) {
|
||||
if (i < voiceSpaces.size()) {
|
||||
currentVoiceSpace = voiceSpaces[i].mappingFunction;
|
||||
}
|
||||
}
|
||||
|
||||
MEMLCeliumAudioApp() : AudioAppBase<NPARAMS>() {
|
||||
// auto voiceSpace1 = [this](const std::array<float, NPARAMS>& params) {
|
||||
// VOICE_SPACE_1_BODY
|
||||
// };
|
||||
|
||||
// auto voiceSpace2 = [this](const std::array<float, NPARAMS>& params) {
|
||||
// VOICE_SPACE_2_BODY
|
||||
// };
|
||||
|
||||
// auto voiceSpacePerc = [this](const std::array<float, NPARAMS>& params) {
|
||||
// VOICE_SPACE_PERC_BODY
|
||||
// };
|
||||
|
||||
// auto voiceSpaceSingle1 = [this](const std::array<float, NPARAMS>& params) {
|
||||
// VOICE_SPACE_SINGLE_1_BODY
|
||||
// };
|
||||
|
||||
// auto voiceSpaceQuadDetune = [this](const std::array<float, NPARAMS>& params) {
|
||||
// VOICE_SPACE_QUAD_DETUNE_BODY
|
||||
// };
|
||||
|
||||
// auto voiceSpaceQuadOct = [this](const std::array<float, NPARAMS>& params) {
|
||||
// VOICE_SPACE_QUAD_OCT_BODY
|
||||
// };
|
||||
|
||||
// auto voiceSpaceQuadDist = [this](const std::array<float, NPARAMS>& params) {
|
||||
// VOICE_SPACE_QUAD_DIST_BODY
|
||||
// };
|
||||
|
||||
|
||||
// voiceSpaces[0] = {"Ellipticacacia", voiceSpaceQuadDetune};
|
||||
// voiceSpaces[1] = {"Rowantares", voiceSpace1};
|
||||
// voiceSpaces[2] = {"Neemeda", voiceSpace2};
|
||||
// voiceSpaces[3] = {"Aquillow", voiceSpacePerc};
|
||||
// voiceSpaces[4] = {"Magnetarch", voiceSpaceSingle1};
|
||||
// voiceSpaces[5] = {"Elderstar", voiceSpaceQuadOct};
|
||||
// voiceSpaces[6] = {"Ipeleiades", voiceSpaceQuadDist};
|
||||
|
||||
// currentVoiceSpace = voiceSpaces[0].mappingFunction;
|
||||
|
||||
queue_init(&sequencerControlQueue, sizeof(int), 1);
|
||||
queue_init(&qMIDINoteOn, sizeof(uint8_t)*2, 1);
|
||||
queue_init(&qMIDINoteOff, sizeof(uint8_t)*2, 1);
|
||||
};
|
||||
|
||||
bool __force_inline euclidean(float phase, const size_t n, const size_t k, const size_t offset, const float pulseWidth)
|
||||
{
|
||||
const float fi = phase * n;
|
||||
int i = static_cast<int>(fi);
|
||||
const float rem = fi - i;
|
||||
if (i == n)
|
||||
{
|
||||
i--;
|
||||
}
|
||||
const int idx = ((i + n - offset) * k) % n;
|
||||
return (idx < k && rem < pulseWidth) ? 1 : 0;
|
||||
}
|
||||
|
||||
stereosample_t __force_inline Process(const stereosample_t x) override
|
||||
{
|
||||
seqEngine.tick();
|
||||
|
||||
float x1[1];
|
||||
|
||||
float envval = v0AmpEnv.play();
|
||||
float v0PitchEnvVal = v0PitchEnv.play() * v0PitchEmph;
|
||||
|
||||
float fbsmooth = (fbzm1 * fbSmoothAlpha) + (feedback * (1.f-fbSmoothAlpha));
|
||||
fbzm1 = fbsmooth;
|
||||
|
||||
float freq0 = baseFreq * (1.f + fbsmooth) + (v0PitchEnvVal * baseFreq);
|
||||
paf0.play(x1, 1, freq0, freq0 + (paf0_cf * freq0), paf0_bw, paf0_vib, paf0_vfr, paf0_shift, 0);
|
||||
float p0 = *x1 * p0Gain;
|
||||
|
||||
const float freq1 = freq0 * detune1;
|
||||
|
||||
paf1.play(x1, 1, freq1, freq1 + (paf1_cf * freq1), paf1_bw, paf1_vib, paf1_vfr, paf1_shift, 1);
|
||||
const float p1 = *x1 * p1Gain;
|
||||
|
||||
const float freq2 = freq1 * detune2;
|
||||
|
||||
paf2.play(x1, 1, freq2, freq2 + (paf2_cf * freq2), paf2_bw, paf2_vib, paf2_vfr, paf2_shift, 1);
|
||||
const float p2 = *x1 * p2Gain;
|
||||
|
||||
float v0 = p0 + p1 + p2;// + p3;
|
||||
|
||||
|
||||
|
||||
v0 = v0 * envval;
|
||||
feedback = v0 * feedbackGain;
|
||||
|
||||
//v1
|
||||
float v1Envval = v1AmpEnv.play();
|
||||
float v1PitchEnvVal = v1PitchEnv.play() * v1PitchEmph;
|
||||
|
||||
float v1freq0 = v1BaseFreq + (v1PitchEnvVal * v1BaseFreq);
|
||||
v1paf0.play(x1, 1, v1freq0, v1freq0 + (v1paf0_cf * v1freq0), v1paf0_bw, 0, 0, v1paf0_shift, 0);
|
||||
float v1p0 = *x1 * v1p0Gain;
|
||||
|
||||
const float v1freq1 = v1freq0 * v1Detune1;
|
||||
|
||||
v1paf1.play(x1, 1, v1freq1, v1freq1 + (v1paf1_cf * v1freq1), v1paf1_bw, 0, 0, v1paf1_shift, 1);
|
||||
const float v1p1 = *x1 * v1p1Gain;
|
||||
|
||||
const float v1freq2 = v1freq1 * v1Detune2;
|
||||
|
||||
v1paf2.play(x1, 1, v1freq2, v1freq2 + (v1paf2_cf * freq2), v1paf2_bw, 0, 0, v1paf2_shift, 1);
|
||||
const float v1p2 = *x1 * v1p2Gain;
|
||||
|
||||
float v1 = v1p0 + v1p1 + v1p2;
|
||||
|
||||
const float rm = v1p0 * v1p1 * v1p2;// * p3;
|
||||
|
||||
v1 = ((1.0 - rmGain) * v1) + (rm * rmGain);
|
||||
|
||||
v1 = v1 * v1Envval;
|
||||
/////
|
||||
|
||||
float mix = v0 + v1;
|
||||
|
||||
float shape = sinf(mix * TWOPI);
|
||||
shape = sinf(((shape * TWOPI) * sineShapeGain) + sineShapeASym);
|
||||
mix = mix + (shape * sineShapeMix);
|
||||
|
||||
|
||||
mix = tanhf(mix);
|
||||
|
||||
stereosample_t ret { mix, mix };
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Setup(float sample_rate, std::shared_ptr<InterfaceBase> interface) override
|
||||
{
|
||||
AudioAppBase<NPARAMS>::Setup(sample_rate, interface);
|
||||
maxiSettings::sampleRate = sample_rate;
|
||||
sampleRatef = static_cast<float>(sample_rate);
|
||||
|
||||
paf0.init();
|
||||
paf0.setsr(maxiSettings::getSampleRate(), 1);
|
||||
|
||||
paf1.init();
|
||||
paf1.setsr(maxiSettings::getSampleRate(), 1);
|
||||
|
||||
paf2.init();
|
||||
paf2.setsr(maxiSettings::getSampleRate(), 1);
|
||||
|
||||
paf3.init();
|
||||
paf3.setsr(maxiSettings::getSampleRate(), 1);
|
||||
|
||||
v1paf0.init();
|
||||
v1paf0.setsr(maxiSettings::getSampleRate(), 1);
|
||||
|
||||
v1paf1.init();
|
||||
v1paf1.setsr(maxiSettings::getSampleRate(), 1);
|
||||
|
||||
v1paf2.init();
|
||||
v1paf2.setsr(maxiSettings::getSampleRate(), 1);
|
||||
|
||||
arpFreq = frequencies[0];
|
||||
envamp=1.f;
|
||||
|
||||
v0AmpEnv.setup(500,500,0.8,1000,sampleRatef);
|
||||
v0PitchEnv.setup(10,500,0.f,100,sampleRatef);
|
||||
v1AmpEnv.setup(500,500,0.8,1000,sampleRatef);
|
||||
v1PitchEnv.setup(10,500,0.f,100,sampleRatef);
|
||||
|
||||
seqEngine.setup(sample_rate);
|
||||
seqEngine.updateBPM(120.f);
|
||||
seqEngine.setPlaying(true);
|
||||
|
||||
seqEngine.onNoteOn = [this](size_t seqIdx, int velocity) {
|
||||
// uint8_t note = kMEMLCeliumSeqNotes[seqIdx];
|
||||
// uint8_t midimsg[2] = { note, static_cast<uint8_t>(velocity) };
|
||||
// queue_try_add(&qMIDINoteOn, &midimsg);
|
||||
// baseFreq = 80.f;
|
||||
noteVel = velocity / 127.0f;
|
||||
noteVel = noteVel * noteVel;
|
||||
switch(seqIdx) {
|
||||
case 0:
|
||||
v0AmpEnv.trigger(noteVel);
|
||||
v0PitchEnv.trigger(1.0);
|
||||
break;
|
||||
case 1:
|
||||
v1AmpEnv.trigger(noteVel);
|
||||
v1PitchEnv.trigger(1.0);
|
||||
break;
|
||||
}
|
||||
};
|
||||
seqEngine.onNoteOff = [this](size_t seqIdx) {
|
||||
// uint8_t note = kMEMLCeliumSeqNotes[seqIdx];
|
||||
// uint8_t midimsg[2] = { note, 0 };
|
||||
// queue_try_add(&qMIDINoteOff, &midimsg);
|
||||
switch(seqIdx) {
|
||||
case 0:
|
||||
v0AmpEnv.release();
|
||||
v0PitchEnv.release();
|
||||
|
||||
break;
|
||||
case 1:
|
||||
v1AmpEnv.release();
|
||||
v1PitchEnv.release();
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
inline float mtof(uint8_t note) {
|
||||
return 440.0f * exp2f((note - 69) / 12.0f);
|
||||
}
|
||||
|
||||
size_t currNote=0;
|
||||
void loop() override {
|
||||
// uint8_t midimsg[2];
|
||||
// if (firstParamsReceived && queue_try_remove(&qMIDINoteOn, &midimsg)) {
|
||||
// baseFreq = 80.f;
|
||||
// noteVel = midimsg[1] / 127.0f;
|
||||
// noteVel = noteVel * noteVel;
|
||||
// newNote = true;
|
||||
// env.trigger(noteVel);
|
||||
// currNote = midimsg[0];
|
||||
// }
|
||||
// if (firstParamsReceived && queue_try_remove(&qMIDINoteOff, &midimsg)) {
|
||||
// if (currNote == midimsg[0]) {
|
||||
// env.release();
|
||||
// }
|
||||
// }
|
||||
AudioAppBase<NPARAMS>::loop();
|
||||
}
|
||||
|
||||
void ProcessParams(const std::array<float, NPARAMS>& params)
|
||||
{
|
||||
firstParamsReceived = true;
|
||||
int seqControl;
|
||||
if (queue_try_remove(&sequencerControlQueue, &seqControl)) {
|
||||
seqEngine.setPlaying(seqControl == 1);
|
||||
}
|
||||
seqEngine.updateParams(params, 0);
|
||||
p0Gain=1.f;
|
||||
p1Gain=1.f;
|
||||
p2Gain=1.f;
|
||||
p3Gain=1.f;
|
||||
|
||||
detune1 = 1.01f;
|
||||
detune2 = 1.02f;
|
||||
// detune3 = 1.2f;
|
||||
|
||||
size_t paramIdx = 14; // 0-13 reserved for seqEngine (2 sequencers × 7 params)
|
||||
auto sqParam = [&]() { const float p = params[paramIdx++]; return p * p; };
|
||||
|
||||
baseFreq = 60.f + (params[paramIdx++] * 10.f);
|
||||
|
||||
paf0_cf = (params[paramIdx++] * 2.f);
|
||||
paf1_cf = (params[paramIdx++] * 2.f);
|
||||
paf2_cf = (params[paramIdx++] * 2.f);
|
||||
// paf3_cf = (params[paramIdx++] * 2.f);
|
||||
|
||||
paf0_bw = 10.f + (params[paramIdx++] * 100.f);
|
||||
paf1_bw = 10.f + (params[paramIdx++] * 100.f);
|
||||
paf2_bw = 10.f + (params[paramIdx++] * 100.f);
|
||||
// paf3_bw = 10.f + (params[paramIdx++] * 100.f);
|
||||
|
||||
paf0_vib = sqParam() * 0.01f;
|
||||
paf1_vib = paf0_vib;
|
||||
paf2_vib = paf0_vib;
|
||||
// paf3_vib = 0.f;
|
||||
|
||||
paf0_vfr = sqParam() * 15.0f;
|
||||
paf1_vfr = paf0_vfr;
|
||||
paf2_vfr = paf0_vfr;
|
||||
// paf3_vfr = 0.f;
|
||||
|
||||
paf0_shift = -100.f + (params[paramIdx++] * 200.f);
|
||||
paf1_shift = -100.f + (params[paramIdx++] * 200.f);
|
||||
paf2_shift = -100.f + (params[paramIdx++] * 200.f);
|
||||
// paf3_shift = -300.f + (params[paramIdx++] * 300.f);
|
||||
|
||||
v0AmpEnv.setup(0.01f + (params[paramIdx++] * 1.f),
|
||||
0.5f + sqParam() * 200.f,
|
||||
0.01 + (params[paramIdx++] * 0.5f), 1.f + sqParam() * 800.f, sampleRatef);
|
||||
|
||||
v0PitchEnv.setup(0.01f + (params[paramIdx++] * 3.f),
|
||||
0.5f + sqParam() * 100.f,
|
||||
0.f, 0.1f, sampleRatef);
|
||||
|
||||
v0PitchEmph = params[paramIdx++]* 50.f;
|
||||
|
||||
sineShapeGain = params[paramIdx++];
|
||||
sineShapeASym = params[paramIdx++]* 0.5f;
|
||||
sineShapeMix = params[paramIdx++];
|
||||
|
||||
rmGain = params[paramIdx++];
|
||||
feedbackGain = 0; //0.1f;
|
||||
|
||||
fbSmoothAlpha=0.5f;
|
||||
|
||||
//v1
|
||||
v1p0Gain=1.f;
|
||||
v1p1Gain=1.f;
|
||||
v1p2Gain=1.f;
|
||||
|
||||
v1BaseFreq = 300.f + (params[paramIdx++] * 10.f);
|
||||
v1Detune1 = 1.0f + (params[paramIdx++] * 1.0f);
|
||||
v1Detune2 = 1.0f + (params[paramIdx++] * 1.0f);
|
||||
|
||||
v1paf0_cf = (params[paramIdx++] * 2.f);
|
||||
v1paf1_cf = (params[paramIdx++] * 2.f);
|
||||
v1paf2_cf = (params[paramIdx++] * 2.f);
|
||||
|
||||
v1paf0_bw = 10.f + (params[paramIdx++] * 400.f);
|
||||
v1paf1_bw = 10.f + (params[paramIdx++] * 600.f);
|
||||
v1paf2_bw = 10.f + (params[paramIdx++] * 500.f);
|
||||
|
||||
v1paf0_shift = -500.f + (params[paramIdx++] * 1000.f);
|
||||
v1paf1_shift = -300.f + (params[paramIdx++] * 600.f);
|
||||
v1paf2_shift = -100.f + (params[paramIdx++] * 200.f);
|
||||
|
||||
v1AmpEnv.setup(0.01f + (params[paramIdx++] * 1.f),
|
||||
0.5f + sqParam() * 100.f,
|
||||
0.01 + (params[paramIdx++] * 0.3f), 1.f + sqParam() * 200.f, sampleRatef);
|
||||
|
||||
v1PitchEnv.setup(0.01f + (params[paramIdx++] * 3.f),
|
||||
0.5f + sqParam() * 100.f,
|
||||
0.f, 0.1f, sampleRatef);
|
||||
|
||||
v1PitchEmph = params[paramIdx++] * 10.f;
|
||||
|
||||
// currentVoiceSpace(params);
|
||||
}
|
||||
|
||||
queue_t qMIDINoteOn, qMIDINoteOff;
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
maxiPAFOperator paf0;
|
||||
maxiPAFOperator paf1;
|
||||
maxiPAFOperator paf2;
|
||||
maxiPAFOperator paf3;
|
||||
|
||||
maxiPAFOperator v1paf0;
|
||||
maxiPAFOperator v1paf1;
|
||||
maxiPAFOperator v1paf2;
|
||||
|
||||
|
||||
maxiOsc pulse;
|
||||
|
||||
ADSRLite v0AmpEnv, v0PitchEnv, v1AmpEnv, v1PitchEnv;
|
||||
|
||||
float frame=0;
|
||||
|
||||
float feedback=0.f, feedbackGain=0.f;
|
||||
|
||||
float p0Gain=1.f, p1Gain = 1.f, p2Gain=1.f, p3Gain=1.f;
|
||||
float v1p0Gain=1.f, v1p1Gain=1.f, v1p2Gain=1.f;
|
||||
|
||||
float v0PitchEmph = 1.f;
|
||||
float v1PitchEmph = 1.f;
|
||||
|
||||
float paf0_freq = 100;
|
||||
float paf1_freq = 100;
|
||||
float paf2_freq = 50;
|
||||
float paf3_freq = 50;
|
||||
|
||||
float paf0_cf = 200;
|
||||
float paf1_cf = 250;
|
||||
float paf2_cf = 250;
|
||||
float paf3_cf = 250;
|
||||
|
||||
float v1paf0_cf = 200;
|
||||
float v1paf1_cf = 250;
|
||||
float v1paf2_cf = 250;
|
||||
|
||||
float paf0_bw = 100;
|
||||
float paf1_bw = 5000;
|
||||
float paf2_bw = 5000;
|
||||
float paf3_bw = 5000;
|
||||
|
||||
float v1paf0_bw = 100;
|
||||
float v1paf1_bw = 5000;
|
||||
float v1paf2_bw = 5000;
|
||||
|
||||
float paf0_vib = 0;
|
||||
float paf1_vib = 1;
|
||||
float paf2_vib = 1;
|
||||
float paf3_vib = 1;
|
||||
|
||||
float paf0_vfr = 2;
|
||||
float paf1_vfr = 2;
|
||||
float paf2_vfr = 2;
|
||||
float paf3_vfr = 2;
|
||||
|
||||
float paf0_shift = 0;
|
||||
float paf1_shift = 0;
|
||||
float paf2_shift = 0;
|
||||
float paf3_shift = 0;
|
||||
|
||||
float v1paf0_shift = 0;
|
||||
float v1paf1_shift = 0;
|
||||
float v1paf2_shift = 0;
|
||||
|
||||
|
||||
float rmGain = 0.f;
|
||||
|
||||
float sineShapeGain=0.1;
|
||||
float sineShapeASym = 0.f;
|
||||
float sineShapeMix = 0.f;
|
||||
float sineShapeMixInv = 1.f;
|
||||
size_t counter=0;
|
||||
size_t freqIndex = 0;
|
||||
size_t freqOffset = 0;
|
||||
float arpFreq=50;
|
||||
|
||||
maxiLine line;
|
||||
float envamp=0.f;
|
||||
|
||||
float detune1 = 1.0;
|
||||
float detune2 = 1.0;
|
||||
float detune3 = 1.0;
|
||||
|
||||
float v1Detune1 = 1.5;
|
||||
float v1Detune2 = 2.1;
|
||||
|
||||
maxiOsc phasorOsc;
|
||||
maxiTrigger zxdetect;
|
||||
|
||||
size_t euclidN=4;
|
||||
|
||||
float baseFreq = 50.0f;
|
||||
float v1BaseFreq = 200.0f;
|
||||
bool newNote=false;
|
||||
float noteVel = 0.f;
|
||||
bool firstParamsReceived = false;
|
||||
|
||||
// float envdec=0.2f/9000.f;
|
||||
|
||||
float sampleRatef = maxiSettings::getSampleRate();
|
||||
|
||||
float fbzm1=0.f;
|
||||
size_t delayMax=10;
|
||||
float fbSmoothAlpha=0.95f;
|
||||
|
||||
};
|
||||
|
||||
#endif // __MEMLCELIUM_AUDIO_APP_HPP__
|
||||
143
modes/AudioApps/RatioSeqEngine.hpp
Normal file
143
modes/AudioApps/RatioSeqEngine.hpp
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
#ifndef __RATIO_SEQ_ENGINE_HPP__
|
||||
#define __RATIO_SEQ_ENGINE_HPP__
|
||||
|
||||
#include "RatioSeq.hpp"
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <cstddef>
|
||||
#include <cmath>
|
||||
|
||||
template<size_t NSEQUENCES>
|
||||
class RatioSeqEngine {
|
||||
public:
|
||||
std::array<ratioSeqState, NSEQUENCES> states;
|
||||
|
||||
std::function<void(size_t seqIdx, int velocity)> onNoteOn;
|
||||
std::function<void(size_t seqIdx)> onNoteOff;
|
||||
std::function<void()> onBarReset;
|
||||
|
||||
void setup(float sample_rate) {
|
||||
sampleRatef = sample_rate;
|
||||
updateBPM(bpm);
|
||||
}
|
||||
|
||||
__force_inline void updateBPM(float newBPM) {
|
||||
bpm = newBPM;
|
||||
float beatLengthInSeconds = 60.f / bpm;
|
||||
float barLengthInSeconds = beatLengthInSeconds * timeSigBeats;
|
||||
float barLengthInSamples = barLengthInSeconds * (sampleRatef / sequencingSampleDiv);
|
||||
barPhasorInc = 1.f / barLengthInSamples;
|
||||
float midiClockLengthInSeconds = beatLengthInSeconds / 24.f;
|
||||
float midiClockLengthInSamples = midiClockLengthInSeconds * sampleRatef;
|
||||
midiClockPhasorInc = 1.f / midiClockLengthInSamples;
|
||||
}
|
||||
|
||||
void setTimeSignature(float beats, float division) {
|
||||
timeSigBeats = beats;
|
||||
timeSigBeatsInv = 1.f / beats;
|
||||
timeSigDivision = division;
|
||||
updateBPM(bpm);
|
||||
}
|
||||
|
||||
void setPlaying(bool play) {
|
||||
playing = play;
|
||||
if (!playing) {
|
||||
if (onNoteOff) {
|
||||
for (size_t i = 0; i < NSEQUENCES; i++) {
|
||||
onNoteOff(i);
|
||||
}
|
||||
}
|
||||
barPhasor = 0.f;
|
||||
midiClockPhasor = 0.f;
|
||||
sequencingSampleCounter = 0;
|
||||
for (auto &s : states) {
|
||||
s.phasor = 0.f;
|
||||
s.lastTrig = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__force_inline void resetBar() {
|
||||
barPhasor = 0.f;
|
||||
if (onBarReset) onBarReset();
|
||||
}
|
||||
|
||||
// Returns true on a sequencing tick. Call once per audio sample from Process().
|
||||
__force_inline bool tick() {
|
||||
if (!playing) return false;
|
||||
|
||||
bool ticked = false;
|
||||
if (sequencingSampleCounter == 0) {
|
||||
barPhasor += barPhasorInc;
|
||||
if (barPhasor >= 1.f) {
|
||||
barPhasor -= 1.f;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < NSEQUENCES; i++) {
|
||||
auto &seq = states[i];
|
||||
float seqPhasor = barPhasor * seq.phasorMul;
|
||||
seqPhasor = fmodf(seqPhasor + seq.phaseOffset, 1.f);
|
||||
|
||||
bool trig = ratioSeq<3>(seqPhasor, seq.phaseOffset, seq.ratioSum, seq.ratios, seq.pulseWidth);
|
||||
bool highAmp = ratioSeq<2>(seqPhasor, seq.phaseOffset, seq.ampRatioSum, seq.ampRatios, 0.5f);
|
||||
|
||||
if (trig && !seq.lastTrig) {
|
||||
if (onNoteOn) onNoteOn(i, highAmp ? 127 : 64);
|
||||
} else if (!trig && seq.lastTrig) {
|
||||
if (onNoteOff) onNoteOff(i);
|
||||
}
|
||||
seq.lastTrig = trig;
|
||||
}
|
||||
ticked = true;
|
||||
}
|
||||
|
||||
sequencingSampleCounter++;
|
||||
if (sequencingSampleCounter >= sequencingSampleDiv) {
|
||||
sequencingSampleCounter = 0;
|
||||
}
|
||||
|
||||
return ticked;
|
||||
}
|
||||
|
||||
// Call from loop() (not audio path). startIdx is the first param index to consume.
|
||||
template<size_t NPARAMS>
|
||||
void updateParams(const std::array<float, NPARAMS>& params, size_t startIdx) {
|
||||
size_t paramIdx = startIdx;
|
||||
for (auto &v : states) {
|
||||
float sum = 0.f;
|
||||
for (size_t i = 0; i < v.ratios.size(); i++) {
|
||||
v.ratios[i] = (float)(int)(params[paramIdx++] * 3.f) + 1.f;
|
||||
sum += v.ratios[i];
|
||||
}
|
||||
v.ratioSum = sum;
|
||||
|
||||
static float muls[4] = {1.f, 2.f, 4.f, 8.f};
|
||||
v.phasorMul = muls[(int)(params[paramIdx++] * 3.999999f)];
|
||||
v.phaseOffset = ((int)(params[paramIdx++] * timeSigBeats)) * timeSigBeatsInv;
|
||||
|
||||
sum = 0.f;
|
||||
for (size_t i = 0; i < v.ampRatios.size(); i++) {
|
||||
v.ampRatios[i] = (float)(int)(params[paramIdx++] * 3.f) + 1.f;
|
||||
sum += v.ampRatios[i];
|
||||
}
|
||||
v.ampRatioSum = sum;
|
||||
}
|
||||
}
|
||||
|
||||
float midiClockPhasorInc = 0.f;
|
||||
float midiClockPhasor = 0.f;
|
||||
bool playing = false;
|
||||
|
||||
private:
|
||||
float sampleRatef = 48000.f;
|
||||
float bpm = 120.f;
|
||||
float timeSigBeats = 4.f;
|
||||
float timeSigBeatsInv = 0.25f;
|
||||
float timeSigDivision = 4.f;
|
||||
float barPhasor = 0.f;
|
||||
float barPhasorInc = 0.f;
|
||||
size_t sequencingSampleDiv = 400;
|
||||
size_t sequencingSampleCounter = 0;
|
||||
};
|
||||
|
||||
#endif // __RATIO_SEQ_ENGINE_HPP__
|
||||
|
|
@ -11,6 +11,18 @@
|
|||
|
||||
#include <span>
|
||||
#include "../../voicespaces/VoiceSpaces.hpp"
|
||||
#include "../../voicespaces/VerbFX/basic.hpp"
|
||||
#include "../../voicespaces/VerbFX/resonant.hpp"
|
||||
#include "../../voicespaces/VerbFX/soft.hpp"
|
||||
#include "../../voicespaces/VerbFX/cathedral.hpp"
|
||||
#include "../../voicespaces/VerbFX/shimmer.hpp"
|
||||
#include "../../voicespaces/VerbFX/chamber.hpp"
|
||||
#include "../../voicespaces/VerbFX/metallic.hpp"
|
||||
#include "../../voicespaces/VerbFX/granular.hpp"
|
||||
#include "../../voicespaces/VerbFX/diffuse.hpp"
|
||||
#include "../../voicespaces/VerbFX/dark.hpp"
|
||||
#include "../../voicespaces/VerbFX/bright.hpp"
|
||||
#include "../../voicespaces/VerbFX/harmonic.hpp"
|
||||
#include "../../src/memllib/synth/OnePoleSmoother.hpp"
|
||||
#include "../../src/memllib/synth/maximilian.h"
|
||||
#include "../../src/daisysp/Effects/pitchshifter.h"
|
||||
|
|
@ -19,18 +31,42 @@
|
|||
|
||||
|
||||
|
||||
template<size_t NPARAMS=24>
|
||||
template<size_t NPARAMS=47>
|
||||
class VerbFXAudioApp : public AudioAppBase<NPARAMS>
|
||||
{
|
||||
public:
|
||||
static constexpr size_t kN_Params = NPARAMS;
|
||||
static constexpr size_t nVoiceSpaces=1;
|
||||
static constexpr size_t nVoiceSpaces=12;
|
||||
|
||||
|
||||
std::array<VoiceSpace<NPARAMS>, nVoiceSpaces> voiceSpaces;
|
||||
|
||||
VoiceSpaceFn<NPARAMS> currentVoiceSpace;
|
||||
|
||||
enum class controlMessages {
|
||||
MSG_ENABLE_FILTERBANK=0,
|
||||
MSG_ENABLE_REVERB,
|
||||
MSG_ENABLE_SHORT_DELAY,
|
||||
MSG_ENABLE_MEDIUM_DELAY,
|
||||
MSG_ENABLE_LONG_DELAY,
|
||||
MSG_ENABLE_DELAY_TO_REVERB,
|
||||
};
|
||||
|
||||
queue_t controlMessageQueue;
|
||||
queue_t wetdryQueue;
|
||||
|
||||
void setWetDryQueued(float value) {
|
||||
queue_try_add(&wetdryQueue, &value);
|
||||
}
|
||||
|
||||
bool enableFilterbank=true;
|
||||
bool enableReverb=true;
|
||||
bool enableShortDelay=true;
|
||||
bool enableMediumDelay=true;
|
||||
bool enableLongDelay=true;
|
||||
bool enableDelayToReverb=true;
|
||||
|
||||
|
||||
std::array<String, nVoiceSpaces> getVoiceSpaceNames() {
|
||||
std::array<String, nVoiceSpaces> names;
|
||||
for(size_t i=0; i < voiceSpaces.size(); i++) {
|
||||
|
|
@ -46,70 +82,151 @@ public:
|
|||
}
|
||||
|
||||
VerbFXAudioApp() : AudioAppBase<NPARAMS>() {
|
||||
auto voiceSpaceDefault = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_DEFAULT_BODY
|
||||
};
|
||||
voiceSpaces[0] = {"Default", voiceSpaceDefault};
|
||||
auto voiceSpaceResonant = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_RESONANT_BODY
|
||||
};
|
||||
voiceSpaces[1] = {"Resonant", voiceSpaceResonant};
|
||||
auto voiceSpaceSoft = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_SOFT_BODY
|
||||
};
|
||||
voiceSpaces[2] = {"Soft", voiceSpaceSoft};
|
||||
auto voiceSpaceCathedral = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_CATHEDRAL_BODY
|
||||
};
|
||||
voiceSpaces[3] = {"Cathedral", voiceSpaceCathedral};
|
||||
auto voiceSpaceShimmer = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_SHIMMER_BODY
|
||||
};
|
||||
voiceSpaces[4] = {"Shimmer", voiceSpaceShimmer};
|
||||
auto voiceSpaceChamber = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_CHAMBER_BODY
|
||||
};
|
||||
voiceSpaces[5] = {"Chamber", voiceSpaceChamber};
|
||||
auto voiceSpaceMetallic = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_METALLIC_BODY
|
||||
};
|
||||
voiceSpaces[6] = {"Metallic", voiceSpaceMetallic};
|
||||
auto voiceSpaceGranular = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_GRANULAR_BODY
|
||||
};
|
||||
voiceSpaces[7] = {"Granular", voiceSpaceGranular};
|
||||
auto voiceSpaceDiffuse = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_DIFFUSE_BODY
|
||||
};
|
||||
voiceSpaces[8] = {"Diffuse", voiceSpaceDiffuse};
|
||||
auto voiceSpaceDark = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_DARK_BODY
|
||||
};
|
||||
voiceSpaces[9] = {"Dark", voiceSpaceDark};
|
||||
auto voiceSpaceBright = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_BRIGHT_BODY
|
||||
};
|
||||
voiceSpaces[10] = {"Bright", voiceSpaceBright};
|
||||
auto voiceSpaceHarmonic = [this](const std::array<float, NPARAMS>& smoothParams) {
|
||||
VOICE_SPACE_VERBFX_HARMONIC_BODY
|
||||
};
|
||||
voiceSpaces[11] = {"Harmonic", voiceSpaceHarmonic};
|
||||
currentVoiceSpace = voiceSpaces[0].mappingFunction;
|
||||
queue_init(&controlMessageQueue, sizeof(controlMessages), 1);
|
||||
queue_init(&wetdryQueue, sizeof(float), 1);
|
||||
};
|
||||
|
||||
|
||||
__attribute__((hot)) stereosample_t __force_inline Process(const stereosample_t x) override
|
||||
{
|
||||
static float verbFB = 0.f;
|
||||
static float delaysFB = 0.f;
|
||||
|
||||
float mix = x.L + x.R;
|
||||
|
||||
smoother.Process(neuralNetOutputs.data(), smoothParams.data());
|
||||
|
||||
//mapping
|
||||
currentVoiceSpace(smoothParams);
|
||||
|
||||
// float allp1fb = smoothParams[4] * 0.99f;
|
||||
// float allp2fb = smoothParams[5] * 0.99f;
|
||||
// float allp3fb = smoothParams[14] * 0.99f;
|
||||
//XFADE
|
||||
|
||||
wetdry_mix_ = (smoothParams[0] * 0.9f) + 0.1f;
|
||||
const float lp0fb = smoothParams[1] * 0.98f;
|
||||
const float lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;
|
||||
const float filterBankDelayFBLevel = sqrtf(filterBankDelayXFade);
|
||||
const float filterBankDelayFBLevelInv = sqrtf(1.f - filterBankDelayXFade);
|
||||
|
||||
const float lp1fb = smoothParams[3] * 0.98f;
|
||||
const float lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;
|
||||
/////////////////// FILTERBANK
|
||||
|
||||
const float lp2fb = smoothParams[5] * 0.98f;
|
||||
const float lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;
|
||||
float filterBankIn = mix + (filterBankDelayFBLevel * ddelayFeedback);
|
||||
float filterBankOut=mix;
|
||||
|
||||
const float lp3fb = smoothParams[7] * 0.98f;
|
||||
const float lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;
|
||||
if (enableFilterbank) {
|
||||
filterBankOut = filterBank0.bandpassChamberlain(filterBankIn, filterBankF0, filterBankRes0);
|
||||
filterBankOut += filterBank1.bandpassChamberlain(filterBankIn, filterBankF1, filterBankRes1);
|
||||
filterBankOut += filterBank2.bandpassChamberlain(filterBankIn, filterBankF2, filterBankRes2);
|
||||
filterBankOut += filterBank3.bandpassChamberlain(filterBankIn, filterBankF3, filterBankRes3);
|
||||
filterBankOut += filterBank4.bandpassChamberlain(filterBankIn, filterBankF4, filterBankRes4);
|
||||
filterBankOut += filterBank5.bandpassChamberlain(filterBankIn, filterBankF5, filterBankRes5);
|
||||
filterBankOut += filterBank6.bandpassChamberlain(filterBankIn, filterBankF6, filterBankRes6);
|
||||
filterBankOut += filterBank7.bandpassChamberlain(filterBankIn, filterBankF7, filterBankRes7);
|
||||
|
||||
const float lp4fb = smoothParams[9] * 0.98f;
|
||||
const float lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;
|
||||
filterBankOut *= 0.125f;
|
||||
}
|
||||
|
||||
const float lp5fb = smoothParams[11] * 0.98f;
|
||||
const float lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;
|
||||
////////////// DELAYS
|
||||
float delayIn = filterBankOut;
|
||||
|
||||
const float lp6fb = smoothParams[13] * 0.98f;
|
||||
const float lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;
|
||||
float delayed = enableLongDelay ? ddelay.read(ddelayTime) : 0.f;
|
||||
ddelay.write((delayIn * filterBankDelayFBLevelInv) + ((ddelayFeedback + (delayIn * filterBankDelayFBLevel)) * delayed));
|
||||
|
||||
const float lp7fb = smoothParams[15] * 0.98f;
|
||||
const float lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;
|
||||
float delayed1 = enableMediumDelay ? ddelay1.read(ddelayTime1) : 0.f;
|
||||
ddelay1.write(delayIn + (ddelayFeedback1 * delayed1));
|
||||
|
||||
float lp0 = lpcomb0.lpcombfb(mix, SIZE_comb0, lp0fb, lp0cutoff);
|
||||
float lp1 = lpcomb1.lpcombfb(mix, SIZE_comb1, lp1fb, lp1cutoff);
|
||||
float lp2 = lpcomb2.lpcombfb(mix, SIZE_comb2, lp2fb, lp2cutoff);
|
||||
float lp3 = lpcomb3.lpcombfb(mix, SIZE_comb3, lp3fb, lp3cutoff);
|
||||
float lp4 = lpcomb4.lpcombfb(mix, SIZE_comb4, lp4fb, lp4cutoff);
|
||||
float lp5 = lpcomb5.lpcombfb(mix, SIZE_comb5, lp5fb, lp5cutoff);
|
||||
float lp6 = lpcomb6.lpcombfb(mix, SIZE_comb6, lp6fb, lp6cutoff);
|
||||
float lp7 = lpcomb7.lpcombfb(mix, SIZE_comb7, lp7fb, lp7cutoff);
|
||||
float delayed2 = enableShortDelay ? ddelay2.read(ddelayTime2) : 0.f;
|
||||
ddelay2.write(delayIn + (ddelayFeedback2 * delayed2));
|
||||
|
||||
float y = lp0 + lp1 + lp2 + lp3 + lp4 + lp5 + lp6 + lp7;
|
||||
float a = fminf(delayMorph * 2.f, 1.f);
|
||||
float b = fmaxf(delayMorph * 2.f - 1.f, 0.f);
|
||||
constexpr float kEqualMix = 0.57735f; // 1/sqrt(3), constant-power equal mix
|
||||
float w_short = kEqualMix + delayBlend * (sqrtf(1.f - a) - kEqualMix);
|
||||
float w_medium = kEqualMix + delayBlend * (sqrtf(a) * sqrtf(1.f - b) - kEqualMix);
|
||||
float w_long = kEqualMix + delayBlend * (sqrtf(a) * sqrtf(b) - kEqualMix);
|
||||
float delaySum = (w_short * delayed2) + (w_medium * delayed1) + (w_long * delayed);
|
||||
|
||||
//////////////// VERB
|
||||
float verbIn = enableReverb ? filterBankOut : 0.f;
|
||||
if (enableDelayToReverb && enableReverb) {
|
||||
verbIn += (delayToVerbLevel * delaySum);
|
||||
}
|
||||
float verbOut=0.f;
|
||||
|
||||
|
||||
const float allp0fb = smoothParams[17] * 0.98f;
|
||||
const float allp1fb = smoothParams[18] * 0.98f;
|
||||
const float allp2fb = smoothParams[19] * 0.98f;
|
||||
const float allp3fb = smoothParams[20] * 0.98f;
|
||||
verbOut = lpcomb0.lpcombfb(filterBankOut, SIZE_comb0, lp0fb, lp0cutoff);
|
||||
verbOut += lpcomb1.lpcombfb(filterBankOut, SIZE_comb1, lp1fb, lp1cutoff);
|
||||
verbOut += lpcomb2.lpcombfb(filterBankOut, SIZE_comb2, lp2fb, lp2cutoff);
|
||||
verbOut += lpcomb3.lpcombfb(filterBankOut, SIZE_comb3, lp3fb, lp3cutoff);
|
||||
verbOut += lpcomb4.lpcombfb(filterBankOut, SIZE_comb4, lp4fb, lp4cutoff);
|
||||
verbOut += lpcomb5.lpcombfb(filterBankOut, SIZE_comb5, lp5fb, lp5cutoff);
|
||||
verbOut += lpcomb6.lpcombfb(filterBankOut, SIZE_comb6, lp6fb, lp6cutoff);
|
||||
verbOut += lpcomb7.lpcombfb(filterBankOut, SIZE_comb7, lp7fb, lp7cutoff);
|
||||
|
||||
|
||||
|
||||
|
||||
verbOut = allp0.allpass(verbOut, SIZE_allp0, allp0fb);
|
||||
verbOut = allp1.allpass(verbOut, SIZE_allp1, allp1fb);
|
||||
verbOut = allp2.allpass(verbOut, SIZE_allp2, allp2fb);
|
||||
verbOut = allp3.allpass(verbOut, SIZE_allp3, allp3fb);
|
||||
|
||||
float y= (sqrtf(verbVsDelayLevel) * delaySum) + (sqrtf(1.f - verbVsDelayLevel) * verbOut);
|
||||
|
||||
//feedback
|
||||
delaysFB = delaySum;
|
||||
verbFB = verbOut;
|
||||
|
||||
|
||||
y = allp0.allpass(y, SIZE_allp0, allp0fb);
|
||||
y = allp1.allpass(y, SIZE_allp1, allp1fb);
|
||||
y = allp2.allpass(y, SIZE_allp2, allp2fb);
|
||||
y = allp3.allpass(y, SIZE_allp3, allp3fb);
|
||||
|
||||
|
||||
// Mix dry
|
||||
y = (y * wetdry_mix_) + (mix * (1.f - wetdry_mix_));
|
||||
y = (y * sqrtf(wetdry_mix_)) + (mix * sqrtf(1.f - wetdry_mix_));
|
||||
|
||||
|
||||
stereosample_t ret { y, y };
|
||||
|
|
@ -124,7 +241,36 @@ public:
|
|||
|
||||
__attribute__((always_inline)) void ProcessParams(const std::array<float, NPARAMS>& params)
|
||||
{
|
||||
// currentVoiceSpace(params);
|
||||
controlMessages msg;
|
||||
while (queue_try_remove(&controlMessageQueue, &msg)) {
|
||||
switch(msg) {
|
||||
case controlMessages::MSG_ENABLE_FILTERBANK:
|
||||
enableFilterbank = !enableFilterbank;
|
||||
break;
|
||||
case controlMessages::MSG_ENABLE_REVERB:
|
||||
enableReverb = !enableReverb;
|
||||
break;
|
||||
case controlMessages::MSG_ENABLE_SHORT_DELAY:
|
||||
enableShortDelay = !enableShortDelay;
|
||||
break;
|
||||
case controlMessages::MSG_ENABLE_MEDIUM_DELAY:
|
||||
enableMediumDelay = !enableMediumDelay;
|
||||
break;
|
||||
case controlMessages::MSG_ENABLE_LONG_DELAY:
|
||||
enableLongDelay = !enableLongDelay;
|
||||
break;
|
||||
case controlMessages::MSG_ENABLE_DELAY_TO_REVERB:
|
||||
enableDelayToReverb = !enableDelayToReverb;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
float v;
|
||||
if (queue_try_remove(&wetdryQueue, &v)) wetdryKnobValue = v;
|
||||
}
|
||||
if (wetdryKnobValue >= 0.f) {
|
||||
wetdry_mix_ = wetdryKnobValue;
|
||||
}
|
||||
neuralNetOutputs = params;
|
||||
}
|
||||
|
||||
|
|
@ -162,12 +308,49 @@ protected:
|
|||
maxiReverbFilters<SIZE_comb6> lpcomb6;
|
||||
maxiReverbFilters<SIZE_comb7> lpcomb7;
|
||||
|
||||
maxiFilter filterBank0;
|
||||
maxiFilter filterBank1;
|
||||
maxiFilter filterBank2;
|
||||
maxiFilter filterBank3;
|
||||
maxiFilter filterBank4;
|
||||
maxiFilter filterBank5;
|
||||
maxiFilter filterBank6;
|
||||
maxiFilter filterBank7;
|
||||
|
||||
DynamicDelay<16384> ddelay;
|
||||
DynamicDelay<2048> ddelay1;
|
||||
DynamicDelay<512> ddelay2;
|
||||
|
||||
maxiDCBlocker dcb;
|
||||
|
||||
float wetdry_mix_{0.5f};
|
||||
float wetdryKnobValue{0.5f};
|
||||
|
||||
// mapping
|
||||
float lp0fb{0}, lp0cutoff{0};
|
||||
float lp1fb{0}, lp1cutoff{0};
|
||||
float lp2fb{0}, lp2cutoff{0};
|
||||
float lp3fb{0}, lp3cutoff{0};
|
||||
float lp4fb{0}, lp4cutoff{0};
|
||||
float lp5fb{0}, lp5cutoff{0};
|
||||
float lp6fb{0}, lp6cutoff{0};
|
||||
float lp7fb{0}, lp7cutoff{0};
|
||||
float allp0fb{0}, allp1fb{0}, allp2fb{0}, allp3fb{0};
|
||||
float filterBankF0{0}, filterBankF1{0}, filterBankF2{0}, filterBankF3{0};
|
||||
float filterBankF4{0}, filterBankF5{0}, filterBankF6{0}, filterBankF7{0};
|
||||
float filterBankRes0{0}, filterBankRes1{0}, filterBankRes2{0}, filterBankRes3{0};
|
||||
float filterBankRes4{0}, filterBankRes5{0}, filterBankRes6{0}, filterBankRes7{0};
|
||||
float ddelayTime{0}, ddelayFeedback{0};
|
||||
float ddelayTime1{0}, ddelayFeedback1{0};
|
||||
float ddelayTime2{0}, ddelayFeedback2{0};
|
||||
float verbVsDelayLevel{0}, delayToVerbLevel{0}, filterBankDelayXFade{0};
|
||||
float delayMorph{0.5f}, delayBlend{0.f};
|
||||
|
||||
OnePoleSmoother<kN_Params> smoother{150.f, kSampleRate};
|
||||
|
||||
// maxiDynamicsLite limiter;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
class MEMLNautModeBreakOr {
|
||||
public:
|
||||
constexpr static size_t kN_InputParams = 4; // joystick x, y, rotate
|
||||
constexpr static size_t kN_InputParams = MEMLNAUT_ANALOG_INPUTS;
|
||||
|
||||
USeqI2C i2cOut;
|
||||
inline static BreakOrAudioApp<> audioAppBreakOr;
|
||||
|
|
@ -32,6 +32,7 @@ public:
|
|||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, BreakOrAudioApp<>::kN_Params);
|
||||
interface.bindInterface(InterfaceRL::INPUT_MODES::JOYSTICK, true);
|
||||
interface.setModeInfo("breakor", "BreakOr");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
|
||||
MEMLNaut::Instance()->setTogA2Callback([this](bool state) { // scr_ref no longer captured directly
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
class MEMLNautModeChannelStrip {
|
||||
public:
|
||||
constexpr static size_t kN_InputParams = 4; // joystick x, y, left and right joysticks
|
||||
constexpr static size_t kN_InputParams = MEMLNAUT_ANALOG_INPUTS;
|
||||
ChannelStripAudioApp<> audioAppChannelStrip;
|
||||
std::array<String, ChannelStripAudioApp<>::nVoiceSpaces> voiceSpaceList;
|
||||
InterfaceRL interface;
|
||||
|
|
@ -20,6 +20,7 @@ public:
|
|||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, ChannelStripAudioApp<>::kN_Params);
|
||||
interface.bindInterface(InterfaceRL::INPUT_MODES::JOYSTICK, true); //set 4D joystick
|
||||
interface.setModeInfo("chstrip", "ChannelStrip");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
class MEMLNautModeElysiamorfs {
|
||||
public:
|
||||
constexpr static size_t kN_InputParams = 4; // joystick x, y, rotate
|
||||
constexpr static size_t kN_InputParams = MEMLNAUT_ANALOG_INPUTS;
|
||||
|
||||
USeqI2C i2cOut;
|
||||
inline static ElysiamorfAudioApp<> audioAppElysiamorfs;
|
||||
|
|
@ -32,6 +32,7 @@ public:
|
|||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, ElysiamorfAudioApp<>::kN_Params);
|
||||
interface.bindInterface(InterfaceRL::INPUT_MODES::JOYSTICK, true);
|
||||
interface.setModeInfo("elysia", "Elysiamorfs");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
|
||||
MEMLNaut::Instance()->setTogA2Callback([this](bool state) { // scr_ref no longer captured directly
|
||||
|
|
|
|||
145
modes/MEMLNautModeMEMLCelium.hpp
Normal file
145
modes/MEMLNautModeMEMLCelium.hpp
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
#pragma once
|
||||
|
||||
#include "../src/memllib/interface/MIDIInOut.hpp"
|
||||
#include "../src/memllib/hardware/memlnaut/display/XYPadView.hpp"
|
||||
#include "../src/memllib/hardware/memlnaut/display/BlockSelectView.hpp"
|
||||
#include "../src/memllib/hardware/memlnaut/MEMLNaut.hpp"
|
||||
#include "AudioApps/MEMLCeliumAudioApp.hpp"
|
||||
#include "../src/memllib/examples/InterfaceRL.hpp"
|
||||
#include "../src/memllib/audio/FocusManager.hpp"
|
||||
#include "../src/memllib/PicoDefs.hpp"
|
||||
#include "MEMLNautMode.hpp"
|
||||
#include <memory>
|
||||
#include <array>
|
||||
|
||||
class MEMLNautModeMEMLCelium {
|
||||
public:
|
||||
constexpr static size_t kN_InputParams = MEMLNAUT_ANALOG_INPUTS;
|
||||
|
||||
inline static MEMLCeliumAudioApp<> audioAppMEMLCelium;
|
||||
std::array<String, MEMLCeliumAudioApp<>::nVoiceSpaces> voiceSpaceList;
|
||||
|
||||
InterfaceRL interface;
|
||||
std::shared_ptr<InterfaceRL> interfacePtr;
|
||||
|
||||
bool sequencerPlaying = false;
|
||||
|
||||
FocusManager<MEMLCeliumAudioApp<>::kN_Params, 2> focusManager;
|
||||
|
||||
|
||||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, MEMLCeliumAudioApp<>::kN_Params);
|
||||
interface.bindInterface(InterfaceRL::INPUT_MODES::JOYSTICK, true);
|
||||
interface.setModeInfo("memlcelium", "MEMLCelium");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
|
||||
focusManager.setGroupName(0, "Seq");
|
||||
focusManager.setGroupName(1, "Synth");
|
||||
focusManager.setParamGroups(MEMLCeliumAudioApp<>::kParamGroupMask);
|
||||
interface.paramTransformHook = [this](std::vector<float>& p) {
|
||||
focusManager.applyInPlace(p);
|
||||
};
|
||||
|
||||
MEMLNaut::Instance()->setTogA2Callback([this](bool state) { // scr_ref no longer captured directly
|
||||
Serial.println(state ? "TogA2 ON" : "TogA2 OFF");
|
||||
if (state) {
|
||||
sequencerPlaying = !sequencerPlaying;
|
||||
queue_try_add(&audioAppMEMLCelium.sequencerControlQueue, &sequencerPlaying);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
String getHelpTitle() {
|
||||
return "MEMLCelium Mode";
|
||||
}
|
||||
|
||||
__force_inline stereosample_t process(stereosample_t x) {
|
||||
return audioAppMEMLCelium.Process(x);
|
||||
}
|
||||
|
||||
void setupAudio(float sample_rate) {
|
||||
audioAppMEMLCelium.Setup(sample_rate, interfacePtr);
|
||||
voiceSpaceList = audioAppMEMLCelium.getVoiceSpaceNames();
|
||||
}
|
||||
|
||||
__force_inline void loop() {
|
||||
audioAppMEMLCelium.loop();
|
||||
}
|
||||
|
||||
std::shared_ptr<MIDIInOut> midi_interf;
|
||||
|
||||
void setupMIDI(std::shared_ptr<MIDIInOut> new_midi_interf) {
|
||||
midi_interf = new_midi_interf;
|
||||
midi_interf->Setup(16);
|
||||
midi_interf->SetMIDISendChannel(1);
|
||||
interface.bindMIDI(midi_interf);
|
||||
|
||||
midi_interf->SetNoteCallback([this](bool noteon, uint8_t note_number, uint8_t vel_value) {
|
||||
if (noteon) {
|
||||
uint8_t midimsg[2] = { note_number, vel_value };
|
||||
queue_try_add(&audioAppMEMLCelium.qMIDINoteOn, &midimsg);
|
||||
}else{
|
||||
uint8_t midimsg[2] = { note_number, vel_value };
|
||||
queue_try_add(&audioAppMEMLCelium.qMIDINoteOff, &midimsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void addViews() {
|
||||
// Focus screen — select which parameter groups are live
|
||||
auto focusView = std::make_shared<BlockSelectView>(
|
||||
"Focus", TFT_CYAN, 2, 120, 70, TFT_BLACK,
|
||||
std::vector<String>{"Seq", "Synth"}, TFT_DARKGREY, 2);
|
||||
|
||||
focusView->SetOnSelectCallback([this, focusView](size_t id) {
|
||||
size_t groupIdx = id - 1;
|
||||
uint32_t newMask = focusManager.getSelectedMask() ^ (1u << groupIdx);
|
||||
focusManager.setFocus(newMask, interface.getLastAction());
|
||||
focusView->toggleAlt(groupIdx);
|
||||
});
|
||||
MEMLNaut::Instance()->disp->InsertViewAfter(interface.rlStatsView, focusView);
|
||||
|
||||
std::shared_ptr<VoiceSpaceSelectView> voiceSpaceSelectView;
|
||||
voiceSpaceSelectView = std::make_shared<VoiceSpaceSelectView>("Voice Spaces");
|
||||
|
||||
MEMLNaut::Instance()->disp->InsertViewAfter(interface.rlStatsView, voiceSpaceSelectView);
|
||||
voiceSpaceSelectView->setOptions(voiceSpaceList);
|
||||
voiceSpaceSelectView->setNewVoiceCallback(
|
||||
[this](size_t idx) {
|
||||
audioAppMEMLCelium.setVoiceSpace(idx);
|
||||
});
|
||||
|
||||
std::shared_ptr<XYPadView> noteTrigView = std::make_shared<XYPadView>("Play", TFT_SILVER);
|
||||
|
||||
static bool is_playing_note = false;
|
||||
static uint8_t last_note_number = 0;
|
||||
|
||||
noteTrigView->SetOnTouchCallback([this](float x, float y) {
|
||||
if (is_playing_note) {
|
||||
midi_interf->sendNoteOff(last_note_number, 0);
|
||||
is_playing_note = false;
|
||||
}
|
||||
uint8_t noteVel = static_cast<uint8_t>(powf(y, 0.5f) * 127.f);
|
||||
uint8_t midimsg[2] = {static_cast<uint8_t>(x * 127.f), noteVel};
|
||||
queue_try_add(&audioAppMEMLCelium.qMIDINoteOn, &midimsg);
|
||||
midi_interf->sendNoteOn(midimsg[0], midimsg[1]);
|
||||
last_note_number = midimsg[0];
|
||||
is_playing_note = true;
|
||||
});
|
||||
noteTrigView->SetOnTouchReleaseCallback([this](float x, float y) {
|
||||
uint8_t midimsg[2] = {last_note_number,0};
|
||||
queue_try_add(&audioAppMEMLCelium.qMIDINoteOff, &midimsg);
|
||||
midi_interf->sendNoteOff(last_note_number, 0);
|
||||
is_playing_note = false;
|
||||
});
|
||||
MEMLNaut::Instance()->disp->AddView(noteTrigView);
|
||||
};
|
||||
|
||||
inline void processAnalysisParams() {}
|
||||
|
||||
void analyse(stereosample_t) {}
|
||||
|
||||
void loopCore0() {}
|
||||
|
||||
};
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
class MEMLNautModePAFSynth {
|
||||
public:
|
||||
constexpr static size_t kN_InputParams = 4; // joystick x, y, rotate
|
||||
constexpr static size_t kN_InputParams = MEMLNAUT_ANALOG_INPUTS;
|
||||
|
||||
inline static PAFSynthAudioApp<> audioAppPAFSynth;
|
||||
std::array<String, PAFSynthAudioApp<>::nVoiceSpaces> voiceSpaceList;
|
||||
|
|
@ -23,6 +23,7 @@ public:
|
|||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, PAFSynthAudioApp<>::kN_Params);
|
||||
interface.bindInterface(InterfaceRL::INPUT_MODES::JOYSTICK, true);
|
||||
interface.setModeInfo("pafsynth", "PAFSynth");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ public:
|
|||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, ThruAudioApp<>::kN_Params);
|
||||
interface.bindInterface(InterfaceRL::INPUT_MODES::JOYSTICK_AND_MACHINE_LISTENING);
|
||||
interface.setModeInfo("samidi", "SoundAnalMIDI");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,11 +22,18 @@ public:
|
|||
// SharedBuffer<float, XiasriAnalysis::kN_Params> machine_list_buffer;
|
||||
|
||||
VerbFXAudioApp<> audioAppVerbFX;
|
||||
std::array<String, VerbFXAudioApp<>::nVoiceSpaces> voiceSpaceList;
|
||||
std::shared_ptr<MIDIInOut> midi_interf;
|
||||
std::shared_ptr<BlockSelectView> enableView;
|
||||
|
||||
|
||||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, VerbFXAudioApp<>::kN_Params);
|
||||
interface.setRVX1Override([this](float value) {
|
||||
audioAppVerbFX.setWetDryQueued(value);
|
||||
});
|
||||
interface.bindInterface(MEMLNAUT_INPUT_MODE, JOYSTICK_IS_4D);
|
||||
interface.setModeInfo("verbfx", "VerbFX");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
}
|
||||
|
||||
|
|
@ -46,10 +53,36 @@ public:
|
|||
}
|
||||
|
||||
void addViews() {
|
||||
enableView = std::make_shared<BlockSelectView>("FX Enable", TFT_YELLOW, 6, 80, 70, TFT_BLACK,
|
||||
std::vector<String>{ "FilterBnk", "Reverb", "ShortDly", "MedDly", "LongDly", "Dly->Verb" },
|
||||
TFT_BLUE, 2);
|
||||
enableView->SetOnSelectCallback([this](size_t id) {
|
||||
enableView->toggleAlt(id - 1);
|
||||
queue_t& q = audioAppVerbFX.controlMessageQueue;
|
||||
switch(id) {
|
||||
case 1: { auto msg = VerbFXAudioApp<>::controlMessages::MSG_ENABLE_FILTERBANK; queue_try_add(&q, &msg); } break;
|
||||
case 2: { auto msg = VerbFXAudioApp<>::controlMessages::MSG_ENABLE_REVERB; queue_try_add(&q, &msg); } break;
|
||||
case 3: { auto msg = VerbFXAudioApp<>::controlMessages::MSG_ENABLE_SHORT_DELAY; queue_try_add(&q, &msg); } break;
|
||||
case 4: { auto msg = VerbFXAudioApp<>::controlMessages::MSG_ENABLE_MEDIUM_DELAY; queue_try_add(&q, &msg); } break;
|
||||
case 5: { auto msg = VerbFXAudioApp<>::controlMessages::MSG_ENABLE_LONG_DELAY; queue_try_add(&q, &msg); } break;
|
||||
case 6: { auto msg = VerbFXAudioApp<>::controlMessages::MSG_ENABLE_DELAY_TO_REVERB; queue_try_add(&q, &msg); } break;
|
||||
}
|
||||
});
|
||||
MEMLNaut::Instance()->disp->AddView(enableView);
|
||||
|
||||
std::shared_ptr<VoiceSpaceSelectView> voiceSpaceSelectView;
|
||||
voiceSpaceSelectView = std::make_shared<VoiceSpaceSelectView>("Voice Spaces");
|
||||
MEMLNaut::Instance()->disp->InsertViewAfter(interface.rlStatsView, voiceSpaceSelectView);
|
||||
voiceSpaceSelectView->setOptions(voiceSpaceList);
|
||||
voiceSpaceSelectView->setNewVoiceCallback(
|
||||
[this](size_t idx) {
|
||||
audioAppVerbFX.setVoiceSpace(idx);
|
||||
});
|
||||
};
|
||||
|
||||
void setupAudio(float sample_rate) {
|
||||
audioAppVerbFX.Setup(sample_rate, interfacePtr);
|
||||
voiceSpaceList = audioAppVerbFX.getVoiceSpaceNames();
|
||||
// Reinitialize XiasriAnalysis filters after maxiSettings is properly configured
|
||||
// mlAnalysis.ReinitFilters();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public:
|
|||
void setupInterface() {
|
||||
interface.setup(kN_InputParams, XIASRIAudioApp<>::kN_Params);
|
||||
interface.bindInterface(InterfaceRL::INPUT_MODES::MACHINE_LISTENING);
|
||||
interface.setModeInfo("xiasri", "XIASRI");
|
||||
interfacePtr = make_non_owning(interface);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 5d67d157228572f458b2744296c3e9585289187d
|
||||
Subproject commit 188496d4621cec7008d83404b80578597b67414b
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit dd1e1f36eac66f95f14daad48ad9def2e4c5f3ec
|
||||
Subproject commit 697773271e34b3ae711e698d81668b8e11e1055a
|
||||
71
voicespaces/VerbFX/basic.hpp
Normal file
71
voicespaces/VerbFX/basic.hpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_BASIC_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_BASIC_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_DEFAULT_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = smoothParams[1] * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp1fb = smoothParams[3] * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp2fb = smoothParams[5] * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp3fb = smoothParams[7] * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp4fb = smoothParams[9] * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp5fb = smoothParams[11] * 0.98f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp6fb = smoothParams[13] * 0.9;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp7fb = smoothParams[15] * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;\
|
||||
\
|
||||
allp0fb = smoothParams[17] * 0.9f;\
|
||||
allp1fb = smoothParams[18] * 0.9f;\
|
||||
allp2fb = smoothParams[19] * 0.9f;\
|
||||
allp3fb = smoothParams[20] * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + (smoothParams[29] * 19.f);\
|
||||
filterBankRes1 = 1.f + (smoothParams[30] * 19.f);\
|
||||
filterBankRes2 = 1.f + (smoothParams[31] * 19.f);\
|
||||
filterBankRes3 = 1.f + (smoothParams[32] * 19.f);\
|
||||
filterBankRes4 = 1.f + (smoothParams[33] * 19.f);\
|
||||
filterBankRes5 = 1.f + (smoothParams[34] * 19.f);\
|
||||
filterBankRes6 = 1.f + (smoothParams[35] * 19.f);\
|
||||
filterBankRes7 = 1.f + (smoothParams[36] * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = (smoothParams[38] * 0.98f);\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = (smoothParams[40] * 0.98f);\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = (smoothParams[42] * 0.98f);\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/bright.hpp
Normal file
69
voicespaces/VerbFX/bright.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_BRIGHT_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_BRIGHT_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_BRIGHT_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = smoothParams[1] * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp1fb = smoothParams[3] * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp2fb = smoothParams[5] * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp3fb = smoothParams[7] * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp4fb = smoothParams[9] * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp5fb = smoothParams[11] * 0.9f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp6fb = smoothParams[13] * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp7fb = smoothParams[15] * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.1f;\
|
||||
\
|
||||
allp0fb = smoothParams[17] * 0.9f;\
|
||||
allp1fb = smoothParams[18] * 0.9f;\
|
||||
allp2fb = smoothParams[19] * 0.9f;\
|
||||
allp3fb = smoothParams[20] * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (sqrtf(smoothParams[21]) * 40.f);\
|
||||
filterBankF1 = 80.f + (sqrtf(smoothParams[22]) * 80.f);\
|
||||
filterBankF2 = 160.f + (sqrtf(smoothParams[23]) * 160.f);\
|
||||
filterBankF3 = 320.f + (sqrtf(smoothParams[24]) * 320.f);\
|
||||
filterBankF4 = 640.f + (sqrtf(smoothParams[25]) * 640.f);\
|
||||
filterBankF5 = 1280.f + (sqrtf(smoothParams[26]) * 1280.f);\
|
||||
filterBankF6 = 2560.f + (sqrtf(smoothParams[27]) * 2560.f);\
|
||||
filterBankF7 = 5120.f + (sqrtf(smoothParams[28]) * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + ((smoothParams[29] * smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + ((smoothParams[30] * smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + ((smoothParams[31] * smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + ((smoothParams[32] * smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + (sqrtf(smoothParams[33]) * 25.f);\
|
||||
filterBankRes5 = 1.f + (sqrtf(smoothParams[34]) * 25.f);\
|
||||
filterBankRes6 = 1.f + (sqrtf(smoothParams[35]) * 25.f);\
|
||||
filterBankRes7 = 1.f + (sqrtf(smoothParams[36]) * 25.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = smoothParams[38] * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = smoothParams[40] * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = smoothParams[42] * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/cathedral.hpp
Normal file
69
voicespaces/VerbFX/cathedral.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_CATHEDRAL_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_CATHEDRAL_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_CATHEDRAL_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = sqrtf(smoothParams[1]) * 0.98f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp1fb = sqrtf(smoothParams[3]) * 0.98f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp2fb = sqrtf(smoothParams[5]) * 0.98f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp3fb = sqrtf(smoothParams[7]) * 0.98f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp4fb = sqrtf(smoothParams[9]) * 0.98f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp5fb = sqrtf(smoothParams[11]) * 0.98f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp6fb = sqrtf(smoothParams[13]) * 0.98f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp7fb = sqrtf(smoothParams[15]) * 0.98f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.3f) + 0.02f;\
|
||||
\
|
||||
allp0fb = sqrtf(smoothParams[17]) * 0.9f;\
|
||||
allp1fb = sqrtf(smoothParams[18]) * 0.9f;\
|
||||
allp2fb = sqrtf(smoothParams[19]) * 0.9f;\
|
||||
allp3fb = sqrtf(smoothParams[20]) * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + (smoothParams[29] * 19.f);\
|
||||
filterBankRes1 = 1.f + (smoothParams[30] * 19.f);\
|
||||
filterBankRes2 = 1.f + (smoothParams[31] * 19.f);\
|
||||
filterBankRes3 = 1.f + (smoothParams[32] * 19.f);\
|
||||
filterBankRes4 = 1.f + (smoothParams[33] * 19.f);\
|
||||
filterBankRes5 = 1.f + (smoothParams[34] * 19.f);\
|
||||
filterBankRes6 = 1.f + (smoothParams[35] * 19.f);\
|
||||
filterBankRes7 = 1.f + (smoothParams[36] * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (sqrtf(smoothParams[37]) * 16373.f);\
|
||||
ddelayFeedback = sqrtf(smoothParams[38]) * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (sqrtf(smoothParams[39]) * 2037.f);\
|
||||
ddelayFeedback1 = sqrtf(smoothParams[40]) * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (sqrtf(smoothParams[41]) * 501.f);\
|
||||
ddelayFeedback2 = sqrtf(smoothParams[42]) * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43] * smoothParams[43];\
|
||||
delayToVerbLevel = sqrtf(smoothParams[44]) * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/chamber.hpp
Normal file
69
voicespaces/VerbFX/chamber.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_CHAMBER_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_CHAMBER_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_CHAMBER_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = (smoothParams[1] * smoothParams[1]) * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp1fb = (smoothParams[3] * smoothParams[3]) * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp2fb = (smoothParams[5] * smoothParams[5]) * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp3fb = (smoothParams[7] * smoothParams[7]) * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp4fb = (smoothParams[9] * smoothParams[9]) * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp5fb = (smoothParams[11] * smoothParams[11]) * 0.9f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp6fb = (smoothParams[13] * smoothParams[13]) * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.1f;\
|
||||
\
|
||||
lp7fb = (smoothParams[15] * smoothParams[15]) * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.1f;\
|
||||
\
|
||||
allp0fb = (smoothParams[17] * smoothParams[17]) * 0.9f;\
|
||||
allp1fb = (smoothParams[18] * smoothParams[18]) * 0.9f;\
|
||||
allp2fb = (smoothParams[19] * smoothParams[19]) * 0.9f;\
|
||||
allp3fb = (smoothParams[20] * smoothParams[20]) * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + ((smoothParams[29] * smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + ((smoothParams[30] * smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + ((smoothParams[31] * smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + ((smoothParams[32] * smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + ((smoothParams[33] * smoothParams[33]) * 19.f);\
|
||||
filterBankRes5 = 1.f + ((smoothParams[34] * smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + ((smoothParams[35] * smoothParams[35]) * 19.f);\
|
||||
filterBankRes7 = 1.f + ((smoothParams[36] * smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + ((smoothParams[37] * smoothParams[37]) * 16373.f);\
|
||||
ddelayFeedback = (smoothParams[38] * smoothParams[38]) * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + ((smoothParams[39] * smoothParams[39]) * 2037.f);\
|
||||
ddelayFeedback1 = (smoothParams[40] * smoothParams[40]) * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + ((smoothParams[41] * smoothParams[41]) * 501.f);\
|
||||
ddelayFeedback2 = (smoothParams[42] * smoothParams[42]) * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/dark.hpp
Normal file
69
voicespaces/VerbFX/dark.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_DARK_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_DARK_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_DARK_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = smoothParams[1] * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp1fb = smoothParams[3] * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp2fb = smoothParams[5] * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp3fb = smoothParams[7] * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp4fb = smoothParams[9] * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp5fb = smoothParams[11] * 0.9f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp6fb = smoothParams[13] * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.3f) + 0.02f;\
|
||||
\
|
||||
lp7fb = smoothParams[15] * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.3f) + 0.02f;\
|
||||
\
|
||||
allp0fb = smoothParams[17] * 0.9f;\
|
||||
allp1fb = smoothParams[18] * 0.9f;\
|
||||
allp2fb = smoothParams[19] * 0.9f;\
|
||||
allp3fb = smoothParams[20] * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 40.f + ((smoothParams[21] * smoothParams[21]) * 40.f);\
|
||||
filterBankF1 = 80.f + ((smoothParams[22] * smoothParams[22]) * 80.f);\
|
||||
filterBankF2 = 160.f + ((smoothParams[23] * smoothParams[23]) * 160.f);\
|
||||
filterBankF3 = 320.f + ((smoothParams[24] * smoothParams[24]) * 320.f);\
|
||||
filterBankF4 = 640.f + ((smoothParams[25] * smoothParams[25]) * 640.f);\
|
||||
filterBankF5 = 1280.f + ((smoothParams[26] * smoothParams[26]) * 1280.f);\
|
||||
filterBankF6 = 2560.f + ((smoothParams[27] * smoothParams[27]) * 2560.f);\
|
||||
filterBankF7 = 5120.f + ((smoothParams[28] * smoothParams[28]) * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + (sqrtf(smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + (sqrtf(smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + (sqrtf(smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + (sqrtf(smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + ((smoothParams[33] * smoothParams[33]) * 19.f);\
|
||||
filterBankRes5 = 1.f + ((smoothParams[34] * smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + ((smoothParams[35] * smoothParams[35]) * 19.f);\
|
||||
filterBankRes7 = 1.f + ((smoothParams[36] * smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = smoothParams[38] * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = smoothParams[40] * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = smoothParams[42] * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/diffuse.hpp
Normal file
69
voicespaces/VerbFX/diffuse.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_DIFFUSE_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_DIFFUSE_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_DIFFUSE_BODY \
|
||||
filterBankDelayXFade = sqrtf(smoothParams[0]); \
|
||||
\
|
||||
lp0fb = smoothParams[1] * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp1fb = smoothParams[3] * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp2fb = smoothParams[5] * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp3fb = smoothParams[7] * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp4fb = smoothParams[9] * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp5fb = smoothParams[11] * 0.9f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp6fb = smoothParams[13] * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp7fb = smoothParams[15] * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;\
|
||||
\
|
||||
allp0fb = sqrtf(smoothParams[17]) * 0.95f;\
|
||||
allp1fb = sqrtf(smoothParams[18]) * 0.95f;\
|
||||
allp2fb = sqrtf(smoothParams[19]) * 0.95f;\
|
||||
allp3fb = sqrtf(smoothParams[20]) * 0.95f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + ((smoothParams[29] * smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + ((smoothParams[30] * smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + ((smoothParams[31] * smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + ((smoothParams[32] * smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + ((smoothParams[33] * smoothParams[33]) * 19.f);\
|
||||
filterBankRes5 = 1.f + ((smoothParams[34] * smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + ((smoothParams[35] * smoothParams[35]) * 19.f);\
|
||||
filterBankRes7 = 1.f + ((smoothParams[36] * smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = sqrtf(smoothParams[38]) * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = sqrtf(smoothParams[40]) * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = sqrtf(smoothParams[42]) * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/granular.hpp
Normal file
69
voicespaces/VerbFX/granular.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_GRANULAR_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_GRANULAR_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_GRANULAR_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = (smoothParams[1] * smoothParams[1]) * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp1fb = (smoothParams[3] * smoothParams[3]) * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp2fb = (smoothParams[5] * smoothParams[5]) * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp3fb = (smoothParams[7] * smoothParams[7]) * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp4fb = (smoothParams[9] * smoothParams[9]) * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp5fb = (smoothParams[11] * smoothParams[11]) * 0.9f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp6fb = (smoothParams[13] * smoothParams[13]) * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp7fb = (smoothParams[15] * smoothParams[15]) * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;\
|
||||
\
|
||||
allp0fb = (smoothParams[17] * smoothParams[17]) * 0.9f;\
|
||||
allp1fb = (smoothParams[18] * smoothParams[18]) * 0.9f;\
|
||||
allp2fb = (smoothParams[19] * smoothParams[19]) * 0.9f;\
|
||||
allp3fb = (smoothParams[20] * smoothParams[20]) * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + ((smoothParams[29] * smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + ((smoothParams[30] * smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + ((smoothParams[31] * smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + ((smoothParams[32] * smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + ((smoothParams[33] * smoothParams[33]) * 19.f);\
|
||||
filterBankRes5 = 1.f + ((smoothParams[34] * smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + ((smoothParams[35] * smoothParams[35]) * 19.f);\
|
||||
filterBankRes7 = 1.f + ((smoothParams[36] * smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = (smoothParams[38] * smoothParams[38]) * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = (smoothParams[40] * smoothParams[40]) * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = sqrtf(smoothParams[42]) * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = sqrtf(smoothParams[43]);\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45] * smoothParams[45];\
|
||||
delayBlend = sqrtf(smoothParams[46]);
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/harmonic.hpp
Normal file
69
voicespaces/VerbFX/harmonic.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_HARMONIC_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_HARMONIC_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_HARMONIC_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = smoothParams[1] * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp1fb = smoothParams[3] * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp2fb = smoothParams[5] * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp3fb = smoothParams[7] * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp4fb = smoothParams[9] * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp5fb = smoothParams[11] * 0.98f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp6fb = smoothParams[13] * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp7fb = smoothParams[15] * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;\
|
||||
\
|
||||
allp0fb = smoothParams[17] * 0.9f;\
|
||||
allp1fb = smoothParams[18] * 0.9f;\
|
||||
allp2fb = smoothParams[19] * 0.9f;\
|
||||
allp3fb = smoothParams[20] * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 80.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 180.f + (smoothParams[22] * 40.f);\
|
||||
filterBankF2 = 280.f + (smoothParams[23] * 40.f);\
|
||||
filterBankF3 = 380.f + (smoothParams[24] * 40.f);\
|
||||
filterBankF4 = 480.f + (smoothParams[25] * 40.f);\
|
||||
filterBankF5 = 580.f + (smoothParams[26] * 40.f);\
|
||||
filterBankF6 = 680.f + (smoothParams[27] * 40.f);\
|
||||
filterBankF7 = 780.f + (smoothParams[28] * 40.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + (sqrtf(smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + (sqrtf(smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + (sqrtf(smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + (sqrtf(smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + (sqrtf(smoothParams[33]) * 19.f);\
|
||||
filterBankRes5 = 1.f + (sqrtf(smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + (sqrtf(smoothParams[35]) * 19.f);\
|
||||
filterBankRes7 = 1.f + (sqrtf(smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = smoothParams[38] * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = smoothParams[40] * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = smoothParams[42] * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/metallic.hpp
Normal file
69
voicespaces/VerbFX/metallic.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_METALLIC_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_METALLIC_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_METALLIC_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = smoothParams[1] * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp1fb = smoothParams[3] * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp2fb = smoothParams[5] * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp3fb = smoothParams[7] * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp4fb = smoothParams[9] * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp5fb = smoothParams[11] * 0.9f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp6fb = smoothParams[13] * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp7fb = smoothParams[15] * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;\
|
||||
\
|
||||
allp0fb = sqrtf(smoothParams[17]) * 0.95f;\
|
||||
allp1fb = sqrtf(smoothParams[18]) * 0.95f;\
|
||||
allp2fb = sqrtf(smoothParams[19]) * 0.95f;\
|
||||
allp3fb = sqrtf(smoothParams[20]) * 0.95f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + (sqrtf(smoothParams[29]) * 25.f);\
|
||||
filterBankRes1 = 1.f + ((smoothParams[30] * smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + (sqrtf(smoothParams[31]) * 25.f);\
|
||||
filterBankRes3 = 1.f + ((smoothParams[32] * smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + (sqrtf(smoothParams[33]) * 25.f);\
|
||||
filterBankRes5 = 1.f + ((smoothParams[34] * smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + (sqrtf(smoothParams[35]) * 25.f);\
|
||||
filterBankRes7 = 1.f + ((smoothParams[36] * smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = smoothParams[38] * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = smoothParams[40] * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = smoothParams[42] * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
70
voicespaces/VerbFX/resonant.hpp
Normal file
70
voicespaces/VerbFX/resonant.hpp
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_RESONANT_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_RESONANT_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_RESONANT_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = smoothParams[1] * 0.99f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp1fb = smoothParams[3] * 0.99f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp2fb = smoothParams[5] * 0.99f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp3fb = smoothParams[7] * 0.99f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp4fb = smoothParams[9] * 0.99f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp5fb = smoothParams[11] * 0.99f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp6fb = smoothParams[13] * 0.99;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp7fb = smoothParams[15] * 0.99f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;\
|
||||
\
|
||||
allp0fb = smoothParams[17] * 0.99f;\
|
||||
allp1fb = smoothParams[18] * 0.99f;\
|
||||
allp2fb = smoothParams[19] * 0.99f;\
|
||||
allp3fb = smoothParams[20] * 0.99f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + (sqrtf(smoothParams[29]) * 25.f);\
|
||||
filterBankRes1 = 1.f + (sqrtf(smoothParams[30]) * 25.f);\
|
||||
filterBankRes2 = 1.f + (sqrtf(smoothParams[31]) * 25.f);\
|
||||
filterBankRes3 = 1.f + (sqrtf(smoothParams[32]) * 25.f);\
|
||||
filterBankRes4 = 1.f + (sqrtf(smoothParams[33]) * 25.f);\
|
||||
filterBankRes5 = 1.f + (sqrtf(smoothParams[34]) * 25.f);\
|
||||
filterBankRes6 = 1.f + (sqrtf(smoothParams[35]) * 25.f);\
|
||||
filterBankRes7 = 1.f + (sqrtf(smoothParams[36]) * 25.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = (smoothParams[38] * 0.99f);\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = (smoothParams[40] * 0.99f);\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = (smoothParams[42] * 0.99f);\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/shimmer.hpp
Normal file
69
voicespaces/VerbFX/shimmer.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_SHIMMER_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_SHIMMER_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_SHIMMER_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = sqrtf(smoothParams[1]) * 0.98f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.4f) + 0.05f;\
|
||||
\
|
||||
lp1fb = sqrtf(smoothParams[3]) * 0.98f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.4f) + 0.05f;\
|
||||
\
|
||||
lp2fb = sqrtf(smoothParams[5]) * 0.98f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.4f) + 0.05f;\
|
||||
\
|
||||
lp3fb = sqrtf(smoothParams[7]) * 0.98f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.4f) + 0.05f;\
|
||||
\
|
||||
lp4fb = sqrtf(smoothParams[9]) * 0.98f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.4f) + 0.05f;\
|
||||
\
|
||||
lp5fb = sqrtf(smoothParams[11]) * 0.98f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.4f) + 0.05f;\
|
||||
\
|
||||
lp6fb = sqrtf(smoothParams[13]) * 0.98f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.4f) + 0.05f;\
|
||||
\
|
||||
lp7fb = sqrtf(smoothParams[15]) * 0.98f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.4f) + 0.05f;\
|
||||
\
|
||||
allp0fb = sqrtf(smoothParams[17]) * 0.99f;\
|
||||
allp1fb = sqrtf(smoothParams[18]) * 0.99f;\
|
||||
allp2fb = sqrtf(smoothParams[19]) * 0.99f;\
|
||||
allp3fb = sqrtf(smoothParams[20]) * 0.99f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + (sqrtf(smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + (sqrtf(smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + (sqrtf(smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + (sqrtf(smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + (sqrtf(smoothParams[33]) * 19.f);\
|
||||
filterBankRes5 = 1.f + (sqrtf(smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + (sqrtf(smoothParams[35]) * 19.f);\
|
||||
filterBankRes7 = 1.f + (sqrtf(smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = sqrtf(smoothParams[38]) * 0.95f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = sqrtf(smoothParams[40]) * 0.95f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = sqrtf(smoothParams[42]) * 0.95f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43] * smoothParams[43];\
|
||||
delayToVerbLevel = sqrtf(smoothParams[44]) * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
69
voicespaces/VerbFX/soft.hpp
Normal file
69
voicespaces/VerbFX/soft.hpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
#ifndef __VOICE_SPACE_VERBFX_SOFT_HPP__
|
||||
#define __VOICE_SPACE_VERBFX_SOFT_HPP__
|
||||
|
||||
#define VOICE_SPACE_VERBFX_SOFT_BODY \
|
||||
filterBankDelayXFade = smoothParams[0]; \
|
||||
\
|
||||
lp0fb = (smoothParams[1] * smoothParams[1]) * 0.9f;\
|
||||
lp0cutoff = (smoothParams[2] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp1fb = (smoothParams[3] * smoothParams[3]) * 0.9f;\
|
||||
lp1cutoff = (smoothParams[4] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp2fb = (smoothParams[5] * smoothParams[5]) * 0.9f;\
|
||||
lp2cutoff = (smoothParams[6] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp3fb = (smoothParams[7] * smoothParams[7]) * 0.9f;\
|
||||
lp3cutoff = (smoothParams[8] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp4fb = (smoothParams[9] * smoothParams[9]) * 0.9f;\
|
||||
lp4cutoff = (smoothParams[10] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp5fb = (smoothParams[11] * smoothParams[11]) * 0.98f;\
|
||||
lp5cutoff = (smoothParams[12] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp6fb = (smoothParams[13] * smoothParams[13]) * 0.9f;\
|
||||
lp6cutoff = (smoothParams[14] * 0.5f) + 0.05f;\
|
||||
\
|
||||
lp7fb = (smoothParams[15] * smoothParams[15]) * 0.9f;\
|
||||
lp7cutoff = (smoothParams[16] * 0.5f) + 0.05f;\
|
||||
\
|
||||
allp0fb = (smoothParams[17] * smoothParams[17]) * 0.9f;\
|
||||
allp1fb = (smoothParams[18] * smoothParams[18]) * 0.9f;\
|
||||
allp2fb = (smoothParams[19] * smoothParams[19]) * 0.9f;\
|
||||
allp3fb = (smoothParams[20] * smoothParams[20]) * 0.9f;\
|
||||
\
|
||||
filterBankF0 = 40.f + (smoothParams[21] * 40.f);\
|
||||
filterBankF1 = 80.f + (smoothParams[22] * 80.f);\
|
||||
filterBankF2 = 160.f + (smoothParams[23] * 160.f);\
|
||||
filterBankF3 = 320.f + (smoothParams[24] * 320.f);\
|
||||
filterBankF4 = 640.f + (smoothParams[25] * 640.f);\
|
||||
filterBankF5 = 1280.f + (smoothParams[26] * 1280.f);\
|
||||
filterBankF6 = 2560.f + (smoothParams[27] * 2560.f);\
|
||||
filterBankF7 = 5120.f + (smoothParams[28] * 5120.f);\
|
||||
\
|
||||
filterBankRes0 = 1.f + ((smoothParams[29] * smoothParams[29]) * 19.f);\
|
||||
filterBankRes1 = 1.f + ((smoothParams[30] * smoothParams[30]) * 19.f);\
|
||||
filterBankRes2 = 1.f + ((smoothParams[31] * smoothParams[31]) * 19.f);\
|
||||
filterBankRes3 = 1.f + ((smoothParams[32] * smoothParams[32]) * 19.f);\
|
||||
filterBankRes4 = 1.f + ((smoothParams[33] * smoothParams[33]) * 19.f);\
|
||||
filterBankRes5 = 1.f + ((smoothParams[34] * smoothParams[34]) * 19.f);\
|
||||
filterBankRes6 = 1.f + ((smoothParams[35] * smoothParams[35]) * 19.f);\
|
||||
filterBankRes7 = 1.f + ((smoothParams[36] * smoothParams[36]) * 19.f);\
|
||||
\
|
||||
ddelayTime = 10.f + (smoothParams[37] * 16373.f);\
|
||||
ddelayFeedback = (smoothParams[38] * smoothParams[38]) * 0.98f;\
|
||||
\
|
||||
ddelayTime1 = 10.f + (smoothParams[39] * 2037.f);\
|
||||
ddelayFeedback1 = (smoothParams[40] * smoothParams[40]) * 0.98f;\
|
||||
\
|
||||
ddelayTime2 = 10.f + (smoothParams[41] * 501.f);\
|
||||
ddelayFeedback2 = (smoothParams[42] * smoothParams[42]) * 0.98f;\
|
||||
\
|
||||
verbVsDelayLevel = smoothParams[43];\
|
||||
delayToVerbLevel = smoothParams[44] * 0.99f;\
|
||||
\
|
||||
delayMorph = smoothParams[45];\
|
||||
delayBlend = smoothParams[46];
|
||||
|
||||
#endif
|
||||
Loading…
Reference in a new issue