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

#include <YM2413Burczynski.hh>

Public Types

enum  KeyPart { 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 (byte 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, byte value)
 Sets the total level: [0..63]. More...
 
void setKeyScaleLevel (Channel &channel, byte value)
 Sets the key scale level: 0->0 / 1->1.5 / 2->3.0 / 3->6.0 dB/OCT. More...
 
void setWaveform (byte value)
 Sets the waveform: 0 = sinus, 1 = half sinus, half silence. More...
 
void setFeedbackShift (byte value)
 Sets the amount of feedback [0..7]. More...
 
void setAttackRate (const Channel &channel, byte value)
 Sets the attack rate [0..15]. More...
 
void setDecayRate (const Channel &channel, byte value)
 Sets the decay rate [0..15]. More...
 
void setReleaseRate (const Channel &channel, byte value)
 Sets the release rate [0..15]. More...
 
void setSustainLevel (byte 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)
 

Detailed Description

Definition at line 17 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 109 of file YM2413Burczynski.hh.

◆ KeyPart

Enumerator
KEY_MAIN 
KEY_RHYTHM 

Definition at line 36 of file YM2413Burczynski.hh.

Constructor & Destructor Documentation

◆ Slot()

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

Definition at line 658 of file YM2413Burczynski.cc.

References EG_OFF.

Member Function Documentation

◆ calc_envelope()

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

Definition at line 413 of file YM2413Burczynski.cc.

◆ calc_phase()

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

◆ calc_slot_mod()

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

Definition at line 552 of file YM2413Burczynski.cc.

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

◆ calcOutput()

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

Definition at line 543 of file YM2413Burczynski.cc.

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

◆ isActive()

bool openmsx::YM2413Burczynski::Slot::isActive ( ) const

Does this slot currently produce an output signal?

Definition at line 703 of file YM2413Burczynski.cc.

References EG_OFF.

Referenced by setKeyOff().

◆ resetOperators()

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

Definition at line 792 of file YM2413Burczynski.cc.

References EG_OFF.

◆ serialize()

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

Definition at line 1318 of file YM2413Burczynski.cc.

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

◆ setAmplitudeModulation()

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

Enables (true) or disables (false) amplitude modulation.

Definition at line 733 of file YM2413Burczynski.cc.

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

◆ setAttackRate()

void openmsx::YM2413Burczynski::Slot::setAttackRate ( const Channel channel,
byte  value 
)

Sets the attack rate [0..15].

Definition at line 760 of file YM2413Burczynski.cc.

References openmsx::YM2413Burczynski::Channel::getKeyCode().

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

◆ setDecayRate()

void openmsx::YM2413Burczynski::Slot::setDecayRate ( const Channel channel,
byte  value 
)

Sets the decay rate [0..15].

Definition at line 767 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 723 of file YM2413Burczynski.cc.

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

◆ setFeedbackShift()

void openmsx::YM2413Burczynski::Slot::setFeedbackShift ( byte  value)

Sets the amount of feedback [0..7].

Definition at line 755 of file YM2413Burczynski.cc.

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

◆ setFrequencyMultiplier()

void openmsx::YM2413Burczynski::Slot::setFrequencyMultiplier ( byte  value)

Sets the frequency multiplier [0..15].

Definition at line 713 of file YM2413Burczynski.cc.

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

◆ setKeyOff()

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

Definition at line 682 of file YM2413Burczynski.cc.

References EG_RELEASE, and isActive().

Referenced by setKeyOnOff(), and openmsx::YM2413Burczynski::YM2413::YM2413().

◆ setKeyOn()

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

Definition at line 673 of file YM2413Burczynski.cc.

References EG_DUMP.

Referenced by setKeyOnOff().

◆ setKeyOnOff()

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

Definition at line 694 of file YM2413Burczynski.cc.

References setKeyOff(), and setKeyOn().

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

◆ setKeyScaleLevel()

void openmsx::YM2413Burczynski::Slot::setKeyScaleLevel ( Channel channel,
byte  value 
)

Sets the key scale level: 0->0 / 1->1.5 / 2->3.0 / 3->6.0 dB/OCT.

Definition at line 744 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 718 of file YM2413Burczynski.cc.

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

◆ setReleaseRate()

void openmsx::YM2413Burczynski::Slot::setReleaseRate ( const Channel channel,
byte  value 
)

Sets the release rate [0..15].

Definition at line 774 of file YM2413Burczynski.cc.

References openmsx::YM2413Burczynski::Channel::getKeyCode().

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

◆ setSustainLevel()

void openmsx::YM2413Burczynski::Slot::setSustainLevel ( byte  value)

Sets the sustain level [0..15].

Definition at line 781 of file YM2413Burczynski.cc.

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

◆ setTotalLevel()

void openmsx::YM2413Burczynski::Slot::setTotalLevel ( Channel channel,
byte  value 
)

Sets the total level: [0..63].

Definition at line 738 of file YM2413Burczynski.cc.

Referenced by openmsx::YM2413Burczynski::Channel::updateInstrumentPart(), and openmsx::YM2413Burczynski::YM2413::YM2413().

◆ setVibrato()

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

Enables (true) or disables (false) vibrato.

Definition at line 728 of file YM2413Burczynski.cc.

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

◆ setWaveform()

void openmsx::YM2413Burczynski::Slot::setWaveform ( byte  value)

Sets the waveform: 0 = sinus, 1 = half sinus, half silence.

Definition at line 750 of file YM2413Burczynski.cc.

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

◆ updateFrequency()

void openmsx::YM2413Burczynski::Slot::updateFrequency ( Channel channel)

Called by Channel when block_fnum changes.

Definition at line 786 of file YM2413Burczynski.cc.

References updateGenerators().

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

◆ updateGenerators()

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

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