-
Notifications
You must be signed in to change notification settings - Fork 4
/
test.lua
executable file
·61 lines (51 loc) · 2.07 KB
/
test.lua
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
str = [[
### global
const num a = 2
const num pi = 3.141592653589793
const num kProfileGauss = 0
const num kProfileBox = 1
const num kProfileInvGauss = 2
const num kProfilePure = 3
const num kModeNatural = 0
const num kModeMetallic = 1
### strings
| channel: 2
const num test = 1 + a
const spectrum spec = spectrum().addSaw(1, 0)
const wavetable wt = spec.toPadWavetable( 3661, kModeNatural, kProfileGauss, 2.7, 1.5, 1.0, 0.0, 1.0, 0.0 )
out wavetableosc(voicepitch(), wt).filter1(3, voicepitch()+24, 0.2).ADSR(0.1, 0.1, -6, 1.0)
/*### strings2
| channel: 1
const spectrum spec2 = spectrum().addSaw(1, 0)
const wavetable wt2 = spec2.toWavetable()
out wavetableosc(voicepitch(), wt2).filter1(3, voicepitch()+96, 0.2).ADSR(0.1, 0.1, -6, 1.0)
*/
### test
| channel: 1
// const spectrum spec2 = spectrum().addSaw(1, 0).addCopy(10, 12)
const spectrum spec2 = spectrum().addSaw(1, 0)
const wavetable wt2 = spec2.toWavetable(34, 0.3, 2.0)
// const wavetable wt3 = spec2.toPadWavetable( 3661, 1, 0, 0.7, 1.0, 1.0, 0.0, 1.0, 0.0 )
// const wavetable wt3 = spec2.toPadWavetable( 3661, kModeNatural, kProfileGauss, 2.7, 1.5, 1.0, 0.0, 1.0, 0.0 )
// out wavetableosc(voicepitch(), wt2).filter1(3, voicepitch()+48, 0.2).ADSR(0.1, 0.1, -6, 1.0)
out wavetableosc(voicepitch()+ADSR(0.01, 0.01, 0.0, 1.0)*velocity()*12.0, wt2).filter1(3, voicepitch()+48*velocity(), 0.2).ADSR(0.1, 0.1, -6, 1.0)
### master
// out strings.compress(strings2, -36, 20, 10, 10) + strings2.reverb(0, 0, 30, -6, -48, 0, -45, 2, 0.004, -1, 0)
out test.reverb(0, 0, 30, -6, -48, 0, -45, 2, 0.004, -6, 0)
// out test.gain(0) + strings
]]
package.path = ";compiler/?.lua"..package.path
require("compiler")
--local program = compile(str)9
--print(serialize_table(program))
local curfilename = debug.getinfo(1, "S").source:sub(2)
local t = os.clock()
export_binary_and_header(curfilename, compile(str))
print(os.clock()-t)
--[[
// | channel: 0
// | min: C#4
// | max: C-5
// | transpose: C-5
// out osc()
]]