VoiceleadingNode.hpp

Go to the documentation of this file.
00001 /*
00002  * C S O U N D   V S T
00003  *
00004  * A VST plugin version of Csound, with Python scripting.
00005  *
00006  * L I C E N S E
00007  *
00008  * This software is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * This software is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this software; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 #ifndef VOICELEADNODE_H
00023 #define VOICELEADNODE_H
00024 
00025 #include "Platform.hpp"
00026 #include "Voicelead.hpp"
00027 #ifdef SWIG
00028 %module CsoundAC
00029 %{
00030 #include "Node.hpp"
00031 #include "Score.hpp"
00032   %}
00033 #else
00034 #include "Node.hpp"
00035 #include "Score.hpp"
00036 #include "Voicelead.hpp"
00037 using namespace boost::numeric;
00038 #endif
00039 
00040 namespace csound
00041 {
00042   class VoiceleadingOperation 
00043   {
00044   public:
00045     VoiceleadingOperation();
00046     virtual ~VoiceleadingOperation();
00053     double beginTime;
00058     double rescaledBeginTime;
00062     double endTime;
00067     double rescaledEndTime;
00068     double P;
00072     double T;
00076     double C;
00080     double V;
00084     bool L;
00088     size_t begin;
00092     size_t end;
00093     bool avoidParallels;
00094   };
00095 
00096   std::ostream &operator << (std::ostream &stream, const VoiceleadingOperation &operation);
00097   
00124   class VoiceleadingNode :
00125     public Node
00126   {
00127   public:
00128     std::map<double, VoiceleadingOperation> operations;
00129     double base;
00130     double range;
00131     bool rescaleTimes;
00132     bool avoidParallels;
00133     size_t divisionsPerOctave;
00134     VoiceleadingNode();
00135     virtual ~VoiceleadingNode();
00139     virtual void apply(Score &score, const VoiceleadingOperation &priorOperation, const VoiceleadingOperation &currentOperation);
00140     virtual void produceOrTransform(Score &score, size_t beginAt, size_t endAt, const ublas::matrix<double> &coordinates);
00141     virtual void PT(double time, double P_, double T);
00142     virtual void PTV(double time, double P_, double T, double V_);
00143     virtual void PTL(double time, double P_, double T, bool avoidParallels = true);
00144     virtual void C(double time, double C_);
00145     virtual void C(double time, std::string C_);
00146     virtual void CV(double time, double C_, double V_);
00147     virtual void CV(double time, std::string C_, double V_);
00148     virtual void CL(double time, double C_, bool avoidParallels = true);
00149     virtual void CL(double time, std::string C_, bool avoidParallels = true);
00150     virtual void V(double time, double V_);
00151     virtual void L(double time, bool avoidParallels = true);
00155     virtual void transform(Score &score, bool rescaleTime = false);
00156   };
00157 }
00158 #endif
00159 

Generated on Sun Nov 9 00:04:52 2008 for Csound and CsoundAC by  doxygen 1.5.6