0
\$\begingroup\$

I'm building a simple triangle-wave sound chip based around a 4-bit DAC. It works, but I have to have each individual square wave for each of the 16 notes (which are bass-range, 60Hz-238Hz.) I want to have one square-wave source and a set of multipliers for each frequency.

Following is a link to the simulated circuit on Falstad circuit simulator. The text next to the column of CLK tags shows the output frequency of each tag. The inputs on the bottom cause the circuit to output different frequencies from 60Hz (far left) to 238Hz (far right) in increments of about 11.5Hz.

Falstad link

\$\endgroup\$
2
  • \$\begingroup\$ instead of getting 16 different frequencies and choosing one, have you considered using an adjustable frequency? You might have less circuitry and more notes. One common way to do this is start with a high frequency and put it through a counter with an adjustable maximum value. \$\endgroup\$ Mar 22, 2023 at 19:42
  • \$\begingroup\$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. \$\endgroup\$
    – Community Bot
    Mar 23, 2023 at 15:52

1 Answer 1

1
\$\begingroup\$

Early sound chips usually worked in a couple different ways.

First way is to have a single large frequency, then divide down by two to get into correct octave, and then divide down with a divisor to get to the correct note, or reasonably close to it. The Philips SAA1009P operated like this, with 8 octaves and range of 256 to 511 as the divisor to get to correct note.

Another way is to have just a phase accumulator, where you increment a counter by some number, and use the high bits of the counter as index to waveform memory, or simply, use it as-is for triangle wave and use the MSB for up/down ramp. This approach was used by the C64 SID chip for example.

So it is easier to just have a high frequency and divide the output down with different methods, than to generate multipliers. If you want 16 specific notes then you could use some sort of look-up table.

\$\endgroup\$
1
  • \$\begingroup\$ I used the SAA1009P system, and it resulted in a set of frequencies between 21Hz and, somewhat amusingly, 666Hz, because of the dividers I was using. I'd give the link so you can look at it and give some advice, but the link is 2000+ characters and link shorteners are banned. \$\endgroup\$
    – cheese
    Mar 23, 2023 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.