rename tonal api -> tonal functions

This commit is contained in:
Felix Roos 2023-06-18 10:32:51 +02:00
parent a71c5957cc
commit 2a449ad3c0
3 changed files with 20 additions and 20 deletions

View File

@ -87,7 +87,7 @@ export const SIDEBAR: Sidebar = {
{ text: 'Signals', link: 'learn/signals' },
{ text: 'Conditional Modifiers', link: 'learn/conditional-modifiers' },
{ text: 'Accumulation', link: 'learn/accumulation' },
{ text: 'Tonal Modifiers', link: 'learn/tonal' },
{ text: 'Tonal Functions', link: 'learn/tonal' },
],
Development: [
{ text: 'REPL', link: 'technical-manual/repl' },

View File

@ -32,4 +32,4 @@ import { JsDoc } from '../../docs/JsDoc';
<JsDoc client:idle name="stut" h={0} />
There are also [Tonal Modifiers](/learn/tonal).
There are also [Tonal Functions](/learn/tonal).

View File

@ -1,14 +1,29 @@
---
title: Tonal API
title: Tonal Functions
layout: ../../layouts/MainLayout.astro
---
import { MiniRepl } from '../../docs/MiniRepl';
import { JsDoc } from '../../docs/JsDoc';
# Tonal API
# Tonal Functions
The Tonal API, uses [tonaljs](https://github.com/tonaljs/tonal) to provide helpers for musical operations.
These functions use [tonaljs](https://github.com/tonaljs/tonal) to provide helpers for musical operations.
### scale(name)
Turns numbers into notes in the scale (zero indexed). Also sets scale for other scale operations, like scaleTranspose.
<MiniRepl
client:idle
tune={`"0 2 4 6 4 2"
.scale("C2:major C2:minor").slow(2))
.note().s("piano")`}
/>
Note that the scale root is octaved here. You can also omit the octave, then index zero will default to octave 3.
All the available scale names can be found [here](https://github.com/tonaljs/tonal/blob/main/packages/scale-type/data.ts).
### transpose(semitones)
@ -22,21 +37,6 @@ Instead of numbers, scientific interval notation can be used as well:
<MiniRepl client:only="react" tune={`"c2 c3".fast(2).transpose("<1P -2M 4P 3m>".slow(2)).note()`} />
### scale(name)
Turns numbers into notes in the scale (zero indexed). Also sets scale for other scale operations, like scaleTranspose.
<MiniRepl
client:idle
tune={`"0 2 4 6 4 2"
.scale(seq('C2 major', 'C2 minor').slow(2))
.note()`}
/>
Note that the scale root is octaved here. You can also omit the octave, then index zero will default to octave 3.
All the available scale names can be found [here](https://github.com/tonaljs/tonal/blob/main/packages/scale-type/data.ts).
### scaleTranspose(steps)
Transposes notes inside the scale by the number of steps: