#include <rsound.h>
Public Member Functions | |
| void | reset (byte *startPtr) |
| void | enable (int flag) |
| void | load (byte *pData) |
Public Attributes | |
| RSound * | _owner = nullptr |
| int | _midiChannel = 0 |
| int | _activeCount = 0 |
| int | _pitchBendFadeStep = 0 |
| int | _volumeFadeStep = 0 |
| int | _panFadeStep = 0 |
| int | _note = 0 |
| int | _program = 0 |
| int | _velocity = 0 |
| int | _noteOffset = 0 |
| int | _keyOnDelayOverride = 0 |
| int | _keyOnDelay = 0 |
| int | _volumeFadeCounter = 0 |
| int | _volumeFadeReload = 0 |
| int | _pitchBendFadeCounter = 0 |
| int | _panFadeCounter = 0 |
| int | _panFadeReload = 0 |
| int | _pan = 0 |
| int | _volume = 0 |
| int | _pitchBend = 0 |
| int | _pitchBendFadeReload = 0 |
| int | _pitchBendFadeCount = 0 |
| byte * | _loopStartPtr = nullptr |
| byte * | _pSrc = nullptr |
| byte * | _innerLoopPtr = nullptr |
| byte * | _outerLoopPtr = nullptr |
| int | _innerLoopCount = 0 |
| int | _outerLoopCount = 0 |
| byte * | _soundData = nullptr |
| byte * | _branchTarget = nullptr |
| int | _transpose = 0 |
| int | _pendingStop = 0 |
Represents the data for a channel on the Return of the Phantom MT-32 / MPU-401 driver. Ported from the Channel struct identified in rsound.ph1's disassembly (sizeof 0x27, five bytes larger than the equivalent Rex Nebular RSound Channel struct).
The word-sized fields at 0x14-0x20 (_loopStartPtr through _soundData) are at the IDENTICAL offsets/order/roles as Rex Nebular's Channel struct - that part of the layout is unchanged between games. The byte fields at 0x00-0x13 are the same overall SET as Rex Nebular (confirmed by matching each field against the exact MIDI status byte/controller number sent by its dedicated helper, e.g. sendProgramChange sends status 0xC0 using _program), just reordered, with _pendingStop moved down to the very last byte (0x26) to make room for a new field (_keyOnDelayOverride, 0x08) with no Rex Nebular equivalent. Two more new fields exist past the Rex Nebular struct's end: _branchTarget (0x22) and _transpose (0x25).
| void MADS::Phantom::Channel::reset | ( | byte * | startPtr | ) |
Zeroes the entire 40-byte channel struct, then re-initialises the loop/source/sound-data pointers to startPtr and centers pan and pitch bend (0x40). More aggressive than Rex Nebular's equivalent, which leaves volume/program/velocity/key-on state untouched.
| void MADS::Phantom::Channel::enable | ( | int | flag | ) |
Marks the channel as pending-stop (fading toward silence) and invalidates _soundData so isSoundActive() no longer matches it.
| void MADS::Phantom::Channel::load | ( | byte * | pData | ) |
Loads a brand new sound into the channel: resets it, marks it active, and resets pitch bend to center on the real device.