Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mod] Ignore WAV offset and note velocity #7

Open
wants to merge 1 commit into
base: tstirrat-sysex-wav-02
Choose a base branch
from
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
4 changes: 4 additions & 0 deletions Source/io/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ void updateMidiBuffer(void) {
asmEventMidiPB();
break;
case MIDI_STATUS_CC:
// ignore WAV channel CC02
if (statusByte == 0xB2 && addressByte == 0x02) {
break;
}
asmEventMidiCC();
break;
case MIDI_STATUS_NOTE_ON:
Expand Down
4 changes: 2 additions & 2 deletions Source/screen/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "../synth/wav.h"
#include "screen.h"

static const uint8_t VERSION_NUMBER[] = "v.1.4.1 sysex";
static const uint8_t VERSION_NUMBER[] = "v.1.4.h-HustlaSyx";

static const uint8_t HELP_DATA[10][18] = {
"octave ",
Expand All @@ -20,7 +20,7 @@ static const uint8_t HELP_DATA[10][18] = {
"sustain cc64",
"pan cc10",
"preset cc05",
"wav offset cc02",
"wav offset nocc",
//
" ",
};
Expand Down
22 changes: 11 additions & 11 deletions Source/synth/wav.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,21 @@ void playNoteWav(void) {
// Note on
noteStatus[WAV].note = noteIndex;

// channel volume louder = smaller value:
const uint8_t noteVelocity = valueByte & AUD3LEVEL_MASK;
if (noteVelocity == 0x60) {
rAUD3LEVEL = AUD3LEVEL_100;
} else if (noteVelocity == 0x40) {
rAUD3LEVEL = AUD3LEVEL_50;
} else {
rAUD3LEVEL = AUD3LEVEL_25;
}

// rAUD3HIGH = 0x00; // was in ASM, probably not needed?
rAUD3HIGH = AUDHIGH_RESTART; // retrigger

rAUD3LOW = wavCurrentFreq;
rAUD3HIGH = wavCurrentFreq >> 8U;

// channel volume louder = smaller value:
// const uint8_t noteVelocity = valueByte & AUD3LEVEL_MASK;
// if (noteVelocity == 0x60) {
rAUD3LEVEL = AUD3LEVEL_100; // fixed max vol
// } else if (noteVelocity == 0x40) {
// rAUD3LEVEL = AUD3LEVEL_50;
// } else {
// rAUD3LEVEL = AUD3LEVEL_25;
// }

// Reset various counters and flags
vibratoPosition[WAV] = 0;
wavStepCounter = 0;
Expand Down