Loris::SpcFile Class Reference

#include <SpcFile.h>

List of all members.

Public Types

typedef std::vector< Markermarkers_type
typedef std::vector< Partialpartials_type

Public Member Functions

 SpcFile (const std::string &filename)
template<typename Iter >
 SpcFile (Iter begin_partials, Iter end_partials, double midiNoteNum=60)
 SpcFile (double midiNoteNum=60)
markers_typemarkers (void)
 Return a reference to the MarkerContainer (see Marker.h) for this SpcFile.
const markers_typemarkers (void) const
 Return a reference to the MarkerContainer (see Marker.h) for this SpcFile.
double midiNoteNumber (void) const
const partials_typepartials (void) const
double sampleRate (void) const
void addPartial (const Loris::Partial &p)
void addPartial (const Loris::Partial &p, int label)
template<typename Iter >
void addPartials (Iter begin_partials, Iter end_partials)
void setMidiNoteNumber (double nn)
void setSampleRate (double rate)
void write (const std::string &filename, double endApproachTime=0)
void writeSinusoidal (const std::string &filename, double endApproachTime=0)
void write (const std::string &filename, bool enhanced, double endApproachTime=0)

Detailed Description

Class SpcFile represents a collection of reassigned bandwidth-enhanced Partial data in a SPC-format envelope stream data file, used by the real-time bandwidth-enhanced additive synthesizer implemented on the Symbolic Sound Kyma Sound Design Workstation. Class SpcFile manages file I/O and conversion between Partials and envelope parameter streams.


Member Typedef Documentation

typedef std::vector< Marker > Loris::SpcFile::markers_type

the type of the container of Markers stored with an SpcFile

typedef std::vector< Partial > Loris::SpcFile::partials_type

the type of the container of Partials stored with an SpcFile


Constructor & Destructor Documentation

Loris::SpcFile::SpcFile ( const std::string &  filename  )  [explicit]

Initialize an instance of SpcFile by importing envelope parameter streams from the file having the specified filename or path.

Parameters:
filename the name of the file to import
template<typename Iter >
Loris::SpcFile::SpcFile ( Iter  begin_partials,
Iter  end_partials,
double  midiNoteNum = 60 
) [inline]

Initialize an instance of SpcFile with copies of the Partials on the specified half-open (STL-style) range.

If compiled with NO_TEMPLATE_MEMBERS defined, this member accepts only PartialList::const_iterator arguments.

Parameters:
begin_partials the beginning of a range of Partials to prepare for Spc export
end_partials the end of a range of Partials to prepare for Spc export
midiNoteNum the fractional MIDI note number, if specified (default is 60)
Loris::SpcFile::SpcFile ( double  midiNoteNum = 60  )  [explicit]

Initialize an instance of SpcFile having the specified fractional MIDI note number, and no Partials (or envelope parameter streams).

Parameters:
midiNoteNum the fractional MIDI note number, if specified (default is 60)

Member Function Documentation

void Loris::SpcFile::addPartial ( const Loris::Partial p,
int  label 
)

Add a Partial, assigning it the specified label (and position in the Spc data).

A SpcFile can contain only one Partial having any given (non-zero) label, so an added Partial will replace a Partial having the same label, if such a Partial exists.

This may throw an InvalidArgument exception if an attempt is made to add unlabeled Partials, or Partials labeled higher than the allowable maximum.

