@@ -20,10 +20,10 @@ typedef struct MidiFmChannel {
20
20
21
21
static MidiFmChannel fmChannels [MAX_FM_CHANS ];
22
22
23
- static u8 pitchIsOutOfRange (u8 pitch );
24
- static u8 effectiveVolume (MidiFmChannel * channelState );
25
- static void updatePan (u8 chan );
26
- static u16 lookupFreqNum (u8 pitch , u8 offset );
23
+ static u8 pitch_is_out_of_range (u8 pitch );
24
+ static u8 effective_volume (MidiFmChannel * channelState );
25
+ static void update_pan (u8 chan );
26
+ static u16 lookup_freq_num (u8 pitch , u8 offset );
27
27
void midi_fm_reset (void );
28
28
29
29
static const FmChannel * * presets ;
@@ -52,12 +52,12 @@ void midi_fm_reset(void)
52
52
53
53
u16 midi_fm_pitchCentsToFreqNum (u8 pitch , s8 cents )
54
54
{
55
- u16 freq = lookupFreqNum (pitch , 0 );
56
- u16 nextFreq = lookupFreqNum (pitch , 1 );
55
+ u16 freq = lookup_freq_num (pitch , 0 );
56
+ u16 nextFreq = lookup_freq_num (pitch , 1 );
57
57
return freq + (((nextFreq - freq ) * cents ) / 100 );
58
58
}
59
59
60
- static void setSynthPitch (u8 chan )
60
+ static void set_synth_pitch (u8 chan )
61
61
{
62
62
MidiFmChannel * fmChan = & fmChannels [chan ];
63
63
synth_pitch (chan , midi_fm_pitchToOctave (fmChan -> pitch ),
@@ -66,7 +66,7 @@ static void setSynthPitch(u8 chan)
66
66
67
67
void midi_fm_note_on (u8 chan , u8 pitch , s8 cents , u8 velocity )
68
68
{
69
- if (pitchIsOutOfRange (pitch )) {
69
+ if (pitch_is_out_of_range (pitch )) {
70
70
return ;
71
71
}
72
72
MidiFmChannel * fmChan = & fmChannels [chan ];
@@ -76,11 +76,11 @@ void midi_fm_note_on(u8 chan, u8 pitch, s8 cents, u8 velocity)
76
76
pitch = percussionPreset -> key ;
77
77
}
78
78
fmChan -> velocity = velocity ;
79
- synth_volume (chan , effectiveVolume (fmChan ));
79
+ synth_volume (chan , effective_volume (fmChan ));
80
80
fmChan -> pitch = pitch ;
81
81
fmChan -> cents = cents ;
82
82
83
- setSynthPitch (chan );
83
+ set_synth_pitch (chan );
84
84
synth_noteOn (chan );
85
85
}
86
86
@@ -94,7 +94,7 @@ void midi_fm_channel_volume(u8 chan, u8 volume)
94
94
{
95
95
MidiFmChannel * fmChan = & fmChannels [chan ];
96
96
fmChan -> volume = volume ;
97
- synth_volume (chan , effectiveVolume (fmChan ));
97
+ synth_volume (chan , effective_volume (fmChan ));
98
98
}
99
99
100
100
void midi_fm_program (u8 chan , u8 program )
@@ -118,10 +118,10 @@ void midi_fm_pan(u8 chan, u8 pan)
118
118
{
119
119
MidiFmChannel * fmChan = & fmChannels [chan ];
120
120
fmChan -> pan = pan ;
121
- updatePan (chan );
121
+ update_pan (chan );
122
122
}
123
123
124
- static void updatePan (u8 chan )
124
+ static void update_pan (u8 chan )
125
125
{
126
126
MidiFmChannel * fmChan = & fmChannels [chan ];
127
127
if (fmChan -> pan > 95 ) {
@@ -138,17 +138,17 @@ u8 midi_fm_pitchToOctave(u8 pitch)
138
138
return (pitch - MIN_MIDI_PITCH ) / SEMITONES ;
139
139
}
140
140
141
- static u16 lookupFreqNum (u8 pitch , u8 offset )
141
+ static u16 lookup_freq_num (u8 pitch , u8 offset )
142
142
{
143
143
return FREQS [((u8 )(pitch - MIN_MIDI_PITCH ) % SEMITONES ) + offset ];
144
144
}
145
145
146
- static u8 pitchIsOutOfRange (u8 pitch )
146
+ static u8 pitch_is_out_of_range (u8 pitch )
147
147
{
148
148
return pitch < MIN_MIDI_PITCH || pitch > MAX_MIDI_PITCH ;
149
149
}
150
150
151
- static u8 effectiveVolume (MidiFmChannel * fmChan )
151
+ static u8 effective_volume (MidiFmChannel * fmChan )
152
152
{
153
153
return (fmChan -> volume * fmChan -> velocity ) / 0x7F ;
154
154
}
@@ -158,5 +158,5 @@ void midi_fm_pitch(u8 chan, u8 pitch, s8 cents)
158
158
MidiFmChannel * fmChan = & fmChannels [chan ];
159
159
fmChan -> pitch = pitch ;
160
160
fmChan -> cents = cents ;
161
- setSynthPitch (chan );
161
+ set_synth_pitch (chan );
162
162
}
0 commit comments