added configs to booket, pluck and byte
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Released under the Apache 2.0 License
|
// Released under the Apache 2.0 License
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
/// BOOKER
|
/// BOOKER
|
||||||
///
|
///
|
||||||
@ -20,7 +21,7 @@
|
|||||||
///
|
///
|
||||||
/// THE LESLIE. Booker comes with a Leslie, which is on by default:
|
/// 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
|
// #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.
|
// Leslie changes both the amplitude and pitch at a certain rate.
|
||||||
// You can adjust them here
|
// You can adjust them here
|
||||||
@ -336,15 +337,6 @@ int8_t drawBarAmplitudes[9] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#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))))
|
#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 pitchCV;
|
||||||
uint16_t tuneCV;
|
uint16_t tuneCV;
|
||||||
@ -411,7 +403,7 @@ void setup()
|
|||||||
drawbars[i][j] = drawBarAmplitudes[drawbars[i][j]];
|
drawbars[i][j] = drawBarAmplitudes[drawbars[i][j]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initializeFrequency(CV_POT_IN1, CV_AUDIO_IN);
|
initializeFrequency(CVIn, Knob1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
@ -430,7 +422,7 @@ uint16_t gain; // our current gain
|
|||||||
uint16_t counter =0;
|
uint16_t counter =0;
|
||||||
void updateControl()
|
void updateControl()
|
||||||
{
|
{
|
||||||
float frequency = getFrequency(CV_POT_IN1, CV_AUDIO_IN);
|
float frequency = getFrequency(CVIn, Knob1);
|
||||||
|
|
||||||
// leslie!
|
// leslie!
|
||||||
#ifdef LESLIE_ON
|
#ifdef LESLIE_ON
|
||||||
@ -445,7 +437,7 @@ void updateControl()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// determine the gain
|
// determine the gain
|
||||||
gain = 1 + (mozziAnalogRead(CV_POT_IN2) >> 2) // Gain (Volume)
|
gain = 1 + (mozziAnalogRead(Knob3) >> 2) // Gain (Volume)
|
||||||
#ifdef LESLIE_ON
|
#ifdef LESLIE_ON
|
||||||
#if LESLIE_VOLUME==0
|
#if LESLIE_VOLUME==0
|
||||||
#else
|
#else
|
||||||
@ -458,7 +450,7 @@ void updateControl()
|
|||||||
if (++counter == COUNTER_MAX)
|
if (++counter == COUNTER_MAX)
|
||||||
{
|
{
|
||||||
counter = 0;
|
counter = 0;
|
||||||
organ = (organ + (mozziAnalogRead(CV_POT3) * NUM_DRAWBAR_SELECTIONS)) >> 10; // Organ Selection
|
organ = (organ + (mozziAnalogRead(Knob2) * NUM_DRAWBAR_SELECTIONS)) >> 10; // Organ Selection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
22
booker/config.h
Normal file
22
booker/config.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//Settings
|
||||||
|
const int pitchSubSteps = 32; //set how many steps are there between semitones. set to 1 to quantize to semitones
|
||||||
|
const int driveAmount = 450;
|
||||||
|
#define MOZZI_CONTROL_RATE 1024
|
||||||
|
|
||||||
|
//Hardware Definitions
|
||||||
|
#define Knob1 A6 //Pitch
|
||||||
|
#define Knob2 A4 //Atonality
|
||||||
|
#define Knob3 A2
|
||||||
|
#define Knob4 A0
|
||||||
|
#define KnobA A5 //Attack
|
||||||
|
#define KnobDR A3 //Decay and Release
|
||||||
|
#define KnobS A1 //Sustain
|
||||||
|
#define CVIn A7 //CV input and Pitch knob
|
||||||
|
#define GateIn 10
|
||||||
|
#define EnvSwitch 11
|
||||||
|
#define DroneSwitch 12
|
||||||
|
#define LED 5
|
||||||
|
|
||||||
|
#define MOZZI_ANALOG_READ_RESOLUTION 10
|
||||||
|
|
||||||
|
//MIDI_CREATE_DEFAULT_INSTANCE();
|
||||||
@ -120,8 +120,6 @@
|
|||||||
t*(((t>>9)&10)|((t>>11)&24)^((t>>10)&15&(t>>15)))
|
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_IN1 A7 // Note In, Pitch Scaling // Filter Cutoff
|
||||||
#define CV_POT_IN2 A6 // Filter Cutoff
|
#define CV_POT_IN2 A6 // Filter Cutoff
|
||||||
|
|||||||
22
pluck/config.h
Normal file
22
pluck/config.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//Settings
|
||||||
|
const int pitchSubSteps = 32; //set how many steps are there between semitones. set to 1 to quantize to semitones
|
||||||
|
const int driveAmount = 450;
|
||||||
|
#define MOZZI_CONTROL_RATE 1024
|
||||||
|
|
||||||
|
//Hardware Definitions
|
||||||
|
#define Knob1 A6 //Pitch
|
||||||
|
#define Knob2 A4 //Atonality
|
||||||
|
#define Knob3 A2
|
||||||
|
#define Knob4 A0
|
||||||
|
#define KnobA A5 //Attack
|
||||||
|
#define KnobDR A3 //Decay and Release
|
||||||
|
#define KnobS A1 //Sustain
|
||||||
|
#define CVIn A7 //CV input and Pitch knob
|
||||||
|
#define GateIn 10
|
||||||
|
#define EnvSwitch 11
|
||||||
|
#define DroneSwitch 12
|
||||||
|
#define LED 5
|
||||||
|
|
||||||
|
#define MOZZI_ANALOG_READ_RESOLUTION 10
|
||||||
|
|
||||||
|
//MIDI_CREATE_DEFAULT_INSTANCE();
|
||||||
@ -1,3 +1,9 @@
|
|||||||
|
// PLUCK by Sean Luke adapted for Sitka Instruments WS-1.0 by Oleksiy Hrachov
|
||||||
|
// TODO:
|
||||||
|
// - rework randomSeed because there's no proper RANDOM_PIN available
|
||||||
|
// - add MIDI capabilities
|
||||||
|
|
||||||
|
|
||||||
// Copyright 2023 Sean Luke
|
// Copyright 2023 Sean Luke
|
||||||
// (sean@cs.gmu.edu)
|
// (sean@cs.gmu.edu)
|
||||||
//
|
//
|
||||||
@ -87,8 +93,7 @@
|
|||||||
///
|
///
|
||||||
/// POT 3 Gain
|
/// POT 3 Gain
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
// this is literally just a deterministic random number table, stolen from arp.ino
|
// this is literally just a deterministic random number table, stolen from arp.ino
|
||||||
PROGMEM const uint8_t NOISE[8192] =
|
PROGMEM const uint8_t NOISE[8192] =
|
||||||
@ -661,22 +666,13 @@ uint8_t currentWave = 0;
|
|||||||
uint8_t wavePos[NUM_WAVES];
|
uint8_t wavePos[NUM_WAVES];
|
||||||
uint8_t waveLength[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
|
#define RANDOM_PIN A5
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
// some reasonable initial defaults
|
// some reasonable initial defaults
|
||||||
pinMode(CV_GATE_OUT, INPUT_PULLUP);
|
pinMode(GateIn, INPUT_PULLUP);
|
||||||
initializeFrequency(CV_POT_IN1, CV_AUDIO_IN);
|
initializeFrequency(CVIn, Knob1);
|
||||||
randomSeed(RANDOM_PIN);
|
randomSeed(RANDOM_PIN);
|
||||||
startMozzi();
|
startMozzi();
|
||||||
|
|
||||||
@ -894,24 +890,24 @@ uint8_t waitCount = 0;
|
|||||||
inline void readPots()
|
inline void readPots()
|
||||||
{
|
{
|
||||||
#ifdef ATONALITY_ON_POT_2
|
#ifdef ATONALITY_ON_POT_2
|
||||||
atonality = ATONALITY_VAL(mozziAnalogRead(CV_POT_IN2) >> 2);
|
atonality = ATONALITY_VAL(mozziAnalogRead(Knob2) >> 2);
|
||||||
uint8_t s = mozziAnalogRead(CV_IN3) >> 7;
|
uint8_t s = mozziAnalogRead(Knob3) >> 7;
|
||||||
#else
|
#else
|
||||||
atonality = ATONALITY_VAL(mozziAnalogRead(CV_IN3) >> 2);
|
atonality = ATONALITY_VAL(mozziAnalogRead(Knob3) >> 2);
|
||||||
uint8_t s = mozziAnalogRead(CV_POT_IN2) >> 7;
|
uint8_t s = mozziAnalogRead(Knob2) >> 7;
|
||||||
#endif
|
#endif
|
||||||
scale = scales[s];
|
scale = scales[s];
|
||||||
shift = shifts[s];
|
shift = shifts[s];
|
||||||
gain = mozziAnalogRead(CV_POT3) >> 6;
|
gain = mozziAnalogRead(Knob4) >> 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void updateControl()
|
void updateControl()
|
||||||
{
|
{
|
||||||
uint16_t pitchPos = getPitchPos(CV_POT_IN1, CV_AUDIO_IN); // we have to call this each time
|
uint16_t pitchPos = getPitchPos(CVIn, Knob1); // we have to call this each time
|
||||||
//readPots();
|
//readPots();
|
||||||
// Check for a trigger
|
// Check for a trigger
|
||||||
uint8_t tr = !digitalRead(CV_GATE_OUT);
|
uint8_t tr = !digitalRead(GateIn);
|
||||||
if (!triggered && tr)
|
if (!triggered && tr)
|
||||||
{
|
{
|
||||||
waitCount = 4;
|
waitCount = 4;
|
||||||
|
|||||||
Reference in New Issue
Block a user