MIDI Digitally Controlled Oscillator

The MIDI VCO (NCO model) is an oscillator that produces a square wave whose frequency is based on a digital input. The input must consist of seven bits (MIDI note). MIDI notes are numbered between zero and 127 (Bit 1 is the MSB). Note: number zero corresponds to a C 5 octaves below middle C. There are 12 notes per octave, so a middle C (which is 261.62 Hz) is note number 60. A440 (A above middle C) is note number 69, and so forth. Square waves of different frequencies can be produced by changing the bit pattern and the mult_factor.

Port Table

Description Direction Default Type Allowed Types Vector Vector Bounds Null Allowed
in IN d d YES 7 / 7 NO
out OUT d d NO   NO

Parameter Table

Name Description Data Type Default Value Limits Vector Vector Bounds Null Allowed
delay Output delay Real 1.0e-9 1.0e-15 / - NO   YES
mult_factor Freq multiplier Real 1 1.0e-9 / - NO   YES

Examples

Atest1 1 2 nco1

.model nco1 nco(delay=1.0N Mult_Factor=16)

See also

XSPICE Devices
XSPICE Code Models