Skip to content

Commit

Permalink
[Mod] Ignore WAV offset and note velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat committed Sep 25, 2024
1 parent 31bca4f commit 3d6adc3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions Source/io/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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[10] = "v.1.3.3 ";
static const uint8_t VERSION_NUMBER[] = "v.1.3.4-HustlaMod";

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
16 changes: 8 additions & 8 deletions Source/synth/wav.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ void playNoteWav(void) {
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;
}
// 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;
// }

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

Expand Down

0 comments on commit 3d6adc3

Please sign in to comment.