/usr/include/csound/VoiceleadingNode.hpp is in libcsoundac-dev 1:6.10.0~dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | /*
* C S O U N D
*
* L I C E N S E
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef VOICELEADNODE_H
#define VOICELEADNODE_H
#include "Platform.hpp"
#include "Voicelead.hpp"
#ifdef SWIG
%module CsoundAC
%{
#include "Node.hpp"
#include "Score.hpp"
%}
#else
#include "Node.hpp"
#include "Score.hpp"
#include "Voicelead.hpp"
#endif
namespace csound
{
/**
* Utility class for storing voice-leading operations
* within a VoiceleadNode for future application.
*/
class SILENCE_PUBLIC VoiceleadingOperation
{
public:
VoiceleadingOperation();
virtual ~VoiceleadingOperation();
/**
* The operation begins at this time,
* and continues until just before the beginning
* of the next operation, or the end of the score,
* whichever comes first.
*/
double beginTime;
/**
* Times may need to be rescaled to
* match the duration of the score.
*/
double rescaledBeginTime;
/**
* The operation ends before this time.
*/
double endTime;
/**
* Times may need to be rescaled
* to match the duration of the score.
*/
double rescaledEndTime;
/**
* Prime chord, or DBL_MAX if no operation.
*/
double P_;
/**
* Transposition, or DBL_MAX if no operation.
*/
double T_;
/**
* Pitch-set class, or DBL_MAX if no operation.
*/
double C_;
/**
* Inversion by interchange.
*/
double K_;
/**
* Contextual transposition.
*/
double Q_;
/**
* Voicing, or DBL_MAX if no operation.
*/
double V_;
/**
* If true, perform the closest voice-leading from the prior operation.
*/
bool L_;
/**
* The index of the first event to which the operation is applied.
*/
size_t begin;
/**
* One past the index of the last event to which the operation is applied.
*/
size_t end;
bool avoidParallels;
};
std::ostream SILENCE_PUBLIC &operator << (std::ostream &stream, const VoiceleadingOperation &operation);
/**
* This node class imposes
* a sequence of one or more
* "voice-leading" operations upon
* the pitches of notes produced by children of this node,
* within a segment of the notes.
* These operations comprise:
* prime chord (P),
* transpose (T),
* unordered pitch-class set (C, equivalent to PT),
* contextual inversion (K),
* contextual transposition (Q),
* voicing (V) within a specified range of pitches,
* and voice-lead (L).
* The values of P, T, C, and V
* each form an additive cyclic group
* whose elements are defined
* by counting through all possible values in order.
* Note that C is not the same as "pitch-class set number"
* in the sense of M = sum over pitch-classes of (2 ^ pitch-class);
* it is rather one less than M.
* Not all combinations of operations are consistent.
* P requires T.
* PT cannot be used with C.
* V cannot be used with L.
* If neither PT nor C is specified, the existing C of the notes is used.
* K and Q require a previous section, and cannot be used with P, T, or C.
* The consistent combinations of operations are thus:
* PT, PTV, PTL, C, CV, CL, K, KV, KL, Q, QV, QL, V, and L.
*/
class SILENCE_PUBLIC VoiceleadingNode :
public Node
{
public:
/**
* Voice-leading operations stored in order
* of starting time.
*/
std::map<double, VoiceleadingOperation> operations;
/**
* The lowest pitch of the range of voicings,
* as a MIDI key number (default = 36).
*/
double base;
/**
* The range of voicings, from the lowest to the highest
* pitch, as a MIDI key number (default = 60).
*/
double range;
/**
* Context for the K and Q operations; must have the
* same cardinality as the pitch-classes in use.
*/
std::vector<double> modality;
/**
* If true (the default), rescale times of voice-leading operations
* in proportion to the duration of the notes produced
* by this and its child nodes.
*/
bool rescaleTimes;
/**
* If true (the default), voice-leadings will avoid
* parallel fifths.
*/
bool avoidParallels;
/**
* The number of equally tempered divisions of the octave (default = 12).
* Note that the octave is always size 12. The size of a division of the
* octave is then 1 in 12-tone equal temperament, 0.5 in 24-tone
* equal temperament, 1.33333 in 9-tone equal temperament, and so on.
*/
size_t divisionsPerOctave;
VoiceleadingNode();
virtual ~VoiceleadingNode();
/**
* Apply the current voice-leading operation to the score, within the specified range of notes.
* If voice-leading proper is to be performed, the prior voice-leading operation is used to determine
* how to lead the voices.
*/
virtual void apply(Score &score, const VoiceleadingOperation &priorOperation, const VoiceleadingOperation ¤tOperation);
/**
* Applies all of the stored voice-leading operations
* to the specified range of notes in the score.
* if rescaleTimes is true, the times of the operations
* will be rescaled to fit the times in the range of notes.
*/
virtual void produceOrTransform(Score &collectingNode,
size_t beginAt,
size_t endAt,
const Eigen::MatrixXd &coordinates);
/**
* Beginning at the specified time and continuing
* to the beginning of the next operation
* or the end of the score, whichever comes first,
* conform notes produced by this node or its children
* to the specified prime chord and transposition.
* Note that PT specifies what musicians normally call a chord,
* e.g. "E flat major ninth." However, chords do not have to be
* in twelve tone equal temperament.
*/
void PT(double time, double P_, double T);
/**
* Beginning at the specified time and continuing
* to the beginning of the next operation
* or the end of the score, whichever comes first,
* conform notes produced by this node or its children
* to the specified prime chord, transposition, and voicing.
* Note that PTV specifies what musicians normally call
* the voicing, or inversion, of a chord.
*/
void PTV(double time, double P_, double T, double V_);
/**
* Beginning at the specified time and continuing
* to the beginning of the next operation
* or the end of the score, whichever comes first,
* conform notes produced by this node or its children
* to the specified chord; the voicing of the chord will be
* the smoothest voice-leading from the pitches of the previous chord.
* Optionally, parallel fifths can be avoided.
* Note that PTL specifies what musicians normally call
* the voice-leading of a chord.
*/
void PTL(double time, double P_, double T, bool avoidParallels = true);
/**
* Beginning at the specified time and continuing
* to the beginning of the next operation
* or the end of the score, whichever comes first,
* conform notes produced by this node or its children
* to the specified prime chord and transposition.
* Note that C (equivalent to PT) specifies what musicians normally
* call a chord.
*/
void C(double time, double C_);
/**
* Same as PT, except that a single number
* is used in place of the P and T numbers.
*/
void C(double time, std::string C_);
/**
* Same as C, except the chord can be specified by
* jazz-type name (e.g. EbM7) instead of C number.
*/
void CV(double time, double C_, double V_);
/**
* Same as PTV, except the chord is specified by
* a single number instead of the P and T numbers.
*/
void CV(double time, std::string C_, double V_);
/**
* Same as CV, except the chord is specified by
* jazz-type name (e.g. EbM7) instead of C number.
*/
void CL(double time, double C_, bool avoidParallels = true);
/**
* Same as PTL, except the chord is specified by
* a single number instead of P and T numbers.
*/
void CL(double time, std::string C_, bool avoidParallels = true);
/**
* Find the C of the previous segment, and contextually invert it; apply
* the resulting C to the current segment. Contextual inversion is
* that inversion of C in which the first two pitch-classes are exchanged.
*/
void K(double time);
/**
* Find the C of the previous segment, and contextually invert it; apply
* the resulting C to the current segment with voicing V. Contextual
* inversion is that inversion of C in which the first two pitch-classes
* are exchanged.
*/
void KV(double time, double V_);
/**
* Find the C of the previous segment, and contextually invert it; apply
* the resulting C to the current segment, using the closest voiceleading
* from the pitches of the previous segment.
* Contextual inversion is that inversion of C in which the first two
* pitch-classes are exchanged.
*/
void KL(double time, bool avoidParallels = true);
/**
* Find the C of the previous segment, and contextually transpose it;
* apply the resulting C to the current segment. Contextual transposition
* transposes C up by Q if C is an I-form, and down by Q if C is a T-form.
*/
void Q(double time, double Q_);
/**
* Find the C of the previous segment, and contextually transpose it;
* apply the resulting C to the current segment with voicing V.
* Contextual transposition transposes C up by Q if C is an I-form,
* and down by Q if C is a T-form.
*/
void QV(double time, double Q_, double V_);
/**
* Find the C of the previous segment, and contextually transpose it;
* apply the resulting C to the current segment, using the closest
* voiceleading from the pitches of the previous segment.
* Contextual transposition transposes C up by Q if C is an I-form,
* and down by Q if C is a T-form.
*/
void QL(double time, double Q_, bool avoidParallels = true);
/**
* Beginning at the specified time and continuing
* to the beginning of the next operation
* or the end of the score, whichever comes first,
* conform notes produced by this node or its children
* to the specified voicing of the chord.
* Note that V specifies what musicians normally call
* the voicing or inversion of the chord.
*/
void V(double time, double V_);
/**
* Beginning at the specified time and continuing
* to the beginning of the next operation
* or the end of the score, whichever comes first,
* conform notes produced by this node or its children
* to the smoothest voice-leading from the pitches
* of the previous segment.
* Optionally, parallel fifths can be avoided.
* Note that L specifies what musicians normally call
* voice-leading.
*/
void L(double time, bool avoidParallels = true);
/**
* Apply all of the voice-leading operations stored within this
* node to the score. Enables voice-leading operations to be used
* outside the context of a music graph.
*/
virtual void transform(Score &score, bool rescaleTime = false);
virtual void setModality(const std::vector<double> &pcs);
virtual std::vector<double> getModality() const;
};
}
#endif
|