// ----
// ---- file   : SynthVoice.h
// ---- author : Bastian Spiegel <bs@tkscript.de>
// ---- legal  : (c) 2011 by Bastian Spiegel. 
// ----          Distributed under terms of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL). See 
// ----          http://www.gnu.org/licenses/licenses.html#LGPL or COPYING for further information.
// ----
// ---- info   : This is part of the "syntracker" midi sequencer.
// ----
// ---- created: 06Apr2011
// ----          
// ---- changed: 
// ----          
// ----
// ----

#ifndef __SYNTHVOICE_H__
#define __SYNTHVOICE_H__


class CustomSynth;


class SynthVoice {
  public:
   CustomSynth *synth;

  public:
   sBool b_active;

   sF32 base_note;    // in normalized note-space (0 .. 127.0).
   sF32 freq;         // frequency modulation (also in normalized note-space)
   sF32 volume;       // 0..1
   sF32 alt_volume;   // 0..1
   sF32 panning;      // -1..1
   sF32 pulse_width;  // 0..1 (length of duty cycle)
   sF32 brilliance;   // 0..1 (0=sine, 1=pulse)

   sF32 phase; // 0..1


  public:
   SynthVoice(void);
   ~SynthVoice();

   void init(CustomSynth *_synth);

   void reset(void);

   void render(sF32 *_d, sUI _numFrames);

};


#endif // __SYNTHVOICE_H__
