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

SynthVoice.h

00001 //
00002 //  SYNTOPIA. See http://Syntopia.sourceforge.net for details and documentation.        
00003 //
00004 //      Author of this file: Mikael Hvidtfeldt Christensen (mikaelc@users.sourceforge.net)
00005 //
00006 
00007 // Visual C++ compiler warnings: 255 char limit on var names.....
00008 #pragma warning(disable: 4786)
00009 
00010 #ifndef __synthvoice__
00011 #define __synthvoice__
00012 
00013 #include "Modules.h"
00014 #include "filters.h"
00015 #include "input.h"
00016 #include "output.h"
00017 #include "Synth.h"
00018 #include "sampler.h"
00019 #include "envelope.h"
00020 #include <string>
00021 #include <list>
00022 
00023 namespace SynthCore {
00024 
00025 class FMOSC;
00026 class Multiplier;
00027 class Envelope;
00028 class Envelope2;
00029 class BiQuad;
00030 class Envelop2;
00031  
00032 
00035 
00036 typedef std::list<Module *> ModuleMap ;
00037 typedef std::list<Module *>::const_iterator ModuleMapIter ;
00038 
00039 
00042 class SynthVoice {
00043 
00044 
00045 public: // --------------------------------------------------------------
00046 
00047         Synth * HostSynth;
00048         int playingNote;
00049         bool noteOn;
00050         bool aLive;
00051     
00052 
00053         Output * SynthOutput;
00054 
00055 
00056         Sampler* myVFO ;
00057         Envelope3* myEnvelope ;
00058         BiQuad* myRez;
00059         Envelope3 * myEnv2;
00060 
00062         SynthVoice(Synth * S, bool defaultSetup = true) ; 
00063         
00065         ~SynthVoice(); 
00066 
00068         void setMidiNote(int n) {playingNote = n;};
00069 
00071         int getMidiNote() {return playingNote;};
00072         
00075         void setMidiFreq(float f) {MidiFreq=f;} // Freq. f in Hz from keyboard  
00076         
00079         float getMidiFreq() {return MidiFreq;} // Freq. f in Hz from keyboard   
00080 
00083         void add(Module * m);
00084 
00086         void SynthVoice::newMidiEvent();
00087 
00090         SynthVoice * SynthVoice::sharedClone() ;
00091 
00092 private: // -------------------------------------------------------------
00093 
00094         float MidiFreq;
00095         ModuleMap voiceMap;     
00096 
00097 
00098 };
00099 
00100 }; // end of namespace: SynthCore
00101 
00102 #endif

Syntopia Project. Visit the web page, or the SourceForge page.
Docs made by Doxygen. Email: Mikael Christensen