ikaros-project / ikaros-3

Ikaros version 3
GNU Affero General Public License v3.0
3 stars 1 forks source link

Fix audio choppiness #53

Closed trondarild closed 1 month ago

trondarild commented 1 month ago

The function generator and the audiooutput modules need to use the internal timing functions to ensure smooth output

ikaros-project commented 1 month ago

This is planned for function generators and oscillators by using rate parameters everywhere.

It would be great with an audio output module that could use a matrix as an audio buffer that is filled and converted to audio at each tick.

ikaros-project commented 1 month ago

The new module Oscillator is supposed to replace FunctionGenerator. It will use real time instead of ticks but is not ready yet.

trondarild commented 1 month ago

Ok sounds good! OutputAudio checked in that exactly takes a matrix buffer and converts to audio, but it's a little choppy still due to rate issues. I guess we can remove FunctionGenerator when oscillator is ready, I just checked it in for testing the audio module.

ikaros-project commented 1 month ago

The new scheduler will include a priority setting for modules that will increase temporal stability it may still be necessary to hand over the sound buffer to a separate thread with more exact timing if it is not already available as af function in the AudioToolbox. A small delay would limit choppiness.

ikaros-project commented 1 month ago

Would it be useful to generate sound buffers from the oscillator module? This would allow the oscillator module to generate signals with frequencies that are higher than 1/ tick_duration. Not sue what the use case would be though, except for sound synthesis.

ikaros-project commented 1 month ago

Choppiness is probably fixed with some mutexes and double buffering