openMSX
|
#include <YM2413Okazaki.hh>
Public Types | |
enum class | EnvelopeState { ATTACK , DECAY , SUSHOLD , SUSTAIN , RELEASE , SETTLE , FINISH } |
Public Member Functions | |
Slot () | |
void | reset () |
void | setEnvelopeState (EnvelopeState state) |
bool | isActive () const |
void | slotOn () |
void | slotOn2 () |
void | slotOff () |
void | setPatch (const Patch &patch) |
void | setVolume (unsigned value) |
unsigned | calc_phase (unsigned lfo_pm) |
template<bool HAS_AM, bool FIXED_ENV> | |
unsigned | calc_envelope (int lfo_am, unsigned fixed_env) |
template<bool HAS_AM> | |
unsigned | calc_fixed_env () const |
void | calc_envelope_outline (unsigned &out) |
template<bool HAS_AM, bool FIXED_ENV> | |
int | calc_slot_car (unsigned lfo_pm, int lfo_am, int fm, unsigned fixed_env) |
template<bool HAS_AM, bool HAS_FB, bool FIXED_ENV> | |
int | calc_slot_mod (unsigned lfo_pm, int lfo_am, unsigned fixed_env) |
int | calc_slot_tom () |
int | calc_slot_snare (bool noise) |
int | calc_slot_cym (unsigned phase7, unsigned phase8) |
int | calc_slot_hat (unsigned phase7, unsigned phase8, bool noise) |
void | updatePG (unsigned freq) |
void | updateTLL (unsigned freq, bool actAsCarrier) |
void | updateRKS (unsigned freq) |
void | updateEG () |
void | updateAll (unsigned freq, bool actAsCarrier) |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
template<bool HAS_AM, bool FIXED_ENV> | |
ALWAYS_INLINE unsigned | calc_envelope (int lfo_am, unsigned fixed_env) |
template<bool HAS_AM, bool FIXED_ENV> | |
ALWAYS_INLINE int | calc_slot_car (unsigned lfo_pm, int lfo_am, int fm, unsigned fixed_env) |
template<bool HAS_AM, bool HAS_FB, bool FIXED_ENV> | |
ALWAYS_INLINE int | calc_slot_mod (unsigned lfo_pm, int lfo_am, unsigned fixed_env) |
Public Attributes | |
int | feedback |
int | output |
unsigned | cPhase |
std::array< unsigned, 8 > | dPhase |
unsigned | volume |
unsigned | tll |
std::span< const int, 16 > | dPhaseDRTableRks |
EnvelopeState | state |
EnvPhaseIndex | eg_phase |
EnvPhaseIndex | eg_dPhase |
EnvPhaseIndex | eg_phase_max |
uint8_t | slot_on_flag |
bool | sustain |
Patch | patch |
Slot * | sibling |
Definition at line 62 of file YM2413Okazaki.hh.
|
strong |
Enumerator | |
---|---|
ATTACK | |
DECAY | |
SUSHOLD | |
SUSTAIN | |
RELEASE | |
SETTLE | |
FINISH |
Definition at line 64 of file YM2413Okazaki.hh.
openmsx::YM2413Okazaki::Slot::Slot | ( | ) |
Definition at line 388 of file YM2413Okazaki.cc.
ALWAYS_INLINE unsigned openmsx::YM2413Okazaki::Slot::calc_envelope | ( | int | lfo_am, |
unsigned | fixed_env | ||
) |
Definition at line 934 of file YM2413Okazaki.cc.
References ATTACK, calc_envelope_outline(), eg_dPhase, eg_phase, eg_phase_max, FINISH, state, SUSHOLD, tll, and openmsx::FixedPoint< FRACTION_BITS_ >::toInt().
unsigned openmsx::YM2413Okazaki::Slot::calc_envelope | ( | int | lfo_am, |
unsigned | fixed_env | ||
) |
void openmsx::YM2413Okazaki::Slot::calc_envelope_outline | ( | unsigned & | out | ) |
Definition at line 903 of file YM2413Okazaki.cc.
References ATTACK, DECAY, openmsx::YM2413Okazaki::Patch::EG, eg_phase, eg_phase_max, FINISH, patch, RELEASE, setEnvelopeState(), SETTLE, sibling, slotOn(), state, SUSHOLD, SUSTAIN, and UNREACHABLE.
Referenced by calc_envelope().
unsigned openmsx::YM2413Okazaki::Slot::calc_fixed_env | ( | ) | const |
Definition at line 963 of file YM2413Okazaki.cc.
References eg_dPhase, eg_phase, FINISH, state, SUSHOLD, tll, and openmsx::FixedPoint< FRACTION_BITS_ >::toInt().
Referenced by openmsx::YM2413Okazaki::YM2413::calcChannel().
ALWAYS_INLINE unsigned openmsx::YM2413Okazaki::Slot::calc_phase | ( | unsigned | lfo_pm | ) |
Definition at line 896 of file YM2413Okazaki.cc.
References cPhase, and dPhase.
Referenced by calc_slot_car(), calc_slot_mod(), calc_slot_snare(), calc_slot_tom(), and openmsx::YM2413Okazaki::YM2413::generateChannels().
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_car | ( | unsigned | lfo_pm, |
int | lfo_am, | ||
int | fm, | ||
unsigned | fixed_env | ||
) |
Definition at line 977 of file YM2413Okazaki.cc.
References calc_phase(), output, patch, openmsx::YM2413Okazaki::PG_MASK, and openmsx::YM2413Okazaki::Patch::WF.
int openmsx::YM2413Okazaki::Slot::calc_slot_car | ( | unsigned | lfo_pm, |
int | lfo_am, | ||
int | fm, | ||
unsigned | fixed_env | ||
) |
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_cym | ( | unsigned | phase7, |
unsigned | phase8 | ||
) |
Definition at line 1021 of file YM2413Okazaki.cc.
References openmsx::YM2413Okazaki::PG_BITS.
Referenced by openmsx::YM2413Okazaki::YM2413::generateChannels().
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_hat | ( | unsigned | phase7, |
unsigned | phase8, | ||
bool | noise | ||
) |
Definition at line 1035 of file YM2413Okazaki.cc.
References openmsx::YM2413Okazaki::PG_BITS.
Referenced by openmsx::YM2413Okazaki::YM2413::generateChannels().
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_mod | ( | unsigned | lfo_pm, |
int | lfo_am, | ||
unsigned | fixed_env | ||
) |
Definition at line 988 of file YM2413Okazaki.cc.
References calc_phase(), openmsx::YM2413Okazaki::Patch::FB, feedback, output, patch, openmsx::YM2413Okazaki::PG_MASK, and openmsx::YM2413Okazaki::Patch::WF.
int openmsx::YM2413Okazaki::Slot::calc_slot_mod | ( | unsigned | lfo_pm, |
int | lfo_am, | ||
unsigned | fixed_env | ||
) |
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_snare | ( | bool | noise | ) |
Definition at line 1011 of file YM2413Okazaki.cc.
References calc_phase().
Referenced by openmsx::YM2413Okazaki::YM2413::generateChannels().
ALWAYS_INLINE int openmsx::YM2413Okazaki::Slot::calc_slot_tom | ( | ) |
Definition at line 1003 of file YM2413Okazaki.cc.
References calc_phase(), patch, openmsx::YM2413Okazaki::PG_MASK, and openmsx::YM2413Okazaki::Patch::WF.
Referenced by openmsx::YM2413Okazaki::YM2413::generateChannels().
bool openmsx::YM2413Okazaki::Slot::isActive | ( | ) | const |
Definition at line 523 of file YM2413Okazaki.cc.
Referenced by openmsx::YM2413Okazaki::YM2413::generateChannels().
void openmsx::YM2413Okazaki::Slot::reset | ( | ) |
Definition at line 393 of file YM2413Okazaki.cc.
References cPhase, dPhase, dPhaseDRTableRks, feedback, ranges::fill(), FINISH, output, setEnvelopeState(), slot_on_flag, sustain, tll, and volume.
Referenced by openmsx::YM2413Okazaki::Channel::reset().
void openmsx::YM2413Okazaki::Slot::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
void openmsx::YM2413Okazaki::Slot::setEnvelopeState | ( | EnvelopeState | state | ) |
Definition at line 496 of file YM2413Okazaki.cc.
References openmsx::YM2413Okazaki::Patch::AR, ATTACK, openmsx::FixedPoint< EP_FP_BITS >::create(), DECAY, eg_phase, eg_phase_max, FINISH, patch, RELEASE, SETTLE, openmsx::YM2413Okazaki::Patch::SL, state, SUSHOLD, SUSTAIN, and updateEG().
Referenced by calc_envelope_outline(), openmsx::YM2413Okazaki::Channel::keyOn(), reset(), setPatch(), slotOff(), slotOn(), and slotOn2().
void openmsx::YM2413Okazaki::Slot::setPatch | ( | const Patch & | patch | ) |
Definition at line 555 of file YM2413Okazaki.cc.
References openmsx::YM2413Okazaki::Patch::EG, patch, setEnvelopeState(), state, SUSHOLD, and SUSTAIN.
Referenced by openmsx::YM2413Okazaki::Channel::setPatch().
void openmsx::YM2413Okazaki::Slot::setVolume | ( | unsigned | value | ) |
Definition at line 565 of file YM2413Okazaki.cc.
References volume.
void openmsx::YM2413Okazaki::Slot::slotOff | ( | ) |
Definition at line 544 of file YM2413Okazaki.cc.
References ATTACK, eg_phase, FINISH, RELEASE, setEnvelopeState(), state, and openmsx::FixedPoint< FRACTION_BITS_ >::toInt().
Referenced by openmsx::YM2413Okazaki::Channel::keyOff().
void openmsx::YM2413Okazaki::Slot::slotOn | ( | ) |
Definition at line 529 of file YM2413Okazaki.cc.
References ATTACK, cPhase, eg_phase, and setEnvelopeState().
Referenced by calc_envelope_outline().
void openmsx::YM2413Okazaki::Slot::slotOn2 | ( | ) |
Definition at line 537 of file YM2413Okazaki.cc.
References ATTACK, eg_phase, and setEnvelopeState().
void openmsx::YM2413Okazaki::Slot::updateAll | ( | unsigned | freq, |
bool | actAsCarrier | ||
) |
Definition at line 488 of file YM2413Okazaki.cc.
References updateEG(), updatePG(), updateRKS(), and updateTLL().
void openmsx::YM2413Okazaki::Slot::updateEG | ( | ) |
Definition at line 435 of file YM2413Okazaki.cc.
References openmsx::YM2413Okazaki::Patch::AR, ATTACK, openmsx::FixedPoint< EP_FP_BITS >::create(), DECAY, dPhaseDRTableRks, openmsx::YM2413Okazaki::Patch::DR, openmsx::YM2413Okazaki::Patch::EG, eg_dPhase, FINISH, patch, RELEASE, openmsx::YM2413Okazaki::Patch::RR, SETTLE, state, SUSHOLD, SUSTAIN, and sustain.
Referenced by setEnvelopeState(), and updateAll().
void openmsx::YM2413Okazaki::Slot::updatePG | ( | unsigned | freq | ) |
Definition at line 407 of file YM2413Okazaki.cc.
References dPhase, enumerate(), openmsx::YM2413Okazaki::Patch::ML, and patch.
Referenced by updateAll().
void openmsx::YM2413Okazaki::Slot::updateRKS | ( | unsigned | freq | ) |
Definition at line 428 of file YM2413Okazaki.cc.
References dPhaseDRTableRks, openmsx::YM2413Okazaki::Patch::KR, and patch.
Referenced by updateAll().
void openmsx::YM2413Okazaki::Slot::updateTLL | ( | unsigned | freq, |
bool | actAsCarrier | ||
) |
Definition at line 423 of file YM2413Okazaki.cc.
References openmsx::YM2413Okazaki::Patch::KL, patch, openmsx::YM2413Okazaki::Patch::TL, tll, and volume.
Referenced by updateAll().
unsigned openmsx::YM2413Okazaki::Slot::cPhase |
Definition at line 108 of file YM2413Okazaki.hh.
Referenced by calc_phase(), openmsx::YM2413Okazaki::YM2413::generateChannels(), reset(), serialize(), and slotOn().
std::array<unsigned, 8> openmsx::YM2413Okazaki::Slot::dPhase |
Definition at line 109 of file YM2413Okazaki.hh.
Referenced by calc_phase(), reset(), and updatePG().
std::span<const int, 16> openmsx::YM2413Okazaki::Slot::dPhaseDRTableRks |
Definition at line 114 of file YM2413Okazaki.hh.
Referenced by reset(), updateEG(), and updateRKS().
EnvPhaseIndex openmsx::YM2413Okazaki::Slot::eg_dPhase |
Definition at line 117 of file YM2413Okazaki.hh.
Referenced by calc_envelope(), calc_fixed_env(), and updateEG().
EnvPhaseIndex openmsx::YM2413Okazaki::Slot::eg_phase |
Definition at line 116 of file YM2413Okazaki.hh.
Referenced by calc_envelope(), calc_envelope_outline(), calc_fixed_env(), serialize(), setEnvelopeState(), slotOff(), slotOn(), and slotOn2().
EnvPhaseIndex openmsx::YM2413Okazaki::Slot::eg_phase_max |
Definition at line 118 of file YM2413Okazaki.hh.
Referenced by calc_envelope(), calc_envelope_outline(), and setEnvelopeState().
int openmsx::YM2413Okazaki::Slot::feedback |
Definition at line 104 of file YM2413Okazaki.hh.
Referenced by calc_slot_mod(), reset(), and serialize().
int openmsx::YM2413Okazaki::Slot::output |
Definition at line 105 of file YM2413Okazaki.hh.
Referenced by calc_slot_car(), calc_slot_mod(), reset(), and serialize().
Patch openmsx::YM2413Okazaki::Slot::patch |
Definition at line 122 of file YM2413Okazaki.hh.
Referenced by calc_envelope_outline(), calc_slot_car(), calc_slot_mod(), calc_slot_tom(), openmsx::YM2413Okazaki::YM2413::calcChannel(), openmsx::YM2413Okazaki::YM2413::generateChannels(), setEnvelopeState(), setPatch(), updateEG(), updatePG(), updateRKS(), and updateTLL().
Slot* openmsx::YM2413Okazaki::Slot::sibling |
Definition at line 123 of file YM2413Okazaki.hh.
Referenced by calc_envelope_outline(), and openmsx::YM2413Okazaki::Channel::Channel().
uint8_t openmsx::YM2413Okazaki::Slot::slot_on_flag |
Definition at line 119 of file YM2413Okazaki.hh.
Referenced by openmsx::YM2413Okazaki::Channel::keyOff(), openmsx::YM2413Okazaki::Channel::keyOn(), and reset().
EnvelopeState openmsx::YM2413Okazaki::Slot::state |
Definition at line 115 of file YM2413Okazaki.hh.
Referenced by calc_envelope(), calc_envelope_outline(), calc_fixed_env(), openmsx::YM2413Okazaki::YM2413::generateChannels(), isActive(), serialize(), setEnvelopeState(), setPatch(), slotOff(), and updateEG().
bool openmsx::YM2413Okazaki::Slot::sustain |
Definition at line 120 of file YM2413Okazaki.hh.
Referenced by reset(), serialize(), openmsx::YM2413Okazaki::Channel::setSustain(), and updateEG().
unsigned openmsx::YM2413Okazaki::Slot::tll |
Definition at line 113 of file YM2413Okazaki.hh.
Referenced by calc_envelope(), calc_fixed_env(), reset(), and updateTLL().
unsigned openmsx::YM2413Okazaki::Slot::volume |
Definition at line 112 of file YM2413Okazaki.hh.
Referenced by reset(), setVolume(), and updateTLL().