added configs to booket, pluck and byte
This commit is contained in:
@ -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
|
||||
// (sean@cs.gmu.edu)
|
||||
//
|
||||
@ -87,8 +93,7 @@
|
||||
///
|
||||
/// POT 3 Gain
|
||||
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
// this is literally just a deterministic random number table, stolen from arp.ino
|
||||
PROGMEM const uint8_t NOISE[8192] =
|
||||
@ -661,22 +666,13 @@ 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);
|
||||
pinMode(GateIn, INPUT_PULLUP);
|
||||
initializeFrequency(CVIn, Knob1);
|
||||
randomSeed(RANDOM_PIN);
|
||||
startMozzi();
|
||||
|
||||
@ -894,24 +890,24 @@ 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;
|
||||
atonality = ATONALITY_VAL(mozziAnalogRead(Knob2) >> 2);
|
||||
uint8_t s = mozziAnalogRead(Knob3) >> 7;
|
||||
#else
|
||||
atonality = ATONALITY_VAL(mozziAnalogRead(CV_IN3) >> 2);
|
||||
uint8_t s = mozziAnalogRead(CV_POT_IN2) >> 7;
|
||||
atonality = ATONALITY_VAL(mozziAnalogRead(Knob3) >> 2);
|
||||
uint8_t s = mozziAnalogRead(Knob2) >> 7;
|
||||
#endif
|
||||
scale = scales[s];
|
||||
shift = shifts[s];
|
||||
gain = mozziAnalogRead(CV_POT3) >> 6;
|
||||
gain = mozziAnalogRead(Knob4) >> 6;
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
// Check for a trigger
|
||||
uint8_t tr = !digitalRead(CV_GATE_OUT);
|
||||
uint8_t tr = !digitalRead(GateIn);
|
||||
if (!triggered && tr)
|
||||
{
|
||||
waitCount = 4;
|
||||
|
||||
Reference in New Issue
Block a user