-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set pitch for first Ch 3 special mode operator using MIDI channel 11.
- Loading branch information
1 parent
ec02e46
commit 34dec7f
Showing
13 changed files
with
143 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "midi_fm_sm.h" | ||
#include "midi_fm.h" | ||
|
||
static const u8 SEMITONES = 12; | ||
static const u16 FREQS[] = { | ||
607, // B | ||
644, 681, 722, 765, 810, 858, 910, 964, 1021, 1081, | ||
1146 // A# | ||
}; | ||
|
||
static u8 octave(u8 pitch) | ||
{ | ||
return (pitch - MIN_MIDI_PITCH) / SEMITONES; | ||
} | ||
|
||
static u16 freqNumber(u8 pitch) | ||
{ | ||
return FREQS[((u8)(pitch - MIN_MIDI_PITCH)) % SEMITONES]; | ||
} | ||
|
||
void midi_fm_sm_note_on(u8 chan, u8 pitch, u8 velocity) | ||
{ | ||
synth_specialModePitch(0, octave(pitch), freqNumber(pitch)); | ||
} | ||
|
||
void midi_fm_sm_pitch_bend(u8 chan, u16 bend) | ||
{ | ||
} | ||
|
||
// no-ops | ||
void midi_fm_sm_note_off(u8 chan, u8 pitch) | ||
{ | ||
} | ||
|
||
void midi_fm_sm_channel_volume(u8 chan, u8 volume) | ||
{ | ||
} | ||
|
||
void midi_fm_sm_pan(u8 chan, u8 pan) | ||
{ | ||
} | ||
|
||
void midi_fm_sm_program(u8 chan, u8 program) | ||
{ | ||
} | ||
|
||
void midi_fm_sm_all_notes_off(u8 chan) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#pragma once | ||
#include "synth.h" | ||
#include <stdbool.h> | ||
#include <types.h> | ||
|
||
void midi_fm_sm_note_on(u8 chan, u8 pitch, u8 velocity); | ||
void midi_fm_sm_pitch_bend(u8 chan, u16 bend); | ||
|
||
// no-ops | ||
void midi_fm_sm_note_off(u8 chan, u8 pitch); | ||
void midi_fm_sm_channel_volume(u8 chan, u8 volume); | ||
void midi_fm_sm_pan(u8 chan, u8 pan); | ||
void midi_fm_sm_program(u8 chan, u8 program); | ||
void midi_fm_sm_all_notes_off(u8 chan); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters