-
Notifications
You must be signed in to change notification settings - Fork 8
/
schema.muon
125 lines (123 loc) · 3.89 KB
/
schema.muon
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
:::
# Create samplers by name
def: list dictionary
# A sampler (function with args)
text: record Sampler
# Input samplers
args: list string
# Sampler function
func: choice Function
# Trapezoidal waveform - Each component must be larger than the previous
# (-1, -1, -1) => Downward Sawtooth
# (-1, 1, 1) => Upward Sawtooth
# (-1, -1, 1) => Constant 1
# (-1, 0, 0) => Triangle Wave
# (0, 0, 1) => Square Wave
# (1, 1, 1) => Constant -1
Zoid: record
# The frequency of the note. Higher values make higher notes
hz: text
# Phase location to start rise (-1:1) from -1 to 1
rise: text
# Phase location to start hold (-1:1) at -1
hold: text
# Phase location to start fall (-1:1) from +1 to -1
fall: text
# Sinusoidal waveform - Implemented as cosine
Sine: record
# The frequency of the note. Higher values make higher notes
hz: text
# Location of zero crossing - 0 (equal) is default
duty: optional text
# Speed of zero crossing - 0 (linear) is default
zero: optional text
# Speed of peak - 0 (linear) is default
peak: optional text
# White noise generator (all frequencies at equal amplitude)
White: record
# Random seed
seed: optional int
# Pink noise generator (all frequencies at equal perception)
Pink: record
# Random seed
seed: optional int
# Phase offset
Phase: record
# Function to apply phase offset to
func: text
# Offset -1:1
offset: text
# A constant value (default 0)
Line: optional number
# A mixer
Mix: record
# Which samples
funcs: list text
# An amplifier
Gain: record
# Which sampler
func: text
# Amount to gain (0 is silent)
amt: text
# Hard and Soft limiting/clipping and compression
Limit: record
# Which sampler
func: text
# Ceiling / threshold - optional amplitude of clamping from 0:1 (default
# 1)
ceil: optional text
# Ratio - How much gain is applied over ceiling from 0:1 (default 0)
ratio: optional text
# Knee - Fraction of amplitude above the ceiling for full ratio effect
# from 0:1 (default 0)
knee: optional text
# Clamping
Clamp: record
# Which sampler
func: text
# Minimum value
min: optional text
# Maximum value
max: optional text
# Value shift
shift: optional text
# Amplitude envelope (can be ADSR or other)
Envelope: record
# Which sampler
func: text
# Components of the envelope
with: list record
# Number of seconds to rise/fall or hold
time: text
# Range 0:1
gain: text
# TODO Reverberation effect
Reverb: record
# TODO Shaping / Equalization effect
Shape: record
# TODO Wavetable / Waypoint / Lookup oscillator
Table: record
# Which sampler to stream audio from
synth: text
# Twang functional audio programming language
# ===========================================
# This is an optional way to use twang to build a synthesis tree. Synthesis
# trees have a root node which does something to "mix" the child synthesis
# nodes' outputs. Synthesis trees can be parameterized and controlled by an
# external input.
#
# The programming language is built on top of MuON (Micro Object Notation):
# https://github.com/muon-data/muon
#
# Naming conventions:
# - GlobalSamplerFunction
# - local_sampler_function
#
# Postfix Calling convention
# - (sampler1 sampler2).SamplerA.SamplerB
# - ((a b).c (d e).f).g
#
# Notable Quirks
# - Time is abstracted out of each function (hidden parameter)
# - Constants are just timeless functions without parameters
:::