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

#include <YM2413Burczynski.hh>

Public Types

enum class  KeyPart : uint8_t { MAIN = 1 , RHYTHM = 2 }
 
enum class  EnvelopeState {
  DUMP , ATTACK , DECAY , SUSTAIN ,
  RELEASE , OFF
}
 

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

Enumerator
DUMP 
ATTACK 
DECAY 
SUSTAIN 
RELEASE 
OFF 

Definition at line 115 of file YM2413Burczynski.hh.

◆ KeyPart

enum class openmsx::YM2413Burczynski::Slot::KeyPart : uint8_t
strong
Enumerator
MAIN 
RHYTHM 

Definition at line 45 of file YM2413Burczynski.hh.

Constructor & Destructor Documentation

◆ Slot()

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

Definition at line 645 of file YM2413Burczynski.cc.

References 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 538 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 681 of file YM2413Burczynski.cc.

References OFF.

Referenced by setKeyOff().

◆ resetOperators()

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

Definition at line 770 of file YM2413Burczynski.cc.

References 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 711 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 738 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 745 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 701 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 733 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 691 of file YM2413Burczynski.cc.

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

◆ setKeyOff()

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

Definition at line 662 of file YM2413Burczynski.cc.

References isActive(), and RELEASE.

Referenced by setKeyOnOff().

◆ setKeyOn()

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

Definition at line 653 of file YM2413Burczynski.cc.

References DUMP, and to_underlying().

Referenced by setKeyOnOff().

◆ setKeyOnOff()

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

Definition at line 672 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 722 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 696 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 752 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 759 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 716 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 706 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 728 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 764 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: