ChoonMLLib - class library to access and convert ChoonML files

Choon Members

Choon overview

Public Instance Constructors

Choon Constructor Construct a Choon instance. This sets the filename but does not read or check the file.

Public Instance Properties

BPM Access the "choon.bpm" attribute. This is the tempo in beats per minute.
Copyright Access the "choon/copyright" element. This is the copyright statement and should be displayed when a user converts/uses a file.
Description Access the "choon/description" element. This is a text description of the file.
ExtFileMode If the ExtFileMode property is true, the ChoonML file is "detached" - all the samples are in separate "WAV" files. Otherwise, samples are included inline. This is controlled by the converter.
Length Access the "choon.length" attribute. This is the length of the mix in the units specified in Unit.
Name Access "choon.name" attribute (required) - this is the name of the mix.
Parts Access the collection of Part elements as a PartCollection This allows the contents of "choon.parts" (the instrumental parts or mixer channels) to be processed
Ref Access the "choon.ref" attribute. This specifies that the mix is based on another file and matches the "choon.name" attribute in the base file.
Samples Access the collection of Sample elements as a SampleCollection This allows the samples to be processed.
Sections Access the collection of Section elements as a SectionCollection This allows the contents of "choon.sections" (the sections of the mix) to be processed.
TimeSig Access the "choon.timesig" attribute. This is the time signature - e.g. 4/4
Unit Access the "choon.unit" attribute. This is the unit used throughout the file for position and length information.

Public Instance Methods

End End the write process. This writes the SFT for the final time and closes the output file. This must be called after all samples have been written.
Equals (inherited from Object) Determines whether the specified Object is equal to the current Object.
Extract This extracts the specified sample to the named file. This is used when converting to a format that uses separate WAV files. If the choonML file is "detached", the existing WAV file is copied (if a new folder or name is specified) or left in place. If inline, the WAV data is extracted into the named file.
GetHashCode (inherited from Object) Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetType (inherited from Object) Gets the Type of the current instance.
Import This imports the specifed sample from a WAV file to either binary data or another file. This is used when converting from a format that uses separate WAV files. If the choonML file is "detached", the existing WAV file is copied (if a new folder or name is specified) or left in place. If inline, the WAV data is read from the file and output
Load Load choonML metadata from the path specified in the constructor This also loads the SFT (if ExtFileMode is true) but does not load any actual samples as the converter app should best be able to manage when sample data is needed.
SaveMeta This saves choonML metadata to the file specified in the constructor. It should be called when all data has been read from the source and is "complete", including sample metadata (but usually not the actual samples). This does not write the SFT - this should be done after this to write a "placeholder" SFT
ToString (inherited from Object) Returns a String that represents the current Object.
WriteSample Write a sample out. If writing a detached file (ExtFileMode=true) this writes the sample as an external file named "sample.ExtFileName". If inline, this stores binary data. Note that this needs to be called *after* both SaveMeta and WriteSFT (first time)
WriteSFT Write the Sample File Table out. This is only relevant for an inline file. With a detached file, this can be called but does nothing. The first time this is called (on a Choon instance) this writes a placeholder SFT (with the correct number of samples) and marks the position. Subsequent calls write current SFT data at this position. A typical converter calls this once after saving Meta and then calls End to finish up.

Protected Instance Methods

Finalize (inherited from Object) Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) Creates a shallow copy of the current Object.

See Also

Choon Class | ChoonML Namespace