openMSX
|
#include <YM2413Burczynski.hh>
Public Types | |
enum | KeyPart : uint8_t { KEY_MAIN = 1 , KEY_RHYTHM = 2 } |
enum | EnvelopeState { EG_DUMP , EG_ATTACK , EG_DECAY , EG_SUSTAIN , EG_RELEASE , EG_OFF } |
Envelope Generator phases Note: These are ordered: phase constants are compared in the code. More... | |
Public Member Functions | |
Slot () | |
void | resetOperators () |
void | updateGenerators (Channel &channel) |
Update phase increment counter of operator. More... | |
int | calcOutput (Channel &channel, unsigned eg_cnt, bool carrier, unsigned lfo_am, int phase) |
int | calc_slot_mod (Channel &channel, unsigned eg_cnt, bool carrier, unsigned lfo_pm, unsigned lfo_am) |
int | calc_envelope (Channel &channel, unsigned eg_cnt, bool carrier) |
int | calc_phase (Channel &channel, unsigned lfo_pm) |
void | setKeyOn (KeyPart part) |
void | setKeyOff (KeyPart part) |
void | setKeyOnOff (KeyPart part, bool enabled) |
bool | isActive () const |
Does this slot currently produce an output signal? More... | |
void | setFrequencyMultiplier (uint8_t value) |
Sets the frequency multiplier [0..15]. More... | |
void | setKeyScaleRate (bool value) |
Sets the key scale rate: true->0, false->2. More... | |
void | setEnvelopeSustained (bool value) |
Sets the envelope type of the current instrument. More... | |
void | setVibrato (bool value) |
Enables (true) or disables (false) vibrato. More... | |
void | setAmplitudeModulation (bool value) |
Enables (true) or disables (false) amplitude modulation. More... | |
void | setTotalLevel (Channel &channel, uint8_t value) |
Sets the total level: [0..63]. More... | |
void | setKeyScaleLevel (Channel &channel, uint8_t value) |
Sets the key scale level: 0->0 / 1->1.5 / 2->3.0 / 3->6.0 dB/OCT. More... | |
void | setWaveform (uint8_t value) |
Sets the waveform: 0 = sinus, 1 = half sinus, half silence. More... | |
void | setFeedbackShift (uint8_t value) |
Sets the amount of feedback [0..7]. More... | |
void | setAttackRate (const Channel &channel, uint8_t value) |
Sets the attack rate [0..15]. More... | |
void | setDecayRate (const Channel &channel, uint8_t value) |
Sets the decay rate [0..15]. More... | |
void | setReleaseRate (const Channel &channel, uint8_t value) |
Sets the release rate [0..15]. More... | |
void | setSustainLevel (uint8_t value) |
Sets the sustain level [0..15]. More... | |
void | updateFrequency (Channel &channel) |
Called by Channel when block_fnum changes. More... | |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
Definition at line 24 of file YM2413Burczynski.hh.
Envelope Generator phases Note: These are ordered: phase constants are compared in the code.
Enumerator | |
---|---|
EG_DUMP | |
EG_ATTACK | |
EG_DECAY | |
EG_SUSTAIN | |
EG_RELEASE | |
EG_OFF |
Definition at line 116 of file YM2413Burczynski.hh.
enum openmsx::YM2413Burczynski::Slot::KeyPart : uint8_t |
Enumerator | |
---|---|
KEY_MAIN | |
KEY_RHYTHM |
Definition at line 43 of file YM2413Burczynski.hh.
openmsx::YM2413Burczynski::Slot::Slot | ( | ) |
Definition at line 644 of file YM2413Burczynski.cc.
References EG_OFF.
|
inline |
Definition at line 398 of file YM2413Burczynski.cc.
References EG_ATTACK, EG_DECAY, EG_DUMP, EG_OFF, EG_RELEASE, EG_SUSTAIN, and openmsx::YM2413Burczynski::Channel::isSustained().
Referenced by calcOutput().
|
inline |
Definition at line 482 of file YM2413Burczynski.cc.
References openmsx::YM2413Burczynski::Channel::getBlockFNum(), and openmsx::FixedPoint< FRACTION_BITS_ >::toInt().
Referenced by calc_slot_mod(), and openmsx::YM2413Burczynski::Channel::calcOutput().
|
inline |
Definition at line 537 of file YM2413Burczynski.cc.
References calc_phase(), and calcOutput().
Referenced by openmsx::YM2413Burczynski::YM2413::generateChannels().
|
inline |
Definition at line 528 of file YM2413Burczynski.cc.
References calc_envelope().
Referenced by calc_slot_mod(), openmsx::YM2413Burczynski::Channel::calcOutput(), and openmsx::YM2413Burczynski::YM2413::generateChannels().
bool openmsx::YM2413Burczynski::Slot::isActive | ( | ) | const |
Does this slot currently produce an output signal?
Definition at line 682 of file YM2413Burczynski.cc.
References EG_OFF.
Referenced by setKeyOff().
void openmsx::YM2413Burczynski::Slot::resetOperators | ( | ) |
Definition at line 771 of file YM2413Burczynski.cc.
References EG_OFF.
void openmsx::YM2413Burczynski::Slot::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 1295 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::serialize().
void openmsx::YM2413Burczynski::Slot::setAmplitudeModulation | ( | bool | value | ) |
Enables (true) or disables (false) amplitude modulation.
Definition at line 712 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setAttackRate | ( | const Channel & | channel, |
uint8_t | value | ||
) |
Sets the attack rate [0..15].
Definition at line 739 of file YM2413Burczynski.cc.
References openmsx::YM2413Burczynski::Channel::getKeyCode().
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setDecayRate | ( | const Channel & | channel, |
uint8_t | value | ||
) |
Sets the decay rate [0..15].
Definition at line 746 of file YM2413Burczynski.cc.
References openmsx::YM2413Burczynski::Channel::getKeyCode().
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setEnvelopeSustained | ( | bool | value | ) |
Sets the envelope type of the current instrument.
value | true->sustained, false->percussive. |
Definition at line 702 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setFeedbackShift | ( | uint8_t | value | ) |
Sets the amount of feedback [0..7].
Definition at line 734 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setFrequencyMultiplier | ( | uint8_t | value | ) |
Sets the frequency multiplier [0..15].
Definition at line 692 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setKeyOff | ( | KeyPart | part | ) |
Definition at line 661 of file YM2413Burczynski.cc.
References EG_RELEASE, and isActive().
Referenced by setKeyOnOff().
void openmsx::YM2413Burczynski::Slot::setKeyOn | ( | KeyPart | part | ) |
Definition at line 652 of file YM2413Burczynski.cc.
References EG_DUMP.
Referenced by setKeyOnOff().
void openmsx::YM2413Burczynski::Slot::setKeyOnOff | ( | KeyPart | part, |
bool | enabled | ||
) |
Definition at line 673 of file YM2413Burczynski.cc.
References setKeyOff(), and setKeyOn().
void openmsx::YM2413Burczynski::Slot::setKeyScaleLevel | ( | Channel & | channel, |
uint8_t | value | ||
) |
Sets the key scale level: 0->0 / 1->1.5 / 2->3.0 / 3->6.0 dB/OCT.
Definition at line 723 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setKeyScaleRate | ( | bool | value | ) |
Sets the key scale rate: true->0, false->2.
Definition at line 697 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setReleaseRate | ( | const Channel & | channel, |
uint8_t | value | ||
) |
Sets the release rate [0..15].
Definition at line 753 of file YM2413Burczynski.cc.
References openmsx::YM2413Burczynski::Channel::getKeyCode().
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setSustainLevel | ( | uint8_t | value | ) |
Sets the sustain level [0..15].
Definition at line 760 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setTotalLevel | ( | Channel & | channel, |
uint8_t | value | ||
) |
Sets the total level: [0..63].
Definition at line 717 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setVibrato | ( | bool | value | ) |
Enables (true) or disables (false) vibrato.
Definition at line 707 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::setWaveform | ( | uint8_t | value | ) |
Sets the waveform: 0 = sinus, 1 = half sinus, half silence.
Definition at line 729 of file YM2413Burczynski.cc.
Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().
void openmsx::YM2413Burczynski::Slot::updateFrequency | ( | Channel & | channel | ) |
Called by Channel when block_fnum changes.
Definition at line 765 of file YM2413Burczynski.cc.
References updateGenerators().
Referenced by openmsx::YM2413Burczynski::Channel::serialize(), and openmsx::YM2413Burczynski::Channel::setFrequency().
void openmsx::YM2413Burczynski::Slot::updateGenerators | ( | Channel & | channel | ) |
Update phase increment counter of operator.
Also updates the EG rates if necessary.
Definition at line 778 of file YM2413Burczynski.cc.
References openmsx::YM2413Burczynski::Channel::getFrequencyIncrement(), openmsx::YM2413Burczynski::Channel::getKeyCode(), and openmsx::YM2413Burczynski::Channel::isSustained().
Referenced by updateFrequency(), and openmsx::YM2413Burczynski::Channel::updateInstrumentPart().