logo
Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related

SynthCore::Synth Class Reference

The main container for the various modules. More...

#include <Synth.h>

List of all members.

Public Methods

 Synth ()
 ~Synth ()
void update ()
 Calls Update on Modules in UpdateMap.

void StateChange ()
void add (Module *m)
void noteOff (int note)
 Pass MIDI signals to this.

void noteOn (int note)
void allNotesOff ()
 Reset MIDI notes.

std::string getXML (int indent=0)
 Return a serialized XML representation of this object, including all sub-components.

void loadXML (std::string fileName)
 Load a serialized XML.

void XMLRegister (string Attr, Output *out)
 Used while parsing XML files. (semi-private).

OutputXMLGetOutput (string Attr)

Public Attributes

OutputOutput1
 Left Output From Synth.

OutputOutput2
 Main Output From Synth.

bool active
SynthVoicevoices [4]
ModuleMap UpdateMap
 Order of automatic updated modules.

ModuleMap totalMap
 Map of all components (also including manually updated ones).


Detailed Description

The main container for the various modules.

All active modules resides in here. There are methods for building updatemaps, which controls the order in which the sample calculation takes place

Todo:
needs some cleaning. Midi section needs improvement: remember velocity, pedal on/off, and pitch bend.

Definition at line 109 of file Synth.h.


Member Function Documentation

void SynthCore::Synth::add Module   m
 

Call this to register module on synth. Registered on totalMap Must be done if UI is to display the module.

Definition at line 231 of file Synth.cpp.

References totalMap.

Referenced by SynthCore::SynthVoice::add().

void SynthCore::Synth::noteOn int    note
 

Pass MIDI signals to this.

Todo:
velocity

Definition at line 350 of file Synth.cpp.

References SynthCore::FreqTable::freqTab, StateChange(), and voices.

void SynthCore::Synth::StateChange  
 

Must be called after a StateChange, IE when some module routes are not active anymore (a voice dies out) (After NoteOn & Last decay of note especially)

Definition at line 330 of file Synth.cpp.

References SynthCore::Output::HostModule, Output1, and UpdateMap.

Referenced by noteOn().

Output* SynthCore::Synth::XMLGetOutput string    Attr [inline]
 

Search for an Output on XMLOutput map. Returns 0 if the search fails.

Definition at line 174 of file Synth.h.


Member Data Documentation

bool SynthCore::Synth::active
 

'active' functions as a mutex: When multi-threaded applications (IE an GUI and the VST interface) accesses the synth class It is sometimes neccesary to turn the VST interface access off. This is done by setting active to false.

Definition at line 123 of file Synth.h.

SynthVoice* SynthCore::Synth::voices[4]
 

The various synth voices (IE the polyphonic components)

Todo:
Change to vector!

Definition at line 153 of file Synth.h.

Referenced by allNotesOff(), noteOff(), and noteOn().


The documentation for this class was generated from the following files:
Syntopia Project. Visit the web page, or the SourceForge page.
Docs made by Doxygen. Email: Mikael Christensen