Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

pcbChannel Class Reference

The channel class. More...

#include <pcbChannel.h>

Collaboration diagram for pcbChannel:

Collaboration graph
[legend]
List of all members.

Public Methods

 pcbChannel (pp::Audio& audio)
 need an audio to allocate the channel.

 ~pcbChannel ()
pcbChannel& operator= (const pcbChannel& channel)
void Reset (bool fPosition = true)
 This is used when a new sample is set or a new note is started.

void VolumeUp (int x)
 Increases the volume by x. The maximum volume is 128.

void VolumeDown (int y)
 Decreases the volume by y. The minimum volume is 0.

void SetVolume (const pcbNote& n)
 Set the volume of the channel. If not for the callback this could be moved into the channel class. As well as set a volume between 0 and 40 it processes the volume effects. VC_PORT_TONE is broken due to reliance on NoteToPeriod and PeriodShift
Parameters:
n   A pcbNote with the volume set to the new volume for the channel.


void DoVolumeSlide ()
 Process the volume slide effect, taking the parameters from memory.

void DoPortamento ()
 Process the portamento effect, taking the parameters from memory. Add or subtract speed to frequency until note is reached. Check for glissando ?

void DoVibrato (unsigned char vib_type = 0)
 Process the vibrato effect, taking the parameters from memory. vib_type = 0 for normal vibrato, or FINE_VIBRATO for you guessed it.

void DoInstrumentVibrato ()
 I'm not really sure how instrument vibrato actually works. xm.txt is not terribly informative about it, in fact it doesn't say anything about it. Maybe it doesn't exist? If anyone knows about it mail me. I think it uses fine vibrato.

void DoTremolo (int max_volume)
 Tremolo is a modulation in the volume.

void DoTremor ()
 Volume is set to zero after y ticks.

unsigned char ProcessEnvelope (pcbInstrument::pcbParameters* p, pcbParamStatus* t)
 This can be used for both panning envelopes and volume envelopes. It takes an envelope represented by p, and the status of envelope (ie the current position etc.) updates the position and returns the current y value.

void ResetEnvelope (pcbParamStatus* t)
void SetEnvelopePosition (int position)
 This sets the current point of the envelopes the one with the x component closest to "position".

void Update ()
void UpdateSample ()
void UpdateVolume ()
 Update the audio systems volume for this channel. Calculate mix volume for this channel. FT2 uses this formula:
 FinalVol = (FadeOutVol  / 65536)          * (EnvelopeVol /    64)          * (GlobalVol   /    64)          * (Vol         /    64)          * Scale; 
.


void UpdatePeriod ()
 Update the period for the channel. From xm.txt:
 Linear frequence table: ----------------------- Period = 10*12*16*4 - Note*16*4 - FineTune/2; Frequency = 8363*2^((6*12*16*4 - Period) / (12*16*4)); Amiga frequence table: ---------------------- Period = (PeriodTab[(Note MOD 12)*8 + FineTune/16]*(1-Frac(FineTune/16)) +           PeriodTab[(Note MOD 12)*8 + FineTune/16]*(Frac(FineTune/16)))          *16/2^(Note DIV 12);    (The period is interpolated for finer finetune values) Frequency = 8363*1712/Period; 
.


void UpdatePosition ()
void UpdatePanning ()
void SetNote (int note)
void SetPeriod (int period)
void SetPosition (long int position)
void SetVolume (int volume)
void SetPanning (int panning)
bool VolumeEnvelopeEnabled ()
bool PanningEnvelopeEnabled ()
void DoVolumeEnvelope ()
void DoPanningEnvelope ()
void SetToTremorVolume ()
void SetPortamentoSpeed (int speed)
void SetPortamentoPeriod (int period)
void PortUp (int least)
void PortDown (int most)
void FinePortUp (int up, int least)
void FinePortDown (int down, int most)
void SetTremor (int tremor)
void SetGlobalVolumeSlide (int slide)
void DoRetrigVolumeSlide (int rx)
void ResetVolume ()
void ResetPanning ()
pp::Sample::relative_note_t GetRelativeNote (int NoteNum) const
pp::Sample::finetune_t GetFineTune (int NoteNum) const
pp::Sample* GetSample (int NoteNum) const
pp::Sample* GetCurrentSample () const
pcbInstrumentGetInstrument () const
void Start ()
void Stop ()
bool operator< (const pcbChannel& channel) const
bool operator== (const pcbChannel& channel) const
void SetInstrumentMode (bool mode)
void SetInstrument (const pcbNote& n, const pcbModule& module)
bool IsInstrument () const
signed char GetVolume () const
void SetSampleNumber (int number)
void SetSampleNumber (const pcbNote& n)
int GetSampleNumber () const
bool HasSample () const
bool HasInstrument () const
void SetKeyOff ()
void SetKeyOn ()
void SetFadeout (unsigned long fadeout)
unsigned char GetTremorVolume () const
unsigned char GetFineVolumeSlide () const
int GetID () const
bool InstrumentPanning () const
void SetPeriodType (period_t type)
 pcbChannel ()
void SetModule (pcbModule* mod)
unsigned char GetOffset () const
void SetOffset (unsigned char offset)
void ResetVibrato ()
void SetVibratoWaveform (unsigned char wave)
unsigned char GetVibratoWaveform () const
void SetVibratoPosition (signed char pos)
void SetVibratoSpeed (unsigned char speed)
void SetVibratoDepth (unsigned char depth)
void SetTremoloWaveform (unsigned char wave)
unsigned char GetTremoloWaveform () const
void SetTremoloPosition (signed char pos)
void SetTremoloSpeed (unsigned char speed)
void SetTremoloDepth (unsigned char depth)
void SetVolumeSlide (unsigned char slide)
void SetFineVolumeSlide (unsigned char slide)
void SetGlissando (unsigned char glissando)
void SetLoopStart (signed char start)
signed char GetLoopStart () const
void SetLoopCount (signed char count)
signed char GetLoopCount () const
void DecrementLoopCount ()
void SetRetrigger (unsigned char retrig)
unsigned char GetRetrigger () const
unsigned char GetNote () const
signed long GetPeriod () const
bool PortamentoComplete () const
unsigned char GetGlobalVolumeSlide () const

Detailed Description

The channel class.

This can't be a ppsChannel since we need to get that from the driver so we'll just give it a ppsChannel.


The documentation for this class was generated from the following files:
Generated at Mon Nov 27 01:47:05 2000 for LibPenguinPlay by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000