Closed gjf2a closed 2 years ago
Hi. Your program works fine for me, I can't hear any noise. Are you running in release mode? The debug mode can sometimes be too slow.
That was the problem! I was running in debug mode. In release mode, it sounds super-clean. Thanks for your help!
Hello,
I am very inexperienced with DSP for sound synthesis, so if this issue resulted from me overlooking something obvious, please accept my apologies.
I'm experimenting with a system architecture for a polyphonic synthesizer. I am creating a multi-channel synth sound as a
Net64
. I am embeddingVar
objects within it. Whenever the player presses a key on the keyboard, it alters the pitch of one of theVar
objects to correspond to the key's pitch.In general, this works pretty well. Problems arise when I use more than five or six
Var
objects to store dynamic pitches. At that point, the sound output collapses into a pile of noise. I experimented with a high-pass filter but it was not effective in eliminating the noise.To demonstrate the problem, I created the
midi_var
repository. Themain.rs
program simplifies the problem by removing the MIDI device. It activates one note every second; with 7 or moreVar
objects, even the first note activation causes the noise problems. Fewer than 7, and it generally sounds fine, with maybe a hint of noise when you get to 5 or 6.Here is the code for embedding the
Var
objects, in this casepitch
andvelocity
(corresponding to the MIDI messages coming from the keyboard). Placing them inside anenvelope()
was the only way I could figure out to make them responsive to changes in theVar
, even though it just ignores thetime
parameter of theenvelope()
:Here is the code from the aforementioned
main.rs
, in case you can point out an error somewhere at a glance. Thank you in advance for any insight you may be able to offer: