Play Tone

Play a musical tone through pin P0 of the Calliope mini for as long as you say.

Simulator

This function only works on the Calliope mini and in some browsers.

music.playTone(440, 120)

Parameters

Example

This example stores the musical note C in the variable freq. Next, it plays that note for 1000 milliseconds (one second).

let freq = music.noteFrequency(Note.C)
music.playTone(freq, 1000)

See also

rest, ring tone , tempo, set tempo, change tempo by

Edit this page on GitHub