Skip to content

Commit bf8815b

Browse files
author
vlazzarini
committed
fix code example
1 parent f471045 commit bf8815b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

docs/examples/create.csd

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@
66
0dbfs = 1
77
88
opcode Osci(a:k,f:k):a
9-
xout linenr(oscili(a,f),0.1,0.1,0.01)
9+
xout oscili(a,f)
1010
endop
1111
1212
instr One
1313
1414
// run at i-time
15-
myInstr:InstrDef = create({{ out Osci(p4,k(p5)) }})
15+
myInstr:InstrDef = create({{ out Osci(p4,p5) }})
1616
myInstance:Instr = create(myInstr)
1717
err1:i = init(myInstance,0.5,440)
1818
19-
// run at perf-time
20-
err2:k = perf(myInstance)
19+
// env, gliss
20+
env:k = linen(0.5,0.1,p3,0.1)
2121
slid:k = expon(440, p3, 880)
22+
23+
// set p5
2224
setp(myInstance, 5, slid)
25+
// run at perf-time, set p4
26+
err2:k = perf(myInstance,env)
2327
2428
// run at deinit time
2529
delete(myInstance)
@@ -34,8 +38,8 @@ instr Two
3438
obj:Opcode = create(oscili)
3539
sig:a = init(obj, p4, p5)
3640
sig:a = perf(obj, p4, p5)
37-
out(sig)
38-
event_i("e", 0, 2)
41+
out(sig*adsr(0.1,0.1,0.5,0.1))
42+
event_i("e", 0, 3)
3943
endin
4044
4145
schedule(One,0,1)

docs/intro/whats-new-in-csound-7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ by various opcodes. For example,
137137

138138
```csound-orc
139139
instr Container
140-
myInstr:InstrDef = create({{ out Osci(p4,k(p5)) }})
140+
myInstr:InstrDef = create({{ out Osci(p4,p5) }})
141141
myInstance:Instr = create(myInstr)
142142
err1:i = init(myInstance,0.5,440)
143143
err2:k = perf(myInstance)

0 commit comments

Comments
 (0)