cursed fix to element count (hardcode my behated)

This commit is contained in:
sigil-03 2025-10-28 18:58:08 -06:00
parent aa57096e4b
commit e6ca9c7ed8

View file

@ -39,7 +39,8 @@ impl<W: Wavetable> SimpleWavetableSynthesizer<W> {
pub fn set_freq(&mut self, freq_hz: usize) {
self.output_freq_hz = freq_hz;
// probably a better way to do this with modulos or something...
self.clock_per_sample = self.clock_freq_hz / self.output_freq_hz / self.wavetable.size();
// FIXME: use the length of the square table.. or whatever wavetable tbh
self.clock_per_sample = self.clock_freq_hz / self.output_freq_hz / 2;
}
pub fn tick(&mut self) {