22 #ifndef MADS_NEBULAR_RSOUND_H 23 #define MADS_NEBULAR_RSOUND_H 25 #include "mads/core/sound_manager.h" 28 namespace RexNebular {
32 #define RSOUND_CHANNEL_COUNT 9 68 int _pitchBendFadeStep = 0;
69 int _volumeFadeStep = 0;
76 int _volumeFadeCounter = 0;
77 int _pitchBendFadeCounter = 0;
78 int _panFadeCounter = 0;
82 int _volumeFadeReload = 0;
83 int _pitchBendFadeReload = 0;
84 int _panFadeReload = 0;
85 int _pitchBendFadeCount = 0;
87 byte *_loopStartPtr =
nullptr;
88 byte *_pSrc =
nullptr;
89 byte *_innerLoopPtr =
nullptr;
90 byte *_outerLoopPtr =
nullptr;
91 int _innerLoopCount = 0;
92 int _outerLoopCount = 0;
93 byte *_soundData =
nullptr;
104 void reset(byte *startPtr);
115 void load(byte *pData);
135 byte _lastMidiStatus;
136 bool _noteTriggeredThisPoll;
137 byte _heldNotes[RSOUND_CHANNEL_COUNT + 1][4];
156 static const byte _sysExHeader[5];
159 void pollAllChannels();
160 void Channel_pollActive(
Channel *channel);
166 void resetChannelRange(
int first,
int last);
171 void resetHeldNotes();
176 void resetAllChannels();
183 void checkFadingChannels();
184 void Channel_checkFade(
Channel *channel);
190 void Channel_flushHeldNotes(
Channel *channel);
195 byte *loadData(
int offset) {
196 return &_soundData[offset];
220 Channel *playSound(
int offset);
228 return playSoundData(loadData(offset), 0);
231 Channel *playSoundData(byte *pData,
int startingChannel = 5);
236 bool isSoundActive(byte *pData);
238 int getRandomNumber();
243 void sendMidiByte(byte value);
244 void sendStatus(
int midiChannel, byte statusNibble);
245 void sendNoteOn(
int midiChannel,
int note,
int velocity);
246 void sendProgramChange(
int midiChannel,
int program);
247 void sendVolume(
int midiChannel,
int volume);
248 void sendPitchBend(
int midiChannel,
int value);
249 void sendPan(
int midiChannel,
int value);
250 void muteChannel(
int midiChannel);
251 void restoreChannelVolume(
int midiChannel,
int volume);
258 void sendGmReset(
int first,
int last);
273 void sendSysEx(
int offset);
275 virtual int command0();
290 Channel _channels[RSOUND_CHANNEL_COUNT];
297 static void validate();
309 int dataOffset,
int dataSize,
int sysExOffset);
319 void setVolume(
int volume)
override;
321 int getFrameCounter() {
322 return _frameCounter;
Channel * playSoundAny(int offset)
Definition: rsound.h:227
void reset(byte *startPtr)
virtual void tickCallback()
Definition: rsound.h:207
void noise() override
Definition: rsound.h:316
Definition: sound_manager.h:38
Definition: anim_timer.h:27