Add chord inversions and voiceleading
This commit is contained in:
@ -39,7 +39,7 @@
|
|||||||
"tone": "^14.8.49",
|
"tone": "^14.8.49",
|
||||||
"unique-names-generator": "^4.7.1",
|
"unique-names-generator": "^4.7.1",
|
||||||
"vite-plugin-markdown": "^2.1.0",
|
"vite-plugin-markdown": "^2.1.0",
|
||||||
"zifferjs": "^0.0.21",
|
"zifferjs": "^0.0.24",
|
||||||
"zzfx": "^1.2.0"
|
"zzfx": "^1.2.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -196,6 +196,20 @@ export class Player extends Event {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
voiceleading() {
|
||||||
|
if (this.atTheBeginning()) this.ziffers.lead();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
lead = () => this.voiceleading();
|
||||||
|
|
||||||
|
invert = (n: number) => {
|
||||||
|
if (this.atTheBeginning()) {
|
||||||
|
this.ziffers.invert(n);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
retrograde() {
|
retrograde() {
|
||||||
if (this.atTheBeginning()) this.ziffers.retrograde();
|
if (this.atTheBeginning()) this.ziffers.retrograde();
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@ -28,6 +28,7 @@ The basic Ziffer notation is entirely written in JavaScript strings (_e.g_ <ic>"
|
|||||||
| **Accidentals** | <ic># b</ic> | Sharp and flats, just like with regular music notation :smile: |
|
| **Accidentals** | <ic># b</ic> | Sharp and flats, just like with regular music notation :smile: |
|
||||||
| **Rest** | <ic>r</ic> | Rest / silences |
|
| **Rest** | <ic>r</ic> | Rest / silences |
|
||||||
| **Repeat** | <ic>:1-9</ic> | Repeat the item 1-9 times |
|
| **Repeat** | <ic>:1-9</ic> | Repeat the item 1-9 times |
|
||||||
|
| **Chords** | <ic>[1-9]+ / [iv]+ / [AG]+name</ic> | Multiple pitches grouped together, roman numerals or named chords |
|
||||||
|
|
||||||
**Note:** Some features are still unsupported. For full syntax see article about <a href="https://zenodo.org/record/7841945" target="_blank">Ziffers</a>.
|
**Note:** Some features are still unsupported. For full syntax see article about <a href="https://zenodo.org/record/7841945" target="_blank">Ziffers</a>.
|
||||||
|
|
||||||
@ -136,6 +137,21 @@ ${makeExample(
|
|||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
${makeExample(
|
||||||
|
"Chord transposition with roman numerals",
|
||||||
|
`
|
||||||
|
z1('i i v%-4 v%-2 vi%-5 vi%-3 iv%-2 iv%-1').sound('sawtooth').out()
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
|
||||||
|
${makeExample(
|
||||||
|
"Chord transposition with named chords",
|
||||||
|
`
|
||||||
|
z1('e C9:4 Emin:4 F7%-1:4 Emaj%-1:4')
|
||||||
|
.sound("stab").out()
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
|
||||||
## Algorithmic operations
|
## Algorithmic operations
|
||||||
|
|
||||||
Ziffers provides shorthands for **many** numeric and algorithimic operations such as evaluating random numbers and creating sequences using list operations:
|
Ziffers provides shorthands for **many** numeric and algorithimic operations such as evaluating random numbers and creating sequences using list operations:
|
||||||
|
|||||||
@ -1451,10 +1451,10 @@ yaml@^2.1.1:
|
|||||||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
|
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
|
||||||
integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
|
integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
|
||||||
|
|
||||||
zifferjs@^0.0.21:
|
zifferjs@^0.0.24:
|
||||||
version "0.0.21"
|
version "0.0.24"
|
||||||
resolved "https://registry.yarnpkg.com/zifferjs/-/zifferjs-0.0.21.tgz#5df0c6541ae189b2515b4eb4856eb9d2c0610778"
|
resolved "https://registry.yarnpkg.com/zifferjs/-/zifferjs-0.0.24.tgz#073f606086ed7977a8c5cd6cc2f9d6c897415281"
|
||||||
integrity sha512-wJat1nbeCJ1j7+5YpeB5MnZdbyFfAwVRB8Ei+cgViEtjidwe4oCLtNq1p8Gq1PjjpSzr32YR57egCdME2Lb5qg==
|
integrity sha512-pTUM2i3pTBsINiflBym48pzQnEmw93Xf9GVq0FUnnWwLBirwJJsOxJeZZG/c7DVf4EnV7oC1Ik/R5ULt2sVtug==
|
||||||
|
|
||||||
zzfx@^1.2.0:
|
zzfx@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user