-
Notifications
You must be signed in to change notification settings - Fork 8
Values
The data that flows between the various Units in Shaden can be grouped into three categories:
- Floating-Point: These represent audio signals and control signals. These values are usually constrained to be in the range [-1,1], but can sometimes be higher.
- Integer: Used to represent various modes in Unit inputs or scalar values.
- Binary: Low and high signals which are represented by the bi-polar values -1 and 1.
These functions help by taking a human-readable value and converting it to the appropriate real (float64) value that the engine can use.
Returns a frequency. x can be one of the following:
- Numeric frequency:
(hz 100) - Scientific pitch notation string:
(hz "A4") - Pitch using music theory transpositions:
(define C3 (theory/pitch "C3")) (hz C3) ; 130.81 (hz (theory/transpose C3 (theory/interval :minor 2))) ; 138.59Hz
Returns a duration in milliseconds.
Returns a frequency for beats-per-minute.
Returns a level represented in dB.
Example:
(db -6)
; 0.5011872336272722
Returns a pitch using scientific notation. This is different from hz in that its used for transposition.
Example:
(theory/pitch "C#4")
(theory/pitch "Eb2")
Returns an interval at a specific integer step. interval can be a string or keyword.
Example:
(theory/interval :perfect 5)
(theory/interval :minor 7)
Return a new pitch that's transposed by a specific interval.
Example:
(theory/transpose (theory/pitch "C3")
(theory/interval :minor 2))
; C#3
Return a list of pitches containing the scale starting at a root pitch. Does not include the octave.
Example:
(theory/scale (theory/pitch "C3") "major" 1)
; (C3, D3, E3, F3, G3, A3, B3)
Scales:
aeolianchromaticdominant-bebopdoriandouble-harmonicharmonic-minorin-senionianlocrianlydianmajor-bebopmajor-pentatonicmajormelodic-minor-bebopminor-pentatonicminormixolydianphrygianwhole-tone
Return a list of pitches containing the chord starting at a root pitch. Does not include the octave.
Example:
(theory/chord (theory/pitch "C3") "major")
; (C3, E3, G3)
Chords:
augmented-major-seventhaugmented-seventhaugmented-sixthaugmenteddiminished-major-seventhdiminished-seventhdiminisheddominant-seventhhalf-diminished-seventhmajor-seventhmajor-sixthmajorminor-seventhminor-sixthminor
| Symbol | Value |
|---|---|
mode/on |
1 |
mode/off |
0 |
mode/high |
1 |
mode/low |
-1 |
| Symbol | Value |
|---|---|
quality/perfect |
0 |
quality/minor |
1 |
quality/major |
2 |
quality/diminished |
3 |
quality/augmented |
4 |
Stages Sequencer Modes
| Symbol | Value |
|---|---|
mode/forward |
0 |
mode/reverse |
1 |
mode/pingpong |
2 |
mode/random |
3 |
| Symbol | Value |
|---|---|
mode/rest |
0 |
mode/first |
1 |
mode/all |
2 |
mode/last |
3 |
mode/hold |
4 |
Gate Modes
| Symbol | Value |
|---|---|
mode/lp |
0 |
mode/both |
1 |
mode/amp |
2 |