@audiofab-io/fv1-core 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/blocks/ATL_DEVELOPER_REFERENCE.md +156 -156
- package/blocks/control/constant.atl +36 -36
- package/blocks/control/entropy_lfo.atl +74 -74
- package/blocks/control/envelope.atl +120 -120
- package/blocks/control/invert.atl +33 -33
- package/blocks/control/pot.atl +149 -149
- package/blocks/control/power.atl +76 -76
- package/blocks/control/ramp_lfo.atl +122 -122
- package/blocks/control/scale_offset.atl +84 -84
- package/blocks/control/sincos_lfo.atl +126 -126
- package/blocks/control/smoother.atl +48 -48
- package/blocks/control/tremolizer.atl +54 -54
- package/blocks/effects/delay/micro_stutter.atl +77 -77
- package/blocks/effects/delay/mn3011.atl +280 -280
- package/blocks/effects/delay/simple_delay.atl +96 -96
- package/blocks/effects/delay/triple_tap_delay.atl +176 -176
- package/blocks/effects/lo-fi/bit_mangler.atl +74 -74
- package/blocks/effects/lo-fi/chiptune.atl +311 -311
- package/blocks/effects/lo-fi/tape_degrade.atl +181 -181
- package/blocks/effects/modulation/chorus.atl +141 -141
- package/blocks/effects/modulation/chorus_4voice.atl +188 -188
- package/blocks/effects/modulation/flanger.atl +184 -184
- package/blocks/effects/modulation/harmonic_trem.atl +129 -129
- package/blocks/effects/modulation/phaser.atl +299 -299
- package/blocks/effects/pitch/octave_up_down.atl +80 -80
- package/blocks/effects/pitch/pitch_offset.atl +149 -149
- package/blocks/effects/pitch/pitch_offset_dual.atl +197 -197
- package/blocks/effects/pitch/pitch_shift.atl +115 -115
- package/blocks/effects/pitch/sub_octave.atl +100 -100
- package/blocks/effects/reverb/ducking_reverb.atl +145 -145
- package/blocks/effects/reverb/min_reverb.atl +132 -132
- package/blocks/effects/reverb/plate_reverb.atl +344 -344
- package/blocks/effects/reverb/room_reverb.atl +293 -293
- package/blocks/effects/reverb/smear.atl +90 -90
- package/blocks/effects/reverb/spring_reverb.atl +353 -353
- package/blocks/filter/1p_high_pass.atl +62 -62
- package/blocks/filter/1p_low_pass.atl +58 -58
- package/blocks/filter/auto_wah.atl +207 -207
- package/blocks/filter/bbd_loss.atl +79 -79
- package/blocks/filter/shelving_high_pass.atl +76 -76
- package/blocks/filter/shelving_low_pass.atl +76 -76
- package/blocks/filter/svf_2p.atl +116 -116
- package/blocks/gain_mix/crossfade.atl +93 -93
- package/blocks/gain_mix/crossfade2.atl +86 -86
- package/blocks/gain_mix/crossfade3.atl +71 -71
- package/blocks/gain_mix/gainboost.atl +54 -54
- package/blocks/gain_mix/mixer2.atl +76 -76
- package/blocks/gain_mix/mixer3.atl +109 -109
- package/blocks/gain_mix/mixer4.atl +151 -151
- package/blocks/gain_mix/volume.atl +50 -50
- package/blocks/io/adc.atl +53 -53
- package/blocks/io/dac.atl +61 -61
- package/blocks/other/stickynote.atl +24 -24
- package/blocks/other/tone_gen_adjustable.atl +137 -137
- package/blocks/other/tone_gen_fixed.atl +109 -109
- package/dist/blockDiagram/builtinBlocks.js +107 -107
- package/dist/blockDiagram/builtinBlocks.js.map +1 -1
- package/dist/blockDiagram/compiler/BlockTemplate.d.ts.map +1 -1
- package/dist/blockDiagram/compiler/BlockTemplate.js +18 -0
- package/dist/blockDiagram/compiler/BlockTemplate.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
---
|
|
2
|
-
{
|
|
3
|
-
"type": "other.tonegen",
|
|
4
|
-
"category": "Other",
|
|
5
|
-
"name": "Tone Generator",
|
|
6
|
-
"description": "Sine wave generator with rotation matrix oscillator (4x oversampled) based on Spin Semi sample code",
|
|
7
|
-
"color": "#FF9800",
|
|
8
|
-
"inputs": [
|
|
9
|
-
{ "id": "coarse_freq", "name": "Coarse Freq", "type": "control", "required": false },
|
|
10
|
-
{ "id": "fine_freq", "name": "Fine Freq", "type": "control", "required": false },
|
|
11
|
-
{ "id": "amplitude", "name": "Amplitude", "type": "control", "required": false }
|
|
12
|
-
],
|
|
13
|
-
"outputs": [
|
|
14
|
-
{ "id": "out", "name": "Output", "type": "audio" }
|
|
15
|
-
],
|
|
16
|
-
"parameters": [
|
|
17
|
-
{
|
|
18
|
-
"id": "coarseFreq",
|
|
19
|
-
"name": "Coarse Frequency",
|
|
20
|
-
"type": "number",
|
|
21
|
-
"default": 0.5,
|
|
22
|
-
"min": 0.0,
|
|
23
|
-
"max": 1.0,
|
|
24
|
-
"step": 0.01
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"id": "fineFreq",
|
|
28
|
-
"name": "Fine Frequency",
|
|
29
|
-
"type": "number",
|
|
30
|
-
"default": 0.5,
|
|
31
|
-
"min": 0.0,
|
|
32
|
-
"max": 1.0,
|
|
33
|
-
"step": 0.01
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"id": "amplitude",
|
|
37
|
-
"name": "Amplitude",
|
|
38
|
-
"type": "number",
|
|
39
|
-
"default": 0.5,
|
|
40
|
-
"min": 0.0,
|
|
41
|
-
"max": 1.0,
|
|
42
|
-
"step": 0.01
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"registers": [
|
|
46
|
-
"freq", "s", "c", "p0fil", "p2fil", "amp"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
---
|
|
50
|
-
@section init
|
|
51
|
-
; Tone Generator init
|
|
52
|
-
skp run, tonegen_adjustable_init
|
|
53
|
-
sof 0.0, 0.5
|
|
54
|
-
wrax ${reg.s}, 0.0
|
|
55
|
-
tonegen_adjustable_init:
|
|
56
|
-
|
|
57
|
-
@section main
|
|
58
|
-
; Sine Wave Generator (rotation matrix, 4x oversampled)
|
|
59
|
-
|
|
60
|
-
; Calculate frequency
|
|
61
|
-
@if pinConnected(fine_freq)
|
|
62
|
-
rdax ${input.fine_freq}, 1.0
|
|
63
|
-
@else
|
|
64
|
-
sof 0.0, ${fineFreq}
|
|
65
|
-
@endif
|
|
66
|
-
sof 0.01, -0.005
|
|
67
|
-
|
|
68
|
-
@if pinConnected(coarse_freq)
|
|
69
|
-
rdax ${input.coarse_freq}, 0.625
|
|
70
|
-
@else
|
|
71
|
-
sof 1.0, (${param.coarseFreq} * 0.625)
|
|
72
|
-
@endif
|
|
73
|
-
sof 1.0, -0.66
|
|
74
|
-
exp 1.0, 0.0
|
|
75
|
-
|
|
76
|
-
; Filter the frequency control
|
|
77
|
-
rdfx ${reg.p0fil}, 0.01
|
|
78
|
-
wrax ${reg.p0fil}, 1.0
|
|
79
|
-
wrax ${reg.freq}, 0.0
|
|
80
|
-
|
|
81
|
-
; Calculate amplitude (dB/step)
|
|
82
|
-
@if pinConnected(amplitude)
|
|
83
|
-
rdax ${input.amplitude}, 0.9375
|
|
84
|
-
@else
|
|
85
|
-
sof 0.0, (${amplitude} * 0.9375)
|
|
86
|
-
@endif
|
|
87
|
-
|
|
88
|
-
; Filter amplitude control
|
|
89
|
-
rdfx ${reg.p2fil}, 0.01
|
|
90
|
-
wrax ${reg.p2fil}, 1.0
|
|
91
|
-
sof 1.0, -0.9375
|
|
92
|
-
exp 1.0, 0.0
|
|
93
|
-
wrax ${reg.amp}, 0.0
|
|
94
|
-
|
|
95
|
-
; Rotation matrix oscillator (4x oversampled)
|
|
96
|
-
|
|
97
|
-
; Iteration 1
|
|
98
|
-
rdax ${reg.c}, 1.0
|
|
99
|
-
mulx ${reg.freq}
|
|
100
|
-
rdax ${reg.s}, 1.0
|
|
101
|
-
wrax ${reg.s}, -1.0
|
|
102
|
-
mulx ${reg.freq}
|
|
103
|
-
rdax ${reg.c}, 1.0
|
|
104
|
-
wrax ${reg.c}, 0.0
|
|
105
|
-
|
|
106
|
-
; Iteration 2
|
|
107
|
-
rdax ${reg.c}, 1.0
|
|
108
|
-
mulx ${reg.freq}
|
|
109
|
-
rdax ${reg.s}, 1.0
|
|
110
|
-
wrax ${reg.s}, -1.0
|
|
111
|
-
mulx ${reg.freq}
|
|
112
|
-
rdax ${reg.c}, 1.0
|
|
113
|
-
wrax ${reg.c}, 0.0
|
|
114
|
-
|
|
115
|
-
; Iteration 3
|
|
116
|
-
rdax ${reg.c}, 1.0
|
|
117
|
-
mulx ${reg.freq}
|
|
118
|
-
rdax ${reg.s}, 1.0
|
|
119
|
-
wrax ${reg.s}, -1.0
|
|
120
|
-
mulx ${reg.freq}
|
|
121
|
-
rdax ${reg.c}, 1.0
|
|
122
|
-
wrax ${reg.c}, 0.0
|
|
123
|
-
|
|
124
|
-
; Iteration 4 (final - accumulate in ACC)
|
|
125
|
-
rdax ${reg.c}, 1.0
|
|
126
|
-
mulx ${reg.freq}
|
|
127
|
-
rdax ${reg.s}, 1.0
|
|
128
|
-
wrax ${reg.s}, -1.0
|
|
129
|
-
mulx ${reg.freq}
|
|
130
|
-
rdax ${reg.c}, 1.0
|
|
131
|
-
wrax ${reg.c}, 1.99
|
|
132
|
-
|
|
133
|
-
; Scale output by amplitude
|
|
134
|
-
mulx ${reg.amp}
|
|
135
|
-
|
|
136
|
-
; Write to output
|
|
137
|
-
wrax ${output.out}, 0.0
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"type": "other.tonegen",
|
|
4
|
+
"category": "Other",
|
|
5
|
+
"name": "Tone Generator",
|
|
6
|
+
"description": "Sine wave generator with rotation matrix oscillator (4x oversampled) based on Spin Semi sample code",
|
|
7
|
+
"color": "#FF9800",
|
|
8
|
+
"inputs": [
|
|
9
|
+
{ "id": "coarse_freq", "name": "Coarse Freq", "type": "control", "required": false },
|
|
10
|
+
{ "id": "fine_freq", "name": "Fine Freq", "type": "control", "required": false },
|
|
11
|
+
{ "id": "amplitude", "name": "Amplitude", "type": "control", "required": false }
|
|
12
|
+
],
|
|
13
|
+
"outputs": [
|
|
14
|
+
{ "id": "out", "name": "Output", "type": "audio" }
|
|
15
|
+
],
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"id": "coarseFreq",
|
|
19
|
+
"name": "Coarse Frequency",
|
|
20
|
+
"type": "number",
|
|
21
|
+
"default": 0.5,
|
|
22
|
+
"min": 0.0,
|
|
23
|
+
"max": 1.0,
|
|
24
|
+
"step": 0.01
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "fineFreq",
|
|
28
|
+
"name": "Fine Frequency",
|
|
29
|
+
"type": "number",
|
|
30
|
+
"default": 0.5,
|
|
31
|
+
"min": 0.0,
|
|
32
|
+
"max": 1.0,
|
|
33
|
+
"step": 0.01
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "amplitude",
|
|
37
|
+
"name": "Amplitude",
|
|
38
|
+
"type": "number",
|
|
39
|
+
"default": 0.5,
|
|
40
|
+
"min": 0.0,
|
|
41
|
+
"max": 1.0,
|
|
42
|
+
"step": 0.01
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"registers": [
|
|
46
|
+
"freq", "s", "c", "p0fil", "p2fil", "amp"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
---
|
|
50
|
+
@section init
|
|
51
|
+
; Tone Generator init
|
|
52
|
+
skp run, tonegen_adjustable_init
|
|
53
|
+
sof 0.0, 0.5
|
|
54
|
+
wrax ${reg.s}, 0.0
|
|
55
|
+
tonegen_adjustable_init:
|
|
56
|
+
|
|
57
|
+
@section main
|
|
58
|
+
; Sine Wave Generator (rotation matrix, 4x oversampled)
|
|
59
|
+
|
|
60
|
+
; Calculate frequency
|
|
61
|
+
@if pinConnected(fine_freq)
|
|
62
|
+
rdax ${input.fine_freq}, 1.0
|
|
63
|
+
@else
|
|
64
|
+
sof 0.0, ${fineFreq}
|
|
65
|
+
@endif
|
|
66
|
+
sof 0.01, -0.005
|
|
67
|
+
|
|
68
|
+
@if pinConnected(coarse_freq)
|
|
69
|
+
rdax ${input.coarse_freq}, 0.625
|
|
70
|
+
@else
|
|
71
|
+
sof 1.0, (${param.coarseFreq} * 0.625)
|
|
72
|
+
@endif
|
|
73
|
+
sof 1.0, -0.66
|
|
74
|
+
exp 1.0, 0.0
|
|
75
|
+
|
|
76
|
+
; Filter the frequency control
|
|
77
|
+
rdfx ${reg.p0fil}, 0.01
|
|
78
|
+
wrax ${reg.p0fil}, 1.0
|
|
79
|
+
wrax ${reg.freq}, 0.0
|
|
80
|
+
|
|
81
|
+
; Calculate amplitude (dB/step)
|
|
82
|
+
@if pinConnected(amplitude)
|
|
83
|
+
rdax ${input.amplitude}, 0.9375
|
|
84
|
+
@else
|
|
85
|
+
sof 0.0, (${amplitude} * 0.9375)
|
|
86
|
+
@endif
|
|
87
|
+
|
|
88
|
+
; Filter amplitude control
|
|
89
|
+
rdfx ${reg.p2fil}, 0.01
|
|
90
|
+
wrax ${reg.p2fil}, 1.0
|
|
91
|
+
sof 1.0, -0.9375
|
|
92
|
+
exp 1.0, 0.0
|
|
93
|
+
wrax ${reg.amp}, 0.0
|
|
94
|
+
|
|
95
|
+
; Rotation matrix oscillator (4x oversampled)
|
|
96
|
+
|
|
97
|
+
; Iteration 1
|
|
98
|
+
rdax ${reg.c}, 1.0
|
|
99
|
+
mulx ${reg.freq}
|
|
100
|
+
rdax ${reg.s}, 1.0
|
|
101
|
+
wrax ${reg.s}, -1.0
|
|
102
|
+
mulx ${reg.freq}
|
|
103
|
+
rdax ${reg.c}, 1.0
|
|
104
|
+
wrax ${reg.c}, 0.0
|
|
105
|
+
|
|
106
|
+
; Iteration 2
|
|
107
|
+
rdax ${reg.c}, 1.0
|
|
108
|
+
mulx ${reg.freq}
|
|
109
|
+
rdax ${reg.s}, 1.0
|
|
110
|
+
wrax ${reg.s}, -1.0
|
|
111
|
+
mulx ${reg.freq}
|
|
112
|
+
rdax ${reg.c}, 1.0
|
|
113
|
+
wrax ${reg.c}, 0.0
|
|
114
|
+
|
|
115
|
+
; Iteration 3
|
|
116
|
+
rdax ${reg.c}, 1.0
|
|
117
|
+
mulx ${reg.freq}
|
|
118
|
+
rdax ${reg.s}, 1.0
|
|
119
|
+
wrax ${reg.s}, -1.0
|
|
120
|
+
mulx ${reg.freq}
|
|
121
|
+
rdax ${reg.c}, 1.0
|
|
122
|
+
wrax ${reg.c}, 0.0
|
|
123
|
+
|
|
124
|
+
; Iteration 4 (final - accumulate in ACC)
|
|
125
|
+
rdax ${reg.c}, 1.0
|
|
126
|
+
mulx ${reg.freq}
|
|
127
|
+
rdax ${reg.s}, 1.0
|
|
128
|
+
wrax ${reg.s}, -1.0
|
|
129
|
+
mulx ${reg.freq}
|
|
130
|
+
rdax ${reg.c}, 1.0
|
|
131
|
+
wrax ${reg.c}, 1.99
|
|
132
|
+
|
|
133
|
+
; Scale output by amplitude
|
|
134
|
+
mulx ${reg.amp}
|
|
135
|
+
|
|
136
|
+
; Write to output
|
|
137
|
+
wrax ${output.out}, 0.0
|
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
---
|
|
2
|
-
{
|
|
3
|
-
"type": "other.tonegen.fixed",
|
|
4
|
-
"category": "Other",
|
|
5
|
-
"name": "Tone Generator (Fixed)",
|
|
6
|
-
"description": "Fixed frequency sine wave generator with amplitude control",
|
|
7
|
-
"color": "#FF9800",
|
|
8
|
-
"labelTemplate": "${param.frequency} Hz",
|
|
9
|
-
"inputs": [
|
|
10
|
-
{ "id": "amplitude", "name": "Amplitude", "type": "control", "required": false }
|
|
11
|
-
],
|
|
12
|
-
"outputs": [
|
|
13
|
-
{ "id": "out", "name": "Output", "type": "audio" }
|
|
14
|
-
],
|
|
15
|
-
"parameters": [
|
|
16
|
-
{
|
|
17
|
-
"id": "frequency",
|
|
18
|
-
"name": "Frequency",
|
|
19
|
-
"type": "number",
|
|
20
|
-
"default": 440,
|
|
21
|
-
"min": 20,
|
|
22
|
-
"max": 10000,
|
|
23
|
-
"step": 1
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"id": "amplitude",
|
|
27
|
-
"name": "Amplitude",
|
|
28
|
-
"type": "number",
|
|
29
|
-
"default": 0.5,
|
|
30
|
-
"min": 0.0,
|
|
31
|
-
"max": 1.0,
|
|
32
|
-
"step": 0.01
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"registers": [
|
|
36
|
-
"freq", "s", "c", "p2fil", "amp"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
---
|
|
40
|
-
@section init
|
|
41
|
-
; Tone Generator (Fixed) init
|
|
42
|
-
skp run, tonegen_fixed_init
|
|
43
|
-
sof 0.0, 0.5
|
|
44
|
-
wrax ${reg.s}, 0.0
|
|
45
|
-
; The angle for frequency is approx (2*PI*freq) / (SampleRate*4)
|
|
46
|
-
sof 0.0, (6.2831853 * ${frequency}) / 131072.0
|
|
47
|
-
wrax ${reg.freq}, 0.0
|
|
48
|
-
tonegen_fixed_init:
|
|
49
|
-
|
|
50
|
-
@section main
|
|
51
|
-
; Sine Wave Generator - ${frequency} Hz (fixed)
|
|
52
|
-
|
|
53
|
-
; Calculate amplitude (dB/step)
|
|
54
|
-
@if pinConnected(amplitude)
|
|
55
|
-
rdax ${input.amplitude}, 0.9375
|
|
56
|
-
@else
|
|
57
|
-
sof 0.0, (${amplitude} * 0.9375)
|
|
58
|
-
@endif
|
|
59
|
-
|
|
60
|
-
; Filter amplitude control
|
|
61
|
-
rdfx ${reg.p2fil}, 0.01
|
|
62
|
-
wrax ${reg.p2fil}, 1.0
|
|
63
|
-
sof 1.0, -0.9375
|
|
64
|
-
exp 1.0, 0.0
|
|
65
|
-
wrax ${reg.amp}, 0.0
|
|
66
|
-
|
|
67
|
-
; Rotation matrix oscillator (4x oversampled)
|
|
68
|
-
|
|
69
|
-
; Iteration 1
|
|
70
|
-
rdax ${reg.c}, 1.0
|
|
71
|
-
mulx ${reg.freq}
|
|
72
|
-
rdax ${reg.s}, 1.0
|
|
73
|
-
wrax ${reg.s}, -1.0
|
|
74
|
-
mulx ${reg.freq}
|
|
75
|
-
rdax ${reg.c}, 1.0
|
|
76
|
-
wrax ${reg.c}, 0.0
|
|
77
|
-
|
|
78
|
-
; Iteration 2
|
|
79
|
-
rdax ${reg.c}, 1.0
|
|
80
|
-
mulx ${reg.freq}
|
|
81
|
-
rdax ${reg.s}, 1.0
|
|
82
|
-
wrax ${reg.s}, -1.0
|
|
83
|
-
mulx ${reg.freq}
|
|
84
|
-
rdax ${reg.c}, 1.0
|
|
85
|
-
wrax ${reg.c}, 0.0
|
|
86
|
-
|
|
87
|
-
; Iteration 3
|
|
88
|
-
rdax ${reg.c}, 1.0
|
|
89
|
-
mulx ${reg.freq}
|
|
90
|
-
rdax ${reg.s}, 1.0
|
|
91
|
-
wrax ${reg.s}, -1.0
|
|
92
|
-
mulx ${reg.freq}
|
|
93
|
-
rdax ${reg.c}, 1.0
|
|
94
|
-
wrax ${reg.c}, 0.0
|
|
95
|
-
|
|
96
|
-
; Iteration 4 (final - accumulate in ACC)
|
|
97
|
-
rdax ${reg.c}, 1.0
|
|
98
|
-
mulx ${reg.freq}
|
|
99
|
-
rdax ${reg.s}, 1.0
|
|
100
|
-
wrax ${reg.s}, -1.0
|
|
101
|
-
mulx ${reg.freq}
|
|
102
|
-
rdax ${reg.c}, 1.0
|
|
103
|
-
wrax ${reg.c}, 1.99
|
|
104
|
-
|
|
105
|
-
; Scale output by amplitude
|
|
106
|
-
mulx ${reg.amp}
|
|
107
|
-
|
|
108
|
-
; Write to output
|
|
109
|
-
wrax ${output.out}, 0.0
|
|
1
|
+
---
|
|
2
|
+
{
|
|
3
|
+
"type": "other.tonegen.fixed",
|
|
4
|
+
"category": "Other",
|
|
5
|
+
"name": "Tone Generator (Fixed)",
|
|
6
|
+
"description": "Fixed frequency sine wave generator with amplitude control",
|
|
7
|
+
"color": "#FF9800",
|
|
8
|
+
"labelTemplate": "${param.frequency} Hz",
|
|
9
|
+
"inputs": [
|
|
10
|
+
{ "id": "amplitude", "name": "Amplitude", "type": "control", "required": false }
|
|
11
|
+
],
|
|
12
|
+
"outputs": [
|
|
13
|
+
{ "id": "out", "name": "Output", "type": "audio" }
|
|
14
|
+
],
|
|
15
|
+
"parameters": [
|
|
16
|
+
{
|
|
17
|
+
"id": "frequency",
|
|
18
|
+
"name": "Frequency",
|
|
19
|
+
"type": "number",
|
|
20
|
+
"default": 440,
|
|
21
|
+
"min": 20,
|
|
22
|
+
"max": 10000,
|
|
23
|
+
"step": 1
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"id": "amplitude",
|
|
27
|
+
"name": "Amplitude",
|
|
28
|
+
"type": "number",
|
|
29
|
+
"default": 0.5,
|
|
30
|
+
"min": 0.0,
|
|
31
|
+
"max": 1.0,
|
|
32
|
+
"step": 0.01
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"registers": [
|
|
36
|
+
"freq", "s", "c", "p2fil", "amp"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
---
|
|
40
|
+
@section init
|
|
41
|
+
; Tone Generator (Fixed) init
|
|
42
|
+
skp run, tonegen_fixed_init
|
|
43
|
+
sof 0.0, 0.5
|
|
44
|
+
wrax ${reg.s}, 0.0
|
|
45
|
+
; The angle for frequency is approx (2*PI*freq) / (SampleRate*4)
|
|
46
|
+
sof 0.0, (6.2831853 * ${frequency}) / 131072.0
|
|
47
|
+
wrax ${reg.freq}, 0.0
|
|
48
|
+
tonegen_fixed_init:
|
|
49
|
+
|
|
50
|
+
@section main
|
|
51
|
+
; Sine Wave Generator - ${frequency} Hz (fixed)
|
|
52
|
+
|
|
53
|
+
; Calculate amplitude (dB/step)
|
|
54
|
+
@if pinConnected(amplitude)
|
|
55
|
+
rdax ${input.amplitude}, 0.9375
|
|
56
|
+
@else
|
|
57
|
+
sof 0.0, (${amplitude} * 0.9375)
|
|
58
|
+
@endif
|
|
59
|
+
|
|
60
|
+
; Filter amplitude control
|
|
61
|
+
rdfx ${reg.p2fil}, 0.01
|
|
62
|
+
wrax ${reg.p2fil}, 1.0
|
|
63
|
+
sof 1.0, -0.9375
|
|
64
|
+
exp 1.0, 0.0
|
|
65
|
+
wrax ${reg.amp}, 0.0
|
|
66
|
+
|
|
67
|
+
; Rotation matrix oscillator (4x oversampled)
|
|
68
|
+
|
|
69
|
+
; Iteration 1
|
|
70
|
+
rdax ${reg.c}, 1.0
|
|
71
|
+
mulx ${reg.freq}
|
|
72
|
+
rdax ${reg.s}, 1.0
|
|
73
|
+
wrax ${reg.s}, -1.0
|
|
74
|
+
mulx ${reg.freq}
|
|
75
|
+
rdax ${reg.c}, 1.0
|
|
76
|
+
wrax ${reg.c}, 0.0
|
|
77
|
+
|
|
78
|
+
; Iteration 2
|
|
79
|
+
rdax ${reg.c}, 1.0
|
|
80
|
+
mulx ${reg.freq}
|
|
81
|
+
rdax ${reg.s}, 1.0
|
|
82
|
+
wrax ${reg.s}, -1.0
|
|
83
|
+
mulx ${reg.freq}
|
|
84
|
+
rdax ${reg.c}, 1.0
|
|
85
|
+
wrax ${reg.c}, 0.0
|
|
86
|
+
|
|
87
|
+
; Iteration 3
|
|
88
|
+
rdax ${reg.c}, 1.0
|
|
89
|
+
mulx ${reg.freq}
|
|
90
|
+
rdax ${reg.s}, 1.0
|
|
91
|
+
wrax ${reg.s}, -1.0
|
|
92
|
+
mulx ${reg.freq}
|
|
93
|
+
rdax ${reg.c}, 1.0
|
|
94
|
+
wrax ${reg.c}, 0.0
|
|
95
|
+
|
|
96
|
+
; Iteration 4 (final - accumulate in ACC)
|
|
97
|
+
rdax ${reg.c}, 1.0
|
|
98
|
+
mulx ${reg.freq}
|
|
99
|
+
rdax ${reg.s}, 1.0
|
|
100
|
+
wrax ${reg.s}, -1.0
|
|
101
|
+
mulx ${reg.freq}
|
|
102
|
+
rdax ${reg.c}, 1.0
|
|
103
|
+
wrax ${reg.c}, 1.99
|
|
104
|
+
|
|
105
|
+
; Scale output by amplitude
|
|
106
|
+
mulx ${reg.amp}
|
|
107
|
+
|
|
108
|
+
; Write to output
|
|
109
|
+
wrax ${output.out}, 0.0
|