Skip to content

Commit

Permalink
Merge pull request #29 from twistedelectrons/newModes
Browse files Browse the repository at this point in the history
New modes
  • Loading branch information
twisted-electrons authored May 24, 2023
2 parents 604d819 + 0537d27 commit 71dc50a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
1 change: 1 addition & 0 deletions include/megafm.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define YM_WR 11
#define YM_IC 30
extern byte presetChordNumber;
extern bool newWide; // enable new wide modes
extern bool chord;
extern bool noRecAction;
extern bool recHeld;
Expand Down
1 change: 1 addition & 0 deletions src/ISR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void isr() {
preset = 99;
}
}
timeToShowPresetNumber = true;
}
}

Expand Down
18 changes: 11 additions & 7 deletions src/MEGAfm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ cd /Users/a/Documents/bootloaderT cd /Users/a/Documents/bootloaderT&&cp -f /priv
#include "preset.h"

// check that we didn't do a rec+voicing before latching arp rec mode
bool newWide; // enable new wide modes
bool noRecAction;
bool recHeld;
bool chordNotes[128];
Expand Down Expand Up @@ -317,19 +318,20 @@ void setup() {
// 3953 bit6 = new fat tuning

// 3954 = pickup mode (0=on)
// 3958 =bendDown
// 3959 =bendUp
// 3960 =mpe mode
// 3961 =vel >lfo1 depth
// 3962 =mod >lfo2 depth
// 3963 =at >lfo3 depth
// 3958 = bendDown
// 3959 = bendUp
// 3960 = mpe mode
// 3961 = vel >lfo1 depth
// 3962 = mod >lfo2 depth
// 3963 = at >lfo3 depth
// 3964 lastbank
// 3965 brightness.
// 3966 = bit 0 stereoCh3
// 3967 = note priority 0=low 1=high 2=last
// 3968 = bit 0 fatSpreadMode

// 3969= magic value 82 says we are already on FW 3.0
// 3969 = magic value 82 says we are already on FW 3.0
// 3970 = enable new wide modes
// otherwise set all SSEG to off
byte input = EEPROM.read(3968);
fatSpreadMode = bitRead(input, 0);
Expand All @@ -341,6 +343,8 @@ void setup() {
input = EEPROM.read(3966);
stereoCh3 = bitRead(input, 0);

newWide = EEPROM.read(3970);

input = EEPROM.read(3950);
noiseTableLength[0] = 0;
bitWrite(noiseTableLength[0], 0, bitRead(input, 2));
Expand Down
6 changes: 6 additions & 0 deletions src/buttons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,13 +656,18 @@ void buttChanged(Button number, bool value) {
if (!mpe) {
// Poly12 Wide6 dualCh3 unison
// Wide4 Wide3

VoiceMode nextVoiceMode[6] = {kVoicingWide6, kVoicingWide4, kVoicingUnison,
kVoicingPoly12, kVoicingWide3, kVoicingDualCh3};

if (voiceMode < kVoiceModeCount) {
voiceMode = nextVoiceMode[voiceMode];
} else {
voiceMode = kVoicingPoly12;
}
if (!newWide && (voiceMode == kVoicingWide4 || voiceMode == kVoicingWide3)) {
voiceMode = kVoicingDualCh3;
}
showVoiceMode(voiceMode);
sendCC(51, voiceMode);

Expand Down Expand Up @@ -879,6 +884,7 @@ void buttChanged(Button number, bool value) {
showVoiceMode(voiceMode);
}
seqRec = true;
displayFreeze = 0;
arpMode = 6;
ledSet(23, 1);
digit(0, 5);
Expand Down
12 changes: 8 additions & 4 deletions src/midi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,10 @@ void HandleControlChange(byte channel, byte number, byte val) {
bitWrite(temp, 4, arpClockEnable);
EEPROM.update(3953, temp);
break;
case 18:
mydisplay.setIntensity(0, constrain(val, 1, 15));
EEPROM.update(3965, constrain(val, 0, 15));
break;

case 19:
if (val) {
Expand Down Expand Up @@ -790,9 +794,9 @@ void HandleControlChange(byte channel, byte number, byte val) {
EEPROM.update(3958, bendDown);
break;

case 18:
mydisplay.setIntensity(0, constrain(val, 1, 15));
EEPROM.update(3965, constrain(val, 0, 15));
case 20:
newWide = constrain(val, 0, 1);
EEPROM.update(3970, constrain(val, 0, 1));
break;
}
}
Expand Down Expand Up @@ -825,7 +829,7 @@ void HandleControlChange(byte channel, byte number, byte val) {
sendTool(17, bendDown);
sendTool(18, EEPROM.read(3965));
sendTool(19, fatMode);

sendTool(20, newWide);
toolMode = true; // MEGAfm is listening to new settings (CC on CH16)
}
// did we receive 1982 twice on channel 16?
Expand Down

0 comments on commit 71dc50a

Please sign in to comment.