Midi Keyboard help

So I tried making my first patch in Audulus. Its a additive synth with over 32 channels and four voices of polyphony. I love the software however every time I use my midi controller it gulches out and will make every voice play the same note and will only play certain notes. And now if I try using Ableton with it then Ableton will crash. Idk what’s wrong but I need help. I really want to get this thing working. Thanks!

Heres the patch:

Calculator.audulus (538.5 KB)

Welcome to the forum! It’s always nice to see a new face. :cowboy_hat_face:
I suspect that your primary problem is simply too much CPU load. By my calculations you have 1024 oscillators in the patch plus 64 meters, 68 knobs, etc.

I noticed that you have multiple copies of the keyboard node which isn’t normally necessary. Since the keyboard nodes are all set the same they will produce the same outputs and so only one copy is required.
Polyphony in Audulus works by duplicating the elements attached to the polyphonic signal. A keyboard node set to 4 channels generates 4 separate pitches and 4 separate gates. When you attach the keyboard node set to 4 channels and attach it to a module with 32 oscillators you end up with 128 oscillators actually running. Since you have eight 32 oscillator modules you end up with 1024 oscillators in total. Since each of the modules receives the same signals from the keyboard node you are generating the same output from each. You should be able to get the same results with only two modules. I’ve modified your patch to remove the extra oscillators and keyboard nodes.

That raises the question of how many oscillators are required to perform additive synthesis in Audulus? The highest frequency we can produce is the Nyquist frequency which is half the sample rate. Attempts Frequencies above the Nyquist limit cause aliasing and result in the introduction of reflected components below the Nyquist limit. If we’re running at a sample rate of 44.1 kHz then we can’t reproduce frequencies over 22.05 kHz. If we assume that 20 Hz is the lowest fundamental we will produce, then the eleventh harmonic will be 20,480 Hz so at most we need 11 oscillators. As the fundamental pitch rises we can use fewer and fewer harmonics before we reach the Nyqiuist frequency. The oscillator node in Audulus is de-aliased but I’m not sure if that means that it will stop outputting at the Nyquist frequency.

You might want to consider moving the meter nodes inside the module and exposing them rather than laying them on top. It will make it easier to move things around.
Modified Calculator.audulus (169.1 KB)

I built an additive oscillator based on the phasor node. It allows you to control the amplitude and phase of each partial. Since there phasor node isn’t anti-aliased, I added a manual cutoff for each oscillator.:
STS harmonic osc model 2 V2.2.audulus (160.4 KB)

Omg thank u so much! ur actually a wizard. And yeah I could probably cut down the oscillators to like 12 or so bc it’ll save cpu and bc of the nyquit Frequency. Thanks again tho!

Glad I could help.
I checked with @Taylor, the developer, and even thought the waveforms in the oscillator nodes are anti-aliased they will all alias if the fundamental frequency is set above the Nyquist frequency. Of course all those aliased oscillators do add a certain grittiness to the sound that you wouldn’t have otherwise. I don’t think it’s always something to avoid but it’s good to be aware of it. :cowboy_hat_face:
You might want to wire the output of the fundamental oscillator to the sync input of the others in each module. Normally they will start and stay in phase, but sometimes rounding errors may cause very slight mismatches in the frequencies which will cause them to diverge. forcing them to sync will prevent this. I haven’t heard much if any change in sound if the partials are out of phase and there is some question as to whether it really matters but it can’t hurt. :cowboy_hat_face:

My apologies. I was mistaken when I stated earlier that the eleventh harmonic of 20 Hz was 20,480 Hz. I was doubling the frequency for each harmonic rather than using the next integer multiple of the fundamental. You wouldn’t reach the Nyquist frequency at 20 Hz until the 110th harmonic at 22,000 Hz. At 440 Hz the 32nd harmonic would be 14,080 Hz, still well below the Nyquist frequency. At a 44.1 kHz sample rate, the 32nd harmonic would be above the Nyquist frequency and produce aliasing only when the fundamental frequency is above 690.625 Hz.

So 32 oscillators isn’t as excessive as I first thought, at least for midrange fundamental frequencies. Sixteen is the most I ever combined, but I might have to build a bigger model. :cowboy_hat_face: