WLJS LogoWLJS Notebook

MusicKeySignature

MusicKeySignature[scale]
MusicKeySignature[fifths]
MusicKeySignature[alterationRules]
MusicKeySignature[properties]

represents the pitch alterations belonging to a musical key.

Create a key signature from a scale:

MusicKeySignature[MusicScale["E Minor"]]

Use the number of fifths away from C major:

MusicKeySignature[4]

Or provide custom accidental rules:

MusicKeySignature[{"F" -> 1, "B" -> -1}]

The available properties are "Fifths" and "AlterationRules".

MusicKeySignature["G"]["PropertyAssociation"]

Key signatures can be attached to MusicMeasure, MusicVoice and MusicScore through their "KeySignature" property.

See the Wolfram Language reference for the complete symbolic API.