Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions LibSource/Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@ class Control {
set(value);
}
void set(const float value){
if(getProgramVector()->hardware_version == OWL_MODULAR_HARDWARE && PID < 4)
#ifdef USE_LEGACY_FIRMWARE
if(getProgramVector()->isLegacyFirmware() && PID < 4)
doSetPatchParameter(PID, 4095 - (int16_t)(value*4096.0f));
else
#endif
doSetPatchParameter(PID, (int16_t)(value*4096));
}
float get(){
if(getProgramVector()->hardware_version == OWL_MODULAR_HARDWARE && PID < 4){
#ifdef USE_LEGACY_FIRMWARE
if(getProgramVector()->isLegacyFirmware() && PID < 4)
return (4095 - getProgramVector()->parameters[PID])/4096.0f;
}else{
else
#endif
return getProgramVector()->parameters[PID]/4096.0f;
}
}
Control<PID>& operator=(const float value){
set(value);
Expand Down
13 changes: 8 additions & 5 deletions LibSource/Patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,22 @@ float Patch::getParameterValue(PatchParameterId pid){
// return getInitialisingPatchProcessor()->getParameterValue(pid);
// if(pid < getProgramVector()->parameters_size)
if(pid < getProgramVector()->parameters_size){
if(getProgramVector()->hardware_version == OWL_MODULAR_HARDWARE && pid < 4){
#ifdef USE_LEGACY_FIRMWARE
if(getProgramVector()->isLegacyFirmware() && pid < 4)
return (4095 - getProgramVector()->parameters[pid])/4096.0f;
}else{
else
#endif
return getProgramVector()->parameters[pid]/4096.0f;
}
}
return 0.0f;
}

void Patch::setParameterValue(PatchParameterId pid, float value){
if(getProgramVector()->hardware_version == OWL_MODULAR_HARDWARE && pid < 4)
#ifdef USE_LEGACY_FIRMWARE
if(getProgramVector()->isLegacyFirmware() && pid < 4)
doSetPatchParameter(pid, 4095 - (int16_t)(value*4096.0f));
else
#endif
doSetPatchParameter(pid, (int16_t)(value*4096));
}

Expand Down Expand Up @@ -82,7 +85,7 @@ int Patch::getElapsedCycles(){
screen.setTextSize(1);
screen.setTextWrap(true);
screen.print(0, 26, pv->message);
}
}
}
void drawTitle(const char* title, ScreenBuffer& screen){
// draw title
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ifndef CONFIG
endif

ifndef PLATFORM
PLATFORM=OWL
PLATFORM=OwlLegacy
endif

DEPS = .FORCE
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Make sure to do a `make clean` before compiling a new patch, or add `clean` to y
* PATCHOUT: number of output channels, default 2
* SLOT: user program slot to store patch in, default 0
* TARGET: changes the output prefix, default 'patch'
* PLATFORM: Alchemist, Wizard, Prism, Magus, Player, default 'OWL'
* PLATFORM: Alchemist, Wizard, Prism, Magus, Player, OWL, default 'OwlLegacy'

If you follow the convention of SimpleDelay then you don't have to specify `PATCHCLASS` and `PATCHFILE`, they will be deduced from `PATCHNAME`.
t
Expand Down
8 changes: 5 additions & 3 deletions Source/PatchProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ AudioBuffer* PatchProcessor::createMemoryBuffer(int channels, int size){
}

void PatchProcessor::setParameterValues(int16_t *params){
if(getProgramVector()->hardware_version == OWL_MODULAR_HARDWARE){
#ifdef USE_LEGACY_FIRMWARE
if(getProgramVector()->isLegacyFirmware()){
for(int i=0; i<4 && i<parameterCount; ++i)
parameters[i]->update(4095 - params[i]);
for(int i=4; i<parameterCount; ++i)
parameters[i]->update(params[i]);
}else{
}
else
#endif
for(int i=0; i<parameterCount; ++i)
parameters[i]->update(params[i]);
}
}

template<typename T, typename V>
Expand Down
31 changes: 26 additions & 5 deletions Source/ProgramVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,22 @@
extern "C" {
#endif

#define OWL_PEDAL_HARDWARE 0x11
#define OWL_MODULAR_HARDWARE 0x12
#define OWL_RACK_HARDWARE 0x13
#define PRISM_HARDWARE 0x14
#define PLAYER_HARDWARE 0x15
#define OWL_PEDAL_HARDWARE 0x11
#define OWL_MODULAR_LEGACY_HARDWARE 0x12
#define OWL_RACK_HARDWARE 0x13
#define PRISM_HARDWARE 0x14
#define PLAYER_HARDWARE 0x15
#define TESSERACT_HARDWARE 0x16
#define ALCHEMIST_HARDWARE 0x17
#define WIZARD_HARDWARE 0x18
#define MAGUS_HARDWARE 0x19
#define EFFECTSBOX_HARDWARE 0x1a
#define WAVETABLE_HARDWARE 0x1b
#define NOCTUA_HARDWARE 0x1c
#define BIOSIGNALS_HARDWARE 0x1d
#define LICH_HARDWARE 0x1e
#define WITCH_HARDWARE 0x1f
#define OWL_MODULAR_HARDWARE 0x20 /* This is not a new device, but a way to distinguish firmware */

#define PROGRAM_VECTOR_CHECKSUM_V11 0x40
#define PROGRAM_VECTOR_CHECKSUM_V12 0x50
Expand Down Expand Up @@ -62,6 +73,16 @@
void (*setPatchParameter)(uint8_t id, int16_t value);
void (*buttonChangedCallback)(uint8_t bid, uint16_t state, uint16_t samples);
MemorySegment* heapLocations;
#ifdef USE_LEGACY_FIRMWARE
/*
* This function is currently used to determine if it's necessary to handle inverting
* ADC values. This is only required for running under legacy firmware (OwlWare) on
* Owl Modular.
*/
inline bool isLegacyFirmware() const {
return hardware_version == OWL_MODULAR_LEGACY_HARDWARE;
}
#endif
} ProgramVector;

#define CHECKSUM_ERROR_STATUS -10
Expand Down
2 changes: 2 additions & 0 deletions compile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ CPP_SRC += ScreenBuffer.cpp ScreenBufferDevice.cpp
else ifeq ($(PLATFORM),Player)
CPPFLAGS += -DOWL_PLAYER
CPP_SRC += ScreenBuffer.cpp ScreenBufferDevice.cpp
else ifeq ($(PLATFORM),OwlLegacy)
CPPFLAGS += -DOWL_CLASSIC -DUSE_LEGACY_FIRMWARE
else
CPPFLAGS += -DOWL_CLASSIC
endif
Expand Down