note-logic | R Documentation |
Relational operators for comparing two noteworthy class objects.
## S3 method for class 'noteworthy'
e1 == e2
## S3 method for class 'noteworthy'
e1 != e2
## S3 method for class 'noteworthy'
e1 < e2
## S3 method for class 'noteworthy'
e1 <= e2
## S3 method for class 'noteworthy'
e1 > e2
## S3 method for class 'noteworthy'
e1 >= e2
e1 |
noteworthy string. |
e2 |
noteworthy string. |
Equality is assessed in the same manner as used for note_sort()
when
sorting pitches. What matters is the underlying semitone value associated
with each pitch, not the string notation such as flat vs. sharp (see
pitch_is_identical()
). When comparing chords, or a chord vs. a single note,
comparison favors the root. Comparison is made of the respective lowest
pitches, then proceeds to the next pitch if equal.
For these operators, the objects on the left and right side of the operator
must both be noteworthy
or an error is returned.
The examples include a chord with its pitches entered out of pitch order.
This does not affect the results because pitches within chords are sorted
before note to note comparisons at each timestep are done between e1
and
e2
.
logical vector
x <- as_noteworthy("f# a d'f#'a' d'f#'a'")
y <- as_noteworthy("g_ b f#'a'd' d'd''")
x == y
x != y
x < y
x > y
x <= y
x >= y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.