Class: Song

Song

An object that generates entire songs.

See the overview on the documentation homepage.

Constructor

new Song(options)

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
sections Array.<Section> | Array.<Object>

the Song's sections as either an Array of Section objects, or an Array of options objects for the Section constructor

bpm Number <optional>
120

the tempo of the song in beats per minute (a beat is the unit of time)

scale Scale <optional>

default section scale, optional if every Section defines its scale

sectionLength Number <optional>

default section length, optional if every Section defines its own length

Implements:
Source:

Methods

@@iterator()

The [Symbol.iterator]() generator function* that implements the iterable protocol

Source:
See:

toJSON() → {Object}

Serialize the Song into a JSON object

Source:
See:
To Do:
  • document the format, example output
Returns:

JSON object representation (a "plain" JavaScript object containing only Numbers, Strings, Arrays, and nested Objects)

Type
Object