openMSX
Public Types | Public Member Functions | List of all members
openmsx::YM2413Burczynski::Slot Class Reference

#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 (const Channel &channel)
 Update phase increment counter of operator.
 
int calcOutput (const Channel &channel, unsigned eg_cnt, bool carrier, unsigned lfo_am, int phase)
 
int calc_slot_mod (const Channel &channel, unsigned eg_cnt, bool carrier, unsigned lfo_pm, unsigned lfo_am)
 
int calc_envelope (const Channel &channel, unsigned eg_cnt, bool carrier)
 
int calc_phase (const 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?
 
void setFrequencyMultiplier (uint8_t value)
 Sets the frequency multiplier [0..15].
 
void setKeyScaleRate (bool value)
 Sets the key scale rate: true->0, false->2.
 
void setEnvelopeSustained (bool value)
 Sets the envelope type of the current instrument.
 
void setVibrato (bool value)
 Enables (true) or disables (false) vibrato.
 
void setAmplitudeModulation (bool value)
 Enables (true) or disables (false) amplitude modulation.
 
void setTotalLevel (const Channel &channel, uint8_t value)
 Sets the total level: [0..63].
 
void setKeyScaleLevel (const Channel &channel, uint8_t value)
 Sets the key scale level: 0->0 / 1->1.5 / 2->3.0 / 3->6.0 dB/OCT.
 
void setWaveform (uint8_t value)
 Sets the waveform: 0 = sinus, 1 = half sinus, half silence.
 
void setFeedbackShift (uint8_t value)
 Sets the amount of feedback [0..7].
 
void setAttackRate (const Channel &channel, uint8_t value)
 Sets the attack rate [0..15].
 
void setDecayRate (const Channel &channel, uint8_t value)
 Sets the decay rate [0..15].
 
void setReleaseRate (const Channel &channel, uint8_t value)
 Sets the release rate [0..15].
 
void setSustainLevel (uint8_t value)
 Sets the sustain level [0..15].
 
void updateFrequency (const Channel &channel)
 Called by Channel when block_fnum changes.
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Detailed Description

Definition at line 26 of file YM2413Burczynski.hh.

Member Enumeration Documentation

◆ EnvelopeState

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 118 of file YM2413Burczynski.hh.

◆ KeyPart

Enumerator
KEY_MAIN 
KEY_RHYTHM 

Definition at line 45 of file YM2413Burczynski.hh.

Constructor & Destructor Documentation

◆ Slot()

openmsx::YM2413Burczynski::Slot::Slot ( )

Definition at line 644 of file YM2413Burczynski.cc.

References EG_OFF.

Member Function Documentation

◆ calc_envelope()

int openmsx::YM2413Burczynski::Slot::calc_envelope ( const Channel channel,
unsigned  eg_cnt,
bool  carrier 
)
inline

◆ calc_phase()

int openmsx::YM2413Burczynski::Slot::calc_phase ( const Channel channel,
unsigned  lfo_pm 
)
inline

◆ calc_slot_mod()

int openmsx::YM2413Burczynski::Slot::calc_slot_mod ( const Channel channel,
unsigned  eg_cnt,
bool  carrier,
unsigned  lfo_pm,
unsigned  lfo_am 
)
inline

Definition at line 537 of file YM2413Burczynski.cc.

References calc_phase(), and calcOutput().

Referenced by openmsx::YM2413Burczynski::YM2413::generateChannels().

◆ calcOutput()

int openmsx::YM2413Burczynski::Slot::calcOutput ( const Channel channel,
unsigned  eg_cnt,
bool  carrier,
unsigned  lfo_am,
int  phase 
)
inline

◆ isActive()

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().

◆ resetOperators()

void openmsx::YM2413Burczynski::Slot::resetOperators ( )

Definition at line 771 of file YM2413Burczynski.cc.

References EG_OFF.

◆ serialize()

template<typename Archive >
void openmsx::YM2413Burczynski::Slot::serialize ( Archive &  ar,
unsigned  version 
)

Definition at line 1295 of file YM2413Burczynski.cc.

References setWaveform().

Referenced by openmsx::YM2413Burczynski::Channel::serialize().

◆ setAmplitudeModulation()

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().

◆ setAttackRate()

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().

◆ setDecayRate()

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().

◆ setEnvelopeSustained()

void openmsx::YM2413Burczynski::Slot::setEnvelopeSustained ( bool  value)

Sets the envelope type of the current instrument.

Parameters
valuetrue->sustained, false->percussive.

Definition at line 702 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart().

◆ setFeedbackShift()

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().

◆ setFrequencyMultiplier()

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().

◆ setKeyOff()

void openmsx::YM2413Burczynski::Slot::setKeyOff ( KeyPart  part)

Definition at line 661 of file YM2413Burczynski.cc.

References EG_RELEASE, and isActive().

Referenced by setKeyOnOff().

◆ setKeyOn()

void openmsx::YM2413Burczynski::Slot::setKeyOn ( KeyPart  part)

Definition at line 652 of file YM2413Burczynski.cc.

References EG_DUMP.

Referenced by setKeyOnOff().

◆ setKeyOnOff()

void openmsx::YM2413Burczynski::Slot::setKeyOnOff ( KeyPart  part,
bool  enabled 
)

Definition at line 673 of file YM2413Burczynski.cc.

References setKeyOff(), and setKeyOn().

◆ setKeyScaleLevel()

void openmsx::YM2413Burczynski::Slot::setKeyScaleLevel ( const 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().

◆ setKeyScaleRate()

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().

◆ setReleaseRate()

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().

◆ setSustainLevel()

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().

◆ setTotalLevel()

void openmsx::YM2413Burczynski::Slot::setTotalLevel ( const 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().

◆ setVibrato()

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().

◆ setWaveform()

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 serialize(), and openmsx::YM2413Burczynski::Channel::updateInstrumentPart().

◆ updateFrequency()

void openmsx::YM2413Burczynski::Slot::updateFrequency ( const 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().

◆ updateGenerators()

void openmsx::YM2413Burczynski::Slot::updateGenerators ( const Channel channel)

The documentation for this class was generated from the following files: