Skip to content

Commit 2918c48

Browse files
author
Martin Klang
committed
Merge branch 'develop'
2 parents df2f43c + a080bb5 commit 2918c48

4 files changed

Lines changed: 25 additions & 16 deletions

File tree

FaustCode/owl.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ class OwlUI : public UI {
396396

397397
void addOutputOwlParameter(
398398
const char* label, FAUSTFLOAT* zone, FAUSTFLOAT lo, FAUSTFLOAT hi) {
399-
if(label[strlen(label) - 1] == '>')
400-
debugMessage("Add '>' character for output parameters");
399+
if(label[strlen(label) - 1] != '>')
400+
debugMessage("Add '>' character for output parameters");
401401
if (fParameterIndex < MAXOWLPARAMETERS) {
402402
if (meta.midiOn && strcasecmp(label, "freq") == 0) {
403403
fParameterTable[fParameterIndex++] =
@@ -414,14 +414,14 @@ class OwlUI : public UI {
414414
else if (fParameter != NO_PARAMETER) {
415415
fParameterTable[fParameterIndex++] = new OwlParameter(
416416
fPatch, fParameter, zone, label, lo, lo, hi, true);
417-
}
418-
else if(fButton != NO_BUTTON){
419-
fParameterTable[fParameterIndex++] = new OwlButton(
420-
fPatch, fButton, zone, label, true);
421-
}
422-
}
423-
fParameter = NO_PARAMETER;
424-
fButton = NO_BUTTON;
417+
}
418+
else if(fButton != NO_BUTTON){
419+
fParameterTable[fParameterIndex++] = new OwlButton(
420+
fPatch, fButton, zone, label, true);
421+
}
422+
}
423+
fParameter = NO_PARAMETER;
424+
fButton = NO_BUTTON;
425425
}
426426

427427
void addOwlButton(const char* label, FAUSTFLOAT* zone) {
@@ -435,7 +435,7 @@ class OwlUI : public UI {
435435
new OwlButton(fPatch, fButton, zone, label);
436436
}
437437
}
438-
fParameter = NO_PARAMETER;
438+
fParameter = NO_PARAMETER;
439439
fButton = NO_BUTTON; // clear current button ID
440440
}
441441

@@ -572,8 +572,8 @@ class OwlUI : public UI {
572572
}
573573
else if (param_tmp == PARAMETER_B && *id >= '0' && *id <= '9') {
574574
fButton = PatchButtonId(BUTTON_A + *id - '1');
575-
}
576-
else {
575+
}
576+
else {
577577
// Inc to skip 1-character params
578578
param_tmp++;
579579
// This is first character for groups of 8 params

LibSource/VoltsPerOctave.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class VoltsPerOctave {
2121
void setTune(float octaves){
2222
tune = octaves;
2323
}
24+
void setMidiNote(float note){
25+
tune = (note-69)/12.0f; // 440Hz == A4 == MIDI Note 69
26+
}
2427
float getFrequency(float sample){
2528
return voltsToHertz(sampleToVolts(sample) + tune);
2629
}
@@ -33,6 +36,12 @@ class VoltsPerOctave {
3336
static float voltsToHertz(float volts){
3437
return 440.f * exp2f(volts);
3538
}
39+
static float hertzToNote(float freq){
40+
return 12 * log2f(freq/440.f) + 69;
41+
}
42+
static float noteToHertz(float note){
43+
return 440.0f * exp2f((note - 69) / 12);
44+
}
3645
float voltsToSample(float volts){
3746
return volts / multiplier + offset;
3847
}

Source/flash.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ MEMORY
1616
PATCHFLASH (rx) : ORIGIN = 0x08040000, LENGTH = 128K /* Sector 6 */ /* total Flash memory is 1Mb */
1717
CCMHEAP (rw) : ORIGIN = 0x10004000, LENGTH = 32K
1818
CCMRAM (rw) : ORIGIN = 0x1000c000, LENGTH = 16K /* total CCM is 64kb */
19-
LOADERRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
20-
PATCHRAM (rwx) : ORIGIN = 0x2000c000, LENGTH = 64K /* total RAM is 112kb */
19+
FIRMWARERAM (rwx): ORIGIN = 0x20000000, LENGTH = 48K
20+
PATCHRAM (rwx) : ORIGIN = 0x2000c000, LENGTH = 144K /* total RAM is 192kb */
2121
NVRAM (rw) : ORIGIN = 0x40024000, LENGTH = 4K
2222
EXTRAM (rx) : ORIGIN = 0x68000000, LENGTH = 1M
2323
}

common.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
DSPLIB=Libraries/CMSIS/DSP_Lib/Source
33

44
# Tool path
5-
TOOLROOT ?= Tools/gcc-arm-none-eabi-9-2019-q4-major/bin/
5+
TOOLROOT ?= Tools/gcc-arm-none-eabi-9-2020-q2-update/bin/
66

77
CMSIS ?= Libraries/CMSIS/Include/
88

0 commit comments

Comments
 (0)