Parameters:
p the Partial to add to this SpcFile
label the label to associate with this Partial in the Spc file (the Partial's own label is ignored).
void Loris::SpcFile::addPartial ( const Loris::Partial p  ) 

Add the specified Partial to the enevelope parameter streams represented by this SpcFile.

A SpcFile can contain only one Partial having any given (non-zero) label, so an added Partial will replace a Partial having the same label, if such a Partial exists.

This may throw an InvalidArgument exception if an attempt is made to add unlabeled Partials, or Partials labeled higher than the allowable maximum.

Parameters:
p the Partial to add to this SpcFile
template<typename Iter >
void Loris::SpcFile::addPartials ( Iter  begin_partials,
Iter  end_partials 
) [inline]

Add all Partials on the specified half-open (STL-style) range to the enevelope parameter streams represented by this SpcFile.

A SpcFile can contain only one Partial having any given (non-zero) label, so an added Partial will replace a Partial having the same label, if such a Partial exists.

If compiled with NO_TEMPLATE_MEMBERS defined, this member accepts only PartialList::const_iterator arguments.

This may throw an InvalidArgument exception if an attempt is made to add unlabeled Partials, or Partials labeled higher than the allowable maximum.

Parameters:
begin_partials the beginning of a range of Partials to add to this Spc file
end_partials the end of a range of Partials to add to this Spc file
double Loris::SpcFile::midiNoteNumber ( void   )  const

Return the fractional MIDI note number assigned to this SpcFile. If the sound has no definable pitch, note number 60.0 is used.

const partials_type& Loris::SpcFile::partials ( void   )  const

Return a read-only (const) reference to the bandwidth-enhanced Partials represented by the envelope parameter streams in this SpcFile.

double Loris::SpcFile::sampleRate ( void   )  const

Return the sampling freqency in Hz for the spc data in this SpcFile. This is the rate at which Kyma must be running to ensure proper playback of bandwidth-enhanced Spc data.

void Loris::SpcFile::setMidiNoteNumber ( double  nn  ) 

Set the fractional MIDI note number assigned to this SpcFile. If the sound has no definable pitch, use note number 60.0 (the default).

void Loris::SpcFile::setSampleRate ( double  rate  ) 

Set the sampling freqency in Hz for the spc data in this SpcFile. This is the rate at which Kyma must be running to ensure proper playback of bandwidth-enhanced Spc data.

The default sample rate is 44100 Hz.

void Loris::SpcFile::write ( const std::string &  filename,
bool  enhanced,
double  endApproachTime = 0 
)

Export the envelope parameter streams represented by this SpcFile to the file having the specified filename or path. Export phase-correct bandwidth-enhanced envelope parameter streams if enhanced is true (the default), or pure sinsoidal streams otherwise.

A nonzero endApproachTime indicates that the Partials do not include a release or decay, but rather end in a static spectrum corresponding to the final Breakpoint values of the partials. The endApproachTime specifies how long before the end of the sound the amplitude, frequency, and bandwidth values are to be modified to make a gradual transition to the static spectrum.

If the endApproachTime is not specified, it is assumed to be zero, corresponding to Partials that decay or release normally.

Deprecated:
This version of write is deprecated, use the two-argument versions write and writeSinusoidal.
Parameters:
filename the name of the file to create
enhanced flag indicating whether to export enhanced (true) or sinusoidal (false) data
endApproachTime the duration in seconds of the gradual transition to a static spectrum at the end of the sound (default 0)
void Loris::SpcFile::write ( const std::string &  filename,
double  endApproachTime = 0 
)

Export the phase-correct bandwidth-enhanced envelope parameter streams represented by this SpcFile to the file having the specified filename or path.

A nonzero endApproachTime indicates that the Partials do not include a release or decay, but rather end in a static spectrum corresponding to the final Breakpoint values of the partials. The endApproachTime specifies how long before the end of the sound the amplitude, frequency, and bandwidth values are to be modified to make a gradual transition to the static spectrum.

If the endApproachTime is not specified, it is assumed to be zero, corresponding to Partials that decay or release normally.

Parameters:
filename the name of the file to create
endApproachTime the duration in seconds of the gradual transition to a static spectrum at the end of the sound (default 0)
void Loris::SpcFile::writeSinusoidal ( const std::string &  filename,
double  endApproachTime = 0 
)

Export the pure sinsoidal (omitting phase and bandwidth data) envelope parameter streams represented by this SpcFile to the file having the specified filename or path.

A nonzero endApproachTime indicates that the Partials do not include a release or decay, but rather end in a static spectrum corresponding to the final Breakpoint values of the partials. The endApproachTime specifies how long before the end of the sound the amplitude, frequency, and bandwidth values are to be modified to make a gradual transition to the static spectrum.

If the endApproachTime is not specified, it is assumed to be zero, corresponding to Partials that decay or release normally.

Parameters:
filename the name of the file to create
endApproachTime the duration in seconds of the gradual transition to a static spectrum at the end of the sound (default 0)

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2