Skip to main content

Class Song

A class for playing a sequence of musical notes

Assembly: MicroAudio.dll
View Source
public class Song

Fields

Notes

The collection of notes in order for the song

View Source
public readonly List<Note> Notes

Methods

AddNote(Note)

Adds a musical note to the sequence of notes to be played

View Source
public void AddNote(Note note)
Parameters
TypeNameDescription
Meadow.Foundation.Audio.NotenoteThe musical note to add

Play(IToneGenerator, int)

Plays the sequence of musical notes, with the specified tempo

View Source
public Task Play(IToneGenerator speaker, int tempo = 120)
Returns

System.Threading.Tasks.Task: A Task representing the asynchronous playback operation

Parameters
TypeNameDescription
Meadow.Peripherals.Speakers.IToneGeneratorspeakerThe IToneGenerator object to play the song
System.Int32tempoThe tempo of the music, in beats per minute