GestureSynth.me

Music calculator

Clock Divider Calculator

Divide an oscillator frequency by an integer and see the new period and musical interval. Compare suboctaves, odd divisions and slow modulation clocks.

clock divider calculator

Clock Divider Calculator guide

A counter can turn a fast oscillator into a suboscillator, pulse clock or low-frequency timing reference. Enter the rate of the incoming cycles and the complete input-to-output division ratio. The result is the repetition frequency of the divided output, plus its period in milliseconds and the interval below the original clock.

Play the instrument ↑
Default result
220 Hz divided clock

Calculation and units

For an integer division N, the output completes one cycle per N input cycles. Output frequency is the input frequency divided by N. The output period is one thousand divided by output hertz in milliseconds. Twelve times the base-two logarithm of the frequency ratio gives the equivalent equal-tempered interval.

Worked examples

Select a named case in the Worked example control to load these values. You can then edit any input to compare the result.

Octave-down clock

Oscillator input (Hz) = 440 · Integer divide ratio = 2.

220 Hz divided clock. Output repeats every 4.545454545 ms · 2 input cycles per output cycle · shift -12 semitones relative to the input.

Counting two full input cycles per output period halves the repetition frequency. The resulting suboscillator follows the input by one exact octave.

Binary counter second stage

Oscillator input (Hz) = 440 · Integer divide ratio = 4.

110 Hz divided clock. Output repeats every 9.090909091 ms · 4 input cycles per output cycle · shift -24 semitones relative to the input.

Two successive divide-by-two stages produce a total division of four. The waveform repeats once per four input cycles even though the pitch shift is two octaves.

Divide by three

Oscillator input (Hz) = 480 · Integer divide ratio = 3.

160 Hz divided clock. Output repeats every 6.25 ms · 3 input cycles per output cycle · shift -19.01955 semitones relative to the input.

A nonbinary division can produce a useful subharmonic. Its musical distance is not an integer number of octaves even when the output frequency is a whole number.

Unity reference

Oscillator input (Hz) = 1000 · Integer divide ratio = 1.

1000 Hz divided clock. Output repeats every 1 ms · 1 input cycles per output cycle · shift 0 semitones relative to the input.

A ratio of one passes the repetition rate unchanged. Use this as a wiring or documentation reference before examining deeper counter stages.

Clock down to an LFO

Oscillator input (Hz) = 32768 · Integer divide ratio = 32768.

1 Hz divided clock. Output repeats every 1000 ms · 32768 input cycles per output cycle · shift -180 semitones relative to the input.

A power-of-two reference and matching integer divisor produce one output period per second. The same calculation applies below the audible range.

Musical reference from a fast clock

Oscillator input (Hz) = 1000000 · Integer divide ratio = 2273.

439.947206335 Hz divided clock. Output repeats every 2.273 ms · 2273 input cycles per output cycle · shift -133.804584 semitones relative to the input.

Integer division usually misses a target pitch by a small amount. Try adjacent divisors to compare the attainable frequencies without rounding the input clock.

Interpreting the result

Check what the circuit or microcontroller calls its divisor. A pin that toggles once every N ticks takes two toggles to complete a cycle, so the full divide ratio can be twice the interrupt interval. Measure like edges on the output when comparing a counter setting with this calculator.

Measurement and model limits

This model assumes periodic input and an integer ratio. It gives no guarantee of a fifty-percent duty cycle, especially for odd divisors. Fractional accumulators, sample-rate converters and pulse-skipping dividers need additional timing information to characterize jitter and individual pulse lengths.

Answers before you play

Common questions

Can a divide-by-three stage produce an octave?

No. An octave down requires a frequency ratio of one half. Division by three produces a different interval that may still work musically as a subharmonic.

How do cascaded divisors combine?

Multiply their ratios. A divide-by-two stage followed by a divide-by-three stage gives an overall divisor of six.

Should I enter a CPU clock or a timer clock?

Enter the frequency arriving at this divider. A timer prescaler may already have reduced the processor clock before this stage.

How do I choose the closest integer divisor?

Divide the input hertz by the desired output hertz. Try the integers on either side and compare the actual frequency errors.