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
Afficher le fichier Open project: GridProtectionAlliance/gsf

Méthodes publiques

Méthode 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

Méthode Description
AddQueuedNotesToSong ( long samplePeriod ) : void

Method Details

AddNotes() public méthode

Add a series of notes to the song.
public AddNotes ( ) : void
Résultat void

AddPhrase() public méthode

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.
Résultat void

AddRest() public méthode

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.
Résultat void

AddRest() public méthode

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.
Résultat void

AddRest() public méthode

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.
Résultat void

AddRest() public méthode

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.
Résultat void

AddRest() public méthode

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.
Résultat void

Finish() public méthode

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
Résultat void

SetCrescendoDynamic() public méthode

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.
Résultat void

SetDiminuendoDynamic() public méthode

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.
Résultat void

Song() public méthode

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
Résultat System

Song() public méthode

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
Résultat System