GameBoy-style Noise Generator in Max - Clocking Trouble

Ellery Aschenbrenner's icon

Ellery Aschenbrenner

7月 24 2024 | 1:37 午前

Hey everyone!

I recently began attempting to recreate the 1st-gen Pokémon cries from scratch, referencing from this video, this document, and this post, and decided to use Max for the LSFR Noise Channel portion. The sequence in my patch matches the Articuno cry data (example here). I'm pretty confident that the LFSR is set up properly for the 7-bit width, and that the sound generation is accurate.

The main issue that I'm having is clocking the system. Because I'm sequencing by hertz values (converted into samples for ease of use), the metro object is much too slow. I attempted to use phasor~ and edge~ objects to send the correct rate of number generation to the LFSR. From my testing, this setup is reliable at low frequencies, but becomes very inaccurate at higher values. Is there a way to make this more accurate so that I can match the original noise style?

I would be grateful for any insight/advice on how to improve this system, or an alternative approach!

Here's the sequenced patch, and a trimmed down version that plays continuously.

GBA-DSG-Noise_7bit_SEQ.maxpat
Max Patch
GBA-DSG-Noise_7bit_Running.maxpat
Max Patch