A Composite Voice Synthesizer

  • Upload
    hermiit

  • View
    229

  • Download
    0

Embed Size (px)

Citation preview

  • 8/14/2019 A Composite Voice Synthesizer

    1/64

    A Composite Voice Synthesizer

    A Composite Voice Synthesizer

    THESIS

    Anthony Carrico

    B.S., University of Illinois, 1992

    Submitted in partial fulfillment of the requirements for the degree of Master of Science in Electrical Engineering in the Graduate College of the University of the University of Illinois

    at Urbana-Champaign, 1994

    Dedication

    This work is dedicated to Zachary Carrico.

    During the course of this project, several people contributed to its success. Paul Radja helped with the initial design and prototyping. Tom Compton helped debug the circuits.

    Michael Hamman helped design software and created compositions with the Composite Voice Synthesizer.

    I thank Doctor Ricardo Uribe for continually advancing the Advanced Digital Signal Laboratory: an environment in which award-winning projects take place through education.

    Table of Contents

    1. Introduction

    2. Synthesizer Design

    Traditional Model

    Problems with Independent Voice Synthesis

    Composite Voice Synthesis

    3. Theory of Design

    Digital Signal Processor

    The Digital Oscillator Bank

    4. Hardware Implementation

    The Digital Signal Processor

    The Oscillator Bank

    The AES-EBU Converter Box

    Digital Audio Converter

    5. Software

    Development and Utility Software

    Oscillator Bank Interface

    Synthesis Core Program

    Application

    Composition

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (1 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#id2792960http://memebeam.org/acarrico/thesis/thesis.html#id2792999http://memebeam.org/acarrico/thesis/thesis.html#id2793006http://memebeam.org/acarrico/thesis/thesis.html#id2793041http://memebeam.org/acarrico/thesis/thesis.html#id2793092http://memebeam.org/acarrico/thesis/thesis.html#id2793166http://memebeam.org/acarrico/thesis/thesis.html#id2793222http://memebeam.org/acarrico/thesis/thesis.html#id2793240http://memebeam.org/acarrico/thesis/thesis.html#id2793426http://memebeam.org/acarrico/thesis/thesis.html#id2793462http://memebeam.org/acarrico/thesis/thesis.html#id2793605http://memebeam.org/acarrico/thesis/thesis.html#id2792732http://memebeam.org/acarrico/thesis/thesis.html#id2792758http://memebeam.org/acarrico/thesis/thesis.html#id2792791http://memebeam.org/acarrico/thesis/thesis.html#id2792807http://memebeam.org/acarrico/thesis/thesis.html#id2792852http://memebeam.org/acarrico/thesis/thesis.html#id2792880http://memebeam.org/acarrico/thesis/thesis.html#id2794074http://memebeam.org/acarrico/thesis/thesis.html#id2794102http://memebeam.org/acarrico/thesis/thesis.html#id2794102http://memebeam.org/acarrico/thesis/thesis.html#id2794074http://memebeam.org/acarrico/thesis/thesis.html#id2792880http://memebeam.org/acarrico/thesis/thesis.html#id2792852http://memebeam.org/acarrico/thesis/thesis.html#id2792807http://memebeam.org/acarrico/thesis/thesis.html#id2792791http://memebeam.org/acarrico/thesis/thesis.html#id2792758http://memebeam.org/acarrico/thesis/thesis.html#id2792732http://memebeam.org/acarrico/thesis/thesis.html#id2793605http://memebeam.org/acarrico/thesis/thesis.html#id2793462http://memebeam.org/acarrico/thesis/thesis.html#id2793426http://memebeam.org/acarrico/thesis/thesis.html#id2793240http://memebeam.org/acarrico/thesis/thesis.html#id2793222http://memebeam.org/acarrico/thesis/thesis.html#id2793166http://memebeam.org/acarrico/thesis/thesis.html#id2793092http://memebeam.org/acarrico/thesis/thesis.html#id2793041http://memebeam.org/acarrico/thesis/thesis.html#id2793006http://memebeam.org/acarrico/thesis/thesis.html#id2792999http://memebeam.org/acarrico/thesis/thesis.html#id2792960
  • 8/14/2019 A Composite Voice Synthesizer

    2/64

    A Composite Voice Synthesizer

    6. Future Work

    A. Masking

    B. CVS Schematics

    C. AES-EBU Schematics

    D. Digital Audio Converter Schematics

    E. Programmable Logic

    F. Software

    G. Memory Map

    Bibliography

    List of Figures

    2.1. Composite Voice Synthesis.

    3.1. Block Diagram of the Composite Voice Synthesizer System.

    3.2. Pipeline Stage Diagram.

    4.1. Block Diagram of DSP with Peripherals.

    B.1. DSP Top Level

    B.2. DSP Memory

    B.3. Digital Signal Processor

    B.4. Seven-Segment Display

    B.5. The ISA Bus

    B.6. The Index Counter

    B.7. Pipeline Top Level

    B.8. Pitch-to-Phase Converter

    B.9. Phase Adder

    B.10. Cosine Look-Up Table

    B.11. Multiplier-Accumulator

    B.12. Phase Registers

    B.13. Pitch Registers

    B.14. Amplitude RegistersC.1. The AES-EBU Converter Box

    D.1. Digital Audio Converter

    D.2. Digital Receiver

    D.3. Display

    D.4. Digital Transmitter

    D.5. Digital-to-Analog Converter

    D.6. Analog-to-Digital Converter

    D.7. Analog Input

    D.8. Microphone Input

    D.9. Reset and ClockE.1. ms-synth.pds

    E.2. ms_dec.pds

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (2 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#id2794174http://memebeam.org/acarrico/thesis/thesis.html#Maskinghttp://memebeam.org/acarrico/thesis/thesis.html#AppendixBhttp://memebeam.org/acarrico/thesis/thesis.html#AppendixChttp://memebeam.org/acarrico/thesis/thesis.html#AppendixDhttp://memebeam.org/acarrico/thesis/thesis.html#PLDhttp://memebeam.org/acarrico/thesis/thesis.html#Softwarehttp://memebeam.org/acarrico/thesis/thesis.html#MemMaphttp://memebeam.org/acarrico/thesis/thesis.html#id2795359http://memebeam.org/acarrico/thesis/thesis.html#fig1http://memebeam.org/acarrico/thesis/thesis.html#fig2http://memebeam.org/acarrico/thesis/thesis.html#fig3http://memebeam.org/acarrico/thesis/thesis.html#fig4http://memebeam.org/acarrico/thesis/thesis.html#id2794268http://memebeam.org/acarrico/thesis/thesis.html#id2794289http://memebeam.org/acarrico/thesis/thesis.html#id2794308http://memebeam.org/acarrico/thesis/thesis.html#id2794328http://memebeam.org/acarrico/thesis/thesis.html#id2794347http://memebeam.org/acarrico/thesis/thesis.html#id2794366http://memebeam.org/acarrico/thesis/thesis.html#id2794386http://memebeam.org/acarrico/thesis/thesis.html#id2794405http://memebeam.org/acarrico/thesis/thesis.html#id2794424http://memebeam.org/acarrico/thesis/thesis.html#id2794443http://memebeam.org/acarrico/thesis/thesis.html#id2794463http://memebeam.org/acarrico/thesis/thesis.html#id2794482http://memebeam.org/acarrico/thesis/thesis.html#id2794501http://memebeam.org/acarrico/thesis/thesis.html#id2794520http://memebeam.org/acarrico/thesis/thesis.html#id2794555http://memebeam.org/acarrico/thesis/thesis.html#id2794591http://memebeam.org/acarrico/thesis/thesis.html#id2794612http://memebeam.org/acarrico/thesis/thesis.html#id2794631http://memebeam.org/acarrico/thesis/thesis.html#id2794650http://memebeam.org/acarrico/thesis/thesis.html#id2794670http://memebeam.org/acarrico/thesis/thesis.html#id2794689http://memebeam.org/acarrico/thesis/thesis.html#id2794708http://memebeam.org/acarrico/thesis/thesis.html#id2794728http://memebeam.org/acarrico/thesis/thesis.html#id2794747http://memebeam.org/acarrico/thesis/thesis.html#ms-synth.pdshttp://memebeam.org/acarrico/thesis/thesis.html#ms_dec.pdshttp://memebeam.org/acarrico/thesis/thesis.html#ms_dec.pdshttp://memebeam.org/acarrico/thesis/thesis.html#ms-synth.pdshttp://memebeam.org/acarrico/thesis/thesis.html#id2794747http://memebeam.org/acarrico/thesis/thesis.html#id2794728http://memebeam.org/acarrico/thesis/thesis.html#id2794708http://memebeam.org/acarrico/thesis/thesis.html#id2794689http://memebeam.org/acarrico/thesis/thesis.html#id2794670http://memebeam.org/acarrico/thesis/thesis.html#id2794650http://memebeam.org/acarrico/thesis/thesis.html#id2794631http://memebeam.org/acarrico/thesis/thesis.html#id2794612http://memebeam.org/acarrico/thesis/thesis.html#id2794591http://memebeam.org/acarrico/thesis/thesis.html#id2794555http://memebeam.org/acarrico/thesis/thesis.html#id2794520http://memebeam.org/acarrico/thesis/thesis.html#id2794501http://memebeam.org/acarrico/thesis/thesis.html#id2794482http://memebeam.org/acarrico/thesis/thesis.html#id2794463http://memebeam.org/acarrico/thesis/thesis.html#id2794443http://memebeam.org/acarrico/thesis/thesis.html#id2794424http://memebeam.org/acarrico/thesis/thesis.html#id2794405http://memebeam.org/acarrico/thesis/thesis.html#id2794386http://memebeam.org/acarrico/thesis/thesis.html#id2794366http://memebeam.org/acarrico/thesis/thesis.html#id2794347http://memebeam.org/acarrico/thesis/thesis.html#id2794328http://memebeam.org/acarrico/thesis/thesis.html#id2794308http://memebeam.org/acarrico/thesis/thesis.html#id2794289http://memebeam.org/acarrico/thesis/thesis.html#id2794268http://memebeam.org/acarrico/thesis/thesis.html#fig4http://memebeam.org/acarrico/thesis/thesis.html#fig3http://memebeam.org/acarrico/thesis/thesis.html#fig2http://memebeam.org/acarrico/thesis/thesis.html#fig1http://memebeam.org/acarrico/thesis/thesis.html#id2795359http://memebeam.org/acarrico/thesis/thesis.html#MemMaphttp://memebeam.org/acarrico/thesis/thesis.html#Softwarehttp://memebeam.org/acarrico/thesis/thesis.html#PLDhttp://memebeam.org/acarrico/thesis/thesis.html#AppendixDhttp://memebeam.org/acarrico/thesis/thesis.html#AppendixChttp://memebeam.org/acarrico/thesis/thesis.html#AppendixBhttp://memebeam.org/acarrico/thesis/thesis.html#Maskinghttp://memebeam.org/acarrico/thesis/thesis.html#id2794174
  • 8/14/2019 A Composite Voice Synthesizer

    3/64

    A Composite Voice Synthesizer

    E.3. synthmsc.pds

    E.4. counter.pds

    F.1. voices.h

    F.2. main.c

    F.3. voice.asm

    F.4. inst.asm

    F.5. env.asm

    G.1. Memory Map

    Chapter 1. Introduction

    The Composite Voice Synthesizer (CVS) is a sine wave generator and a digital signal processor (DSP) with an AES-EBU (Acoustical Engineering Society, European Broadcast

    Union) digital output. The project also includes a Digital Audio Converter that provides bidirectional conversion between two-channel AES-EBU data and two-channel analog signals.

    The intended use of the CVS is the exploration of real-time sound synthesis and music composition. The real-time nature of the CVS distinguishes it from disk-storage based

    computer music systems, and the composite nature of the CVS distinguishes it from other real-time synthesizers. These distinctions are made in design, but they are also a matter of

    application; certainly the CVS is capable of traditional real-time synthesis or computer music.

    The CVS was designed and built in the Advanced Digital Systems Laboratory: A learning environment which makes the CVS available to students with diverse interests. This

    ensures its further development and use as an instrument for research and learning for years to come.

    Chapter 2. Synthesizer Design

    Table of Contents

    Traditional Model

    Problems with Independent Voice Synthesis

    Composite Voice Synthesis

    Traditional Model

    In acoustic musical instruments, a fixed number of voices are available at one time. A piano has 88 voices available, and each produces only one pitch. A saxophone has one voice

    available, but that voice produces many pitches and timbres. These instruments generate the sound for each voice independently; each voice on an acoustic instrument is a separate

    hardware oscillator such as a string, reed or membrane. This arrangement makes up the instrument's voice structure.

    Designers of electronic musical instruments adopted this same approach. Most electronic instruments output several voices that produce many pitches and timbres. Electronic

    instruments either duplicate the sound synthesis hardware for each voice, like acoustic instruments, or multiplex the synthesis hardware in time to produce several independent voices.

    In either case, there is a fixed voice structure.

    Problems with Independent Voice Synthesis

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (3 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#synthmsc.pdshttp://memebeam.org/acarrico/thesis/thesis.html#counter.pdshttp://memebeam.org/acarrico/thesis/thesis.html#voices.hhttp://memebeam.org/acarrico/thesis/thesis.html#main.chttp://memebeam.org/acarrico/thesis/thesis.html#voice.asmhttp://memebeam.org/acarrico/thesis/thesis.html#inst.asmhttp://memebeam.org/acarrico/thesis/thesis.html#env.asmhttp://memebeam.org/acarrico/thesis/thesis.html#id2795346http://memebeam.org/acarrico/thesis/thesis.html#id2793006http://memebeam.org/acarrico/thesis/thesis.html#id2793041http://memebeam.org/acarrico/thesis/thesis.html#id2793092http://memebeam.org/acarrico/thesis/thesis.html#id2793092http://memebeam.org/acarrico/thesis/thesis.html#id2793041http://memebeam.org/acarrico/thesis/thesis.html#id2793006http://memebeam.org/acarrico/thesis/thesis.html#id2795346http://memebeam.org/acarrico/thesis/thesis.html#env.asmhttp://memebeam.org/acarrico/thesis/thesis.html#inst.asmhttp://memebeam.org/acarrico/thesis/thesis.html#voice.asmhttp://memebeam.org/acarrico/thesis/thesis.html#main.chttp://memebeam.org/acarrico/thesis/thesis.html#voices.hhttp://memebeam.org/acarrico/thesis/thesis.html#counter.pdshttp://memebeam.org/acarrico/thesis/thesis.html#synthmsc.pds
  • 8/14/2019 A Composite Voice Synthesizer

    4/64

    A Composite Voice Synthesizer

    A composer may desire to use more voices than are available on a particular instrument. Gathering several instruments together is one way to provide more voices, but this may not

    be feasible during composition. Assembling the sound on disk or tape before listening also allows more voices, but the delay involved disrupts the feedback necessary for

    composition. These compromises arise because electronic instruments dedicate most of their hardware to the computationally intensive task of independent voice synthesis. In an

    article on additive synthesizer design, Snell suggests an application of his synthesizer [Snell77] The 256 sinusoidal components might be utilized in generating 16 voices or

    instruments, each having 16 partials. This independent voice structure dominates the design and application of most real-time music synthesizers.

    Composite Voice Synthesis

    Figure 2.1. Composite Voice Synthesis.

    Composite Voice Synthesis is a paradigm for designing instruments that diverge from the traditional model; this allows the composer a greater range of activities and research. TheCVS overcomes independent voice limitations by moving the voice structure before synthesis. A composite voice is made of the sounds from an arbitrary voice structure and the

    synthesis hardware synthesizes the resulting single voice (Figure 2.1).

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (4 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#fig1http://memebeam.org/acarrico/thesis/thesis.html#fig1
  • 8/14/2019 A Composite Voice Synthesizer

    5/64

    A Composite Voice Synthesizer

    The composite voice reduces the computational load of synthesis making the instrument's resource use more efficient and flexible. The synthesizer can use its full synthesis hardware

    on a small number of voices or exploit pychoacoustic effects to synthesize a larger number of voices than an independent voice structure would allow (Appendix A,Masking).

    The CVS's scope is limited to spectral interpolation and synthesis, not analysis or sequencing. Ideally, the CVS would synthesize the composite voice of a preprocessor that could also

    help design or analyze voices; however, the CVS's own DSP assembled all music created so far because, as yet, there is no composite voice preprocessor for the system.

    Chapter 3. Theory of Design

    Table of Contents

    Digital Signal Processor

    The Digital Oscillator Bank

    Figure 3.1. Block Diagram of the Composite Voice Synthesizer System.

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (5 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#Maskinghttp://memebeam.org/acarrico/thesis/thesis.html#Maskinghttp://memebeam.org/acarrico/thesis/thesis.html#id2793222http://memebeam.org/acarrico/thesis/thesis.html#id2793240http://memebeam.org/acarrico/thesis/thesis.html#id2793240http://memebeam.org/acarrico/thesis/thesis.html#id2793222http://memebeam.org/acarrico/thesis/thesis.html#Masking
  • 8/14/2019 A Composite Voice Synthesizer

    6/64

    A Composite Voice Synthesizer

    The CVS's hardware has two parts (see Figure 3.1):

    q A general purpose DSP.

    q A fixed pipeline processor that implements a digital oscillator bank.

    This section explains the design of these parts.

    Digital Signal Processor

    The DSP is an inexpensive fixed-point processor. It features a hardware multiplier that is necessary for signal processing. The processor also interfaces easily with the output circuitry

    of the CVS. The flexibility of this programmable processor allows for easy experimentation with the oscillator bank.

    The Digital Oscillator Bank

    The digital oscillator bank is a pipeline that converts amplitude and pitch arrays to sound samples (Xn) according to its dedicated function:

    Xn = Sumn Ampnx COS (Phasen + change Phasen)

    Figure 3.2. Pipeline Stage Diagram.

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (6 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#fig2http://memebeam.org/acarrico/thesis/thesis.html#fig2
  • 8/14/2019 A Composite Voice Synthesizer

    7/64

    A Composite Voice Synthesizer

    The pipeline calculates each cosine in the following phases diagrammed in Figure 3.2:

    1. Look up pitch.2. Convert pitch to phase change -- look up old phase.

    3. Add phase change to old phase.

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (7 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#fig3http://memebeam.org/acarrico/thesis/thesis.html#fig3
  • 8/14/2019 A Composite Voice Synthesizer

    8/64

    A Composite Voice Synthesizer

    4. Store new phase -- look up cosine of new phase -- look up amplitude.

    5. Multiply cosine by amplitude.

    Pitch is exponentially related to frequency through the equation frequency = frefx 2pitch where frefis the reference for the exponential curve. For example, if 27.5 Hz (note A0 in

    musical terms) is chosen for the reference pitch, then pitch four is 440 Hz, the standard musical reference. The actual reference frequency (pitch zero) is 2-9/12 x 27.5Hz, 16.35 Hz,

    musical pitch C0. The following equation gives the phase change required each sample period: frequency = (change phase/220) fs, where fs is the sample frequency. A look-up table

    provides conversion from pitch to phase change in the pipeline. This conversion simplifies the hardware and software interfaces to the oscillator bank (see Chapter 4 and 5).

    The oscillator bank uses a 16-bit word sine wave table that is 65536 (64K) words long. Noise analysis for digital oscillators presented by Moore [Moore77] indicates that this table

    should give an 84dB signal-to-error noise ratio (SNeR), although the reference does not contain specific noise data for this size table. The cosine function is a full 2pi wave cycle.

    Chapter 4. Hardware Implementation

    Table of Contents

    The Digital Signal Processor

    The Oscillator Bank

    The AES-EBU Converter Box

    Digital Audio Converter

    The CVS is a 16-bit card that resides on the Industry Standard Architecture (ISA) bus of a personal computer (see Figure 3.1). The circuit board is a Vector Board with power and

    ground planes. Physically, high-speed complementary metal oxide semiconductor (CMOS) and transistor transistor logic (TTL) parts make up the circuit. Their interconnect is Kynar

    wire on 3M strips soldered to integrated circuit (IC) sockets. In hindsight, the CVS should have been built with the 55 mil wire-wrapped pin technology used in other parts of the

    project; the 3M strips concealed several bad connections discovered and fixed during debugging. Appendix B, CVS Schematics contains the complete CVS schematics.

    The Digital Signal Processor

    The microprocessor that controls the CVS is a 16-bit fixed point DSP (Texas Instruments TMS320C26 [TI90a]). In addition to the processor's internal processor memory, 16384

    words of random access memory (RAM) are available in its external address space. The processor has a Harvard architecture with separate data and instruction spaces; however, bothspaces decode physically to the same external memory: four 16384 x 4-bit static CMOS RAMs (Cypress Semiconductor CY7C164-20PC).

    The DSP has a very simple, somewhat limiting, interface with its host processor (the personal computer). The host can interrupt, hold or reset the DSP through an I/O register. In the

    hold state, the host can directly address the DSP's external memory to examine it or load data, code and interrupt vectors. This interface allows full host downloading, monitoring and

    debugging capabilities, but since the host holds the DSP during these operations, real-time interaction is limited.

    Figure 4.1. Block Diagram of DSP with Peripherals.

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (8 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#id2793462http://memebeam.org/acarrico/thesis/thesis.html#id2793605http://memebeam.org/acarrico/thesis/thesis.html#id2792732http://memebeam.org/acarrico/thesis/thesis.html#id2792758http://memebeam.org/acarrico/thesis/thesis.html#fig2http://memebeam.org/acarrico/thesis/thesis.html#AppendixBhttp://memebeam.org/acarrico/thesis/thesis.html#AppendixBhttp://memebeam.org/acarrico/thesis/thesis.html#AppendixBhttp://memebeam.org/acarrico/thesis/thesis.html#fig2http://memebeam.org/acarrico/thesis/thesis.html#id2792758http://memebeam.org/acarrico/thesis/thesis.html#id2792732http://memebeam.org/acarrico/thesis/thesis.html#id2793605http://memebeam.org/acarrico/thesis/thesis.html#id2793462
  • 8/14/2019 A Composite Voice Synthesizer

    9/64

    A Composite Voice Synthesizer

    The DSP connects to the following peripherals (Figure 4.1):

    q A seven-segment LED display.

    q A synchronous serial port.

    q Controls for the oscillator bank's amplitudes.

    q Controls for the oscillator bank's pitches.

    q The oscillator bank's output register.

    The seven-segment LED display facilitates hardware and software debugging. An external register latches its value and serves as a driver for the display. Simply writing to this

    register presents a value on the LED display.

    The synchronous serial port is part of the DSP integrated circuit and drives a nine-pin connector at the back edge of the circuit board. An external box (described below) converts the

    serial output to a standard AES-EBU digital audio output. To maintain a consistent sample rate in the system, the signal that clocks the synthesis hardware also clocks the serial port.

    The DSP controls the oscillator bank through dual-port static RAM in its data memory space. This memory contains arrays for amplitude and pitch. As the DSP manipulates these

    arrays, the oscillator output immediately reflects the changes. The DSP reads these oscillator output samples from a register mapped in to one of its ports.

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (9 of 64)2004/12/06 12:11:25 .

    http://memebeam.org/acarrico/thesis/thesis.html#fig4http://memebeam.org/acarrico/thesis/thesis.html#fig4
  • 8/14/2019 A Composite Voice Synthesizer

    10/64

    A Composite Voice Synthesizer

    The Oscillator Bank

    The oscillator bank is a pipeline constructed from discrete registers, memories and logic. The pipeline implements one oscillator, but an index counter, made from a programmable

    logic device (PLD), time multiplexes the pipeline. The index counter uses the pipeline to sum up to 512 cosines each sample period. Discrete registers and integrated pipeline registers

    separate the pipeline phases. The implementation uses the following components:

    q Pitch array -- dual-ported static RAM.

    q Pitch-to-phase change converter -- erasable programmable read only memory (EPROM).

    q Phase accumulators -- dual-ported static RAM and TTL adders.q Cosine table -- EPROM.

    q Amplitude array -- dual-ported static RAM.

    q Multiplier accumulator -- VLSI component.

    The data path widths (the number of bits) vary across the pipeline. The oscillators store phase in 20-bit accumulators. Low frequency resolution and full frequency range mandate this

    wide path in a single sample rate system; however, a 12-bit pitch specifies the 20-bit phase change used by the accumulators. The pitch-to-phase change look-up table maps this 12-bit

    number to a 20-bit number. The 12-bit word length requires only a single processor data bus access.

    The cosine function is a full 2pi wave cycle stored in 64K 16-bit words of EPROM. This look-up table truncates the 20-bit phase output of the phase accumulator to 16 bits and maps

    it to a 16-bit output. The multiplier accumulator scales this value by a 16-bit amplitude and sums the time-multiplexed output values each sample period. The DSP converts the

    resulting samples to a 16-bit serial output stream.

    The AES-EBU Converter Box

    The second piece of hardware in this system is the AES-EBU converter box. This converter is external because of space constraints on the CVS board. The converter uses a Crystal

    Semiconductor digital audio transmitter to change the DSP's synchronous serial format to the digital audio standard format. Appendix C,AES-EBU Schematics contains the AES-

    EBU converter schematics.

    Digital Audio Converter

    The Digital Audio Converter is the final hardware built for this system. It provides conversion between AES-EBU digital audio and line-level analog signals. It also contains a

    microphone preamplifier. This device uses a two-channel analog-to-digital converter with a digital audio transmitter and a two-channel digital-to-analog converter with a digital audio

    receiver. All of these devices are Crystal Semiconductor parts. The microphone preamplifier is based on an Analog Devices operational amplifier. This device required special

    attention to power supplies, ground planes, circuit layout and other factors outside the scope of this thesis. Appendix D,Digital Audio Converter Schematics contains the Digital

    Audio Converter schematics.

    Chapter 5. Software

    Table of Contents

    Development and Utility Software

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (10 of 64)2004/12/06 12:11:25 .

    A C it V i S th i

    http://memebeam.org/acarrico/thesis/thesis.html#AppendixChttp://memebeam.org/acarrico/thesis/thesis.html#AppendixChttp://memebeam.org/acarrico/thesis/thesis.html#AppendixDhttp://memebeam.org/acarrico/thesis/thesis.html#AppendixDhttp://memebeam.org/acarrico/thesis/thesis.html#id2792807http://memebeam.org/acarrico/thesis/thesis.html#id2792807http://memebeam.org/acarrico/thesis/thesis.html#AppendixDhttp://memebeam.org/acarrico/thesis/thesis.html#AppendixC
  • 8/14/2019 A Composite Voice Synthesizer

    11/64

    A Composite Voice Synthesizer

    Oscillator Bank Interface

    Synthesis Core Program

    Application

    Composition

    Software is an important part of all programmable digital systems, including the CVS. During hardware assembly, utility software helped verify and debug the design. Later

    application software put the board to work.

    Development and Utility Software

    The Texas Instruments fixed point C compiler, assembler and linker work together to produce code for the CVS's DSP. Texas Instruments provides C code for a COFF (common

    object file format) loader that was modified to directly access the CVS. This loader downloads program code and data to the CVS. In addition, utilities (written in C) run on the host

    computer to accomplish the following tasks:

    q Clear the DSP's external memory.

    q View the DSP's external memory.

    q Reset, hold and interrupt the DSP.

    This collection of programs form a monitor for developing software on the CVS.

    Oscillator Bank Interface

    Programs access the digital oscillator bank through two arrays mapped in specific locations of the data memory space. The amplitude array simply specifies 16-bit amplitude values.

    The pitch array specifies 12-bit pitches. Since this system uses pitch instead of frequency units, programs can linearly shift a sound's pitch. For instance, a sound with three harmonic

    elements is transposed by adding a constant to each component; the resulting pitches are still harmonic. There are two sets of amplitude and pitch arrays and the DSP's external flag

    determines which one of these the oscillator bank uses. This double-buffer scheme allows the DSP to change one set while the other is in use, similar to a double frame buffer in video

    animation.

    Synthesis Core Program

    Three critical functions are the basis of a core program that can be expanded to create musical compositions:

    q DSP initialization.

    q Oscillator bank control.

    q Audio sample output.

    This program relates the oscillator bank hardware to a software stack of pitch and amplitude envelopes. The core program is driven by serial port and timer interrupts.

    When the serial port interrupt triggers, the DSP fetches a sample from the oscillator bank's output and sends the sample out the serial port. The digital audio stream expects two-

    channel (left/right) output, thus this sequence happens twice every sample period; currently, both channels receive the same signal.

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (11 of 64)2004/12/06 12:11:25 .

    A C it V i S th i

    http://memebeam.org/acarrico/thesis/thesis.html#id2792852http://memebeam.org/acarrico/thesis/thesis.html#id2792880http://memebeam.org/acarrico/thesis/thesis.html#id2794074http://memebeam.org/acarrico/thesis/thesis.html#id2794102http://memebeam.org/acarrico/thesis/thesis.html#id2794102http://memebeam.org/acarrico/thesis/thesis.html#id2794074http://memebeam.org/acarrico/thesis/thesis.html#id2792880http://memebeam.org/acarrico/thesis/thesis.html#id2792852
  • 8/14/2019 A Composite Voice Synthesizer

    12/64

    A Composite Voice Synthesizer

    The timer interrupt divides the processor's time into eight segments for multitasking. The DSP uses one of these segments for generating the oscillator bank's envelopes. The

    remaining segments can be used for composition or other sound synthesis code.

    Envelope generators track the pitch and amplitude for each sine wave. At the lowest level, arrays in dual ported RAM directly determine pitch and amplitude. The envelope

    generators use two-level linear interpolation. A fast inner loop interpolates breakpoints that another routine generates from envelope points. Each oscillator can be assigned an

    arbitrarily long set of pitch and amplitude envelope points. A stack stores unused oscillators so that program code can easily allocate oscillators as necessary. When an oscillator

    reaches the end of its envelope, the oscillator automatically goes back to the oscillator stack.

    Application

    A simple music player was the first application designed for the CVS. This player works with three data files. The first specifies envelope shapes which are combined in the second to

    form instruments. Finally a third file encodes notes from a staff. Parts of two musical pieces were entered into this player: a Bach invention and a Beethoven quartet (Appendix F,

    Software). These serve as a demonstration of the system; however, data files for this player are tedious to generate.

    Composition

    Michael Hamman [Hamman93], who helped write the core synthesis program, experimented with code for music composition on the CVS. His own words describe this work:

    The program Core-Dump uses the CVS to explore fixed-point numeric processing algorithms which nevertheless display complex and unpredictable behaviors. The

    program implements a network of simple modulus functions of the sort x = (y * m) MOD n. By experimenting with different networks and observing their (audible)

    results, networks were implemented which favored output behaviors that are extremely sensitive to initial conditions and which can vary considerably over time as the

    system is running. The program defines a network of value-less nodes. The values which determine the connections between nodes and which determine the system's

    output values (those used by the oscillator) are determined at run time. The system uses 128 of the 512 oscillators available on the oscillator bank. The program is

    designed to run continuously (forever), producing sequences of sounds as it does so. Different input data result in completely different resultant behaviors. Typically

    changes in the sound sequences can occur suddenly and without transition. This characteristic behavior traces the behavior of the software generating it: certain

    regions of order emerge and persist for some time and then suddenly change revealing either a new region of order or ever-varying regions of disorder.

    Chapter 6. Future WorkWhen is a project done? There is no satisfactory answer, but there are several aspects of this project that merit further exploration. The focus of this work was hardware design and

    implementation, but the idea of Composite Voice Synthesis deserves research for its own sake.

    Within the framework of this project, a second component could be built to process and transfer spectral data to the CVS. This device would combine instrument sounds and reduce

    the resulting spectrum according to psychoacoustic masking principals. Also, future signal processing experiments in the Advanced Digital Systems Laboratory can make use of the

    Digital Audio Converter built for this project.

    Outside of this project researchers should develop other real-time synthesizers using the Composite Voice principle, instead of classical voice structure. Finally, engineers and other

    technical people who develop tools should collaborate with composers on design and application, a path chosen in this project. The results of such collaboration will surprise and

    delight.

    Appendix A. Maskingfile:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (12 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

    http://memebeam.org/acarrico/thesis/thesis.html#Softwarehttp://memebeam.org/acarrico/thesis/thesis.html#Softwarehttp://memebeam.org/acarrico/thesis/thesis.html#Softwarehttp://memebeam.org/acarrico/thesis/thesis.html#Software
  • 8/14/2019 A Composite Voice Synthesizer

    13/64

    A Composite Voice Synthesizer

    Masking inherent in the human hearing mechanism locally reduces the ear's dynamic range in frequency bands around spectral peaks. Several audio data compression algorithms for

    digital tape (Phillips) and disk (Sony) recording, digital radio transmission (Musicam) and video soundtrack storage (Motion Picture Experts Group, MPEG) rely on this phenomenon.

    Haken [Haken92] designed and built a digital signal processor to investigate interpolation between sounds. He points out that auditory masking can make the sound synthesis more

    efficient. The computational savings available with Composite Voice Synthesis can be enhanced by taking advantage of masking effects.

    Appendix B. CVS Schematics

    The following pages contain the complete Composite Voice Synthesizer schematics.

    Figure B.1. DSP Top Level

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (13 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    14/64

    A Composite Voice Synthesizer

    Figure B.2. DSP Memory

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (14 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    15/64

    A Composite Voice Synthesizer

    Figure B.3. Digital Signal Processor

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (15 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    16/64

    Co pos te Vo ce Sy t es e

    Figure B.4. Seven-Segment Display

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (16 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    17/64

    p y

    Figure B.5. The ISA Bus

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (17 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    18/64

    Figure B.6. The Index Counter

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (18 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    19/64

    Figure B.7. Pipeline Top Level

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (19 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    20/64

    Figure B.8. Pitch-to-Phase Converter

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (20 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    21/64

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (21 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    22/64

    Figure B.9. Phase Adder

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (22 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    23/64

    Figure B.10. Cosine Look-Up Table

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (23 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    24/64

    Figure B.11. Multiplier-Accumulator

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (24 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    25/64

    Figure B.12. Phase Registers

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (25 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    26/64

    Figure B.13. Pitch Registers

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (26 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    27/64

    Figure B.14. Amplitude Registers

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (27 of 64)2004/12/06 12:11:25 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    28/64

    Appendix C. AES-EBU Schematics

    The following pages contain the complete AES-EBU converter schematics.

    Figure C.1. The AES-EBU Converter Box

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (28 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    29/64

    Appendix D. Digital Audio Converter Schematics

    The following pages contain the complete Digital Audio Converter schematics.

    Figure D.1. Digital Audio Converter

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (29 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    30/64

    Figure D.2. Digital Receiver

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (30 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    31/64

    Figure D.3. Display

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (31 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    32/64

    Figure D.4. Digital Transmitter

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (32 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    33/64

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (33 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    Figure D 5 Digital to Analog Converter

  • 8/14/2019 A Composite Voice Synthesizer

    34/64

    Figure D.5. Digital-to-Analog Converter

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (34 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    35/64

    Figure D.6. Analog-to-Digital Converter

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (35 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    36/64

    Figure D.7. Analog Input

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (36 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    37/64

    Figure D.8. Microphone Input

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (37 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    38/64

    Figure D.9. Reset and Clock

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (38 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    39/64

    Appendix E. Programmable Logic

    The following pages contain the complete equations for the system's programmable logic.

    Figure E.1 | Figure E.2 | Figure E.3 | Figure E.4

    Figure E.1. ms-synth.pds

    ;PALASM Design Description

    ;---------------------------------- Declaration Segment -----------

    TITLE ms-synth.pds

    PATTERN

    REVISION 1

    AUTHOR Anthony Carrico

    COMPANY ADSLDATE 03/28/92

    CHIP ms_synth PAL22V10

    ;---------------------------------- PIN Declarations --------------

    PIN 1 sa19

    PIN 2 sa18

    PIN 3 sa17

    PIN 4 sa16

    PIN 5 sa9

    PIN 6 sa8

    PIN 7 sa7

    PIN 8 sa6PIN 9 sa1

    PIN 10 aen

    PIN 11 /iow

    PIN 13 /smemw

    PIN 14 port COMBINATORIAL

    PIN 15 /dsp_hold

    PIN 16 /dsp1

    PIN 17 /dsp2

    PIN 18 mem_d COMBINATORIAL

    PIN 19 /DACK0 COMBINATORIAL

    PIN 20 /rw1 COMBINATORIAL

    PIN 21 /rw2 COMBINATORIAL

    PIN 22 /EN1 COMBINATORIAL

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (39 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    PIN 23 /EN2 COMBINATORIAL

    http://memebeam.org/acarrico/thesis/thesis.html#ms-synth.pdshttp://memebeam.org/acarrico/thesis/thesis.html#ms_dec.pdshttp://memebeam.org/acarrico/thesis/thesis.html#synthmsc.pdshttp://memebeam.org/acarrico/thesis/thesis.html#counter.pdshttp://memebeam.org/acarrico/thesis/thesis.html#counter.pdshttp://memebeam.org/acarrico/thesis/thesis.html#synthmsc.pdshttp://memebeam.org/acarrico/thesis/thesis.html#ms_dec.pdshttp://memebeam.org/acarrico/thesis/thesis.html#ms-synth.pds
  • 8/14/2019 A Composite Voice Synthesizer

    40/64

    ;------------------------------------ Boolean Equation Segment -----

    EQUATIONS

    mem_d = sa19 * sa18 * /sa17 * sa16 * /DACK0

    port = sa9 * sa8 * /sa7 * /sa6 * sa1 * /aen * iow

    rw1=smemw

    rw2=smemw

    rw1.trst = dsp_hold * dsp1 * mem_drw2.trst = dsp_hold * dsp2 * mem_d

    EN1 = DSP1

    EN2 = DSP2

    EN1.TRST = dsp_hold * dsp1 * MEM_D

    Figure E.2. ms_dec.pds

    ;PALASM Design Description;---------------------------------- Declaration Segment -----------

    TITLE ms_dec.pds

    PATTERN

    REVISION 1

    AUTHOR Anthony Carrico

    COMPANY ADSL

    DATE 03/28/92

    CHIP _ms_dec PALCE16V8

    ;---------------------------------- PIN Declarations --------------

    PIN 2 ada15 ;

    PIN 3 ada14 ;

    PIN 4 adb15 ;

    PIN 5 adb14 ;

    PIN 6 /DSa ;

    PIN 7 mem_d ;

    PIN 8 /strbb ;

    PIN 11 /PSa ;

    PIN 12 /mema COMBINATORIAL ;

    PIN 13 /memb COMBINATORIAL ;

    PIN 14 /amp COMBINATORIAL ;

    PIN 15 /pitch COMBINATORIAL ;

    PIN 16 /out COMBINATORIAL ;

    PIN 17 /MEMCS16 COMBINATORIAL ;;----------------------------------- Boolean Equation Segment -----

    EQUATIONS

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (40 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    mema= /ada15 * /ada14 * (DSa + PSa + mem_d )

  • 8/14/2019 A Composite Voice Synthesizer

    41/64

    memb= /adb15 * /adb14 * ( strbb + mem_d )

    amp= /ada15 * ada14 * ( DSa + PSa + mem_d)

    pitch= ada15 * /ada14 * ( DSa + PSa + mem_d )

    out= /ada15 * ada14 * (DSa + PSa + mem_d )

    MEMCS16 = 1

    MEMCS16.TRST = MEM_D

    Figure E.3. synthmsc.pds

    ;PALASM Design Description

    ;---------------------------------- Declaration Segment -----------

    TITLE SYNTH MISC

    PATTERN

    REVISION 2.0

    AUTHOR ANTHONY CARRICO

    COMPANY ADSL

    DATE 01/30/93

    CHIP _SYNTHMSC PAL22V10

    ;---------------------------------- PIN Declarations -------------

    PIN 1 CLK ;

    PIN 2 r_w

    PIN 3 /is

    PIN 20 synthdiv registered

    PIN 21 /synth

    PIN 22 /light

    PIN 23 SYNTHCLK REGISTERED ;

    ;----------------------------------- Boolean Equation Segment -----

    EQUATIONS

    SYNTHCLK = /SYNTHCLK * synthdiv + synthclk*/synthdiv

    synthdiv = /synthdiv

    light = /r_w * is

    synth = r_w * is

    Figure E.4. counter.pds

    ;PALASM Design Description

    ;---------------------------------- Declaration Segment -----------

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (41 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    TITLE counter

  • 8/14/2019 A Composite Voice Synthesizer

    42/64

    PATTERN

    REVISION 1.00

    AUTHOR Anthony Carrico

    COMPANY ADSL

    DATE 10/04/92

    CHIP _counter PAL22V10

    ;---------------------------------- PIN Declarations --------------

    PIN 1 clk ; CLOCK

    PIN 2 sr0 ; INPUT

    PIN 3 sr1 ; INPUTPIN 4 sr2 ; INPUT

    PIN 5 sr3 ; INPUT

    PIN 6 sr4 ; INPUT

    PIN 7 sr5 ; INPUT

    PIN 8 sr6 ; INPUT

    PIN 9 sr7 ; INPUT

    PIN 10 xf ;flag from dsp to tell synth to switch banks

    PIN 15 na8 REGISTERED ; OUTPUT

    PIN 16 na7 REGISTERED ; OUTPUT

    PIN 17 na6 REGISTERED ; OUTPUT

    PIN 18 na5 REGISTERED ; OUTPUT

    PIN 19 na4 REGISTERED ; OUTPUT

    PIN 20 na3 REGISTERED ; OUTPUT

    PIN 21 na2 REGISTERED ; OUTPUT

    PIN 22 na1 REGISTERED ; OUTPUT

    PIN 23 na0 REGISTERED ; OUTPUT

    PIN 14 /load COMBINATORIAL ; OUTPUT

    ;----------------------------------- Boolean Equation Segment -----

    EQUATIONS

    load = na0*na1*na2*na3*na4*na5*na6*na7

    na0 = /load*/na0

    na1 = load*sr0

    + /load*(na0*/na1+/na0*na1)na2 = load*sr1

    + /load*(na1*na0*/na2+/(na1*na0)*na2)

    na3 = load*sr2

    + /load*(na2*na1*na0*/na3+/(na2*na1*na0)*na3)

    na4 = load*sr3

    + /load*(na3*na2*na1*na0*/na4+/(na3*na2*na1*na0)*na4)

    na5 = load*sr4

    + /load*(na4*na3*na2*na1*na0*/na5+/(na4*na3*na2*na1*na0)*na5)

    na6 = load*sr5

    + /load*(na5*na4*na3*na2*na1*na0*/na6+/(na5*na4*na3*na2*na1*na0)*na6)

    na7 = load*sr6+ /load *(/(na6*na5*na4*na3*na2*na1*na0)*na7+na6*na5*na4*na3*na2*na1*na0*/na7)

    na8 = xf

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (42 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

  • 8/14/2019 A Composite Voice Synthesizer

    43/64

    Appendix F. Software

    The following pages contain the complete program and some of the data to play a Beethoven quartet on the CVS.

    Figure F.1 | Figure F.2 | Figure F.3 | Figure F.4 | Figure F.5

    Figure F.1. voices.h

    /* Anthony Carrico 2/25/93 */

    /* voices.h */

    /* Header for synthesizer program */

    #include

    #include

    #include

    #define numosc 128

    #define n1osc 32

    #define n2osc 64

    #define n3osc 96

    #define numenv 20

    #define numvoice 22

    #define numinst 20

    unsigned int *prd = (unsigned int *) 3; /* ptr to PRD register */

    int *amp1 = (int *) 0x4100; /* Amp Pointer */

    int *pitch1 = (int *) 0x8100; /* Pitch Pointer */

    int *amp0 = (int *) 0x4000; /* Amp Pointer */

    int *pitch0 = (int *)0x8000; /* Pitch Pointer */int BPamp[numosc], BPpitch[numosc];

    int STEPSZ_amp[numosc], STEPSZ_pitch[numosc];

    int acc_pitch[numosc], acc_amp[numosc];

    int *env_table[numenv];

    int *voice_table[numvoice];

    int *inst_table[numinst];

    int **EP_env = (int**) 0x2000;

    int *EP_time = (int *) 0x2100;

    unsigned int *EP_old = (unsigned int *) 0x2200;

    int *EP_pitch = (int *) 0x2300;

    int *EP_amp = (int *) 0x2400;int *EP_on = (int *) 0x2500;

    int *osc_stack = (int*) 0x2600;

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (43 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    int osc_top = 0;

    http://memebeam.org/acarrico/thesis/thesis.html#voices.hhttp://memebeam.org/acarrico/thesis/thesis.html#main.chttp://memebeam.org/acarrico/thesis/thesis.html#voice.asmhttp://memebeam.org/acarrico/thesis/thesis.html#inst.asmhttp://memebeam.org/acarrico/thesis/thesis.html#env.asmhttp://memebeam.org/acarrico/thesis/thesis.html#env.asmhttp://memebeam.org/acarrico/thesis/thesis.html#inst.asmhttp://memebeam.org/acarrico/thesis/thesis.html#voice.asmhttp://memebeam.org/acarrico/thesis/thesis.html#main.chttp://memebeam.org/acarrico/thesis/thesis.html#voices.h
  • 8/14/2019 A Composite Voice Synthesizer

    44/64

    int VP[numvoice];

    extern int env0[];

    extern int env1[];

    extern int env2[];

    extern int env3[];

    extern int env4[];

    extern int env5[];

    extern int env6[];

    extern int env7[];

    extern int env8[];extern int env9[];

    extern int env10[];

    extern int env11[];

    extern int env12[];

    extern int env13[];

    extern int env14[];

    extern int env15[];

    extern int env16[];

    extern int env17[];

    extern int env18[];

    extern int env19[];

    extern int v0[];

    extern int v1[];

    extern int v2[];

    extern int v3[];

    extern int v4[];

    extern int v5[];

    extern int v6[];

    extern int v7[];

    extern int v8[];

    extern int v9[];

    extern int v10[];

    extern int v11[];extern int v12[];

    extern int v13[];

    extern int v14[];

    extern int v15[];

    extern int v16[];

    extern int v17[];

    extern int v18[];

    extern int v19[];

    extern int v20[];

    extern int v21[];

    extern int inst0[];extern int inst1[];

    extern int inst2[];

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (44 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    extern int inst3[];

  • 8/14/2019 A Composite Voice Synthesizer

    45/64

    extern int inst4[];

    extern int inst5[];

    extern int inst6[];

    extern int inst7[];

    extern int inst8[];

    extern int inst9[];

    extern int inst10[];

    extern int inst11[];

    extern int inst12[];

    extern int inst13[];extern int inst14[];

    extern int inst15[];

    extern int inst16[];

    extern int inst17[];

    extern int inst18[];

    extern int inst19[];

    void c_int1();

    void c_int2();

    void c_int5();

    void setup();

    void env(int osc);

    int init_osc();

    int give_osc(int osc);

    int get_osc();

    void init_extern();

    void trig_inst(int *inst, int amp, int pitch);

    void trig_voice(int num, int event, int *voice);

    void prog1();

    void prog2();

    void prog3();

    Figure F.2. main.c

    /* Anthony Carrico 2/4/93 */

    /* main.c */

    /* player program */

    #include "voices.h"

    void prog1 ()

    {

    static int tick=0;

    static int event=0;int j;

    tick++;

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (45 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    if (tick % 4 == 0)

    {

  • 8/14/2019 A Composite Voice Synthesizer

    46/64

    {

    for (j=0;j 15;

    EP_pitch[osc] = pitch + *(inst+*inst+j+1);

    EP_env[osc] = env_table[*(inst+2 * *inst + j +1)];

    EP_on[osc]=1;}

    }

    void prog2() {}

    void prog3() {}

    /* init_osc --> put all the oscillators in the oscillator pool

    only call this once !!! */

    int init_osc()

    {int j; for(j=0;j give an oscillator to the oscillator pool */

    /* return(1) ---> normal */

    /* return(0) ---> can't return the osc */

    int give_osc(int osc)

    {

    if (osc_top < numosc)

    {

    osc_stack[osc_top] = osc;osc_top++;

    return(1);

    }

    else

    return(0);

    }

    /* get_osc() --> gets an oscillator from the oscillator pool */

    /* returns the oscillator number or */

    /* returns numosc if none available */

    int get_osc()

    {

    unsigned int i[11];

    unsigned int temp;

    i[0] = 33;

    i[1] = 125;

    i[2] = 38;

    i[3] = 52;

    i[4] = 120;

    i[5] = 176;

    i[6] = 160;

    i[7] = 61;

    i[8] = 32;i[9] = 56;

    i[10] = 0-4-128-16-2;

    if (osc_top != 0)

    {

    osc_top--;

    temp = numosc-osc_top;

    if (temp>9)

    temp=10;

    outport (0,i[temp]);

    return (osc_stack[osc_top]);

    }else

    return(numosc);

    file:///F|/New%20Folder%20(2)/New%20Folder/A_COMPOSITE_VOICE_SYNTHESIZ.HTM (47 of 64)2004/12/06 12:11:26 .

    A Composite Voice Synthesizer

    }

  • 8/14/2019 A Composite Voice Synthesizer

    48/64

    /*-------------------------------------------------------------------------*/

    void main()

    {

    unsigned int i,j;

    unsigned int* timerflag;

    /* interupt flag */

    timerflag = (unsigned int *) 98;

    setup();

    while (1){

    for (i=0;i 3;

    acc_amp[j] += STEPSZ_amp[j];

    amp0[j] = acc_amp[j];

    }

    }

    else

    {

    asm(" rxf ");

    for(j=0;j> 3;acc_amp[j] += STEPSZ_amp[j];

    amp1[j] = acc_amp[j];

    }

    }

    switch(i)

    {

    case 0:

    for(j=0;j VECS PAGE = 0

    cinit > CODE PAGE 0

  • 8/14/2019 A Composite Voice Synthesizer

    64/64

    .cinit > CODE PAGE = 0

    .const > CODE PAGE = 0

    .switch > CODE PAGE = 0

    .text: > CODE PAGE = 0

    .data > EXT_RAM PAGE = 1

    .bss: > INT_RAM PAGE = 1

    .sysmem: > INT_RAM PAGE = 1

    amp: > AMP PAGE = 1pitch: > PITCH PAGE = 1

    }

    Bibliography

    [Haken92]IEEE Transactions on Signal Processing. 40. 9. September, 1992. Computational methods for real-time Fourier synthesis. L. Haken.

    [Hamman93] November, 1993. Personal Memo. Michael Hamman.

    [Moore77] Computer Music Journel. April, 1977. Table lookup noise for sinusoidal digital oscillators. F. R. Moore.

    [Snell77] Computer Music Journel. April, 1977. Design of a digital oscillator which will generate up to 256 low distortion sine waves in real time.. J. Snell.

    [TI90a] TMS320 Fixed-Point DSP Assembly Language Tools. 1990. Texas Instruments.

    [TI90b] TMS320C2x C Compiler Reference Guide. 1990. Texas Instruments.

    [TI89] Second-Generation TMS320 User's Guide. 1989. Texas Instruments.