Note

new Note(integer pos, boolean relative)

the MUSIQ.js Note object
Parameters:
Name Type Description
pos integer the midi position of the note
relative boolean a boolean, true if the note is relative (it doesn't have an octave). if relative is true, pos should not be larger than 12
Source:

Members

simple

get a simple notation for a note, i.e. C#
Source:

toRelative

convert the note to a relative note
Source:

Methods

<static> cofPosition(Note note) → integer

the Note's position on the circle of fifths
Parameters:
Name Type Description
note Note a Note object
Source:
Returns:
the position on the circle of fifths as an integer ( C = 0, G = 1, D = 2, ... F = -1 )
Type
integer

<static> distance(Note note1, Note note2) → integer

the distance (in semitones) to another note this is the number notation of the interval
Parameters:
Name Type Description
note1 Note The first note
note2 Note The second note
Source:
Returns:
The distance between the notes in semitones
Type
integer

<static> fromNotation(string notation)Note

get a new note object from a string notation
Parameters:
Name Type Description
notation string in the form C4, Bb6 etc where the number is the octave this should also match lowerCase notations
Source:
Returns:
a note object or null, when no note could be found
Type
Note

<static> fromPos(integer pos)Note

make a note object from a position
Parameters:
Name Type Description
pos integer the midi position of the note
Source:
Returns:
Type
Note

<static> interval(Note note1, Note note2)Interval

the interval between the notes
Parameters:
Name Type Description
note1 Note The first note
note2 Note The second note
Source:
Returns:
The interval between the notes
Type
Interval

<static> notation(Note note, integer signature) → string

get the proper notation for a note In the end, we use the unicode characters ♭ and ♯ to represent sharps and flats, instead of b or #
Parameters:
Name Type Description
note Note A Note object
signature integer the amount of sharps of flats (0 = no sharps / flats, 1 = 1 sharp, -1 = 1 flat, etc.)
Source:
Returns:
the notation used based on the
Type
string

<static> relativeDistance(Note note1, Note note2) → integer

returns the relative distance from note1 to note2 this is an integer from 0 - 11 representing the distance in semitones between the notes
Parameters:
Name Type Description
note1 Note The first note
note2 Note The second note
Source:
Returns:
The relative distance between the notes in semitones
Type
integer

<static> shortestDistance(Note note1, Note note2) → integer

Parameters:
Name Type Description
note1 Note The first note
note2 Note The second note
Source:
To Do:
  • - implement function
Returns:
the shortest distance from note1 to note2
Type
integer

<static> shortestRelativeDistance() → integer

Source:
To Do:
  • - implement function
Returns:
the shortest relative distance
Type
integer

<static> signature(Note note) → integer

The signature as an integer representing the amount of sharps or flats the scale has when using this note as root.
Parameters:
Name Type Description
note Note a Note object
Source:
Returns:
The signature as an integer representing the amount of sharps or flats the scale has when using this note as root.
Type
integer

<static> signatureIsFlat(boolean|integer signature) → boolean

checks if a signature is flat
Parameters:
Name Type Description
signature boolean | integer the signature ( if an integer, )
Source:
Returns:
True if the signature is flat (one or more b)
Type
boolean

<static> simpleNotation(Note note, integer signature) → string

get a simple notation for a note, i.e. C#
Parameters:
Name Type Description
note Note A note object
signature integer the amount of sharps of flats (0 = no sharps / flats, 1 = 1 sharp, -1 = 1 flat, etc.)
Source:
Returns:
Type
string

<static> transpose(Note note, Interval interval)

transpose a note with an interval
Parameters:
Name Type Description
note Note A note object
interval Interval An interval object
Source:

cofPosition() → integer

the Note's position on the circle of fifths
Source:
Returns:
the position on the circle of fifths as an integer ( C = 0, G = 1, D = 2, ... F = -1 )
Type
integer

distance(Note note) → integer

calculates the distance from this note to the specified note
Parameters:
Name Type Description
note Note the note to calculate the distance to
Source:
Returns:
the distance from this note to the note in semitones
Type
integer

frequency() → Number

returns the frequency (in Hz) of the note in equal temperament use this for sound generation possible optimization: lookup table
Source:
Returns:
the frequency of the note in Hz
Type
Number

hasName() → boolean

can this note have the following name? compensates for accidentals, i.e.
Source:
Returns:
true if the note can be described by this name
Type
boolean

interval(Interval interval)Note

transpose the note with an interval
Parameters:
Name Type Description
interval Interval An interval object
Source:
Returns:
Type
Note

notation(integer signature) → string

get the proper notation for a note In the end, we use the unicode characters ♭ and ♯ to represent sharps and flats, instead of b or #
Parameters:
Name Type Description
signature integer the amount of sharps of flats (0 = no sharps / flats, 1 = 1 sharp, -1 = 1 flat, etc.)
Source:
Returns:
the notation used based on the
Type
string

octave() → integer

the octave the note is in
Source:
Returns:
the octave
Type
integer

relativeDistance(Note note) → integer

returns the relative distance from this note to note this is an integer from 0 - 11 representing the distance in semitones between the notes
Parameters:
Name Type Description
note Note The second note
Source:
Returns:
The relative distance between the notes in semitones
Type
integer

relPos() → integer

get the relative position of the note
Source:
Returns:
the relative position ( 0 - 11 )
Type
integer

shortestDistance(Note note) → integer

Parameters:
Name Type Description
note Note The second note
Source:
Returns:
the shortest distance from this to note
Type
integer

signature() → integer

The signature as an integer representing the amount of sharps or flats the scale has when using this note as root.
Source:
Returns:
The signature as an integer representing the amount of sharps or flats the scale has when using this note as root.
Type
integer

transpose()Note

transpose a note
Source:
Returns:
A new Note object
Type
Note

type() → string

the type of object, always returns "note"
Source:
Returns:
"note"
Type
string