[Edited]
This is a self-answer to my previous question, which has been moved to the bottom of this edited answer.
Using s.bind { ... }
with .onFree
for a synth with a duration shorter than the latency time will not give the expected result. It limits the shortest interval to the next execution to the latency time. So, s.bind{ ... }
should not be used with .onFree{ ... }
(
SynthDef(\test, { |freq = 440, amp = 0.1, rT = 1, out = 0|
var sig = SinOsc.ar(freq * [1, 1.01]);
sig = sig * Env.perc(0.01, rT).ar(Done.freeSelf) * amp;
OffsetOut.ar(out, sig)
}).add;
)
(
a = {
Synth(\test,
[
\freq, (60..72).choose.midicps,
\amp, (-24, -21 .. -9).choose.dbamp,
\rT, 0.1,
]
).onFree { a.() }
}
)
a.()
Sorry for asking a very stupid question, but I will not remove this. Someone might make the same logical mistake I did.
My question was as follows:
Hm…
*I have here a question. *
Should s.bind
be here used as follows?
(
SynthDef(\test, { |freq = 440, amp = 0.1, rT = 1, out = 0|
var sig = SinOsc.ar(freq * [1, 1.01]) * amp;
sig = sig * Env.perc(0.01, rT).ar(Done.freeSelf);
OffsetOut.ar(out, sig)
}).add;
)
(
a = {
s.bind { // necessary?
Synth(\test,
[
\freq, (60..72).choose.midicps,
\amp, (-24, -21 .. -9).choose.dbamp,
\rT, 2 ** (-3..1).choose,
]
).onFree { a.() }
}
}
)
a.()
or as follows?
(
a = {
Synth(\test,
[
\freq, (60..72).choose.midicps,
\amp, (-24, -21 .. -9).choose.dbamp,
\rT, 2 ** (-3..1).choose,
]
).onFree { s.bind { a.() } }
}
)
a.()
Thanks in advance!