我想要一个恒定的音高,没有可听得见的裂纹来启动包络,在开始时音量超快速加速(没有音量开裂),在短时间内缓慢释放,就像快速的声音长笛做得很快,但比这更简单。我所拥有的是:
const flute1 = new Tone.Synth({
oscillator: {
type: 'sine',
},
envelope: {
attack: 0.01,
decay: 0,
sustain: 1,
release: 1
}
}).toDestination()
但如果我在循环中调用它,第一个声音会破坏音量,你可以听到每个节拍的声音在音量缓慢上升。我怎样才能使它们每个都统一相同的声音?
let fluteRhythm = [1, 0, 1, 0, 0]
let fluteRhythmI = 0
const loopA = new Tone.Loop(time => {
let play = fluteRhythm[fluteRhythmI++]
if (fluteRhythmI == fluteRhythm.length) {
fluteRhythmI = 0
}
if (play) {
flute1.triggerAttackRelease("C2", "8n", time);
}
}, "4n").start(0)