C# Class GSF.Media.Music.Song

Allows creation of a synthesized musical score storing the resultant song in an in-memory wave file for play back or saving music to disk.
Inheritance: WaveFile
Mostrar archivo Open project: GridProtectionAlliance/gsf

Public Methods

Method Description
AddNotes ( ) : void

Add a series of notes to the song.

AddPhrase ( GSF.Media.Music.Phrase phrase ) : void

Add a predefined phrase of notes to the song.

AddRest ( NoteValue restLength ) : void

Add a rest for the given length for the current beat.

AddRest ( NoteValue restLength, int dots ) : void

Add a rest for the given length for the current beat.

AddRest ( NoteValueBritish restLength ) : void

Add a rest for the given length for the current beat.

AddRest ( NoteValueBritish restLength, int dots ) : void

Add a rest for the given length for the current beat.

AddRest ( double restLength ) : void

Add a rest for the given length for the current beat.

Finish ( ) : void

Called when there are no more notes to add.

This flushes the remaining queued notes into the song allowing them to run their remaining time.

SetCrescendoDynamic ( int totalBeats, Dynamic endDynamic ) : void

Starts crescendo dynamic over the range of the specified number of beats.

Current Dynamic is the starting dynamic which should be less than endDynamic.

SetDiminuendoDynamic ( int totalBeats, Dynamic endDynamic ) : void

Starts diminuendo dynamic over the range of the specified number of beats.

Current Dynamic is the starting dynamic which should be greater than endDynamic.

Song ( ) : System

Creates a new song with a 3/4 measure size, a tempo of 240 quarter-notes per minute, mezzo-forte prevailing dynamic level, using a basic note timbre and standard CD-quality settings for the underlying sound file.

Song ( SampleRate sampleRate, BitsPerSample bitsPerSample, DataChannels channels ) : System

Creates a new song with a 3/4 measure size, a tempo of 240 quarter-notes per minute, mezzo-forte prevailing dynamic level, using a basic note timbre and the specified audio format settings.

Private Methods

Method Description
AddQueuedNotesToSong ( long samplePeriod ) : void

Method Details

AddNotes() public method

Add a series of notes to the song.
public AddNotes ( ) : void
return void

AddPhrase() public method

Add a predefined phrase of notes to the song.
public AddPhrase ( GSF.Media.Music.Phrase phrase ) : void
phrase GSF.Media.Music.Phrase Phrase to add.
return void

AddRest() public method

Add a rest for the given length for the current beat.
public AddRest ( NoteValue restLength ) : void
restLength NoteValue Duration of wait specified as a note value.
return void

AddRest() public method

Add a rest for the given length for the current beat.
public AddRest ( NoteValue restLength, int dots ) : void
restLength NoteValue Duration of wait specified as a note value.
dots int Total dotted note length extensions to apply.
return void

AddRest() public method

Add a rest for the given length for the current beat.
public AddRest ( NoteValueBritish restLength ) : void
restLength NoteValueBritish Duration of wait specified as a note value.
return void

AddRest() public method

Add a rest for the given length for the current beat.
public AddRest ( NoteValueBritish restLength, int dots ) : void
restLength NoteValueBritish Duration of wait specified as a note value.
dots int Total dotted note length extensions to apply.
return void

AddRest() public method

Add a rest for the given length for the current beat.
public AddRest ( double restLength ) : void
restLength double Duration of wait specified as a note value.
return void

Finish() public method

Called when there are no more notes to add.
This flushes the remaining queued notes into the song allowing them to run their remaining time.
public Finish ( ) : void
return void

SetCrescendoDynamic() public method

Starts crescendo dynamic over the range of the specified number of beats.
Current Dynamic is the starting dynamic which should be less than endDynamic.
public SetCrescendoDynamic ( int totalBeats, Dynamic endDynamic ) : void
totalBeats int Total number of beats overwhich to gradually increase volume.
endDynamic Dynamic Desired volume when crescendo is complete.
return void

SetDiminuendoDynamic() public method

Starts diminuendo dynamic over the range of the specified number of beats.
Current Dynamic is the starting dynamic which should be greater than endDynamic.
public SetDiminuendoDynamic ( int totalBeats, Dynamic endDynamic ) : void
totalBeats int Total number of beats overwhich to gradually decrease volume.
endDynamic Dynamic Desired volume when diminuendo is complete.
return void

Song() public method

Creates a new song with a 3/4 measure size, a tempo of 240 quarter-notes per minute, mezzo-forte prevailing dynamic level, using a basic note timbre and standard CD-quality settings for the underlying sound file.
public Song ( ) : System
return System

Song() public method

Creates a new song with a 3/4 measure size, a tempo of 240 quarter-notes per minute, mezzo-forte prevailing dynamic level, using a basic note timbre and the specified audio format settings.
public Song ( SampleRate sampleRate, BitsPerSample bitsPerSample, DataChannels channels ) : System
sampleRate SampleRate Desired sample rate
bitsPerSample BitsPerSample Desired bits-per-sample
channels DataChannels Desired data channels
return System