In this chapter, you learn how to use the micro:bit music library to build and play simple tunes. The music library allows you to build music by combining music notes, octaves, beats (duration), accidentals (flats and sharps), and so forth. You can also use built-in melodies in your applications.
By default, the music module expects the speaker to be connected through micro:bit’s pin 0. However, you can use any analog pin to connect the speaker (or multiple speakers) by defining the output pin to override the default pin 0.