#include <AiffFile.h>
Public Types | |
| typedef std::vector< double > | samples_type |
| The type of the sample storage in an AiffFile. | |
| typedef samples_type::size_type | size_type |
| The type of all size parameters for AiffFile. | |
| typedef std::vector< Marker > | markers_type |
| The type of AIFF marker storage in an AiffFile. | |
Public Member Functions | |
| AiffFile (const std::string &filename) | |
| template<typename Iter > | |
| AiffFile (Iter begin_partials, Iter end_partials, double samplerate, double fadeTime=.001) | |
| AiffFile (double samplerate, size_type numFrames=0, unsigned int numChannels=1) | |
| AiffFile (const double *buffer, size_type bufferlength, double samplerate) | |
| AiffFile (const double *buffer_left, const double *buffer_right, size_type bufferlength, double samplerate) | |
| AiffFile (const std::vector< double > &vec, double samplerate) | |
| AiffFile (const std::vector< double > &vec_left, const std::vector< double > &vec_right, double samplerate) | |
| AiffFile (const AiffFile &other) | |
| AiffFile & | operator= (const AiffFile &rhs) |
| markers_type & | markers (void) |
| const markers_type & | markers (void) const |
| double | midiNoteNumber (void) const |
| unsigned int | numChannels (void) const |
| size_type | numFrames (void) const |
| size_type | sampleFrames (void) const |
| double | sampleRate (void) const |
| samples_type & | samples (void) |
| const samples_type & | samples (void) const |
| void | addPartial (const Loris::Partial &p, double fadeTime=.001) |
| template<typename Iter > | |
| void | addPartials (Iter begin_partials, Iter end_partials, double fadeTime=.001) |
| void | setMidiNoteNumber (double nn) |
| void | write (const std::string &filename, unsigned int bps=16) |
| Loris::AiffFile::AiffFile | ( | const std::string & | filename | ) | [explicit] |
Initialize an instance of AiffFile by importing sample data from the file having the specified filename or path.
| filename | is the name or path of an AIFF samples file |
| Loris::AiffFile::AiffFile | ( | Iter | begin_partials, | |
| Iter | end_partials, | |||
| double | samplerate, | |||
| double | fadeTime = .001 | |||
| ) | [inline] |
Initialize an instance of AiffFile with samples rendered from a sequnence of Partials. The Partials in the specified half-open (STL-style) range are rendered at the specified sample rate, using the (optionally) specified Partial fade time (see Synthesizer.h for an examplanation of fade time).
| begin_partials | is the beginning of a sequence of Partials | |
| end_partials | is (one-past) the end of a sequence of Partials | |
| samplerate | is the rate at which Partials are rendered | |
| fadeTime | is the Partial fade time for rendering the Partials on the specified range. If unspecified, the default fade time is 1 ms. |
Initialize an instance of AiffFile with samples rendered from a sequnence of Partials. The Partials in the specified half-open (STL-style) range are rendered at the specified sample rate, using the (optionally) specified Partial fade time (see Synthesizer.h for an examplanation of fade time).
| begin_partials | is the beginning of a sequence of Partials | |
| end_partials | is (one-past) the end of a sequence of Partials | |
| samplerate | is the rate at which Partials are rendered | |
| fadeTime | is the Partial fade time for rendering the Partials on the specified range. If unspecified, the default fade time is 1 ms. |
| Loris::AiffFile::AiffFile | ( | double | samplerate, | |
| size_type | numFrames = 0, |
|||
| unsigned int | numChannels = 1 | |||
| ) |
Initialize an instance of AiffFile having the specified sample rate, preallocating numFrames samples, initialized to zero.
| samplerate | is the rate at which Partials are rendered | |
| numFrames | is the initial number of (zero) samples. If unspecified, no samples are preallocated. | |
| numChannels | is the number of channels of audio data to preallocate (default 1 channel) |
| Loris::AiffFile::AiffFile | ( | const double * | buffer, | |
| size_type | bufferlength, | |||
| double | samplerate | |||
| ) |
Initialize an instance of AiffFile from a buffer of sample data, with the specified sample rate.
| buffer | is a pointer to a buffer of floating point samples. | |
| bufferlength | is the number of samples in the buffer. | |
| samplerate | is the sample rate of the samples in the buffer. |
| Loris::AiffFile::AiffFile | ( | const double * | buffer_left, | |
| const double * | buffer_right, | |||
| size_type | bufferlength, | |||
| double | samplerate | |||
| ) |
Initialize an instance of AiffFile from two buffers of sample data, with the specified sample rate. Both buffers must store the same number (bufferLength) of samples.
| buffer_left | is a pointer to a buffer of floating point samples representing the left channel samples. | |
| buffer_right | is a pointer to a buffer of floating point samples representing the right channel samples. | |
| bufferlength | is the number of samples in the buffer. | |
| samplerate | is the sample rate of the samples in the buffer. |
| Loris::AiffFile::AiffFile | ( | const std::vector< double > & | vec, | |
| double | samplerate | |||
| ) |
Initialize an instance of AiffFile from a vector of sample data, with the specified sample rate.
| vec | is a vector of floating point samples. | |
| samplerate | is the sample rate of the samples in the vector. |
| Loris::AiffFile::AiffFile | ( | const std::vector< double > & | vec_left, | |
| const std::vector< double > & | vec_right, | |||
| double | samplerate | |||
| ) |
Initialize an instance of AiffFile from two vectors of sample data, with the specified sample rate. If the two vectors have different lengths, the shorter one is padded with zeros.
| vec_left | is a vector of floating point samples representing the left channel samples. | |
| vec_right | is a vector of floating point samples representing the right channel samples. | |
| samplerate | is the sample rate of the samples in the vectors. |
| Loris::AiffFile::AiffFile | ( | const AiffFile & | other | ) |
| void Loris::AiffFile::addPartial | ( | const Loris::Partial & | p, | |
| double | fadeTime = .001 | |||
| ) |
| void Loris::AiffFile::addPartials | ( | Iter | begin_partials, | |
| Iter | end_partials, | |||
| double | fadeTime = .001 | |||
| ) | [inline] |
Accumulate samples rendered from a sequence of Partials. The Partials in the specified half-open (STL-style) range are rendered at this AiffFile's sample rate, using the (optionally) specified Partial fade time (see Synthesizer.h for an examplanation of fade time).
| begin_partials | is the beginning of a sequence of Partials | |
| end_partials | is (one-past) the end of a sequence of Partials | |
| fadeTime | is the Partial fade time for rendering the Partials on the specified range. If unspecified, the default fade time is 1 ms. |
Accumulate samples rendered from a sequence of Partials. The Partials in the specified half-open (STL-style) range are rendered at this AiffFile's sample rate, using the (optionally) specified Partial fade time (see Synthesizer.h for an examplanation of fade time).
| begin_partials | is the beginning of a sequence of Partials | |
| end_partials | is (one-past) the end of a sequence of Partials | |
| fadeTime | is the Partial fade time for rendering the Partials on the specified range. If unspecified, the default fade time is 1 ms. |
| const markers_type& Loris::AiffFile::markers | ( | void | ) | const |
| markers_type& Loris::AiffFile::markers | ( | void | ) |
| double Loris::AiffFile::midiNoteNumber | ( | void | ) | const |
Return the fractional MIDI note number assigned to this AiffFile. If the sound has no definable pitch, note number 60.0 is used.
| unsigned int Loris::AiffFile::numChannels | ( | void | ) | const |
Return the number of channels of audio samples represented by this AiffFile, 1 for mono, 2 for stereo.
| size_type Loris::AiffFile::numFrames | ( | void | ) | const |
Return the number of sample frames represented in this AiffFile. A sample frame contains one sample per channel for a single sample interval (e.g. mono and stereo samples files having a sample rate of 44100 Hz both have 44100 sample frames per second of audio samples).
| size_type Loris::AiffFile::sampleFrames | ( | void | ) | const [inline] |
Bad old legacy name for numFrames.
| double Loris::AiffFile::sampleRate | ( | void | ) | const |
Return the sampling freqency in Hz for the sample data in this AiffFile.
| const samples_type& Loris::AiffFile::samples | ( | void | ) | const |
Return a const reference (or const reference) to the vector containing the floating-point sample data for this AiffFile.
| samples_type& Loris::AiffFile::samples | ( | void | ) |
Return a reference (or const reference) to the vector containing the floating-point sample data for this AiffFile.
| void Loris::AiffFile::setMidiNoteNumber | ( | double | nn | ) |
Set the fractional MIDI note number assigned to this AiffFile. If the sound has no definable pitch, use note number 60.0 (the default).
| nn | is a fractional MIDI note number, 60 is middle C. |
| void Loris::AiffFile::write | ( | const std::string & | filename, | |
| unsigned int | bps = 16 | |||
| ) |
Export the sample data represented by this AiffFile to the file having the specified filename or path. Export signed integer samples of the specified size, in bits (8, 16, 24, or 32).
| filename | is the name or path of the AIFF samples file to be created or overwritten. | |
| bps | is the number of bits per sample to store in the samples file (8, 16, 24, or 32).If unspeicified, 16 bits |
1.5.7