playable

The playable data object provides a common format to play tones, melodies, and songs. Each of these music sources are created in different ways but are transformed into playable objects so that a single playback method is used to play them.

Music sources for playable objects

The blocks used to create playable music soucres are the following:

Tone

A tone is a musical note, or a sound frequency, and a duration. The duration is often set as the length of a beat.

Middle C1beattonefor

Melody

Melodies are a series of notes and a tempo to play them at.

120melodyat tempo(bpm)

Built-in sound

A built-in sound is a simple melody already composed for you. There are several you can choose from.

soundba ding

Song

Songs are complex music sources which have many notes from different instruments. Songs are made in the Song Editor.

song

Play the music

In your programs, you can simply use the play blocks for each playable object. Like this one for tone:

Middle C1beattoneforplayuntil done

Or, this one for song:

songplayuntil done

Example

Put 4 different playable music sources in an array. Play one after the other.

Middle C1beattonefor120melodyat tempo(bpm)soundba dingsongarray ofplayablessomeMusicsomeMusic500pausemsplayuntil donefor elementofdosetplayablestoon start

See also

play, tone playable, string playable, melody playable, create song