Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f4f2cbbda | |||
| 74f9dd1d74 |
133
InputsTest/InputsTest.ino
Normal file
133
InputsTest/InputsTest.ino
Normal file
@ -0,0 +1,133 @@
|
||||
//Hardware Definitions
|
||||
#define Knob1 A6 //Intensity
|
||||
#define Knob2 A4 //Modulation Frequency
|
||||
#define Knob3 A2 //Harmonics
|
||||
#define Knob4 A0
|
||||
#define KnobA A5
|
||||
#define KnobDR A3
|
||||
#define KnobS A1
|
||||
#define CVIn A7
|
||||
#define GateIn 10
|
||||
#define EnvSwitch 11
|
||||
#define DroneSwitch 12
|
||||
#define LED 5
|
||||
|
||||
// smoothing for intensity to remove clicks on transitions
|
||||
float smoothness = 0.95f;
|
||||
Smooth <long> aSmoothIntensity(smoothness);
|
||||
|
||||
int carrierFreq = 440;
|
||||
int mod_ratio = 5; // brightness (harmonics)
|
||||
long fm_intensity; // carries control info from updateControl to updateAudio
|
||||
|
||||
|
||||
void MIDINoteOn(byte channel, byte note, byte velocity) {
|
||||
carrierFreq = mtof((int) note);
|
||||
envelope.noteOn();
|
||||
MIDINotePlaying = true;
|
||||
digitalWrite(LED, LOW);
|
||||
}
|
||||
|
||||
void MIDINoteOff(byte channel, byte note, byte velocity) {
|
||||
envelope.noteOff();
|
||||
//MIDINotePlaying = false;
|
||||
digitalWrite(LED, HIGH);
|
||||
}
|
||||
|
||||
|
||||
void setup(){
|
||||
//pinMode(LED_BUILTIN_TX,INPUT); //switch rx and tx leds of, so they don't blink on midi
|
||||
//pinMode(LED_BUILTIN_RX,INPUT);
|
||||
pinMode(LED, OUTPUT);
|
||||
pinMode(GateIn, INPUT_PULLUP);
|
||||
pinMode(EnvSwitch, INPUT_PULLUP);
|
||||
pinMode(DroneSwitch, INPUT_PULLUP);
|
||||
|
||||
MIDI.setHandleNoteOn(MIDINoteOn);
|
||||
MIDI.setHandleNoteOff(MIDINoteOff);
|
||||
MIDI.begin(MIDI_CHANNEL);
|
||||
|
||||
startMozzi();
|
||||
|
||||
digitalWrite(LED, HIGH);
|
||||
}
|
||||
|
||||
|
||||
void updateControl(){
|
||||
//Get Control Values
|
||||
int CVInVal = mozziAnalogRead(CVIn);
|
||||
int knob1Val = mozziAnalogRead(Knob1);
|
||||
int knob2Val = mozziAnalogRead(Knob2);
|
||||
int knob3Val = mozziAnalogRead(Knob3);
|
||||
int knob4Val = mozziAnalogRead(Knob4);
|
||||
int knobAVal = mozziAnalogRead(KnobA);
|
||||
int knobDRVal = mozziAnalogRead(KnobDR);
|
||||
int knobSVal = mozziAnalogRead(KnobS);
|
||||
bool droneSwitchVal = digitalRead(DroneSwitch);
|
||||
bool envSwitchVal = digitalRead(EnvSwitch);
|
||||
bool gateInVal = !digitalRead(GateIn);
|
||||
|
||||
//Remap the Values
|
||||
if (!MIDINotePlaying) {
|
||||
carrierFreq = kMapCarrierFreq(CVInVal); //Pitch
|
||||
if (gateInVal && !gateIsHigh) {
|
||||
gateIsHigh = true;
|
||||
envelope.noteOn();
|
||||
} else if (!gateInVal && gateIsHigh) {
|
||||
gateIsHigh = false;
|
||||
envelope.noteOff();
|
||||
}
|
||||
} else if (MIDINotePlaying && !envelope.playing()) { //
|
||||
MIDINotePlaying = false;
|
||||
}
|
||||
int intensity = kMapIntensity(knob1Val);
|
||||
float modSpeed = (float)kMapModSpeed(knob2Val)/1000; //float for lower frequencies
|
||||
int harmonics = kMapHarmonics(knob3Val);
|
||||
int knob4Map = 1;//mapThisToo(knob4Val);
|
||||
|
||||
//Update Envelope Settings
|
||||
int attackTime = kMapAttack(knobAVal);
|
||||
int decayReleaseTime = kMapDecayRelease(knobDRVal);
|
||||
int sustainLevel = kMapSustain(knobSVal);
|
||||
envelope.setDecayLevel(sustainLevel); //Should be enough
|
||||
//envelope.setSustainLevel(sustainLevel); //but with this, just in case
|
||||
envelope.setTimes(attackTime, decayReleaseTime, 30000, decayReleaseTime); //30000 is so the note will sustain 30 seconds unless a noteOff comes
|
||||
//envelope.setDecayLevel(100);
|
||||
//envelope.setSustainLevel(100);
|
||||
//envelope.setTimes(150, 300, 10000, 300); //10000 is so the note will sustain 10 seconds unless a noteOff comes
|
||||
|
||||
|
||||
|
||||
//calculate the modulation frequency to stay in ratio
|
||||
int modFreq = carrierFreq * mod_ratio * harmonics;
|
||||
|
||||
// set the FM oscillator frequencies
|
||||
aCarrier.setFreq(carrierFreq);
|
||||
aModulator.setFreq(modFreq);
|
||||
|
||||
// calculate the fm_intensity
|
||||
fm_intensity = ((long)intensity * knob4Map * (kIntensityMod.next()+128))>>8; // shift back to range after 8 bit multiply
|
||||
|
||||
kIntensityMod.setFreq(modSpeed);
|
||||
MIDI.read();
|
||||
|
||||
digitalWrite(LED, !gateInVal);
|
||||
|
||||
envelope.update();
|
||||
if(!droneSwitchVal) {
|
||||
gain = envelope.next();
|
||||
} else {
|
||||
gain = 255;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AudioOutput updateAudio(){
|
||||
long modulation = aSmoothIntensity.next(fm_intensity) * aModulator.next();
|
||||
return MonoOutput::from16Bit((int) gain * aCarrier.phMod(modulation));
|
||||
}
|
||||
|
||||
|
||||
void loop(){
|
||||
audioHook();
|
||||
}
|
||||
423
PolyFM/PolyFM.ino
Executable file
423
PolyFM/PolyFM.ino
Executable file
@ -0,0 +1,423 @@
|
||||
// Arduino polyphonic FM sound
|
||||
// * 31250 Hz sampling rate
|
||||
// * 9-bit resolution
|
||||
// * 4-fold polyphony (4 different tones can play simulatenously)
|
||||
// * FM-synthesis with time-varying modulation amplitude
|
||||
// * ADSR envelopes
|
||||
// * 12 preset instruments
|
||||
// Through PWM with timer1, sound is generated on pin 9
|
||||
// instrument-select button on A5
|
||||
// 18 sound keys on the remaining i/o pins
|
||||
// by Rolf Oldeman Feb 2019
|
||||
// Licence CC BY-NC-SA 2.5 https://creativecommons.org/licenses/by-nc-sa/2.5/
|
||||
|
||||
#include <MIDI.h>
|
||||
|
||||
//instrument definitions
|
||||
#define ninstr 12 // piano xlphn guitar cmbll bell funky vibr metal violin bass trumpt harm
|
||||
unsigned int ldness[ninstr] = { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64}; // loudness
|
||||
unsigned int pitch0[ninstr] = { 12, 12, 12, 12, 24, 24, 0, 12, 24, 12, 12, 24}; // pitch of key0
|
||||
unsigned int ADSR_a[ninstr] = { 4096, 8192, 8192, 8192, 4096, 512, 512, 8192, 128, 128, 256, 256}; // attack parameter
|
||||
unsigned int ADSR_d[ninstr] = { 8, 32, 16, 16, 8, 16, 16, 8, 16, 16, 64, 32}; // decay parameter
|
||||
unsigned int ADSR_s[ninstr] = { 0, 0, 0, 0, 0, 0, 0, 0, 240, 240, 192, 192}; // sustain parameter
|
||||
unsigned int ADSR_r[ninstr] = { 64, 128, 32, 32, 16, 32, 32, 32, 32, 32, 64, 64}; // release parameter
|
||||
unsigned int FM_inc[ninstr] = { 256, 512, 768, 400, 200, 96, 528, 244, 256, 128, 64, 160}; // FM frequency wrt pitch
|
||||
unsigned int FM_a1[ninstr] = { 128, 512, 512, 1024, 512, 0, 1024, 2048, 256, 256, 384, 256}; // FM amplitude start
|
||||
unsigned int FM_a2[ninstr] = { 64, 0, 128, 128, 128, 512, 768, 512, 128, 128, 256, 128}; // FM amplitude end
|
||||
unsigned int FM_dec[ninstr] = { 64, 128, 128, 128, 32, 128, 128, 128, 128, 128, 64, 64}; // FM decay
|
||||
|
||||
//define the pitch2key mapping
|
||||
#define keyC4 0
|
||||
#define keyC4s 1
|
||||
#define keyD4 2
|
||||
#define keyD4s 3
|
||||
#define keyE4 4
|
||||
#define keyF4 5
|
||||
#define keyF4s 6
|
||||
#define keyG4 7
|
||||
#define keyG4s 8
|
||||
#define keyA4 9
|
||||
#define keyA4s 10
|
||||
#define keyB4 11
|
||||
#define keyC5 12
|
||||
#define keyC5s 13
|
||||
#define keyD5 14
|
||||
#define keyD5s 15
|
||||
#define keyE5 16
|
||||
#define keyF5 17
|
||||
|
||||
#define nokey 255
|
||||
#define instrkey 254
|
||||
|
||||
//define the pin to key mapping for 18-key keyboard
|
||||
#define pinD0 nokey //Arduino pin D0
|
||||
#define pinD1 nokey //Arduino pin D1
|
||||
#define pinD2 keyA4s //Arduino pin D2
|
||||
#define pinD3 keyA4 //Arduino pin D3
|
||||
#define pinD4 keyG4s //Arduino pin D4
|
||||
#define pinD5 keyG4 //Arduino pin D5
|
||||
#define pinD6 keyF4s //Arduino pin D6
|
||||
#define pinD7 keyF4 //Arduino pin D7
|
||||
#define pinB0 keyE4 //Arduino pin D8
|
||||
#define pinB1 nokey //Arduino pin D9 used for audio out
|
||||
#define pinB2 keyD4s //Arduino pin D10
|
||||
#define pinB3 keyD4 //Arduino pin D11
|
||||
#define pinB4 keyC4s //Arduino pin D12
|
||||
#define pinB5 keyC4 //Arduino pin D13
|
||||
#define pinB6 nokey //Arduino pin D14 inexistent
|
||||
#define pinB7 nokey //Arduino pin D15 inexistent
|
||||
#define pinC0 keyC5s //Arduino pin A0
|
||||
#define pinC1 keyD5 //Arduino pin A1
|
||||
#define pinC2 keyD5s //Arduino pin A2
|
||||
#define pinC3 keyE5 //Arduino pin A2
|
||||
#define pinC4 keyF5 //Arduino pin A3
|
||||
#define pinC5 instrkey //Arduino pin A4
|
||||
#define pinC6 nokey //Arduino pin A5 inexistent
|
||||
#define pinC7 nokey //Arduino pin A6 inexistent
|
||||
|
||||
|
||||
//set up array with sine values in signed 8-bit numbers
|
||||
const float pi = 3.14159265;
|
||||
char sine[256];
|
||||
void setsine() {
|
||||
for (int i = 0; i < 256; ++i) {
|
||||
sine[i] = (sin(2 * 3.14159265 * (i + 0.5) / 256)) * 128;
|
||||
}
|
||||
}
|
||||
|
||||
//setup frequencies/phase increments, starting at C3=0 to B6. (A4 is defined as 440Hz)
|
||||
unsigned int tone_inc[48];
|
||||
void settones() {
|
||||
for (byte i=0; i<48; i++){
|
||||
tone_inc[i]= 440.0 * pow(2.0, ( (i-21) / 12.0)) * 65536.0 / (16000000.0/512) + 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
byte butstatD=0;
|
||||
byte butstatB=0;
|
||||
byte butstatC=0;
|
||||
byte prevbutstatD=0;
|
||||
byte prevbutstatB=0;
|
||||
byte prevbutstatC=0;
|
||||
|
||||
byte instr=0;
|
||||
|
||||
void setup() {
|
||||
|
||||
//disable all inerrupts to avoid glitches
|
||||
noInterrupts();
|
||||
|
||||
//setup the array with sine values
|
||||
setsine();
|
||||
|
||||
//setup array with tone frequency phase increments
|
||||
settones();
|
||||
|
||||
//Set a fast PWM signal on TIMER1A, 9-bit resolution, 31250Hz
|
||||
pinMode(9, OUTPUT);
|
||||
TCCR1A = 0B10000010; //9-bit fast PWM
|
||||
TCCR1B = 0B00001001;
|
||||
|
||||
//setup pins for input with pull-up
|
||||
if(pinD0 != nokey){DDRD &=~(1<<0);PORTD |=(1<<0);};
|
||||
if(pinD1 != nokey){DDRD &=~(1<<1);PORTD |=(1<<1);};
|
||||
if(pinD2 != nokey){DDRD &=~(1<<2);PORTD |=(1<<2);};
|
||||
if(pinD3 != nokey){DDRD &=~(1<<3);PORTD |=(1<<3);};
|
||||
if(pinD4 != nokey){DDRD &=~(1<<4);PORTD |=(1<<4);};
|
||||
if(pinD5 != nokey){DDRD &=~(1<<5);PORTD |=(1<<5);};
|
||||
if(pinD6 != nokey){DDRD &=~(1<<6);PORTD |=(1<<6);};
|
||||
if(pinD7 != nokey){DDRD &=~(1<<7);PORTD |=(1<<7);};
|
||||
if(pinB0 != nokey){DDRB &=~(1<<0);PORTB |=(1<<0);};
|
||||
if(pinB1 != nokey){DDRB &=~(1<<1);PORTB |=(1<<1);};
|
||||
if(pinB2 != nokey){DDRB &=~(1<<2);PORTB |=(1<<2);};
|
||||
if(pinB3 != nokey){DDRB &=~(1<<3);PORTB |=(1<<3);};
|
||||
if(pinB4 != nokey){DDRB &=~(1<<4);PORTB |=(1<<4);};
|
||||
if(pinB5 != nokey){DDRB &=~(1<<5);PORTB |=(1<<5);};
|
||||
if(pinB6 != nokey){DDRB &=~(1<<6);PORTB |=(1<<6);};
|
||||
if(pinB7 != nokey){DDRB &=~(1<<7);PORTB |=(1<<7);};
|
||||
if(pinC0 != nokey){DDRC &=~(1<<0);PORTC |=(1<<0);};
|
||||
if(pinC1 != nokey){DDRC &=~(1<<1);PORTC |=(1<<1);};
|
||||
if(pinC2 != nokey){DDRC &=~(1<<2);PORTC |=(1<<2);};
|
||||
if(pinC3 != nokey){DDRC &=~(1<<3);PORTC |=(1<<3);};
|
||||
if(pinC4 != nokey){DDRC &=~(1<<4);PORTC |=(1<<4);};
|
||||
if(pinC5 != nokey){DDRC &=~(1<<5);PORTC |=(1<<5);};
|
||||
if(pinC6 != nokey){DDRC &=~(1<<6);PORTC |=(1<<6);};
|
||||
if(pinC7 != nokey){DDRC &=~(1<<7);PORTC |=(1<<7);};
|
||||
|
||||
//store button setting at startup
|
||||
butstatD = PIND;
|
||||
butstatB = PINB;
|
||||
butstatC = PINC;
|
||||
}
|
||||
|
||||
|
||||
//initialize the main parameters of the pulse length setting
|
||||
#define nch 4 //number of channels that can produce sound simultaneously
|
||||
unsigned int phase[nch] = {0,0,0,0};
|
||||
int inc[nch] = {0,0,0,0};
|
||||
byte amp[nch] = {0,0,0,0};
|
||||
unsigned int FMphase[nch]= {0,0,0,0};
|
||||
unsigned int FMinc[nch] = {0,0,0,0};
|
||||
unsigned int FMamp[nch] = {0,0,0,0};
|
||||
|
||||
// main function (forced inline) to update the pulse length
|
||||
inline void setPWM() __attribute__((always_inline));
|
||||
inline void setPWM() {
|
||||
|
||||
//wait for the timer to complete loop
|
||||
while ((TIFR1 & 0B00000001) == 0);
|
||||
|
||||
//Clear(!) the overflow bit by writing a 1 to it
|
||||
TIFR1 |= 0B00000001;
|
||||
|
||||
//increment the phases of the FM
|
||||
FMphase[0] += FMinc[0];
|
||||
FMphase[1] += FMinc[1];
|
||||
FMphase[2] += FMinc[2];
|
||||
FMphase[3] += FMinc[3];
|
||||
|
||||
//increment the phases of the note
|
||||
phase[0] += inc[0];
|
||||
phase[1] += inc[1];
|
||||
phase[2] += inc[2];
|
||||
phase[3] += inc[3];
|
||||
|
||||
//calculate the output value and set pulse width for timer2
|
||||
int val = sine[(phase[0]+sine[FMphase[0]>>8]*FMamp[0]) >> 8] * amp[0];
|
||||
val += sine[(phase[1]+sine[FMphase[1]>>8]*FMamp[1]) >> 8] * amp[1];
|
||||
val += sine[(phase[2]+sine[FMphase[2]>>8]*FMamp[2]) >> 8] * amp[2];
|
||||
val += sine[(phase[3]+sine[FMphase[3]>>8]*FMamp[3]) >> 8] * amp[3];
|
||||
|
||||
//set the pulse length
|
||||
OCR1A = val/128 + 256;
|
||||
}
|
||||
|
||||
//properties of each note played
|
||||
byte iADSR[nch] = {0, 0, 0, 0};
|
||||
unsigned int envADSR[nch] = {0, 0, 0, 0};
|
||||
unsigned int ADSRa[nch] = {0, 0, 0, 0};
|
||||
unsigned int ADSRd[nch] = {0, 0, 0, 0};
|
||||
unsigned int ADSRs[nch] = {0, 0, 0, 0};
|
||||
unsigned int ADSRr[nch] = {0, 0, 0, 0};
|
||||
byte amp_base[nch] = {0, 0, 0, 0};
|
||||
unsigned int inc_base[nch] = {0, 0, 0, 0};
|
||||
unsigned int FMa0[nch] = {0, 0, 0, 0};
|
||||
int FMda[nch] = {0, 0, 0, 0};
|
||||
unsigned int FMinc_base[nch]= {0, 0, 0, 0};
|
||||
unsigned int FMdec[nch] = {0, 0, 0, 0};
|
||||
unsigned int FMexp[nch] = {0, 0, 0, 0};
|
||||
unsigned int FMval[nch] = {0, 0, 0, 0};
|
||||
byte keych[nch] = {0, 0, 0, 0};
|
||||
unsigned int tch[nch] = {0, 0, 0, 0};
|
||||
|
||||
|
||||
// main loop. Duration of loop is determined by number of setPWM calls
|
||||
// Each setPWMcall corresponds to 512 cylcles=32mus
|
||||
// Tloop= 32mus * #setPWM. #setPWM=15 gives Tloop=0.48ms
|
||||
void loop() {
|
||||
|
||||
//read and interpret input buttons
|
||||
prevbutstatD = butstatD;
|
||||
prevbutstatB = butstatB;
|
||||
prevbutstatC = butstatC;
|
||||
butstatD = PIND;
|
||||
butstatB = PINB;
|
||||
butstatC = PINC;
|
||||
byte keypressed = nokey;
|
||||
byte keyreleased = nokey;
|
||||
if(butstatD!=prevbutstatD){
|
||||
if ( pinD0!=nokey and (butstatD & (1<<0)) == 0 and (prevbutstatD & (1<<0)) > 0 ) keypressed = pinD0;
|
||||
if ( pinD0!=nokey and (butstatD & (1<<0)) > 0 and (prevbutstatD & (1<<0)) == 0 ) keyreleased = pinD0;
|
||||
if ( pinD1!=nokey and (butstatD & (1<<1)) == 0 and (prevbutstatD & (1<<1)) > 0 ) keypressed = pinD1;
|
||||
if ( pinD1!=nokey and (butstatD & (1<<1)) > 0 and (prevbutstatD & (1<<1)) == 0 ) keyreleased = pinD1;
|
||||
if ( pinD2!=nokey and (butstatD & (1<<2)) == 0 and (prevbutstatD & (1<<2)) > 0 ) keypressed = pinD2;
|
||||
if ( pinD2!=nokey and (butstatD & (1<<2)) > 0 and (prevbutstatD & (1<<2)) == 0 ) keyreleased = pinD2;
|
||||
if ( pinD3!=nokey and (butstatD & (1<<3)) == 0 and (prevbutstatD & (1<<3)) > 0 ) keypressed = pinD3;
|
||||
if ( pinD3!=nokey and (butstatD & (1<<3)) > 0 and (prevbutstatD & (1<<3)) == 0 ) keyreleased = pinD3;
|
||||
if ( pinD4!=nokey and (butstatD & (1<<4)) == 0 and (prevbutstatD & (1<<4)) > 0 ) keypressed = pinD4;
|
||||
if ( pinD4!=nokey and (butstatD & (1<<4)) > 0 and (prevbutstatD & (1<<4)) == 0 ) keyreleased = pinD4;
|
||||
if ( pinD5!=nokey and (butstatD & (1<<5)) == 0 and (prevbutstatD & (1<<5)) > 0 ) keypressed = pinD5;
|
||||
if ( pinD5!=nokey and (butstatD & (1<<5)) > 0 and (prevbutstatD & (1<<5)) == 0 ) keyreleased = pinD5;
|
||||
if ( pinD6!=nokey and (butstatD & (1<<6)) == 0 and (prevbutstatD & (1<<6)) > 0 ) keypressed = pinD6;
|
||||
if ( pinD6!=nokey and (butstatD & (1<<6)) > 0 and (prevbutstatD & (1<<6)) == 0 ) keyreleased = pinD6;
|
||||
if ( pinD7!=nokey and (butstatD & (1<<7)) == 0 and (prevbutstatD & (1<<7)) > 0 ) keypressed = pinD7;
|
||||
if ( pinD7!=nokey and (butstatD & (1<<7)) > 0 and (prevbutstatD & (1<<7)) == 0 ) keyreleased = pinD7;
|
||||
}
|
||||
if(butstatB!=prevbutstatB){
|
||||
if ( pinB0!=nokey and (butstatB & (1<<0)) == 0 and (prevbutstatB & (1<<0)) > 0 ) keypressed = pinB0;
|
||||
if ( pinB0!=nokey and (butstatB & (1<<0)) > 0 and (prevbutstatB & (1<<0)) == 0 ) keyreleased = pinB0;
|
||||
if ( pinB1!=nokey and (butstatB & (1<<1)) == 0 and (prevbutstatB & (1<<1)) > 0 ) keypressed = pinB1;
|
||||
if ( pinB1!=nokey and (butstatB & (1<<1)) > 0 and (prevbutstatB & (1<<1)) == 0 ) keyreleased = pinB1;
|
||||
if ( pinB2!=nokey and (butstatB & (1<<2)) == 0 and (prevbutstatB & (1<<2)) > 0 ) keypressed = pinB2;
|
||||
if ( pinB2!=nokey and (butstatB & (1<<2)) > 0 and (prevbutstatB & (1<<2)) == 0 ) keyreleased = pinB2;
|
||||
if ( pinB3!=nokey and (butstatB & (1<<3)) == 0 and (prevbutstatB & (1<<3)) > 0 ) keypressed = pinB3;
|
||||
if ( pinB3!=nokey and (butstatB & (1<<3)) > 0 and (prevbutstatB & (1<<3)) == 0 ) keyreleased = pinB3;
|
||||
if ( pinB4!=nokey and (butstatB & (1<<4)) == 0 and (prevbutstatB & (1<<4)) > 0 ) keypressed = pinB4;
|
||||
if ( pinB4!=nokey and (butstatB & (1<<4)) > 0 and (prevbutstatB & (1<<4)) == 0 ) keyreleased = pinB4;
|
||||
if ( pinB5!=nokey and (butstatB & (1<<5)) == 0 and (prevbutstatB & (1<<5)) > 0 ) keypressed = pinB5;
|
||||
if ( pinB5!=nokey and (butstatB & (1<<5)) > 0 and (prevbutstatB & (1<<5)) == 0 ) keyreleased = pinB5;
|
||||
if ( pinB6!=nokey and (butstatB & (1<<6)) == 0 and (prevbutstatB & (1<<6)) > 0 ) keypressed = pinB6;
|
||||
if ( pinB6!=nokey and (butstatB & (1<<6)) > 0 and (prevbutstatB & (1<<6)) == 0 ) keyreleased = pinB6;
|
||||
if ( pinB7!=nokey and (butstatB & (1<<7)) == 0 and (prevbutstatB & (1<<7)) > 0 ) keypressed = pinB7;
|
||||
if ( pinB7!=nokey and (butstatB & (1<<7)) > 0 and (prevbutstatB & (1<<7)) == 0 ) keyreleased = pinB7;
|
||||
}
|
||||
if(butstatC!=prevbutstatC){
|
||||
if ( pinC0!=nokey and (butstatC & (1<<0)) == 0 and (prevbutstatC & (1<<0)) > 0 ) keypressed = pinC0;
|
||||
if ( pinC0!=nokey and (butstatC & (1<<0)) > 0 and (prevbutstatC & (1<<0)) == 0 ) keyreleased = pinC0;
|
||||
if ( pinC1!=nokey and (butstatC & (1<<1)) == 0 and (prevbutstatC & (1<<1)) > 0 ) keypressed = pinC1;
|
||||
if ( pinC1!=nokey and (butstatC & (1<<1)) > 0 and (prevbutstatC & (1<<1)) == 0 ) keyreleased = pinC1;
|
||||
if ( pinC2!=nokey and (butstatC & (1<<2)) == 0 and (prevbutstatC & (1<<2)) > 0 ) keypressed = pinC2;
|
||||
if ( pinC2!=nokey and (butstatC & (1<<2)) > 0 and (prevbutstatC & (1<<2)) == 0 ) keyreleased = pinC2;
|
||||
if ( pinC3!=nokey and (butstatC & (1<<3)) == 0 and (prevbutstatC & (1<<3)) > 0 ) keypressed = pinC3;
|
||||
if ( pinC3!=nokey and (butstatC & (1<<3)) > 0 and (prevbutstatC & (1<<3)) == 0 ) keyreleased = pinC3;
|
||||
if ( pinC4!=nokey and (butstatC & (1<<4)) == 0 and (prevbutstatC & (1<<4)) > 0 ) keypressed = pinC4;
|
||||
if ( pinC4!=nokey and (butstatC & (1<<4)) > 0 and (prevbutstatC & (1<<4)) == 0 ) keyreleased = pinC4;
|
||||
if ( pinC5!=nokey and (butstatC & (1<<5)) == 0 and (prevbutstatC & (1<<5)) > 0 ) keypressed = pinC5;
|
||||
if ( pinC5!=nokey and (butstatC & (1<<5)) > 0 and (prevbutstatC & (1<<5)) == 0 ) keyreleased = pinC5;
|
||||
if ( pinC6!=nokey and (butstatC & (1<<6)) == 0 and (prevbutstatC & (1<<6)) > 0 ) keypressed = pinC6;
|
||||
if ( pinC6!=nokey and (butstatC & (1<<6)) > 0 and (prevbutstatC & (1<<6)) == 0 ) keyreleased = pinC6;
|
||||
if ( pinC7!=nokey and (butstatC & (1<<7)) == 0 and (prevbutstatC & (1<<7)) > 0 ) keypressed = pinC7;
|
||||
if ( pinC7!=nokey and (butstatC & (1<<7)) > 0 and (prevbutstatC & (1<<7)) == 0 ) keyreleased = pinC7;
|
||||
}
|
||||
|
||||
setPWM(); //#1
|
||||
|
||||
//change instrument if instrument select button is pressed
|
||||
if ( keypressed==instrkey) {
|
||||
instr++;
|
||||
if (instr>=ninstr) instr=0;
|
||||
keypressed=keyA4;
|
||||
}
|
||||
if (keyreleased==instrkey) keyreleased=keyA4;
|
||||
|
||||
setPWM(); //#2
|
||||
|
||||
//find the best channel to start a new note
|
||||
byte nextch = 255;
|
||||
//first check if the key is still being played
|
||||
if (iADSR[0] > 0 and keypressed == keych[0])nextch = 0;
|
||||
if (iADSR[1] > 0 and keypressed == keych[1])nextch = 1;
|
||||
if (iADSR[2] > 0 and keypressed == keych[2])nextch = 2;
|
||||
if (iADSR[3] > 0 and keypressed == keych[3])nextch = 3;
|
||||
//then check for an empty channel
|
||||
if (nextch == 255) {
|
||||
if (iADSR[0] == 0)nextch = 0;
|
||||
if (iADSR[1] == 0)nextch = 1;
|
||||
if (iADSR[2] == 0)nextch = 2;
|
||||
if (iADSR[3] == 0)nextch = 3;
|
||||
}
|
||||
//otherwise use the channel with the longest playing note
|
||||
if (nextch == 255) {
|
||||
nextch = 0;
|
||||
if (tch[0] > tch[nextch])nextch = 0;
|
||||
if (tch[1] > tch[nextch])nextch = 1;
|
||||
if (tch[2] > tch[nextch])nextch = 2;
|
||||
if (tch[3] > tch[nextch])nextch = 3;
|
||||
}
|
||||
|
||||
setPWM(); //#3
|
||||
|
||||
//initiate new note if needed
|
||||
if (keypressed != nokey) {
|
||||
phase[nextch]=0;
|
||||
amp_base[nextch] = ldness[instr];
|
||||
inc_base[nextch] = tone_inc[pitch0[instr]+keypressed];
|
||||
ADSRa[nextch]=ADSR_a[instr];
|
||||
ADSRd[nextch]=ADSR_d[instr];
|
||||
ADSRs[nextch]=ADSR_s[instr]<<8;
|
||||
ADSRr[nextch]=ADSR_r[instr];
|
||||
iADSR[nextch] = 1;
|
||||
FMphase[nextch]=0;
|
||||
FMinc_base[nextch] = ((long)inc_base[nextch]*FM_inc[instr])/256;
|
||||
FMa0[nextch] = FM_a2[instr];
|
||||
FMda[nextch] = FM_a1[instr]-FM_a2[instr];
|
||||
FMexp[nextch]=0xFFFF;
|
||||
FMdec[nextch]=FM_dec[instr];
|
||||
keych[nextch] = keypressed;
|
||||
tch[nextch] = 0;
|
||||
}
|
||||
|
||||
setPWM(); //#4
|
||||
|
||||
//stop a note if the button is released
|
||||
if (keyreleased != nokey) {
|
||||
if (keych[0] == keyreleased)iADSR[0] = 4;
|
||||
if (keych[1] == keyreleased)iADSR[1] = 4;
|
||||
if (keych[2] == keyreleased)iADSR[2] = 4;
|
||||
if (keych[3] == keyreleased)iADSR[3] = 4;
|
||||
}
|
||||
|
||||
setPWM(); //#5
|
||||
|
||||
//update FM decay exponential
|
||||
FMexp[0]-=(long)FMexp[0]*FMdec[0]>>16;
|
||||
FMexp[1]-=(long)FMexp[1]*FMdec[1]>>16;
|
||||
FMexp[2]-=(long)FMexp[2]*FMdec[2]>>16;
|
||||
FMexp[3]-=(long)FMexp[3]*FMdec[3]>>16;
|
||||
|
||||
setPWM(); //#6
|
||||
|
||||
//adjust the ADSR envelopes
|
||||
for (byte ich = 0; ich < nch; ich++) {
|
||||
if (iADSR[ich] == 4) {
|
||||
if (envADSR[ich] <= ADSRr[ich]) {
|
||||
envADSR[ich] = 0;
|
||||
iADSR[ich] = 0;
|
||||
}
|
||||
else envADSR[ich] -= ADSRr[ich];
|
||||
}
|
||||
if (iADSR[ich] == 2) {
|
||||
if (envADSR[ich] <= (ADSRs[ich] + ADSRd[ich])) {
|
||||
envADSR[ich] = ADSRs[ich];
|
||||
iADSR[ich] = 3;
|
||||
}
|
||||
else envADSR[ich] -= ADSRd[ich];
|
||||
}
|
||||
if (iADSR[ich] == 1) {
|
||||
if ((0xFFFF - envADSR[ich]) <= ADSRa[ich]) {
|
||||
envADSR[ich] = 0xFFFF;
|
||||
iADSR[ich] = 2;
|
||||
}
|
||||
else envADSR[ich] += ADSRa[ich];
|
||||
}
|
||||
tch[ich]++;
|
||||
setPWM(); //#7-10
|
||||
}
|
||||
|
||||
//update the tone for channel 0
|
||||
amp[0] = (amp_base[0] * (envADSR[0] >> 8)) >> 8;
|
||||
inc[0] = inc_base[0];
|
||||
FMamp[0] = FMa0[0] + ((long)FMda[0] * FMexp[0]>>16);
|
||||
FMinc[0] = FMinc_base[0];
|
||||
setPWM(); //#11
|
||||
|
||||
//update the tone for channel 1
|
||||
amp[1] = (amp_base[1] * (envADSR[1] >> 8)) >> 8;
|
||||
inc[1] = inc_base[1];
|
||||
FMamp[1] = FMa0[1] + ((long)FMda[1] * FMexp[1]>>16);
|
||||
FMinc[1] = FMinc_base[1];
|
||||
setPWM(); //#12
|
||||
|
||||
//update the tone for channel 2
|
||||
amp[2] = (amp_base[2] * (envADSR[2] >> 8)) >> 8;
|
||||
inc[2] = inc_base[2];
|
||||
FMamp[2] = FMa0[2] + ((long)FMda[2] * FMexp[2]>>16);
|
||||
FMinc[2] = FMinc_base[2];
|
||||
setPWM(); //#13
|
||||
|
||||
//update the tone for channel 3
|
||||
amp[3] = (amp_base[3] * (envADSR[3] >> 8)) >> 8;
|
||||
inc[3] = inc_base[3];
|
||||
FMamp[3] = FMa0[3] + ((long)FMda[3] * FMexp[3]>>16);
|
||||
FMinc[3] = FMinc_base[3];
|
||||
setPWM(); //#14
|
||||
|
||||
//update counters
|
||||
tch[0]++;
|
||||
tch[1]++;
|
||||
tch[2]++;
|
||||
tch[3]++;
|
||||
|
||||
setPWM(); //#15
|
||||
|
||||
}
|
||||
81
Template/Template.ino
Normal file
81
Template/Template.ino
Normal file
@ -0,0 +1,81 @@
|
||||
// Basic template for Sitka Instruments WS-1.0 Mozzi firmwares
|
||||
|
||||
#include <Mozzi.h>
|
||||
#include <mozzi_midi.h> //for mtof() function
|
||||
#include <MIDI.h>
|
||||
|
||||
//Settings
|
||||
#define MIDI_CHANNEL MIDI_CHANNEL_OMNI
|
||||
|
||||
//Hardware Definitions
|
||||
#define Knob1 A6
|
||||
#define Knob2 A4
|
||||
#define Knob3 A2
|
||||
#define Knob4 A0
|
||||
#define KnobA A5
|
||||
#define KnobDR A3
|
||||
#define KnobS A1
|
||||
#define CVIn A7
|
||||
#define GateIn 13
|
||||
#define EnvSwitch 12
|
||||
#define DroneSwitch 11
|
||||
#define LED 5
|
||||
|
||||
#define MOZZI_CONTROL_RATE 128
|
||||
#define MOZZI_ANALOG_READ_RESOLUTION 10
|
||||
|
||||
MIDI_CREATE_DEFAULT_INSTANCE();
|
||||
|
||||
void MIDINoteOn(byte channel, byte note, byte velocity) {
|
||||
carrierFreq = mtof((int) note);
|
||||
envelope.noteOn();
|
||||
}
|
||||
|
||||
void MIDINoteOff(byte channel, byte note, byte velocity) {
|
||||
envelope.noteOff();
|
||||
}
|
||||
|
||||
void setup(){
|
||||
//pinMode(LED_BUILTIN_TX,INPUT); //switch rx and tx leds of, so they don't blink on midi
|
||||
//pinMode(LED_BUILTIN_RX,INPUT);
|
||||
pinMode(LED, OUTPUT);
|
||||
pinMode(GateIn, INPUT_PULLUP);
|
||||
pinMode(EnvSwitch, INPUT_PULLUP);
|
||||
pinMode(DroneSwitch, INPUT_PULLUP);
|
||||
|
||||
MIDI.setHandleNoteOn(MIDINoteOn);
|
||||
MIDI.setHandleNoteOff(MIDINoteOff);
|
||||
MIDI.begin(MIDI_CHANNEL);
|
||||
|
||||
startMozzi();
|
||||
|
||||
digitalWrite(LED, HIGH);
|
||||
}
|
||||
|
||||
|
||||
void updateControl(){
|
||||
//Get Control Values
|
||||
int CVInVal = mozziAnalogRead(CVIn);
|
||||
int knob1Val = mozziAnalogRead(Knob1);
|
||||
int knob2Val = mozziAnalogRead(Knob2);
|
||||
int knob3Val = mozziAnalogRead(Knob3);
|
||||
int knob4Val = mozziAnalogRead(Knob4);
|
||||
int knobAVal = mozziAnalogRead(KnobA);
|
||||
int knobDRVal = mozziAnalogRead(KnobDR);
|
||||
int knobSVal = mozziAnalogRead(KnobS);
|
||||
bool droneSwitchVal = digitalRead(DroneSwitch);
|
||||
bool envSwitchVal = digitalRead(EnvSwitch);
|
||||
bool gateInVal = digitalRead(GateIn);
|
||||
|
||||
//Do all the control-related updates here
|
||||
|
||||
MIDI.read();
|
||||
}
|
||||
|
||||
AudioOutput updateAudio(){
|
||||
return MonoOutput::from16Bit((int) gain * aCarrier.phMod(modulation));
|
||||
}
|
||||
|
||||
void loop(){
|
||||
audioHook();
|
||||
}
|
||||
201
booker/LICENSE
Normal file
201
booker/LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
62
booker/README.md
Normal file
62
booker/README.md
Normal file
@ -0,0 +1,62 @@
|
||||
# Booker
|
||||
|
||||
Booker is Hammond Organ simulator complete with a Leslie. Booker is meant to run on the AE Modular GRAINS, but it could be adapted to any Arduino. Booker was written by Sean Luke [sean@cs.gmu.edu]
|
||||
|
||||
Set your Grains to **MOZZI MODE**. You will need to install the Mozzi Library. You can do this from the Library Manager in your Arduino IDE.
|
||||
|
||||
Booker comes with a Leslie, which is on by default, but you can turn it off in the code or change its rate, volume adjustment, and pitch adjustment.
|
||||
|
||||
## Adjusting Tuning and Tracking
|
||||
|
||||
Grains's Inputs track 1.3V/octave, not 1V/octave: we'll need to scale them to track properly. To do this, you can adjust the Pitch CV Scaling on Pot 1. This GRAINS program is set up to play the C three octaves below Middle C when it receives 0V. You should be able to use Pot 1 to scale the pitch such that high Cs play in tune as well. Once you have things tracking well, you can then use the Pitch Tune (Audio In) to tune 0V to some other note. Note that as GRAINS resistors warm up, the scaling will change and you will need to adjust the tracking again, at least until they are fully warmed up.
|
||||
|
||||
By default the note corresponding to 0V is C0, three octaves below middle C, that is MIDI note 24, or 32.7 Hz. You can customize the tuning for this Grains program but only UP. This can be done in two ways. First, you can add pitch to the tuning with a CV value to Audio In. Second, you can transpose the pitch up by changing the TRANSPOSE_OCTAVES and/or TRANSPOSE\_SEMITONES #defines in the code to positive integers. You can also change TRANSPOSE\_BITS: a "bit" is the minimum possible change Grains can do, equal to 1/17 of a semitone.
|
||||
|
||||
## Volume
|
||||
|
||||
Some drawbar settings are quiet and can get overwhelmed by noise, others are loud and can distort. You can compensate with the volume knob.
|
||||
|
||||
|
||||
## Drawbar Settings
|
||||
|
||||
Booker also has 16 selections of drawbar settings, but in the code it comes with 98 total: just swap whatever you'd like in, or customize it as you see fit. The default settings are, in order:
|
||||
|
||||
885324588 Blues
|
||||
888800000 Booker T. Jones 1
|
||||
888630000 Booker T. Jones 2
|
||||
878000456 Bright Comping
|
||||
843000000 Dark Comping
|
||||
888888888 Full Organ
|
||||
808808008 Gospel 1
|
||||
888000008 Gospel 2
|
||||
868666568 Greg Allman 1
|
||||
888600000 Greg Allman 2
|
||||
886800300 Paul Shaffer 1
|
||||
888768888 Paul Shaffer 2
|
||||
888878678 Paul Shaffer 3
|
||||
808000008 Reggae
|
||||
080000000 Sweet
|
||||
876543211 Strings
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
#### IN 1
|
||||
Pitch CV
|
||||
#### IN 2
|
||||
Volume CV
|
||||
#### IN 3
|
||||
[UNUSED]
|
||||
#### AUDIO IN (A)
|
||||
Pitch Tune
|
||||
#### AUDIO OUT
|
||||
Out
|
||||
#### DIGITAL OUT (D)
|
||||
[UNUSED]
|
||||
#### POT 1
|
||||
Pitch Tune [Set the switch to IN1]
|
||||
#### POT 2
|
||||
Volume
|
||||
#### POT 3
|
||||
Choice of organ [Set the switch to MAN]
|
||||
|
||||
474
booker/booker.ino
Normal file
474
booker/booker.ino
Normal file
@ -0,0 +1,474 @@
|
||||
// Copyright 2023 Sean Luke
|
||||
// (sean@cs.gmu.edu)
|
||||
//
|
||||
// Released under the Apache 2.0 License
|
||||
|
||||
|
||||
/// BOOKER
|
||||
///
|
||||
/// Booker is a Hammond Organ simulator, complete with Leslie. It is meant to run on the
|
||||
/// AE Modular GRAINS, but it could be adapted to any Arduino.
|
||||
///
|
||||
/// SET GRAINS TO MOZZI MODE. Sorry, no Grains mode.
|
||||
///
|
||||
/// You will need to install the Mozzi Library. You can do this from the Library Manager
|
||||
/// in your Arduino IDE.
|
||||
///
|
||||
/// ALIASING: At extremely high frequencies, a few of Booker's drawbars will go over Nyquist and
|
||||
/// you may hear some antialiasing effects. I can fix this but it puts me over the
|
||||
/// computational budget of the device, so it's not going to happen.
|
||||
///
|
||||
/// THE LESLIE. Booker comes with a Leslie, which is on by default:
|
||||
|
||||
#define LESLIE_ON // To turn this off, put a // before the #define, as in //#define
|
||||
|
||||
// Leslie changes both the amplitude and pitch at a certain rate.
|
||||
// You can adjust them here
|
||||
|
||||
#define LESLIE_FREQUENCY 5.66 // This is the 450 speed. The classic slower speed is 0.66, but it's too slow
|
||||
#define LESLIE_VOLUME 1 // Values are 0 (min but not gone), 1, 2, 3, 4, 5, 6 (max).
|
||||
#define LESLIE_PITCH 128 // Values are 1.0 (lots) ... 128.0 or more (little). Can be floating point.
|
||||
|
||||
/// ADJUSTING TUNING AND TRACKING
|
||||
///
|
||||
/// Grains's Inputs track 1.3V/octave, not 1V/octave: we'll need to scale them to track properly.
|
||||
/// To do this, you can adjust the Pitch CV Scaling on Pot 1. This GRAINS program is set up to play
|
||||
/// the C three octaves below Middle C when it receives 0V. You should be able to use Pot 1 to scale
|
||||
/// the pitch such that high Cs play in tune as well. Once you have things tracking well, you can
|
||||
/// then use the Pitch Tune (Audio In) to tune 0V to some other note. Note that as GRAINS resistors
|
||||
/// warm up, the scaling will change and you will need to adjust the tracking again, at least until
|
||||
/// they are fully warmed up.
|
||||
///
|
||||
/// By default the note corresponding to 0V is C0, three octaves below middle C, that is MIDI note 24,
|
||||
/// or 32.7 Hz. You can customize the tuning for this Grains program. This can be done
|
||||
/// in two ways. First, you can add pitch to the tuning with a CV value to Audio In. Second, you
|
||||
/// can transpose the pitch up by changing the TRANSPOSE_OCTAVES and/or TRANSPOSE_SEMITONES #defines
|
||||
/// in the code to positive integers. You can also change TRANSPOSE_BITS: a "bit" is the minimum possible
|
||||
/// change Grains can do, equal to 1/17 of a semitone.
|
||||
///
|
||||
|
||||
/// CONFIGURATION
|
||||
///
|
||||
/// IN 1 Pitch CV
|
||||
/// IN 2 Volume CV
|
||||
/// IN 3 [Unused]
|
||||
/// AUDIO IN (A) Pitch Tune
|
||||
/// AUDIO OUT Out
|
||||
/// DIGITAL OUT (D) [Unused]
|
||||
///
|
||||
/// POT 1 Pitch Scaling [Set the switch to In1]
|
||||
///
|
||||
/// POT 2 Volume
|
||||
///
|
||||
/// POT 3 Choice of Organ [Set the switch to MAN]
|
||||
|
||||
/// Lastly, here is our present drawbar selection. Keep this to no more than 31 but feel free
|
||||
/// to change the selections. There is a big list of 99 selections below you could swap in.
|
||||
|
||||
#define NUM_DRAWBAR_SELECTIONS 16
|
||||
uint8_t drawbars[NUM_DRAWBAR_SELECTIONS][9] =
|
||||
{
|
||||
{ 8, 8, 8, 8, 8, 8, 8, 8, 8 }, // 888888888 Full Organ
|
||||
{ 8, 8, 5, 3, 2, 4, 5, 8, 8 }, // 885324588 Blues
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Booker T. Jones 1
|
||||
{ 8, 8, 8, 6, 3, 0, 0, 0, 0 }, // 888630000 Booker T. Jones 2
|
||||
{ 8, 7, 8, 0, 0, 0, 4, 5, 6 }, // 878000456 Bright Comping
|
||||
{ 8, 4, 3, 0, 0, 0, 0, 0, 0 }, // 843000000 Dark Comping
|
||||
{ 8, 0, 8, 8, 0, 8, 0, 0, 8 }, // 808808008 Gospel 1
|
||||
{ 8, 8, 8, 0, 0, 0, 0, 0, 8 }, // 888000008 Gospel 2
|
||||
{ 8, 6, 8, 6, 6, 6, 5, 6, 8 }, // 868666568 Greg Allman 1
|
||||
{ 8, 8, 8, 6, 0, 0, 0, 0, 0 }, // 888600000 Greg Allman 2
|
||||
{ 8, 8, 6, 8, 0, 0, 3, 0, 0 }, // 886800300 Paul Shaffer 1
|
||||
{ 8, 8, 8, 7, 6, 8, 8, 8, 8 }, // 888768888 Paul Shaffer 2
|
||||
{ 8, 8, 8, 8, 7, 8, 6, 7, 8 }, // 888878678 Paul Shaffer 3
|
||||
{ 8, 0, 8, 0, 0, 0, 0, 0, 8 }, // 808000008 Reggae
|
||||
{ 0, 8, 0, 0, 0, 0, 0, 0, 0 }, // 080000000 Sine
|
||||
{ 8, 7, 6, 5, 4, 3, 2, 1, 1 }, // 876543211 Strings
|
||||
};
|
||||
|
||||
/** Here is a collection of Drawbar Selections for you.
|
||||
You can find more online.
|
||||
|
||||
{ 0, 0, 7, 7, 4, 0, 0, 3, 4 }, // 007740034 Alone in the City
|
||||
{ 8, 8, 7, 7, 2, 4, 1, 1, 0 }, // 887724110 America (Gospel) (U)
|
||||
{ 0, 0, 6, 6, 0, 6, 0, 0, 0 }, // 006606000 America (Gospel) (L)
|
||||
{ 8, 8, 5, 3, 2, 4, 5, 8, 8 }, // 885324588 Blues
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Booker T. Jones 1
|
||||
{ 8, 8, 8, 6, 3, 0, 0, 0, 0 }, // 888630000 Booker T. Jones 2
|
||||
{ 8, 8, 8, 8, 0, 8, 0, 0, 8 }, // 888808008 Born to B3 (Gospel) (U)
|
||||
{ 0, 0, 7, 7, 2, 5, 4, 0, 0 }, // 007725400 Born to B3 (Gospel) (L)
|
||||
{ 8, 8, 8, 1, 1, 0, 0, 0, 0 }, // 888110000 Brian Auger 1
|
||||
{ 8, 8, 8, 8, 0, 5, 0, 0, 0 }, // 888805000 Brian Auger 2
|
||||
{ 8, 7, 8, 0, 0, 0, 4, 5, 6 }, // 878000456 Bright Comping
|
||||
{ 8, 0, 0, 0, 0, 0, 8, 8, 8 }, // 800000888 Brother Jack
|
||||
{ 8, 4, 3, 0, 0, 0, 0, 0, 0 }, // 843000000 Dark Comping
|
||||
{ 8, 8, 8, 8, 8, 8, 8, 8, 8 }, // 888888888 Dark Solo A (U)
|
||||
{ 6, 6, 2, 0, 0, 0, 0, 0, 0 }, // 662000000 Dark Solo A (L)
|
||||
{ 8, 2, 8, 2, 0, 0, 0, 0, 2 }, // 828200002 Dark Solo B (U)
|
||||
{ 6, 0, 6, 0, 0, 0, 0, 0, 0 }, // 606000000 Dark Solo B (L)
|
||||
{ 8, 8, 8, 0, 0, 0, 8, 8, 8 }, // 888000888 Fat
|
||||
{ 0, 8, 0, 0, 8, 0, 8, 8, 3 }, // 080080883 Fifth Organ (Gospel) (U)
|
||||
{ 0, 0, 8, 8, 0, 6, 0, 0, 0 }, // 008806000 Fifth Organ (Gospel) (L)
|
||||
{ 0, 0, 6, 8, 0, 2, 0, 0, 0 }, // 006802000 Flutes
|
||||
{ 8, 8, 8, 6, 6, 6, 8, 8, 8 }, // 888666888 Full and High
|
||||
{ 8, 6, 8, 8, 6, 8, 0, 6, 8 }, // 868868068 Full and Sweet
|
||||
{ 8, 8, 8, 8, 8, 8, 8, 8, 8 }, // 888888888 Full Organ
|
||||
{ 6, 8, 8, 6, 0, 0, 0, 0, 4 }, // 688600004 Funky Comping
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Gimme Some Loving
|
||||
{ 8, 0, 8, 8, 0, 8, 0, 0, 8 }, // 808808008 Gospel 1
|
||||
{ 8, 8, 8, 0, 0, 0, 0, 0, 8 }, // 888000008 Gospel 2
|
||||
{ 8, 6, 8, 6, 6, 6, 5, 6, 8 }, // 868666568 Greg Allman 1
|
||||
{ 8, 8, 8, 6, 0, 0, 0, 0, 0 }, // 888600000 Greg Allman 2
|
||||
{ 8, 8, 6, 0, 0, 0, 0, 4, 0 }, // 886000040 Greg Allman 3
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 8, 8 }, // 888800088 Greg Rolie 1
|
||||
{ 8, 8, 6, 4, 0, 0, 0, 0, 0 }, // 886400000 Greg Rolie 2
|
||||
{ 8, 8, 8, 8, 8, 6, 6, 6, 6 }, // 888886666 Greg Rolie 4
|
||||
{ 8, 8, 8, 4, 2, 0, 0, 8, 0 }, // 888420080 Groove Holmes (Gospel) (U)
|
||||
{ 0, 0, 0, 5, 0, 5, 0, 0, 0 }, // 000505000 Groove Holmes (Gospel) (L)
|
||||
{ 8, 8, 0, 0, 0, 0, 0, 0, 0 }, // 880000000 House Bass (Gospel) (U)
|
||||
{ 0, 0, 8, 0, 8, 0, 0, 0, 0 }, // 008080000 House Bass (Gospel) (L)
|
||||
{ 8, 6, 8, 6, 0, 0, 0, 0, 6 }, // 868600006 Jimmy McGriff 1
|
||||
{ 8, 8, 3, 2, 0, 0, 1, 2, 5 }, // 883200125 Jimmy McGriff 2 (Gospel) (U)
|
||||
{ 4, 4, 8, 6, 5, 0, 0, 0, 0 }, // 448650000 Jimmy McGriff 2 (Gospel) (L)
|
||||
{ 8, 8, 8, 8, 8, 8, 8, 8, 8 }, // 888888888 Jimmy Smith 1 (U)
|
||||
{ 0, 0, 7, 5, 0, 0, 0, 0, 0 }, // 007500000 Jimmy Smith 1 (L)
|
||||
{ 8, 8, 8, 0, 0, 0, 0, 0, 0 }, // 888000000 Jimmy Smith 2 (U)
|
||||
{ 8, 3, 8, 0, 0, 0, 0, 0, 0 }, // 838000000 Jimmy Smith 2 (L)
|
||||
{ 8, 8, 8, 0, 0, 0, 0, 0, 0 }, // 888000000 Jimmy Smith 3 (U)
|
||||
{ 8, 0, 8, 0, 0, 0, 0, 0, 0 }, // 808000000 Jimmy Smith 3 (L)
|
||||
{ 8, 8, 8, 4, 0, 0, 0, 8, 0 }, // 888400080 Joey DeFrancesco
|
||||
{ 8, 8, 4, 4, 0, 0, 0, 0, 0 }, // 884400000 Jon Lord
|
||||
{ 8, 8, 0, 0, 6, 0, 0, 0, 0 }, // 880060000 Latin (Gospel) (U)
|
||||
{ 0, 0, 6, 6, 7, 6, 0, 0, 0 }, // 006676000 Latin (Gospel) (L)
|
||||
{ 8, 0, 0, 8, 0, 8, 0, 0, 0 }, // 800808000 Matthew Fisher
|
||||
{ 8, 6, 8, 8, 0, 0, 0, 0, 4 }, // 868800004 Melvin Crispel
|
||||
{ 8, 0, 3, 6, 0, 0, 0, 0, 0 }, // 803600000 Mellow
|
||||
{ 0, 0, 7, 8, 0, 0, 4, 5, 3 }, // 007800453 Meditation Time (Gospel) (U)
|
||||
{ 0, 0, 6, 7, 0, 0, 5, 4, 0 }, // 006700540 Meditation Time (Gospel) (L)
|
||||
{ 8, 8, 6, 8, 0, 0, 3, 0, 0 }, // 886800300 Paul Shaffer 1
|
||||
{ 8, 8, 8, 7, 6, 8, 8, 8, 8 }, // 888768888 Paul Shaffer 2
|
||||
{ 8, 8, 8, 8, 7, 8, 6, 7, 8 }, // 888878678 Paul Shaffer 3
|
||||
{ 8, 5, 0, 0, 0, 5, 0, 0, 0 }, // 850005000 Pink Floyd
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Power Chords
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Progessive (Gospel) (U)
|
||||
{ 0, 0, 8, 8, 8, 4, 0, 0, 0 }, // 008884000 Progessive (Gospel) (L)
|
||||
{ 0, 0, 6, 8, 7, 6, 4, 0, 0 }, // 006876400 Ray Charles
|
||||
{ 8, 0, 8, 0, 0, 0, 0, 0, 8 }, // 808000008 Reggae
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Rock, R&B (U)
|
||||
{ 8, 4, 8, 0, 0, 0, 0, 0, 0 }, // 848000000 Rock, R&B (L)
|
||||
{ 8, 0, 0, 3, 8, 8, 8, 8, 8 }, // 800388888 Screaming (Gospel) (U)
|
||||
{ 0, 0, 7, 0, 3, 3, 3, 3, 3 }, // 007033333 Screaming (Gospel) (L)
|
||||
{ 0, 0, 8, 8, 8, 8, 8, 0, 0 }, // 008888800 Shirley Scott
|
||||
{ 8, 3, 0, 0, 0, 0, 3, 7, 8 }, // 830000378 Simmering
|
||||
{ 0, 8, 0, 0, 0, 0, 0, 0, 0 }, // 080000000 Sine
|
||||
{ 8, 7, 6, 5, 5, 6, 7, 8, 8 }, // 876556788 Shouting 1
|
||||
{ 6, 6, 8, 8, 4, 8, 5, 8, 8 }, // 668848588 Shouting 2
|
||||
{ 8, 7, 8, 6, 4, 5, 4, 6, 6 }, // 878645466 Shouting 3 (Gospel) (U)
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Shouting 3 (Gospel) (L)
|
||||
{ 0, 0, 8, 4, 0, 0, 0, 0, 0 }, // 008400000 Slow Balllad
|
||||
{ 0, 6, 8, 8, 4, 0, 0, 0, 3 }, // 068840003 Slowly
|
||||
{ 8, 8, 8, 7, 0, 0, 0, 0, 0 }, // 888700000 Soft Backing (Gospel) (U)
|
||||
{ 5, 5, 5, 4, 0, 0, 0, 0, 0 }, // 555400000 Soft Backing (Gospel) (L)
|
||||
{ 8, 0, 8, 4, 0, 0, 0, 0, 8 }, // 808400008 Soft Chords
|
||||
{ 6, 7, 8, 4, 0, 4, 2, 3, 1 }, // 678404231 Speaker Talking (Gospel) (U)
|
||||
{ 0, 0, 6, 6, 0, 2, 0, 2, 4 }, // 006602024 Speaker Talking (Gospel) (L)
|
||||
{ 8, 8, 8, 6, 4, 3, 2, 0, 0 }, // 888643200 Steppenwolf
|
||||
{ 8, 8, 8, 8, 7, 6, 7, 8, 8 }, // 888876788 Steve Winwood
|
||||
{ 8, 7, 6, 5, 4, 3, 2, 1, 1 }, // 876543211 Strings
|
||||
{ 0, 0, 8, 0, 0, 0, 0, 0, 0 }, // 008000000 Sweet
|
||||
{ 7, 8, 7, 7, 4, 6, 0, 4, 6 }, // 787746046 Testimony Service (Gospel) (U)
|
||||
{ 0, 0, 8, 8, 0, 0, 6, 7, 3 }, // 008800673 Testimony Service (Gospel) (L)
|
||||
{ 8, 7, 8, 6, 5, 6, 4, 6, 7 }, // 878656467 Theatre Organ (Gospel) (U)
|
||||
{ 0, 0, 8, 8, 4, 4, 0, 0, 0 }, // 008844000 Theatre Organ (Gospel) (L)
|
||||
{ 8, 8, 8, 8, 0, 0, 0, 0, 0 }, // 888800000 Tom Coster
|
||||
{ 8, 0, 0, 0, 0, 0, 0, 0, 8 }, // 800000008 Whistle 1
|
||||
{ 8, 8, 8, 0, 0, 0, 0, 0, 8 }, // 888000008 Whistle 2
|
||||
{ 6, 8, 8, 6, 0, 0, 0, 0, 0 }, // 688600000 Whiter Shade Of Pale 1 (U)
|
||||
{ 8, 8, 0, 0, 7, 0, 7, 7, 0 }, // 880070770 Whiter Shade Of Pale 1 (L)
|
||||
{ 8, 8, 8, 8, 0, 8, 0, 0, 6 }, // 888808006 Whiter Shade Of Pale 2 (U)
|
||||
{ 0, 0, 4, 4, 4, 0, 0, 0, 0 }, // 004440000 Whiter Shade Of Pale 2 (L)
|
||||
{ 8, 6, 6, 8, 0, 0, 0, 0, 0 }, // 866800000 Wide Leslie
|
||||
*/
|
||||
|
||||
|
||||
|
||||
PROGMEM const float frequencies[1024+512] = {
|
||||
32.7, 32.81097, 32.922318, 33.034042, 33.146145, 33.25863, 33.37149, 33.48474, 33.59837, 33.71239, 33.826794, 33.94159, 34.056774, 34.172344, 34.28831, 34.40467,
|
||||
34.521423, 34.638577, 34.756123, 34.87407, 34.992416, 35.111168, 35.23032, 35.349876, 35.469837, 35.590206, 35.710987, 35.832172, 35.95377, 36.075783, 36.198208, 36.32105,
|
||||
36.444305, 36.56798, 36.692078, 36.816593, 36.941532, 37.066895, 37.192684, 37.3189, 37.445545, 37.572617, 37.700123, 37.82806, 37.956432, 38.08524, 38.214485, 38.34417,
|
||||
38.47429, 38.60486, 38.735863, 38.867317, 38.999214, 39.131565, 39.26436, 39.397606, 39.531303, 39.665455, 39.80006, 39.935123, 40.070644, 40.20663, 40.34307, 40.47998,
|
||||
40.617348, 40.755188, 40.893494, 41.03227, 41.171513, 41.31123, 41.451424, 41.59209, 41.733234, 41.874863, 42.016968, 42.159554, 42.302628, 42.446182, 42.59022, 42.73476,
|
||||
42.87978, 43.025295, 43.171303, 43.317806, 43.46481, 43.612312, 43.760315, 43.908817, 44.057823, 44.207336, 44.357357, 44.507885, 44.658924, 44.81048, 44.962543, 45.115128,
|
||||
45.26823, 45.421852, 45.575993, 45.73066, 45.885845, 46.04156, 46.197807, 46.354584, 46.511887, 46.66973, 46.828106, 46.987022, 47.146477, 47.30647, 47.467007, 47.62809,
|
||||
47.78972, 47.951893, 48.11462, 48.277905, 48.44174, 48.60613, 48.771072, 48.93658, 49.102654, 49.269283, 49.43648, 49.604248, 49.772583, 49.94149, 50.11097, 50.281025,
|
||||
50.451656, 50.622868, 50.79466, 50.967033, 51.13999, 51.31354, 51.487675, 51.6624, 51.83772, 52.013634, 52.190147, 52.36726, 52.544968, 52.723286, 52.902206, 53.08173,
|
||||
53.261868, 53.44261, 53.623974, 53.80595, 53.988544, 54.171757, 54.355595, 54.540054, 54.725136, 54.91085, 55.097195, 55.28417, 55.47178, 55.660027, 55.848915, 56.038437,
|
||||
56.228607, 56.419422, 56.61089, 56.803, 56.99576, 57.189182, 57.38326, 57.57799, 57.773384, 57.96944, 58.166164, 58.363556, 58.561615, 58.76035, 58.95976, 59.15984,
|
||||
59.360603, 59.562046, 59.764175, 59.966988, 60.17049, 60.374683, 60.579563, 60.785145, 60.991425, 61.198402, 61.406086, 61.614468, 61.82356, 62.033363, 62.243877, 62.455105,
|
||||
62.667053, 62.879715, 63.093098, 63.307213, 63.52205, 63.737614, 63.95391, 64.170944, 64.38871, 64.607216, 64.82647, 65.04646, 65.2672, 65.488686, 65.71092, 65.93392,
|
||||
66.15767, 66.38218, 66.60745, 66.83349, 67.06029, 67.287865, 67.51621, 67.74534, 67.975235, 68.20591, 68.43737, 68.66962, 68.90265, 69.136475, 69.37109, 69.606514,
|
||||
69.84273, 70.07974, 70.31756, 70.55618, 70.79562, 71.03587, 71.27694, 71.518814, 71.76152, 72.00505, 72.249405, 72.49458, 72.7406, 72.98745, 73.23514, 73.483665,
|
||||
73.73304, 73.98325, 74.23433, 74.48624, 74.73901, 74.992645, 75.24714, 75.502495, 75.75872, 76.01581, 76.27377, 76.53261, 76.79233, 77.052925, 77.314415, 77.57678,
|
||||
77.84005, 78.1042, 78.36925, 78.63521, 78.902054, 79.169815, 79.438484, 79.70806, 79.97856, 80.24997, 80.52231, 80.795555, 81.06975, 81.34486, 81.62091, 81.897896,
|
||||
82.17582, 82.45468, 82.734505, 83.01527, 83.29699, 83.57966, 83.8633, 84.14788, 84.43345, 84.71997, 85.00748, 85.29596, 85.58542, 85.875854, 86.167274, 86.459694,
|
||||
86.7531, 87.0475, 87.3429, 87.63931, 87.936714, 88.23513, 88.53457, 88.835014, 89.136475, 89.43897, 89.742485, 90.04703, 90.352615, 90.65923, 90.96689, 91.27559,
|
||||
91.585335, 91.89614, 92.208, 92.52091, 92.83488, 93.14992, 93.466034, 93.78321, 94.10147, 94.420815, 94.741234, 95.062744, 95.38535, 95.709045, 96.03384, 96.35974,
|
||||
96.68674, 97.014854, 97.34407, 97.674416, 98.00588, 98.33848, 98.672195, 99.007034, 99.343025, 99.68015, 100.018425, 100.35785, 100.69841, 101.04014, 101.383026, 101.72707,
|
||||
102.072296, 102.418686, 102.76624, 103.11499, 103.46492, 103.81603, 104.168335, 104.521835, 104.87654, 105.232445, 105.58956, 105.94788, 106.30742, 106.66818, 107.03017, 107.39338,
|
||||
107.75783, 108.12351, 108.49043, 108.858604, 109.22803, 109.598694, 109.97062, 110.34382, 110.71828, 111.094, 111.47101, 111.8493, 112.22886, 112.60971, 112.99186, 113.375305,
|
||||
113.760056, 114.1461, 114.53347, 114.92215, 115.31214, 115.70346, 116.0961, 116.49008, 116.8854, 117.28206, 117.68006, 118.079414, 118.480125, 118.882195, 119.28563, 119.69043,
|
||||
120.09661, 120.504166, 120.9131, 121.323425, 121.73515, 122.14826, 122.56278, 122.97871, 123.39604, 123.8148, 124.23497, 124.65657, 125.0796, 125.50407, 125.92997, 126.35732,
|
||||
126.78612, 127.21638, 127.64809, 128.08127, 128.51593, 128.95204, 129.38965, 129.82875, 130.26933, 130.71141, 131.15498, 131.60007, 132.04666, 132.49478, 132.9444, 133.39555,
|
||||
133.84824, 134.30246, 134.75822, 135.21555, 135.6744, 136.13481, 136.59679, 137.06035, 137.52547, 137.99217, 138.46046, 138.93033, 139.40181, 139.87486, 140.34953, 140.82582,
|
||||
141.30373, 141.78326, 142.2644, 142.7472, 143.2316, 143.71767, 144.2054, 144.69475, 145.18579, 145.67848, 146.17285, 146.6689, 147.16663, 147.66605, 148.16716, 148.66997,
|
||||
149.1745, 149.68073, 150.18869, 150.69836, 151.20976, 151.7229, 152.23778, 152.75441, 153.27278, 153.79292, 154.31483, 154.83852, 155.36397, 155.8912, 156.42023, 156.95105,
|
||||
157.48367, 158.01811, 158.55435, 159.0924, 159.6323, 160.17403, 160.71759, 161.26299, 161.81024, 162.35936, 162.91034, 163.46318, 164.0179, 164.57451, 165.133, 165.69339,
|
||||
166.25568, 166.81989, 167.38599, 167.95403, 168.52399, 169.09589, 169.66972, 170.24551, 170.82324, 171.40294, 171.9846, 172.56825, 173.15387, 173.74149, 174.33109, 174.92268,
|
||||
175.5163, 176.11192, 176.70956, 177.30923, 177.91096, 178.51471, 179.1205, 179.72836, 180.33829, 180.95027, 181.56433, 182.18048, 182.79874, 183.41907, 184.0415, 184.66606,
|
||||
185.29276, 185.92155, 186.55247, 187.18556, 187.82079, 188.45816, 189.09772, 189.73943, 190.38332, 191.0294, 191.67766, 192.32814, 192.9808, 193.6357, 194.29282, 194.95216,
|
||||
195.61374, 196.27757, 196.94365, 197.61198, 198.2826, 198.95547, 199.63065, 200.3081, 200.98785, 201.66992, 202.35431, 203.04102, 203.73004, 204.42142, 205.11514, 205.8112,
|
||||
206.50964, 207.21043, 207.91362, 208.6192, 209.32715, 210.0375, 210.75029, 211.46548, 212.1831, 212.90317, 213.62566, 214.35062, 215.07803, 215.8079, 216.54027, 217.2751,
|
||||
218.01244, 218.75227, 219.49463, 220.2395, 220.9869, 221.73682, 222.4893, 223.24432, 224.00192, 224.7621, 225.52484, 226.29016, 227.0581, 227.82864, 228.60178, 229.37756,
|
||||
230.15598, 230.93703, 231.72072, 232.50706, 233.2961, 234.08781, 234.88219, 235.67928, 236.47908, 237.28157, 238.0868, 238.89478, 239.70547, 240.51894, 241.33514, 242.15413,
|
||||
242.97589, 243.80046, 244.62779, 245.45796, 246.29094, 247.12674, 247.96538, 248.80687, 249.65121, 250.49841, 251.3485, 252.20146, 253.05731, 253.91609, 254.77777, 255.64238,
|
||||
256.50992, 257.3804, 258.2538, 259.13025, 260.0096, 260.89197, 261.7773, 262.66568, 263.55707, 264.45145, 265.34888, 266.24933, 267.1529, 268.05948, 268.96915, 269.88193,
|
||||
270.7978, 271.71674, 272.63882, 273.56406, 274.4924, 275.42392, 276.3586, 277.29642, 278.23743, 279.18167, 280.1291, 281.0797, 282.03357, 282.9907, 283.95102, 284.91464,
|
||||
285.8815, 286.85165, 287.82513, 288.80188, 289.78192, 290.76532, 291.75204, 292.74213, 293.7356, 294.7324, 295.7326, 296.73615, 297.74316, 298.75357, 299.76743, 300.78467,
|
||||
301.8054, 302.82962, 303.8573, 304.88843, 305.9231, 306.96127, 308.00296, 309.0482, 310.097, 311.1493, 312.20517, 313.2647, 314.32776, 315.39444, 316.46475, 317.53873,
|
||||
318.61627, 319.69754, 320.78244, 321.87106, 322.96335, 324.05936, 325.15906, 326.26248, 327.3697, 328.48065, 329.59537, 330.71384, 331.83618, 332.96228, 334.0922, 335.22595,
|
||||
336.36356, 337.50504, 338.65036, 339.79962, 340.95273, 342.10977, 343.27072, 344.43567, 345.60455, 346.77734, 347.95416, 349.13498, 350.31976, 351.5086, 352.70148, 353.89838,
|
||||
355.09937, 356.3044, 357.51355, 358.7268, 359.94415, 361.16565, 362.3913, 363.6211, 364.85507, 366.0932, 367.33557, 368.58215, 369.83298, 371.088, 372.34732, 373.6109,
|
||||
374.87878, 376.15094, 377.42746, 378.70825, 379.99344, 381.28296, 382.57687, 383.87518, 385.17786, 386.485, 387.79654, 389.11258, 390.43304, 391.758, 393.08746, 394.42142,
|
||||
395.75992, 397.10294, 398.45056, 399.8027, 401.1595, 402.52084, 403.8868, 405.25742, 406.6327, 408.01263, 409.39722, 410.78656, 412.1806, 413.57935, 414.98285, 416.3911,
|
||||
417.80417, 419.22202, 420.64468, 422.07214, 423.5045, 424.94168, 426.38376, 427.83072, 429.28256, 430.73938, 432.20108, 433.66782, 435.13947, 436.61615, 438.09784, 439.58453,
|
||||
441.07632, 442.57312, 444.075, 445.582, 447.09412, 448.61136, 450.13376, 451.66132, 453.19406, 454.73203, 456.27515, 457.82355, 459.3772, 460.93616, 462.50037, 464.0699,
|
||||
465.6447, 467.2249, 468.8105, 470.4014, 471.99774, 473.5995, 475.2067, 476.81934, 478.43744, 480.06107, 481.6902, 483.3248, 484.96503, 486.61075, 488.26212, 489.91907,
|
||||
491.58163, 493.24985, 494.9237, 496.60327, 498.28854, 499.9795, 501.6762, 503.37866, 505.0869, 506.80096, 508.5208, 510.24652, 511.97806, 513.7155, 515.4588, 517.20807,
|
||||
518.96326, 520.72437, 522.49146, 524.2646, 526.0437, 527.82886, 529.6201, 531.4174, 533.2208, 535.0303, 536.84595, 538.6678, 540.4958, 542.32996, 544.1704, 546.01715,
|
||||
547.87, 549.7293, 551.59485, 553.4667, 555.3449, 557.2295, 559.1205, 561.01794, 562.9218, 564.8321, 566.7489, 568.6721, 570.602, 572.5383, 574.4813, 576.43085,
|
||||
578.387, 580.3498, 582.3193, 584.2954, 586.2782, 588.26776, 590.2641, 592.2672, 594.2771, 596.2938, 598.3174, 600.3478, 602.3851, 604.4293, 606.4805, 608.5387,
|
||||
610.60376, 612.6759, 614.75507, 616.84125, 618.9346, 621.0349, 623.14246, 625.2571, 627.3789, 629.508, 631.6443, 633.7878, 635.93866, 638.09674, 640.26215, 642.4349,
|
||||
644.61505, 646.8026, 648.99756, 651.19995, 653.40985, 655.62726, 657.8521, 660.0846, 662.32465, 664.57227, 666.8275, 669.09045, 671.361, 673.63934, 675.9254, 678.21924,
|
||||
680.5208, 682.8302, 685.1474, 687.4725, 689.8054, 692.14636, 694.4952, 696.85205, 699.2168, 701.58966, 703.9705, 706.3595, 708.7566, 711.16174, 713.5752, 715.9967,
|
||||
718.42645, 720.86456, 723.31085, 725.7654, 728.22833, 730.69965, 733.1793, 735.6674, 738.16394, 740.66895, 743.18243, 745.7045, 748.23505, 750.7743, 753.322, 755.87854,
|
||||
758.44366, 761.01746, 763.6, 766.19135, 768.79144, 771.4004, 774.0182, 776.64484, 779.28046, 781.925, 784.5785, 787.241, 789.9126, 792.5932, 795.2829, 797.98175,
|
||||
800.6897, 803.4069, 806.13336, 808.869, 811.61395, 814.3682, 817.13184, 819.90485, 822.68726, 825.47906, 828.28033, 831.0912, 833.9115, 836.74146, 839.581, 842.4302,
|
||||
845.289, 848.15753, 851.0358, 853.9238, 856.8217, 859.7294, 862.647, 865.57434, 868.5118, 871.4591, 874.4165, 877.38385, 880.3613, 883.3488, 886.34656, 889.35443,
|
||||
892.3725, 895.4008, 898.4394, 901.4883, 904.54755, 907.61725, 910.69727, 913.7878, 916.8888, 920.0003, 923.1224, 926.25507, 929.3983, 932.5523, 935.717, 938.8924,
|
||||
942.0786, 945.27563, 948.48346, 951.7022, 954.9319, 958.1725, 961.42413, 964.68677, 967.96045, 971.2453, 974.54126, 977.84845, 981.1668, 984.4965, 987.8374, 991.1897,
|
||||
994.55334, 997.92847, 1001.31494, 1004.713, 1008.12256, 1011.5437, 1014.97644, 1018.42084, 1021.8769, 1025.3447, 1028.8242, 1032.3157, 1035.8188, 1039.334, 1042.861, 1046.4,
|
||||
1049.951, 1053.5142, 1057.0894, 1060.6766, 1064.2761, 1067.8877, 1071.5117, 1075.1478, 1078.7965, 1082.4574, 1086.1309, 1089.8168, 1093.515, 1097.226, 1100.9495, 1104.6855,
|
||||
1108.4344, 1112.1959, 1115.9702, 1119.7573, 1123.5574, 1127.3702, 1131.196, 1135.0348, 1138.8866, 1142.7516, 1146.6295, 1150.5206, 1154.425, 1158.3427, 1162.2736, 1166.2178,
|
||||
1170.1754, 1174.1465, 1178.131, 1182.129, 1186.1406, 1190.1659, 1194.2048, 1198.2574, 1202.3237, 1206.4039, 1210.4979, 1214.6058, 1218.7277, 1222.8635, 1227.0134, 1231.1772,
|
||||
1235.3555, 1239.5476, 1243.7542, 1247.9749, 1252.2101, 1256.4595, 1260.7234, 1265.0017, 1269.2946, 1273.6019, 1277.924, 1282.2606, 1286.6122, 1290.9783, 1295.3594, 1299.7551,
|
||||
1304.166, 1308.5918, 1313.0326, 1317.4884, 1321.9594, 1326.4456, 1330.9469, 1335.4635, 1339.9956, 1344.543, 1349.1057, 1353.6841, 1358.2778, 1362.8871, 1367.5123, 1372.153,
|
||||
1376.8094, 1381.4817, 1386.1698, 1390.8739, 1395.594, 1400.3301, 1405.0822, 1409.8503, 1414.6348, 1419.4354, 1424.2523, 1429.0856, 1433.9353, 1438.8014, 1443.6841, 1448.5834,
|
||||
1453.4993, 1458.4318, 1463.3811, 1468.347, 1473.33, 1478.3298, 1483.3467, 1488.3804, 1493.4314, 1498.4994, 1503.5847, 1508.6873, 1513.807, 1518.9442, 1524.0989, 1529.271,
|
||||
1534.4606, 1539.6678, 1544.893, 1550.1356, 1555.3961, 1560.6743, 1565.9706, 1571.2849, 1576.6171, 1581.9674, 1587.3359, 1592.7227, 1598.1277, 1603.551, 1608.9928, 1614.453,
|
||||
1619.9318, 1625.4291, 1630.9451, 1636.4797, 1642.0333, 1647.6056, 1653.1968, 1658.807, 1664.4363, 1670.0847, 1675.7523, 1681.439, 1687.1451, 1692.8706, 1698.6154, 1704.3798,
|
||||
1710.1636, 1715.9672, 1721.7904, 1727.6334, 1733.4962, 1739.379, 1745.2817, 1751.2043, 1757.1472, 1763.1102, 1769.0934, 1775.0969, 1781.1208, 1787.1653, 1793.23, 1799.3154,
|
||||
1805.4215, 1811.5485, 1817.696, 1823.8644, 1830.0538, 1836.2643, 1842.4957, 1848.7483, 1855.0221, 1861.3173, 1867.6338, 1873.9717, 1880.3312, 1886.7123, 1893.1149, 1899.5393,
|
||||
1905.9855, 1912.4536, 1918.9436, 1925.4557, 1931.9899, 1938.546, 1945.1246, 1951.7256, 1958.3489, 1964.9948, 1971.663, 1978.3539, 1985.0676, 1991.8041, 1998.5634, 2005.3457,
|
||||
2012.1509, 2018.9791, 2025.8308, 2032.7056, 2039.6036, 2046.5251, 2053.4702, 2060.4387, 2067.431, 2074.447, 2081.4868, 2088.5503, 2095.638, 2102.7495, 2109.8855, 2117.0454,
|
||||
2124.2297, 2131.4385, 2138.6716, 2145.9292, 2153.2117, 2160.5188, 2167.8508, 2175.2075, 2182.589, 2189.9958, 2197.4277, 2204.8848, 2212.3672, 2219.875, 2227.4084, 2234.9673,
|
||||
2242.5518, 2250.1619, 2257.7979, 2265.46, 2273.148, 2280.862, 2288.602, 2296.3687, 2304.1616, 2311.981, 2319.8267, 2327.6992, 2335.5984, 2343.5244, 2351.4773, 2359.4573,
|
||||
2367.464, 2375.4985, 2383.5596, 2391.6484, 2399.7646, 2407.9084, 2416.0798, 2424.279, 2432.5059, 2440.7607, 2449.0435, 2457.3545, 2465.6936, 2474.0613, 2482.457, 2490.8816,
|
||||
2499.3345, 2507.816, 2516.3267, 2524.8657, 2533.434, 2542.0315, 2550.658, 2559.314, 2567.999, 2576.7139, 2585.4578, 2594.232, 2603.0354, 2611.8691, 2620.7327, 2629.6262,
|
||||
2638.5498, 2647.5042, 2656.4885, 2665.5037, 2674.549, 2683.6255, 2692.7322, 2701.8704, 2711.039, 2720.2393, 2729.4707, 2738.7334, 2748.0273, 2757.3528, 2766.7102, 2776.099,
|
||||
2785.52, 2794.973, 2804.458, 2813.9749, 2823.5242, 2833.1062, 2842.7205, 2852.3672, 2862.047, 2871.7595, 2881.505, 2891.2837, 2901.0955, 2910.9404, 2920.8188, 2930.7307,
|
||||
2940.6765, 2950.656, 2960.6692, 2970.716, 2980.7974, 2990.913, 3001.0627, 3011.247, 3021.466, 3031.7195, 3042.0078, 3052.3313, 3062.6895, 3073.0828, 3083.5117, 3093.9756,
|
||||
3104.4753, 3115.0103, 3125.5813, 3136.1882, 3146.8313, 3157.5103, 3168.225, 3178.9768, 3189.765, 3200.5896, 3211.4512, 3222.349, 3233.2844, 3244.2568, 3255.2664, 3266.3135,
|
||||
3277.398, 3288.5198, 3299.6797, 3310.8774, 3322.113, 3333.3867, 3344.6987, 3356.0493, 3367.4382, 3378.866, 3390.3323, 3401.8374, 3413.3818, 3424.9653, 3436.5881, 3448.2505,
|
||||
3459.9524, 3471.6938, 3483.4753, 3495.2969, 3507.1582, 3519.0598, 3531.0022, 3542.9849, 3555.008, 3567.0723, 3579.1775, 3591.3235, 3603.5107, 3615.7395, 3628.0098, 3640.3218,
|
||||
3652.6753, 3665.071, 3677.5088, 3689.9885, 3702.5107, 3715.0752, 3727.6826, 3740.3328, 3753.026, 3765.762, 3778.5413, 3791.364, 3804.2302, 3817.1401, 3830.0938, 3843.0916,
|
||||
3856.1333, 3869.2192, 3882.3496, 3895.525, 3908.7444, 3922.009, 3935.3186, 3948.6733, 3962.0735, 3975.519, 3989.0103, 4002.547, 4016.1301, 4029.759, 4043.4343, 4057.1558,
|
||||
4070.924, 4084.7388, 4098.6006, 4112.51, 4126.4653, 4140.4688, 4154.52, 4168.6187, 4182.765, 4196.9595, 4211.202, 4225.493, 4239.833, 4254.2207, 4268.6577, 4283.1436,
|
||||
4297.6787, 4312.263, 4326.8975, 4341.5806, 4356.314, 4371.097, 4385.931, 4400.815, 4415.7495, 4430.735, 4445.7705, 4460.858, 4475.9956, 4491.185, 4506.4263, 4521.719,
|
||||
4537.0645, 4552.461, 4567.91, 4583.411, 4598.9653, 4614.5728, 4630.232, 4645.9453, 4661.7114, 4677.5313, 4693.405, 4709.332, 4725.3135, 4741.349, 4757.439, 4773.584,
|
||||
4789.783, 4806.038, 4822.3477, 4838.7124, 4855.133, 4871.609, 4888.141, 4904.729, 4921.3735, 4938.0747, 4954.8325, 4971.647, 4988.5186, 5005.4473, 5022.4336, 5039.4775,
|
||||
5056.5796, 5073.7393, 5090.957, 5108.2334, 5125.569, 5142.963, 5160.4155, 5177.9277, 5195.4995, 5213.131, 5230.822, 5248.5728, 5266.3843, 5284.256, 5302.1885, 5320.1816,
|
||||
5338.2363, 5356.3516, 5374.529, 5392.7676, 5411.0684, 5429.431, 5447.8564, 5466.3438, 5484.894, 5503.5073, 5522.184, 5540.924, 5559.7275, 5578.5947, 5597.526, 5616.5215,
|
||||
5635.5815, 5654.706, 5673.8955, 5693.151, 5712.4707, 5731.856, 5751.3076, 5770.825, 5790.4087, 5810.0586, 5829.7754, 5849.5596, 5869.41, 5889.328, 5909.314, 5929.368,
|
||||
};
|
||||
|
||||
|
||||
#define FREQUENCY(pitch) pgm_read_float_near(&frequencies[pitch])
|
||||
#define CONTROL_RATE 128 // More than this and we're gonna get clicks probably
|
||||
|
||||
#include <MozziGuts.h>
|
||||
#include <Oscil.h>
|
||||
#include <tables/sin256_int8.h>
|
||||
#include <tables/sin1024_int8.h>
|
||||
|
||||
/// OSCILLATORS
|
||||
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel1(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel2(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel3(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel4(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel5(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel6(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel7(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel8(SIN1024_DATA);
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> tonewheel9(SIN1024_DATA);
|
||||
|
||||
Oscil<SIN1024_NUM_CELLS, AUDIO_RATE> oscils[9] =
|
||||
{
|
||||
tonewheel1, tonewheel2, tonewheel3,
|
||||
tonewheel4, tonewheel5, tonewheel6,
|
||||
tonewheel7, tonewheel8, tonewheel9
|
||||
};
|
||||
|
||||
#ifdef LESLIE_ON
|
||||
Oscil<SIN256_NUM_CELLS, CONTROL_RATE> leslie(SIN256_DATA); // Leslie LFO
|
||||
#endif
|
||||
|
||||
//float drawbarFrequencies[9] = { 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0 };
|
||||
uint8_t drawbarFrequencies[9] = { 1, 2, 3, 4, 6, 8, 10, 12, 16 };
|
||||
|
||||
// These are the amplitudes of each of the drawbar stop positions (0...8).
|
||||
// Each additional stop increases by 3db. I think I have this right? Not sure.
|
||||
// We are int8_t, not uin8_t, so we can multiply faster against oscils, which is
|
||||
// also int8_t.
|
||||
int8_t drawBarAmplitudes[9] =
|
||||
{
|
||||
0, 7, 18, 32, 48, 65, 85, 105, 127
|
||||
};
|
||||
|
||||
|
||||
#define CV_POT_IN1 A7 // Note in, Pitch Scaling
|
||||
#define CV_POT_IN2 A6 // Gain
|
||||
#define CV_POT3 A4 // Organ Selection
|
||||
#define CV_IN3 A2 // [Unused]
|
||||
#define CV_AUDIO_IN A0 // Pitch Tune
|
||||
#define CV_AUDIO_OUT 9 // Out
|
||||
#define CV_GATE_OUT 10 // [Unused]
|
||||
|
||||
|
||||
#define MEDIAN_OF_THREE(a,b,c) (((a) <= (b)) ? (((b) <= (c)) ? (b) : (((a) < (c)) ? (c) : (a))) : (((a) <= (c)) ? (a) : (((b) < (c)) ? (c) : (b))))
|
||||
uint16_t pitchCV;
|
||||
uint16_t tuneCV;
|
||||
uint16_t pA;
|
||||
uint16_t pB;
|
||||
void initializeFrequency(uint8_t pitch, uint8_t tune)
|
||||
{
|
||||
pitchCV = mozziAnalogRead(pitch);
|
||||
tuneCV = mozziAnalogRead(tune);
|
||||
}
|
||||
|
||||
#define TRANSPOSE_BITS 0
|
||||
#define TRANSPOSE_SEMITONES 0
|
||||
#define TRANSPOSE_OCTAVES 0
|
||||
#define LARGE_JUMP 32
|
||||
#define SEMITONE 17
|
||||
#define FREQ_COUNTER_MAX 4
|
||||
uint8_t freqCounter = 0;
|
||||
inline float getFrequency(uint8_t pitch, uint8_t tune)
|
||||
{
|
||||
tuneCV = (tuneCV * 15 + mozziAnalogRead(tune)) >> 4;
|
||||
uint16_t p = mozziAnalogRead(pitch);
|
||||
|
||||
uint16_t diff = (p > pitchCV ? p - pitchCV : pitchCV - p);
|
||||
if (diff >= LARGE_JUMP)
|
||||
{
|
||||
pitchCV = p; // jump right there
|
||||
freqCounter = FREQ_COUNTER_MAX;
|
||||
}
|
||||
else if (freqCounter > 0)
|
||||
{
|
||||
freqCounter--;
|
||||
pitchCV = (pitchCV + p) >> 1;
|
||||
pB = pA;
|
||||
pA = pitchCV;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16_t p1 = MEDIAN_OF_THREE(p, pA, pB);
|
||||
pB = pA;
|
||||
pA = p;
|
||||
pitchCV = (pitchCV * 7 + p1) >> 3;
|
||||
}
|
||||
int16_t finalPitch = pitchCV + (tuneCV >> 1) + TRANSPOSE_SEMITONES * 17 + TRANSPOSE_OCTAVES * 205 + TRANSPOSE_BITS;
|
||||
return FREQUENCY(finalPitch < 0 ? 0 : (finalPitch > 1535 ? 1535 : finalPitch));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void setup()
|
||||
{
|
||||
startMozzi();
|
||||
// Fire up the leslie
|
||||
#ifdef LESLIE_ON
|
||||
leslie.setFreq((float)LESLIE_FREQUENCY);
|
||||
#endif
|
||||
|
||||
// precompute the drawbars so we don't have to compute them during updateAudio()
|
||||
for(uint8_t i = 0; i < NUM_DRAWBAR_SELECTIONS; i++)
|
||||
{
|
||||
for(uint8_t j = 0; j < 9; j++)
|
||||
{
|
||||
drawbars[i][j] = drawBarAmplitudes[drawbars[i][j]];
|
||||
}
|
||||
}
|
||||
initializeFrequency(CV_POT_IN1, CV_AUDIO_IN);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
audioHook();
|
||||
}
|
||||
|
||||
|
||||
// Median-Of-Three Filter for Pitch, dunno if we need it
|
||||
uint16_t inA = 0;
|
||||
uint16_t inB = 0;
|
||||
uint8_t organ = 0; // Current index into the drawbars array
|
||||
uint16_t gain; // our current gain
|
||||
|
||||
#define COUNTER_MAX 4
|
||||
uint16_t counter =0;
|
||||
void updateControl()
|
||||
{
|
||||
float frequency = getFrequency(CV_POT_IN1, CV_AUDIO_IN);
|
||||
|
||||
// leslie!
|
||||
#ifdef LESLIE_ON
|
||||
int8_t les = leslie.next();
|
||||
frequency += les * (1.0 / LESLIE_PITCH);
|
||||
#endif
|
||||
|
||||
// set the drawbars
|
||||
for(uint8_t i = 0; i < 9; i++)
|
||||
{
|
||||
oscils[i].setFreq((frequency * drawbarFrequencies[i]));
|
||||
}
|
||||
|
||||
// determine the gain
|
||||
gain = 1 + (mozziAnalogRead(CV_POT_IN2) >> 2) // Gain (Volume)
|
||||
#ifdef LESLIE_ON
|
||||
#if LESLIE_VOLUME==0
|
||||
#else
|
||||
+ ((les + 128) >> (8 - (LESLIE_VOLUME - 1))); // note: >> 8 still goes between -1 and 0 depending on whether it's positive or negative initially
|
||||
#endif
|
||||
#endif
|
||||
;
|
||||
|
||||
// what organ are we playing?
|
||||
if (++counter == COUNTER_MAX)
|
||||
{
|
||||
counter = 0;
|
||||
organ = (organ + (mozziAnalogRead(CV_POT3) * NUM_DRAWBAR_SELECTIONS)) >> 10; // Organ Selection
|
||||
}
|
||||
}
|
||||
|
||||
int updateAudio()
|
||||
{
|
||||
uint8_t* d = drawbars[organ];
|
||||
int32_t val = oscils[0].next() * d[0]; // hoisting this out gives me just enough computational space to avoid clicks, ugh
|
||||
for(uint8_t i = 1; i < 9; i++)
|
||||
{
|
||||
val += (oscils[i].next() * d[i]);
|
||||
}
|
||||
return ((val >> 8) * gain) >> 8;
|
||||
}
|
||||
201
byte/LICENSE
Normal file
201
byte/LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
70
byte/README.md
Normal file
70
byte/README.md
Normal file
@ -0,0 +1,70 @@
|
||||
# Byte
|
||||
|
||||
Byte is a bytebeat synthesizer similar to ALGODRONE or ByteBeat-Xfade. You can provide
|
||||
up to 16 bytebeat expressions (defined as BYTEBEAT\_1 through BYTEBEAT\_16 in the code), and
|
||||
then select and play them. Feel free to change them! But they must be valid C/C++
|
||||
expressions or they won't compile. You can change the pitch and tuning, as well as the
|
||||
volume. Additionally you can reset the bytebeat algorithm at any time by sending a
|
||||
trigger or gate to DIGITAL OUT.
|
||||
|
||||
## Building ByteBeats
|
||||
|
||||
A bytebeat is any C expression using the 32-bit variable 't'. It's called 16384 times a second
|
||||
and the result, mod 255, is output as an audio sample.
|
||||
|
||||
Byte has a special feature: a special variable called x which ranges from 0 to 255. It's
|
||||
set by CV coming in to IN 3, and is by default 0. You could stick x in your expressions
|
||||
to control them in real-time via CV.
|
||||
|
||||
Byte is fragile: if in your expression you modify Byte's internal variables (like triggered or pitchCV
|
||||
or even t!) you can seriously break Byte. So don't do that.
|
||||
|
||||
There are many bytebeat expressions available online. For a small collection, see
|
||||
[Viznut's archive](http://viznut.fi/demos/unix/bytebeat_formulas.txt). Note that some of these
|
||||
are designed for JavaScript or have Sine or Pow in them: they are unlikely to work.
|
||||
|
||||
You can test bytebeats [on the following webpage](https://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html)
|
||||
before adding them to GRAINS. You can change the Hz values on that page as well. GRAINS's
|
||||
default HZ is 16384, though you can turn it down to half of that or less.
|
||||
|
||||
## Tuning
|
||||
|
||||
You can't really tune BYTE: to do so would require changing the sampling rate, and Mozzi doesn't
|
||||
make it easy to do that without modifying Mozzi's config in its library. Maybe later.
|
||||
|
||||
On Pot 1 I have set things up so you can change the pitch to some degree. There are 16
|
||||
settings. Setting 8 (typically a bit to the left of due center) is the default setting.
|
||||
Since Mozzi's sampling rate is 16384 Hz, this is about one octave above and twice as fast
|
||||
as the traditional pitch, which normally corresponds to 8000 Hz. If you turn the knob
|
||||
to the LEFT of this, Byte will get slower and lower in pitch. It does this by just playing
|
||||
fewer times when Mozzi asks it to. It's pretty crude but it works. If you turn the knob to
|
||||
the RIGHT, Byte will get higher in pitch but also change how it plays. This is because it
|
||||
is incrementing the "t" variable by more and more (by default it's incremented by 1).
|
||||
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
#### IN 1
|
||||
Pitch CV
|
||||
#### IN 2
|
||||
Bytebeat CV
|
||||
#### IN 3
|
||||
Auxilliary Variable 1 CV (x)
|
||||
#### AUDIO IN (A)
|
||||
[UNUSED]
|
||||
#### AUDIO OUT
|
||||
Out
|
||||
#### DIGITAL OUT (D)
|
||||
Reset
|
||||
#### POT 1
|
||||
Pitch Scaling
|
||||
|
||||
[Set the switch to MAN probably]
|
||||
#### POT 2
|
||||
Bytebeat
|
||||
|
||||
[Set the switch to MAN probably]
|
||||
#### POT 3
|
||||
Volume
|
||||
|
||||
240
byte/byte.ino
Normal file
240
byte/byte.ino
Normal file
@ -0,0 +1,240 @@
|
||||
// Copyright 2024 Sean Luke
|
||||
// (sean@cs.gmu.edu)
|
||||
//
|
||||
// Released under the Apache 2.0 License
|
||||
|
||||
|
||||
/// BYTE
|
||||
///
|
||||
/// Byte is a bytebeat synthesizer similar to ALGODRONE or ByteBeat-Xfade. You can provide
|
||||
/// up to 16 bytebeat expressions (defined as BYTEBEAT_1 through BYTEBEAT_16 below), and
|
||||
/// then select and play them. Feel free to change them! But they must be valid C/C++
|
||||
/// expressions or they won't compile. You can change the pitch and tuning, as well as the
|
||||
/// volume. Additionally you can reset the bytebeat algorithm at any time by sending a
|
||||
/// trigger or gate to DIGITAL OUT.
|
||||
///
|
||||
/// BUILDING BYTEBEATS
|
||||
/// A bytebeat is any C expression using the 32-bit variable 't'. It's called 16384 times a second
|
||||
/// and the result, mod 255, is output as an audio sample.
|
||||
///
|
||||
/// Byte has a special feature: a special variable called x which ranges from 0 to 255. It's
|
||||
/// controlled by CV coming in to IN 3, and is by default 0. You could stick x in your expressions
|
||||
/// to control them in real-time via CV.
|
||||
///
|
||||
/// Byte is fragile: if in your expression you modify Byte's own variables (like triggered or pitchCV
|
||||
/// or even t!) you can seriously break Byte. So don't do that.
|
||||
///
|
||||
///
|
||||
/// TUNING
|
||||
///
|
||||
/// You can't really tune BYTE: to do so would require changing the sampling rate, and Mozzi doesn't
|
||||
/// make it easy to do that without modifying Mozzi's config in its library. Maybe later.
|
||||
///
|
||||
/// On Pot 1 I have set things up so you can change the pitch to some degree. There are 16
|
||||
/// settings. Setting 8 (typically a bit to the left of due center) is the default setting.
|
||||
/// Since Mozzi's sampling rate is 16384 Hz, this is about one octave above and twice as fast
|
||||
/// as the traditional pitch, which normally corresponds to 8000 Hz. If you turn the knob
|
||||
/// to the LEFT of this, Byte will get slower and lower in pitch. It does this by just playing
|
||||
/// fewer times when Mozzi asks it to. It's pretty crude but it works. If you turn the knob to
|
||||
/// the RIGHT, Byte will get higher in pitch but also change how it plays. This is because it
|
||||
/// is incrementing the "t" variable by more and more (by default it's incremented by 1).
|
||||
///
|
||||
///
|
||||
/// SET GRAINS TO MOZZI MODE. Sorry, no Grains mode.
|
||||
///
|
||||
/// You will need to install the Mozzi Library. You can do this from the Library Manager
|
||||
/// in your Arduino IDE.
|
||||
|
||||
|
||||
/// CONFIGURATION
|
||||
///
|
||||
/// IN 1 Pitch CV
|
||||
/// IN 2 Bytebeat CV
|
||||
/// IN 3 Auxilliary Variable 1 CV (x)
|
||||
/// AUDIO IN (A) UNUSED
|
||||
/// AUDIO OUT Out
|
||||
/// DIGITAL OUT (D) Reset
|
||||
///
|
||||
/// POT 1 Pitch Scaling [Set the switch to MAN probably]
|
||||
///
|
||||
/// POT 2 Bytebeat [Set the switch to MAN probably]
|
||||
///
|
||||
/// POT 3 Volume
|
||||
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
// FOR MORE BYTEBEAT EXAMPLES SEE
|
||||
// http://viznut.fi/demos/unix/bytebeat_formulas.txt
|
||||
//
|
||||
// Test your bytebeats out first in HTML!
|
||||
// https://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html
|
||||
|
||||
#define BYTEBEAT_1 \
|
||||
t*(42&t>>10)
|
||||
|
||||
#define BYTEBEAT_2 \
|
||||
t|t%255|t%257
|
||||
|
||||
#define BYTEBEAT_3 \
|
||||
t*(((t>>11)&(t>>8))&(123&(t>>3)))
|
||||
|
||||
#define BYTEBEAT_4 \
|
||||
t*(t>>((t>>9)|(t>>8))&(63&(t>>4)))
|
||||
|
||||
#define BYTEBEAT_5 \
|
||||
(t>>6|t|t>>(t>>16))*10+((t>>11)&7)
|
||||
|
||||
#define BYTEBEAT_6 \
|
||||
(t|(t>>9|t>>7))*t&(t>>11|t>>9)
|
||||
|
||||
#define BYTEBEAT_7 \
|
||||
t*5&(t>>7)|t*3&(t*4>>10)
|
||||
|
||||
#define BYTEBEAT_8 \
|
||||
(t>>7|t|t>>6)*10+4*(t&t>>13|t>>6)
|
||||
|
||||
#define BYTEBEAT_9 \
|
||||
((t&4096)?((t*(t^t%255)|(t>>4))>>1):(t>>3)|((t&8192)?t<<2:t))
|
||||
|
||||
#define BYTEBEAT_10 \
|
||||
((t*(t>>8|t>>9)&46&t>>8))^(t&t>>13|t>>6)
|
||||
|
||||
#define BYTEBEAT_11 \
|
||||
(t*5&t>>7)|(t*3&t>>10)
|
||||
|
||||
#define BYTEBEAT_12 \
|
||||
(int)(t/1e7*t*t+t)%127|t>>4|t>>5|t%127+(t>>16)|t
|
||||
|
||||
#define BYTEBEAT_13 \
|
||||
((t/2*(15&(0x234568a0>>(t>>8&28))))|t/2>>(t>>11)^t>>12)+(t/16&t&24)
|
||||
|
||||
#define BYTEBEAT_14 \
|
||||
(t&t%255)-(t*3&t>>13&t>>6)
|
||||
|
||||
#define BYTEBEAT_15 \
|
||||
t>>4|t&((t>>5)/(t>>7-(t>>15)&-t>>7-(t>>15)))
|
||||
|
||||
#define BYTEBEAT_16 \
|
||||
t*(((t>>9)&10)|((t>>11)&24)^((t>>10)&15&(t>>15)))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define CV_POT_IN1 A7 // Note In, Pitch Scaling // Filter Cutoff
|
||||
#define CV_POT_IN2 A6 // Filter Cutoff
|
||||
#define CV_POT3 A4 // Resonance
|
||||
#define CV_IN3 A2 // Amplitude CV
|
||||
#define CV_AUDIO_IN A0 // Pitch Tune // Resonance CV
|
||||
#define CV_AUDIO_OUT 9 // Out
|
||||
#define CV_GATE_OUT 10 // [Unused]
|
||||
#define RANDOM_PIN A5
|
||||
|
||||
#define CONTROL_RATE 64
|
||||
|
||||
|
||||
#include <MozziGuts.h>
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(CV_GATE_OUT, INPUT);
|
||||
startMozzi();
|
||||
}
|
||||
|
||||
uint8_t triggered = false;
|
||||
uint8_t x;
|
||||
uint8_t frequency = 1;
|
||||
uint8_t gain;
|
||||
uint8_t expression;
|
||||
uint32_t t = 0;
|
||||
uint8_t oldExpression = 0;
|
||||
uint8_t maxCount = 1;
|
||||
uint8_t increment = 1;
|
||||
|
||||
void updateControl()
|
||||
{
|
||||
frequency = (mozziAnalogRead(CV_POT_IN1) >> 6) + 1;
|
||||
if (frequency >= 8)
|
||||
{
|
||||
maxCount = 1;
|
||||
increment = frequency - 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
maxCount = 9 - frequency;
|
||||
increment = 1;
|
||||
}
|
||||
|
||||
gain = mozziAnalogRead(CV_POT3) >> 5; // 0...31
|
||||
x = mozziAnalogRead(CV_IN3) >> 2; // 0...255
|
||||
expression = mozziAnalogRead(CV_POT_IN2) >> 6; // 0...15
|
||||
if (digitalRead(CV_GATE_OUT))
|
||||
{
|
||||
if (!triggered)
|
||||
{
|
||||
triggered = true;
|
||||
t = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
triggered = false;
|
||||
}
|
||||
|
||||
if (expression != oldExpression)
|
||||
{
|
||||
t = 0;
|
||||
oldExpression = expression;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint8_t count = 1;
|
||||
int16_t last = 0;
|
||||
|
||||
int updateAudio()
|
||||
{
|
||||
count--;
|
||||
if (count == 0)
|
||||
{
|
||||
count = maxCount;
|
||||
|
||||
// shift pitch
|
||||
t += increment;
|
||||
|
||||
// select expression
|
||||
uint8_t result;
|
||||
switch(expression)
|
||||
{
|
||||
case 0: result = (uint8_t)(255 & (BYTEBEAT_1)); break;
|
||||
case 1: result = (uint8_t)(255 & (BYTEBEAT_2)); break;
|
||||
case 2: result = (uint8_t)(255 & (BYTEBEAT_3)); break;
|
||||
case 3: result = (uint8_t)(255 & (BYTEBEAT_4)); break;
|
||||
case 4: result = (uint8_t)(255 & (BYTEBEAT_5)); break;
|
||||
case 5: result = (uint8_t)(255 & (BYTEBEAT_6)); break;
|
||||
case 6: result = (uint8_t)(255 & (BYTEBEAT_7)); break;
|
||||
case 7: result = (uint8_t)(255 & (BYTEBEAT_8)); break;
|
||||
case 8: result = (uint8_t)(255 & (BYTEBEAT_9)); break;
|
||||
case 9: result = (uint8_t)(255 & (BYTEBEAT_10)); break;
|
||||
case 10: result = (uint8_t)(255 & (BYTEBEAT_11)); break;
|
||||
case 11: result = (uint8_t)(255 & (BYTEBEAT_12)); break;
|
||||
case 12: result = (uint8_t)(255 & (BYTEBEAT_13)); break;
|
||||
case 13: result = (uint8_t)(255 & (BYTEBEAT_14)); break;
|
||||
case 14: result = (uint8_t)(255 & (BYTEBEAT_15)); break;
|
||||
case 15: result = (uint8_t)(255 & (BYTEBEAT_16)); break;
|
||||
}
|
||||
|
||||
// convert to signed and change amplitude
|
||||
last = ((result - (int16_t)128) * gain) >> 4; // gain should go 0...31
|
||||
}
|
||||
return last;
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
audioHook();
|
||||
}
|
||||
|
||||
201
pluck/LICENSE
Normal file
201
pluck/LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
88
pluck/README.md
Normal file
88
pluck/README.md
Normal file
@ -0,0 +1,88 @@
|
||||
# Pluck
|
||||
|
||||
Pluck is a Karplus-Strong string plucking thing. You pluck a string by providing a PITCH
|
||||
and then triggering the TRIGGER. Pluck maintains up to 4 voices of strings being plucked at
|
||||
one time. No two plucks will sound exactly alike, nor will they have the same decay nor volume.
|
||||
|
||||
SET GRAINS TO MOZZI MODE. Sorry, no Grains mode.
|
||||
|
||||
You will need to install the Mozzi Library. You can do this from the Library Manager
|
||||
in your Arduino IDE.
|
||||
|
||||
There are three options for plucking. First, you can set the DECAY of the pluck. Note that higher
|
||||
note plucks will decay much faster regardless, but you can stretch them out this way. Second, you
|
||||
can set the GAIN (the volume). Longer decays will sound increasingly metallic and when they pile
|
||||
up you'll need to reduce the gain. Third, you can set the ATONALITY of the pluck: how much
|
||||
it will sound like a string versus an atonal drum or crash sound.
|
||||
Basically more atonality rapidly adds more and more noise to the sound.
|
||||
|
||||
You can't have both ATONALITY and DECAY on the IN 2 knob and input: one is relegated to CV via IN 3.
|
||||
By default ATONALITY is on IN 3 and DECAY gets the IN2 knob/input. But if you'd like to swap that,
|
||||
just uncomment a #define in the code.
|
||||
|
||||
Note that if you change the atonality, pitch, gain, or decay, it will not affect the currently plucked
|
||||
notes: it only affects later notes. This trick helps the computational efficiency of the program and
|
||||
thus the quality of the note sound: but in fact changing any of these four elements in real time adds
|
||||
weird and undesirable artifacts in Mozzi, so you wouldn't want it anyway.
|
||||
|
||||
|
||||
## Tuning
|
||||
|
||||
Unlike other Mozzi projects, Pluck has to compute the wave array size immediately in order to play it. This means
|
||||
it that has to make a snap judgment about the current pitch, and sometimes it's wrong because GRAINS / Mozzi
|
||||
are very sloppy and noisy in providing proper pitch information. So occasionally it'll be off when you play it.
|
||||
I will try to work on it, but expect Pluck to not be exactly on pitch every time you do a pluck. I can make it
|
||||
more accurate, but at the expense of much more latency (and Pluck has plenty of latency already).
|
||||
|
||||
Also, you can adjust tuning, but note that Karplus-Strong is limited in its ability precisely match
|
||||
a given pitch. High plucks will be far, far less pitch accurate than low plucks. The lowest
|
||||
pluck you can do is 64 Hz (roughly a C two octaves below middle C).
|
||||
|
||||
|
||||
|
||||
## Adjusting Tuning and Tracking
|
||||
|
||||
Grains's Inputs track 1.3V/octave, not 1V/octave: we'll need to scale them to track properly.
|
||||
To do this, you can adjust the Pitch CV Scaling on Pot 1. This GRAINS program is set up to play
|
||||
the C three octaves below Middle C when it receives 0V. You should be able to use Pot 1 to scale
|
||||
the pitch such that high Cs play in tune as well. Once you have things tracking well, you can
|
||||
then use the Pitch Tune (Audio In) to tune 0V to some other note. Note that as GRAINS resistors
|
||||
warm up, the scaling will change and you will need to adjust the tracking again, at least until
|
||||
they are fully warmed up.
|
||||
|
||||
By default the note corresponding to 0V is C0, three octaves below middle C, that is MIDI note 24,
|
||||
or 32.7 Hz. You can customize the tuning for this Grains program but only UP. This can be done
|
||||
in two ways. First, you can add pitch to the tuning with a CV value to Audio In. Second, you
|
||||
can transpose the pitch up by changing the TRANSPOSE\_OCTAVES and/or TRANSPOSE\_SEMITONES #defines
|
||||
in the code to positive integers. You can also change TRANSPOSE\_BITS: a "bit" is the minimum possible change Grains can do, equal to 1/17 of a semitone.
|
||||
|
||||
|
||||
## Grains Bug
|
||||
|
||||
There is a bug in GRAINS that affects Pots (Dials) 1 and 2. If you set the switch to "Man",
|
||||
then the range of the Pot is correct. But if you set the switch to "In 1" (or "In 2"), then
|
||||
the range of the Dial is maximum (1.0 or 5V for our purposes) at about the 2 o'clock position
|
||||
on the Dial. Beyond that it stays at 1.0.
|
||||
|
||||
## Configuration
|
||||
|
||||
#### IN 1
|
||||
Pitch CV
|
||||
#### IN 2
|
||||
Decay (or Atonality) CV
|
||||
#### IN 3
|
||||
Atonality (or Decay)
|
||||
#### AUDIO IN (A)
|
||||
Pitch Tune
|
||||
#### AUDIO OUT
|
||||
Out
|
||||
#### DIGITAL OUT (D)
|
||||
Trigger
|
||||
#### POT 1
|
||||
Pitch CV Scaling [Set the switch to IN1]
|
||||
#### POT 2
|
||||
Decay (or Atonality)
|
||||
[If you're not using Decay/Atonality CV, set the switch to MAN]
|
||||
#### POT 3
|
||||
Gain
|
||||
|
||||
965
pluck/pluck.ino
Normal file
965
pluck/pluck.ino
Normal file
@ -0,0 +1,965 @@
|
||||
// Copyright 2023 Sean Luke
|
||||
// (sean@cs.gmu.edu)
|
||||
//
|
||||
// Released under the Apache 2.0 License
|
||||
|
||||
|
||||
/// PLUCK
|
||||
///
|
||||
/// Pluck is a Karplus-Strong string plucking thing. You pluck a string by providing a PITCH
|
||||
/// and then triggering the TRIGGER. Pluck maintains up to 4 voices of strings being plucked at
|
||||
/// one time. No two plucks will sound exactly alike, nor will they have the same decay nor volume.
|
||||
///
|
||||
/// SET GRAINS TO MOZZI MODE. Sorry, no Grains mode.
|
||||
///
|
||||
/// You will need to install the Mozzi Library. You can do this from the Library Manager
|
||||
/// in your Arduino IDE.
|
||||
///
|
||||
/// There are three options for plucking. First, you can set the DECAY of the pluck. Note that higher
|
||||
/// note plucks will decay much faster regardless, but you can stretch them out this way. Second, you
|
||||
/// can set the GAIN (the volume). Second, you can set the ATONALITY of the pluck: how much
|
||||
/// it will sound like a string versus an atonal drum or crash sound. Basically more atonality rapidly
|
||||
/// adds more and more noise to the sound. Third, you can set the DECAY of the pluck. Longer decays
|
||||
/// will sound increasingly metallic and when they pile up you'll need to reduce the GAIN.
|
||||
///
|
||||
/// You can't have both ATONALITY and DECAY on the IN 2 knob and input: one is relegated to CV via IN 3.
|
||||
/// By default ATONALITY is on IN 3 and DECAY gets the IN2 knob/input. But if you'd like to swap that,
|
||||
/// just uncomment the following #define below (that is, remove the // ):
|
||||
|
||||
|
||||
// #define ATONALITY_ON_POT_2
|
||||
|
||||
/// Note that if you change the atonality, pitch, gain, or decay, it will not affect the currently plucked
|
||||
/// notes: it only affects later notes. This trick helps the computational efficiency of the program and
|
||||
/// thus the quality of the note sound: but in fact changing any of these four elements in real time adds
|
||||
/// weird and undesirable artifacts in Mozzi, so you wouldn't want it anyway.
|
||||
|
||||
/// TUNING
|
||||
///
|
||||
/// Unlike other Mozzi projects, Pluck has to compute the wave array size immediately in order to play it. This means
|
||||
/// it that has to make a snap judgment about the current pitch, and sometimes it's wrong because GRAINS / Mozzi
|
||||
/// are very sloppy and noisy in providing proper pitch information. So occasionally it'll be off when you play it.
|
||||
/// I will try to work on it, but expect Pluck to not be exactly on pitch every time you do a pluck. I can make it
|
||||
/// more accurate, but at the expense of much more latency (and Pluck has plenty of latency already).
|
||||
///
|
||||
/// One thing you can do is ask Pluck to always round to the nearest semitone. You'll have to get your pitch tracking
|
||||
/// right. To do this, you want to uncomment the following #define:
|
||||
|
||||
//#define ROUND_TO_SEMITONE
|
||||
|
||||
///
|
||||
/// Also, you can adjust tuning, but note that Karplus-Strong is limited in its ability precisely match
|
||||
/// a given pitch. High plucks will be far, far less pitch accurate than low plucks. The lowest
|
||||
/// pluck you can do is 64 Hz (roughly a C two octaves below middle C).
|
||||
///
|
||||
///
|
||||
/// ADJUSTING TUNING AND TRACKING
|
||||
///
|
||||
/// Grains's Inputs track 1.3V/octave, not 1V/octave: we'll need to scale them to track properly.
|
||||
/// To do this, you can adjust the Pitch CV Scaling on Pot 1. This GRAINS program is set up to play
|
||||
/// the C three octaves below Middle C when it receives 0V. You should be able to use Pot 1 to scale
|
||||
/// the pitch such that high Cs play in tune as well. Once you have things tracking well, you can
|
||||
/// then use the Pitch Tune (Audio In) to tune 0V to some other note. Note that as GRAINS resistors
|
||||
/// warm up, the scaling will change and you will need to adjust the tracking again, at least until
|
||||
/// they are fully warmed up.
|
||||
///
|
||||
/// By default the note corresponding to 0V is C0, three octaves below middle C, that is MIDI note 24,
|
||||
/// or 32.7 Hz. You can customize the tuning for this Grains program. This can be done
|
||||
/// in two ways. First, you can add pitch to the tuning with a CV value to Audio In. Second, you
|
||||
/// can transpose the pitch up by changing the TRANSPOSE_OCTAVES and/or TRANSPOSE_SEMITONES #defines
|
||||
/// in the code to positive integers. You can also change TRANSPOSE_BITS: a "bit" is the minimum possible
|
||||
/// change Grains can do, equal to 1/17 of a semitone.
|
||||
|
||||
|
||||
/// CONFIGURATION
|
||||
///
|
||||
/// IN 1 Pitch CV
|
||||
/// IN 2 Decay (or Atonality) CV
|
||||
/// IN 3 Atonality (or Decay)
|
||||
/// AUDIO IN (A) Pitch Tune
|
||||
/// AUDIO OUT Out
|
||||
/// DIGITAL OUT (D) Trigger
|
||||
///
|
||||
/// POT 1 Pitch Scaling [Set the switch to In1]
|
||||
///
|
||||
/// POT 2 Decay (or Atonality)
|
||||
/// [Set the switch to In2]
|
||||
///
|
||||
/// POT 3 Gain
|
||||
|
||||
|
||||
|
||||
|
||||
// this is literally just a deterministic random number table, stolen from arp.ino
|
||||
PROGMEM const uint8_t NOISE[8192] =
|
||||
{
|
||||
0xF1, 0xD2, 0xAC, 0x49, 0x3C, 0xC9, 0xF2, 0xA2, 0x09, 0x18, 0x98, 0x22, 0x64, 0xEA, 0xEA, 0x49, 0x3A, 0x7B, 0x56, 0xA5, 0x18, 0x9D, 0xBD, 0x38, 0xFE, 0x6D, 0x21, 0xE8, 0x4B, 0x33, 0xBC, 0xA2,
|
||||
0x06, 0xFB, 0x41, 0xB6, 0xBA, 0xAC, 0x6E, 0x2C, 0x1E, 0x9D, 0xFB, 0x96, 0x6D, 0x9D, 0xDA, 0xE1, 0x6C, 0x04, 0xD4, 0xEC, 0x7E, 0x3C, 0xC1, 0x69, 0xE8, 0x74, 0x38, 0x8A, 0x2E, 0x1B, 0x72, 0xE6,
|
||||
0xA3, 0xA1, 0x41, 0x03, 0xC4, 0xCD, 0x0C, 0xBB, 0x8D, 0xC7, 0xF9, 0xC0, 0x54, 0xE8, 0x29, 0x2A, 0x02, 0x2A, 0xFB, 0x13, 0x19, 0x9D, 0xDA, 0x2B, 0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 0xFF, 0x2A, 0x48, 0xF2, 0xA2, 0xF7, 0x26, 0xF9, 0x43, 0x4A, 0x41, 0x0C, 0x09, 0xBC,
|
||||
0xF4, 0x7F, 0x97, 0x75, 0xA0, 0x18, 0x5D, 0xA9, 0x04, 0x40, 0xD5, 0x0B, 0xB7, 0x11, 0xF8, 0x60, 0xD9, 0x7C, 0x90, 0x04, 0x2E, 0x16, 0x15, 0x0D, 0xD9, 0xEE, 0x49, 0xAF, 0xC2, 0x3A, 0x3B, 0x02,
|
||||
0xBC, 0xDA, 0xEA, 0x78, 0xDC, 0x25, 0x9F, 0xC5, 0x98, 0x64, 0x7C, 0xC5, 0xDC, 0x11, 0x73, 0x91, 0x5D, 0xE9, 0xA9, 0x60, 0x04, 0x93, 0x5F, 0x09, 0xD9, 0x96, 0x0E, 0x56, 0x95, 0x63, 0x34, 0xB5,
|
||||
0xCC, 0xB2, 0x5A, 0xAA, 0xC1, 0xA0, 0xE7, 0x70, 0x93, 0xB1, 0xA7, 0xCD, 0x4D, 0x46, 0x3E, 0xEE, 0x85, 0xCE, 0x77, 0xE6, 0x7A, 0x3B, 0x1D, 0xF3, 0x11, 0x17, 0x82, 0x94, 0x6C, 0x8E, 0x63, 0x7E,
|
||||
};
|
||||
|
||||
|
||||
// This table tells us how to round (floor really) to the nearest semitone.
|
||||
// It's just computed as (DOTIMES (X (+ 1024 512)) (PRINT (FLOOR (* 17.05 (FLOOR (/ X 17.05))))))
|
||||
// and is just an elaborate way of avoiding a division and a little floating-point. It's lazy.
|
||||
|
||||
PROGMEM const uint16_t semitones[1024 + 512] =
|
||||
{
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34,
|
||||
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
||||
68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
|
||||
85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
|
||||
102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
|
||||
119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
|
||||
136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
|
||||
153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
|
||||
170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
|
||||
187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
|
||||
204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
|
||||
221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
|
||||
238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
|
||||
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
|
||||
272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272,
|
||||
289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289,
|
||||
306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, 306,
|
||||
323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
|
||||
341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, 341,
|
||||
358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 358, 358,
|
||||
375, 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, 375, 375,
|
||||
392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392,
|
||||
409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, 409,
|
||||
426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 426,
|
||||
443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443,
|
||||
460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460, 460,
|
||||
477, 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, 477, 477,
|
||||
494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494, 494,
|
||||
511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, 511,
|
||||
528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528, 528,
|
||||
545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545, 545,
|
||||
562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562, 562,
|
||||
579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579,
|
||||
596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596,
|
||||
613, 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, 613, 613,
|
||||
630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630, 630,
|
||||
647, 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
|
||||
664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664, 664,
|
||||
682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682, 682,
|
||||
699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699,
|
||||
716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, 716,
|
||||
733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733, 733,
|
||||
750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750,
|
||||
767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767,
|
||||
784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784, 784,
|
||||
801, 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, 801, 801,
|
||||
818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818, 818,
|
||||
835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
|
||||
852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852,
|
||||
869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, 869,
|
||||
886, 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, 886, 886,
|
||||
903, 903, 903, 903, 903, 903, 903, 903, 903, 903, 903, 903, 903, 903, 903, 903, 903,
|
||||
920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920,
|
||||
937, 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, 937, 937,
|
||||
954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954,
|
||||
971, 971, 971, 971, 971, 971, 971, 971, 971, 971, 971, 971, 971, 971, 971, 971, 971,
|
||||
988, 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, 988, 988,
|
||||
1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005,
|
||||
1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022,
|
||||
1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040, 1040,
|
||||
1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057, 1057,
|
||||
1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1074,
|
||||
1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091,
|
||||
1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108,
|
||||
1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
|
||||
1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142,
|
||||
1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159,
|
||||
1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176,
|
||||
1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193,
|
||||
1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210,
|
||||
1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227,
|
||||
1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244,
|
||||
1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261,
|
||||
1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278,
|
||||
1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295, 1295,
|
||||
1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312, 1312,
|
||||
1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329,
|
||||
1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346,
|
||||
1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364, 1364,
|
||||
1364, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381, 1381,
|
||||
1381, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398, 1398,
|
||||
1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415, 1415,
|
||||
1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432, 1432,
|
||||
1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,
|
||||
1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466, 1466,
|
||||
1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483, 1483,
|
||||
1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500,
|
||||
1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517, 1517,
|
||||
1534
|
||||
};
|
||||
|
||||
#define SEMITONES(idx) pgm_read_word_near(&semitones[idx])
|
||||
|
||||
|
||||
// This lookup table prevents us from having to do pow() to convert pitch/CV to frequency
|
||||
// and thus to a wave length. These values correspond with 0V being 32.7Hz. We only allow
|
||||
// frequencies of 64 or greater, which corresponds to wave lengths of 16384 / 64 = 256 or
|
||||
// smaller. We then continue another 512 for some headroom when pitch-shifting.
|
||||
PROGMEM const uint8_t wavetableSizes[1024 + 512] =
|
||||
/*
|
||||
{
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256,
|
||||
256, 256, 256, 255, 254, 253, 252, 251, 251, 250, 249, 248, 247, 246,
|
||||
245, 245, 244, 243, 242, 241, 241, 240, 239, 238, 237, 236, 236, 235,
|
||||
234, 233, 233, 232, 231, 230, 229, 229, 228, 227, 226, 226, 225, 224,
|
||||
223, 222, 222, 221, 220, 219, 219, 218, 217, 216, 216, 215, 214, 214,
|
||||
213, 212, 211, 211, 210, 209, 209, 208, 207, 206, 206, 205, 204, 204,
|
||||
203, 202, 202, 201, 200, 200, 199, 198, 198, 197, 196, 196, 195, 194,
|
||||
194, 193, 192, 192, 191, 190, 190, 189, 188, 188, 187, 186, 186, 185,
|
||||
185, 184, 183, 183, 182, 181, 181, 180, 180, 179, 178, 178, 177, 177,
|
||||
176, 175, 175, 174, 174, 173, 172, 172, 171, 171, 170, 170, 169, 168,
|
||||
168, 167, 167, 166, 166, 165, 164, 164, 163, 163, 162, 162, 161, 161,
|
||||
160, 159, 159, 158, 158, 157, 157, 156, 156, 155, 155, 154, 154, 153,
|
||||
153, 152, 152, 151, 151, 150, 149, 149, 148, 148, 147, 147, 146, 146,
|
||||
145, 145, 145, 144, 144, 143, 143, 142, 142, 141, 141, 140, 140, 139,
|
||||
139, 138, 138, 137, 137, 136, 136, 135, 135, 135, 134, 134, 133, 133,
|
||||
132, 132, 131, 131, 130, 130, 130, 129, 129, 128, 128, 127, 127, 127,
|
||||
126, 126, 125, 125, 124, 124, 124, 123, 123, 122, 122, 121, 121, 121,
|
||||
120, 120, 119, 119, 119, 118, 118, 117, 117, 117, 116, 116, 115, 115,
|
||||
115, 114, 114, 114, 113, 113, 112, 112, 112, 111, 111, 110, 110, 110,
|
||||
109, 109, 109, 108, 108, 107, 107, 107, 106, 106, 106, 105, 105, 105,
|
||||
104, 104, 104, 103, 103, 102, 102, 102, 101, 101, 101, 100, 100, 100,
|
||||
99, 99, 99, 98, 98, 98, 97, 97, 97, 96, 96, 96, 95, 95, 95, 94, 94,
|
||||
94, 93, 93, 93, 93, 92, 92, 92, 91, 91, 91, 90, 90, 90, 89, 89, 89,
|
||||
89, 88, 88, 88, 87, 87, 87, 86, 86, 86, 86, 85, 85, 85, 84, 84, 84,
|
||||
84, 83, 83, 83, 82, 82, 82, 82, 81, 81, 81, 80, 80, 80, 80, 79, 79,
|
||||
79, 79, 78, 78, 78, 78, 77, 77, 77, 76, 76, 76, 76, 75, 75, 75, 75,
|
||||
74, 74, 74, 74, 73, 73, 73, 73, 72, 72, 72, 72, 71, 71, 71, 71, 70,
|
||||
70, 70, 70, 69, 69, 69, 69, 69, 68, 68, 68, 68, 67, 67, 67, 67, 66,
|
||||
66, 66, 66, 66, 65, 65, 65, 65, 64, 64, 64, 64, 64, 63, 63, 63, 63,
|
||||
63, 62, 62, 62, 62, 61, 61, 61, 61, 61, 60, 60, 60, 60, 60, 59, 59,
|
||||
59, 59, 59, 58, 58, 58, 58, 58, 57, 57, 57, 57, 57, 56, 56, 56, 56,
|
||||
56, 55, 55, 55, 55, 55, 55, 54, 54, 54, 54, 54, 53, 53, 53, 53, 53,
|
||||
53, 52, 52, 52, 52, 52, 51, 51, 51, 51, 51, 51, 50, 50, 50, 50, 50,
|
||||
50, 49, 49, 49, 49, 49, 49, 48, 48, 48, 48, 48, 48, 47, 47, 47, 47,
|
||||
47, 47, 46, 46, 46, 46, 46, 46, 45, 45, 45, 45, 45, 45, 45, 44, 44,
|
||||
44, 44, 44, 44, 44, 43, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 42,
|
||||
42, 41, 41, 41, 41, 41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 40, 39,
|
||||
39, 39, 39, 39, 39, 39, 38, 38, 38, 38, 38, 38, 38, 38, 37, 37, 37,
|
||||
37, 37, 37, 37, 37, 36, 36, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35,
|
||||
35, 35, 35, 35, 34, 34, 34, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33,
|
||||
33, 33, 33, 33, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31,
|
||||
31, 31, 31, 31, 31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 29,
|
||||
29, 29, 29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
|
||||
25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23,
|
||||
23, 23, 23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22,
|
||||
22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
|
||||
21, 21, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18,
|
||||
18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17,
|
||||
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 14,
|
||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11,
|
||||
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
|
||||
11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
|
||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
||||
};
|
||||
*/
|
||||
{
|
||||
251, 250, 249, 248, 247, 246, 245, 245, 244, 243, 242, 241, 241,
|
||||
240, 239, 238, 237, 236, 236, 235, 234, 233, 233, 232, 231, 230, 229,
|
||||
229, 228, 227, 226, 226, 225, 224, 223, 223, 222, 221, 220, 220, 219,
|
||||
218, 217, 217, 216, 215, 214, 214, 213, 212, 211, 211, 210, 209, 209,
|
||||
208, 207, 207, 206, 205, 204, 204, 203, 202, 202, 201, 200, 200, 199,
|
||||
198, 198, 197, 196, 196, 195, 194, 194, 193, 192, 192, 191, 190, 190,
|
||||
189, 188, 188, 187, 187, 186, 185, 185, 184, 183, 183, 182, 182, 181,
|
||||
180, 180, 179, 179, 178, 177, 177, 176, 176, 175, 174, 174, 173, 173,
|
||||
172, 171, 171, 170, 170, 169, 169, 168, 167, 167, 166, 166, 165, 165,
|
||||
164, 163, 163, 162, 162, 161, 161, 160, 160, 159, 159, 158, 157, 157,
|
||||
156, 156, 155, 155, 154, 154, 153, 153, 152, 152, 151, 151, 150, 150,
|
||||
149, 149, 148, 148, 147, 147, 146, 146, 145, 145, 144, 144, 143, 143,
|
||||
142, 142, 141, 141, 140, 140, 139, 139, 138, 138, 138, 137, 137, 136,
|
||||
136, 135, 135, 134, 134, 133, 133, 133, 132, 132, 131, 131, 130, 130,
|
||||
129, 129, 129, 128, 128, 127, 127, 126, 126, 126, 125, 125, 124, 124,
|
||||
123, 123, 123, 122, 122, 121, 121, 121, 120, 120, 119, 119, 118, 118,
|
||||
118, 117, 117, 117, 116, 116, 115, 115, 115, 114, 114, 113, 113, 113,
|
||||
112, 112, 111, 111, 111, 110, 110, 110, 109, 109, 108, 108, 108, 107,
|
||||
107, 107, 106, 106, 106, 105, 105, 105, 104, 104, 103, 103, 103, 102,
|
||||
102, 102, 101, 101, 101, 100, 100, 100, 99, 99, 99, 98, 98, 98, 97,
|
||||
97, 97, 96, 96, 96, 95, 95, 95, 94, 94, 94, 93, 93, 93, 93, 92, 92,
|
||||
92, 91, 91, 91, 90, 90, 90, 89, 89, 89, 89, 88, 88, 88, 87, 87, 87,
|
||||
86, 86, 86, 86, 85, 85, 85, 84, 84, 84, 84, 83, 83, 83, 82, 82, 82,
|
||||
82, 81, 81, 81, 81, 80, 80, 80, 79, 79, 79, 79, 78, 78, 78, 78, 77,
|
||||
77, 77, 77, 76, 76, 76, 76, 75, 75, 75, 74, 74, 74, 74, 73, 73, 73,
|
||||
73, 73, 72, 72, 72, 72, 71, 71, 71, 71, 70, 70, 70, 70, 69, 69, 69,
|
||||
69, 68, 68, 68, 68, 68, 67, 67, 67, 67, 66, 66, 66, 66, 65, 65, 65,
|
||||
65, 65, 64, 64, 64, 64, 64, 63, 63, 63, 63, 62, 62, 62, 62, 62, 61,
|
||||
61, 61, 61, 61, 60, 60, 60, 60, 60, 59, 59, 59, 59, 59, 58, 58, 58,
|
||||
58, 58, 57, 57, 57, 57, 57, 56, 56, 56, 56, 56, 55, 55, 55, 55, 55,
|
||||
55, 54, 54, 54, 54, 54, 53, 53, 53, 53, 53, 53, 52, 52, 52, 52, 52,
|
||||
51, 51, 51, 51, 51, 51, 50, 50, 50, 50, 50, 50, 49, 49, 49, 49, 49,
|
||||
49, 48, 48, 48, 48, 48, 48, 47, 47, 47, 47, 47, 47, 47, 46, 46, 46,
|
||||
46, 46, 46, 45, 45, 45, 45, 45, 45, 45, 44, 44, 44, 44, 44, 44, 43,
|
||||
43, 43, 43, 43, 43, 43, 42, 42, 42, 42, 42, 42, 42, 41, 41, 41, 41,
|
||||
41, 41, 41, 40, 40, 40, 40, 40, 40, 40, 40, 39, 39, 39, 39, 39, 39,
|
||||
39, 38, 38, 38, 38, 38, 38, 38, 38, 37, 37, 37, 37, 37, 37, 37, 37,
|
||||
36, 36, 36, 36, 36, 36, 36, 36, 35, 35, 35, 35, 35, 35, 35, 35, 35,
|
||||
34, 34, 34, 34, 34, 34, 34, 34, 33, 33, 33, 33, 33, 33, 33, 33, 33,
|
||||
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 31, 31, 31, 31, 31, 31, 31,
|
||||
31, 31, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 29, 29, 29, 29, 29,
|
||||
29, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 27,
|
||||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26,
|
||||
26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 24,
|
||||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23,
|
||||
23, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
|
||||
22, 22, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
|
||||
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 19, 19,
|
||||
19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18,
|
||||
18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17,
|
||||
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16,
|
||||
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15,
|
||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||
15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
|
||||
14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
|
||||
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
|
||||
12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
|
||||
11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
|
||||
10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
|
||||
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
|
||||
8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,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 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1
|
||||
};
|
||||
|
||||
|
||||
#define WAVETABLE_SIZE(pitch) pgm_read_byte_near(&wavetableSizes[pitch])
|
||||
#define CONTROL_RATE 256
|
||||
|
||||
#include <MozziGuts.h>
|
||||
#include <mozzi_rand.h>
|
||||
|
||||
// The WAVE LENGTH is the SAMPLING FREQUENCY (16384) divided by the NOTE FREQUENCY.
|
||||
// If our lowest frequency is 32, then we have to have tables of size 512.
|
||||
// But we have about 2K of space maximum. Let's say that our minimum frequency is 64 (about a very low C)
|
||||
// Then we have tables of size 256 each, and 6 of them would be 1.5K, which is probably enough?
|
||||
#define MAX_WAVELENGTH 251
|
||||
#define NUM_WAVES 4
|
||||
int8_t wave[NUM_WAVES][MAX_WAVELENGTH]; // probably doesn't need to be signed?
|
||||
uint8_t currentWave = 0;
|
||||
uint8_t wavePos[NUM_WAVES];
|
||||
uint8_t waveLength[NUM_WAVES];
|
||||
|
||||
|
||||
|
||||
#define CV_POT_IN1 A7 // Note In, Pitch Scaling
|
||||
#define CV_POT_IN2 A6 // Atonality
|
||||
#define CV_POT3 A4 // Volume
|
||||
#define CV_IN3 A2
|
||||
#define CV_AUDIO_IN A0 // Pitch Tune
|
||||
#define CV_AUDIO_OUT 9 // Out
|
||||
#define CV_GATE_OUT 10 // Trigger
|
||||
#define RANDOM_PIN A5
|
||||
|
||||
void setup()
|
||||
{
|
||||
// some reasonable initial defaults
|
||||
pinMode(CV_GATE_OUT, INPUT_PULLUP);
|
||||
initializeFrequency(CV_POT_IN1, CV_AUDIO_IN);
|
||||
randomSeed(RANDOM_PIN);
|
||||
startMozzi();
|
||||
|
||||
readPots(); // read them at least once
|
||||
}
|
||||
|
||||
#define MEDIAN_OF_THREE(a,b,c) (((a) <= (b)) ? (((b) <= (c)) ? (b) : (((a) < (c)) ? (c) : (a))) : (((a) <= (c)) ? (a) : (((b) < (c)) ? (c) : (b))))
|
||||
uint16_t pitchCV;
|
||||
uint16_t tuneCV;
|
||||
uint16_t pA;
|
||||
uint16_t pB;
|
||||
//uint16_t pC;
|
||||
//uint16_t pD;
|
||||
|
||||
void initializeFrequency(uint8_t pitch, uint8_t tune)
|
||||
{
|
||||
pitchCV = mozziAnalogRead(pitch);
|
||||
tuneCV = mozziAnalogRead(tune);
|
||||
}
|
||||
|
||||
// NOTE: Presently not using this, using MEDIAN_OF_THREE instead
|
||||
// From https://stackoverflow.com/questions/480960/how-do-i-calculate-the-median-of-five-in-c
|
||||
static uint16_t medianOfFive(uint16_t a, uint16_t b, uint16_t c, uint16_t d, uint16_t e)
|
||||
{
|
||||
return b < a ? d < c ? b < d ? a < e ? a < d ? e < d ? e : d
|
||||
: c < a ? c : a
|
||||
: e < d ? a < d ? a : d
|
||||
: c < e ? c : e
|
||||
: c < e ? b < c ? a < c ? a : c
|
||||
: e < b ? e : b
|
||||
: b < e ? a < e ? a : e
|
||||
: c < b ? c : b
|
||||
: b < c ? a < e ? a < c ? e < c ? e : c
|
||||
: d < a ? d : a
|
||||
: e < c ? a < c ? a : c
|
||||
: d < e ? d : e
|
||||
: d < e ? b < d ? a < d ? a : d
|
||||
: e < b ? e : b
|
||||
: b < e ? a < e ? a : e
|
||||
: d < b ? d : b
|
||||
: d < c ? a < d ? b < e ? b < d ? e < d ? e : d
|
||||
: c < b ? c : b
|
||||
: e < d ? b < d ? b : d
|
||||
: c < e ? c : e
|
||||
: c < e ? a < c ? b < c ? b : c
|
||||
: e < a ? e : a
|
||||
: a < e ? b < e ? b : e
|
||||
: c < a ? c : a
|
||||
: a < c ? b < e ? b < c ? e < c ? e : c
|
||||
: d < b ? d : b
|
||||
: e < c ? b < c ? b : c
|
||||
: d < e ? d : e
|
||||
: d < e ? a < d ? b < d ? b : d
|
||||
: e < a ? e : a
|
||||
: a < e ? b < e ? b : e
|
||||
: d < a ? d : a;
|
||||
}
|
||||
|
||||
#define TRANSPOSE_BITS 0
|
||||
#define TRANSPOSE_SEMITONES 0
|
||||
#define TRANSPOSE_OCTAVES 0
|
||||
#define LARGE_JUMP 32
|
||||
#define SEMITONE 17
|
||||
#define FREQ_COUNTER_MAX 4
|
||||
uint8_t freqCounter = 0;
|
||||
inline uint16_t getPitchPos(uint8_t pitch, uint8_t tune)
|
||||
{
|
||||
tuneCV = (tuneCV * 15 + mozziAnalogRead(tune)) >> 4;
|
||||
uint16_t p = mozziAnalogRead(pitch);
|
||||
uint16_t p1 = MEDIAN_OF_THREE(p, pA, pB); //medianOfFive(p, pA, pB, pC, pD);
|
||||
//pD = pC;
|
||||
// pC = pB;
|
||||
pB = pA;
|
||||
pA = p;
|
||||
pitchCV = p1;
|
||||
//pitchCV = (pitchCV + p1) >> 1;
|
||||
|
||||
int16_t finalPitch = pitchCV + (tuneCV >> 1) + TRANSPOSE_SEMITONES * 17 + TRANSPOSE_OCTAVES * 205 + TRANSPOSE_BITS;
|
||||
//return FREQUENCY(finalPitch < 0 ? 0 : (finalPitch > 1535 ? 1535 : finalPitch));
|
||||
return finalPitch;
|
||||
}
|
||||
|
||||
|
||||
#define GET_NOISE(pos) pgm_read_byte_near(&NOISE[pos])
|
||||
|
||||
void load(uint16_t pitchPos)
|
||||
{
|
||||
#ifdef ROUND_TO_SEMITONE
|
||||
uint16_t idx = SEMITONES(pitchPos > 1535 ? 1535 : pitchPos);
|
||||
waveLength[currentWave] = WAVETABLE_SIZE(idx); // Max WAVETABLE SIZE is 251
|
||||
#else
|
||||
waveLength[currentWave] = WAVETABLE_SIZE(pitchPos > 1535 ? 1535 : pitchPos); // Max WAVETABLE SIZE is 251
|
||||
#endif
|
||||
uint8_t start = rand(7936); // 8192 - 256, so we have enough space without wrapping
|
||||
for(uint8_t i = 0; i < waveLength[currentWave]; i++)
|
||||
{
|
||||
// We are using the noise array rather than just the random number generator on
|
||||
// the assumption that it's faster. Fingers crossed.
|
||||
wave[currentWave][i] = (int8_t)GET_NOISE(start + i);
|
||||
}
|
||||
currentWave++;
|
||||
if (currentWave >= NUM_WAVES) currentWave = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Rises as a Cube, with some tweaks at the end for the electric sounds
|
||||
const PROGMEM uint8_t ATONALITY[256] =
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
|
||||
5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11,
|
||||
11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18,
|
||||
19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29,
|
||||
30, 30, 31, 32, 33, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43,
|
||||
44, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60,
|
||||
61, 62, 64, 65, 66, 67, 69, 70, 71, 72, 74, 75, 76, 78, 79, 81, 82,
|
||||
83, 85, 86, 88, 89, 91, 92, 94, 95, 97, 98, 100, 102, 103, 105, 107,
|
||||
108, 110, 112, 114, 115, 117, 119, 121, 123, 124, 126, 128, 130, 132,
|
||||
134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 157, 159, 161,
|
||||
163, 165, 168, 170, 172, 175, 177, 179, 182, 184, 187, 189, 192, 194,
|
||||
197, 199, 202, 204, 207, 209, 212, 215, 217, 220, 223, 226, 228, 231,
|
||||
234, 237, 240, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 255, 255};
|
||||
|
||||
|
||||
/*
|
||||
// Rises as a Square
|
||||
const PROGMEM uint8_t ATONALITY[] =
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
|
||||
2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7,
|
||||
8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15,
|
||||
16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 25,
|
||||
25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 36, 36,
|
||||
37, 38, 39, 40, 40, 41, 42, 43, 44, 44, 45, 46, 47, 48, 49, 50, 50,
|
||||
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
|
||||
68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 79, 80, 81, 82, 83, 84, 85,
|
||||
87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 99, 100, 101, 102, 104, 105,
|
||||
106, 108, 109, 110, 112, 113, 114, 116, 117, 118, 120, 121, 122, 124,
|
||||
125, 127, 128, 129, 131, 132, 134, 135, 137, 138, 140, 141, 143, 144,
|
||||
146, 147, 149, 150, 152, 153, 155, 156, 158, 160, 161, 163, 164, 166,
|
||||
168, 169, 171, 172, 174, 176, 177, 179, 181, 182, 184, 186, 188, 189,
|
||||
191, 193, 195, 196, 198, 200, 202, 203, 205, 207, 209, 211, 212, 214,
|
||||
216, 218, 220, 222, 224, 225, 227, 229, 231, 233, 235, 237, 239, 241,
|
||||
243, 245, 247, 249, 251, 253, 255};
|
||||
*/
|
||||
|
||||
/*
|
||||
// Rises as a Cube
|
||||
const PROGMEM uint8_t ATONALITY[] =
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
|
||||
5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11,
|
||||
11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18,
|
||||
19, 19, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29,
|
||||
30, 30, 31, 32, 33, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43,
|
||||
44, 44, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60,
|
||||
61, 62, 64, 65, 66, 67, 69, 70, 71, 72, 74, 75, 76, 78, 79, 81, 82,
|
||||
83, 85, 86, 88, 89, 91, 92, 94, 95, 97, 98, 100, 102, 103, 105, 107,
|
||||
108, 110, 112, 114, 115, 117, 119, 121, 123, 124, 126, 128, 130, 132,
|
||||
134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 157, 159, 161,
|
||||
163, 165, 168, 170, 172, 175, 177, 179, 182, 184, 187, 189, 192, 194,
|
||||
197, 199, 202, 204, 207, 209, 212, 215, 217, 220, 223, 226, 228, 231,
|
||||
234, 237, 240, 243, 246, 249, 252, 255};
|
||||
*/
|
||||
|
||||
/*
|
||||
// Rises as x^4
|
||||
const PROGMEM uint8_t ATONALITY[] =
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
|
||||
4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10,
|
||||
10, 10, 11, 11, 12, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17,
|
||||
18, 18, 19, 20, 20, 21, 21, 22, 23, 23, 24, 25, 25, 26, 27, 28, 28,
|
||||
29, 30, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
|
||||
45, 46, 48, 49, 50, 51, 52, 54, 55, 56, 57, 59, 60, 61, 63, 64, 66,
|
||||
67, 69, 70, 72, 73, 75, 76, 78, 80, 81, 83, 85, 87, 89, 90, 92, 94,
|
||||
96, 98, 100, 102, 104, 106, 108, 110, 112, 115, 117, 119, 121, 124,
|
||||
126, 128, 131, 133, 136, 138, 141, 143, 146, 149, 151, 154, 157, 160,
|
||||
162, 165, 168, 171, 174, 177, 180, 183, 187, 190, 193, 196, 200, 203,
|
||||
206, 210, 213, 217, 220, 224, 228, 231, 235, 239, 243, 247, 251, 255};
|
||||
*/
|
||||
|
||||
#define ATONALITY_VAL(i) pgm_read_byte_near(&ATONALITY[i])
|
||||
|
||||
|
||||
// SCALE AND SHIFT
|
||||
// This is just a way of increasing the decay. Instead of doing (a + b) / 2
|
||||
// we do (a + b * (x - 1)) / x for values of x from 2 to 256, x is a power of 2.
|
||||
// To do this we do (a + b * scale) >> shift
|
||||
// We have 8 options for x: 2, 4, ... 256, as described below.
|
||||
// NOTE: if this is too extreme maybe we could change it to
|
||||
// (a * (max - x) + b * x) / MAX
|
||||
const uint8_t scales[8] = { 1, 3, 7, 15, 31, 63, 127, 255 }; // 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535 };
|
||||
const uint8_t shifts[8] = { 1, 2, 3, 4, 5, 6, 7, 8, }; // 9, 10, 11, 12, 13, 14, 15, 16 };
|
||||
uint16_t scale; // one of scales[]. uint16_t to make multiplication easier later.
|
||||
uint8_t shift; // one of shifts[]
|
||||
|
||||
// ATONALITY
|
||||
// This is the probability that after doing (a + b) / 2 we multiply the whole thing by -1.
|
||||
// It was suggested by Karplus and Strong as a way to increase the "atonality" of the sound,
|
||||
// which really just makes it noisier.
|
||||
uint8_t atonality = 0; // 0...255
|
||||
|
||||
// GAIN
|
||||
// This is just the volume knob at the end.
|
||||
uint8_t gain; // 0...15
|
||||
|
||||
|
||||
uint8_t triggered = false;
|
||||
uint8_t waitCount = 0;
|
||||
|
||||
inline void readPots()
|
||||
{
|
||||
#ifdef ATONALITY_ON_POT_2
|
||||
atonality = ATONALITY_VAL(mozziAnalogRead(CV_POT_IN2) >> 2);
|
||||
uint8_t s = mozziAnalogRead(CV_IN3) >> 7;
|
||||
#else
|
||||
atonality = ATONALITY_VAL(mozziAnalogRead(CV_IN3) >> 2);
|
||||
uint8_t s = mozziAnalogRead(CV_POT_IN2) >> 7;
|
||||
#endif
|
||||
scale = scales[s];
|
||||
shift = shifts[s];
|
||||
gain = mozziAnalogRead(CV_POT3) >> 6;
|
||||
}
|
||||
|
||||
|
||||
void updateControl()
|
||||
{
|
||||
uint16_t pitchPos = getPitchPos(CV_POT_IN1, CV_AUDIO_IN); // we have to call this each time
|
||||
//readPots();
|
||||
// Check for a trigger
|
||||
uint8_t tr = !digitalRead(CV_GATE_OUT);
|
||||
if (!triggered && tr)
|
||||
{
|
||||
waitCount = 4;
|
||||
triggered = 1;
|
||||
}
|
||||
else if (!tr)
|
||||
{
|
||||
triggered = 0;
|
||||
}
|
||||
if (waitCount)
|
||||
{
|
||||
if (waitCount == 1)
|
||||
{
|
||||
readPots();
|
||||
load(pitchPos);
|
||||
}
|
||||
waitCount--;
|
||||
}
|
||||
}
|
||||
|
||||
int updateAudio()
|
||||
{
|
||||
int16_t multiply = atonality > 0 ? ((rand(256) < atonality) ? -1 : 1) : 1;
|
||||
int16_t total = 0;
|
||||
for(uint8_t i = 0; i < NUM_WAVES; i++)
|
||||
{
|
||||
int8_t a = wave[i][wavePos[i]];
|
||||
wavePos[i]++;
|
||||
if (wavePos[i] >= waveLength[i]) wavePos[i] = 0;
|
||||
|
||||
int8_t b = wave[i][wavePos[i]];
|
||||
if (a != b)
|
||||
{
|
||||
int8_t c = (int8_t)((multiply * (a + b * scale)) >> shift);
|
||||
wave[i][wavePos[i]] = c;
|
||||
total += c;
|
||||
}
|
||||
else total += a;
|
||||
}
|
||||
|
||||
// We only have 4 voices, which can sum to +/- 512. We can automatically scale to -192 ... +192
|
||||
// by multiplying by 3 and dividing by 8. A single voice we'd divide by 2.
|
||||
// FIXME: for one voice, this would effectively divide by 2, we don't want that, right? Maybe >> 4 or >> 3?
|
||||
return (total * gain) >> 2; // or >> 1 ?
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
audioHook();
|
||||
}
|
||||
Reference in New Issue
Block a user