This project has practical applications in experimental music composition and other sound related artistic endeavors. The final product shuffles the data of two sounds to create a unique third sound. There are a few user-controlled parameters to control various qualities of the output.

;This device 'morphs' between two sounds. Initially one sound is fed alone to the output stream. Gradually parts from sound two are inserted into the output stream. As time progresses a greater part of the output stream is taken from sound two. Finally the output stream is composed completely of sound two.

This process is depicted here. As you can see the output wave is a composite of samples taken from the two sound streams. This diagram illustrates a period of time somewhere in the middle of the morph since the output wave contains about 50% of each sound. The number of samples (the block size) the morphmaster is swapping into the output stream at a time is variable. Block size variation is a result of changing the rate at which we switch between the two sound streams. The switching rate is variable, via a function generator, between approximately 1Hz and 10KHz. At first we tried to control this switching rate using a 555 timer. However, a 555 is not designed to cover such a large frequency range. In the near future we will use a Maxim038 for this purpose. It is designed to run between .2Hz and 1MHz.

Sound two always comes from a live analog sound input. Sound one, on the other hand, can be either a live analog input like sound one, or a looped, recorded sound stored in RAM. A switch (SW2 appendix A) allows the user to choose between these two modes. A green LED (GRN appendix A) indicates that a morph is in progress. If the looped sound mode is chosen the user may record any sound he/she inputs. The recording process is initiated by the push of the 'record' button (#27 Appenndix B), and continues until the RAM array is filled. A red LED (RED appendix A) illuminates while recording is in progress. After the recording is complete another switch (SW1 appendix A, #28 appenndix B) begins the morph. The morph may be halted and restarted at any time by turning the switch off. A new recording may be made, replacing the old, by pushing the reset button (#30 appendix B)

The sampling rate, and thereby the recording length and playback rate of the recorded sound, is determined by the frequency of our system clock. This is variable by a potentiometer knob (#2 appendix B), controllable by the user in real time. The user can speed up or slow down the playback rate of the recorded sound by turning this knob.

Example of use:

First plug in sound source one into RCA input 0. Plug sound source two into RCA input 1. These must be standard line level signals. Plug the output into an amplifier. The output is also at line level. Attatch the function generator to two little wires sticking out of the bottom of the bottom of the board. Yellow wire goes to red, and black to black. Now we are ready to do some morphing.

Mode 1: (Live/Live) Press reset. Flip switch two to the on position. The speed of the morph is variable by the potentiometer knob. Counter clockwise rotation speeds up the process and vice versa. Note: slower morphs correspond to lower sampling rates and lesser sound quality. Block size can be adjusted by varying the frequency of the function generator. Press reset restart morph, flip switch two to stop it.

Mode 2: (Live/Recorded loop) Press reset. Determine how much you would like to record by setting the knob. A line on the board indicates ten seconds of sound. You can record between five and thirty seconds. Press record button to begin recording. You will hear on the output the sound you are recording. When the red light goes off, the recording is finished. Flip switch one to the on position. The recorded sound will begin looping, and will morph with the second sound stream. The playback speed and morph rate is variable by the potentiometer knob. Counter clockwise rotation speeds up the process and vice versa. Note: Longer recording/slower morphs correspond to lower sampling rates and lesser sound quality. Block size can be adjusted by varying the frequency of the function generator. Press reset to restart morph, flip switch two to stop it.

The Morphmaster is comprised of the following functional components a bus, bus controller, ADC/DAC, RAM, and switching logic. Here we will describe each of these in greater detail.

The Bus All signal data in this system goes through an 8-bit bus. All devices dealing with this data- ADCs, RAM and DAC are connected directly to the bus. Obviously, only one of these components may be writing data to this bus at the same time. Looking at appendix C you can see that timing is dictated by a three state cycle. This cycle is necessary to insure that the necessary data and control inputs to each device are stable and valid before each clock edge. The three state cycle is the foundation of our entire machine design. In the first state data is put on the bus by either ADC conversion or reading from memory. In the second state data is read off the bus and written to RAM, or put into the first of two register levels in the DAC. In the third state data is put second, output register of the DAC and the RAM address is incremented. All of this is choreographed by the bus controller.

Bus Controller The bus controller, implemented as a microcoded state machine, manages all the control signals to the DAC, ADC and the RAM. It also controls the RAM adress counter and the LEDs. Each mode of operation is expressed in the microcode for this machine.

The ASM for the bus controller clearly shows the three main modes the controller may be in; record, morph 1 (live/recorded), and morph 2 (live/live). Each mode employs the three step cycle described above. In record mode the first step, the convert state (0010), is to instruct ADC 0 to convert one analog sample to digital and put it on the bus. Next, the write state (0011), wrtiting to RAM is enabled and the bus data is put in memory. If we've reached the end of RAM addresses we are finished recording and we go to an idle state (0110). Otherwise we increment the RAM address and continue recording.

After recording we stay in the idle state until the morph switch is flipped. We then enter morph 1 mode. In this mode the first step is to place data from RAM to the bus (0111). The data is then sent to the first of two register levels in the DAC (state 1000). In the third stage (1001) of this mode data is cached to the final output register of the DAC where it is output as analog sound. In this state swe also increment the RAM address. At this point we check our switch function to determine where the next sample comes from- ADC1 or memory. If we are directed to take a sample from RAM then we repeat these steps exactly. If we are to take sound from the ADC then the states (1010, 0101, 1001) are equivalent to when reading from RAM, except that data is read from ADC 1 rather than from RAM. While looping in this mode we continually check the morph switch to determine whether to continue morphing.

The other mode of our device, morphing two live sounds, you can see in our ASM chart (appendix A) in states 1100-1111. This mode also employs the three state cycle. The initial state for this acts as a setup state (1100) where we decide where to take our sound data from, ADC 0 or ADC 1. This decision hinges on the signal from our switching function. Regardless of where we take the sound from, the steps are the same. First we convert an analog sample to digital (1101, 1110.) Then we send the data to the first level DAC register (1011, 1111.) Finally we put the data in the output register of the DAC (1100.) Again, in each loop through this mode we check the morph 2 switch to decide whether to keep morphing.

Switching Logic The morph takes place over a number of steps. Each of these steps correspond to one iteration, one run through the RAM array, and with each step we morph a bit more. We can look at each of these steps as a high level "super state" consisting of 16 substates. Each super state describes the output ratio between the two inputs. That is, it will say how much of each stream will be selected to go to the output stream. We will move through the super states according to the number of iterations we've gone through. See Rom Files or C code for an illustration of this.

Our device uses another microcoded state machine to implement this switching. The only variable is what we refer to as 'RAM rollover' which is asserted whenver the RAM adress counter rolls over. This is the signal to move to the next superstate of the morph. Even when we're not in morph 1 mode we still use the RAM rollover to progress through the morph. The one output from this machine, 'z' on our ASM, prescribes which data to send to the DAC, ie. ADC 0, ADC 1, or RAM.

Because the switching function operates on a different clock from our bus controller and the rest of the system, we ran into problems with synchronizing. Thus some handshaking hardware was necessary.

Handshaking It was necessary to realize handshaking in both directions between the switching logic and the bus controller. Synchronizing signals going from the former to the latter was a simple matter of sending the 'z' control signal to a flip flop running on the bus controller's clock. Handshaking of 'ram rollover' in the other direction was a little bit trickier.

We had to use an S-R latch and a D-flip flop. The incoming signal sets the latch. The output of the latch is the input to the flip-flop which holds the data stable for an entire clock cycle satisfying the setup and hold times of the switching logic machine. The output from the flip flop also acts as the reset for the latch.

RAM We used a 512k x 8 bit SRAM. All the control lines of the RAM are controlled by the bus controller. All the data lines are connected to our bus. The 19-bit address of the RAM comes from five parallel 4-bit counters. An 8 way NAND gate is used to recognize when the end of the address space is reached (this is the 'ram rollover' we mentioned above).

ADC/DAC In order for the ADC to convert the analog signal to digital, it must have two voltage reference points. The lower reference point is equivalent to a digital output of all zeros and the high reference point is equivalent to a digital output of all ones. Since we are only using a positive power supply and by its nature an audio signal is both positive and negative, it was necessary to DC offset the analog audio signal so that it resides entirely in the positive voltage domain. Now that the signal has been put in the positive domain, we then tied the lower reference point to ground and the higher reference point is variable between 0 and 5 volts to account for different signal levels.

The DAC has a similar structure of lower and upper voltage threshold settings. Again, since we are using only a positive power supply we had to set the lower reference to ground and the upper to a positive voltage. But to run the signal to a typical audio amplifier the signal must swing positive and negative. A 470µf capacitor was inserted on our output signal to block the DC component and give us a pure AC signal.

The DAC we chose runs at +12V rather than +5 as everything else in our system. Because of this, we had to use a separate power supply to run it. This will soon be solved by running our entire system on a +12V power supply and voltage dividing it down to 5V for the other components.

 

The Morphmaster has three major components: the bus controller, the switching logic and the bus devices. We built these components seperately insuring that each one was fully functional before moving on to the next. We used two 20 pin, 15 input headers to connect to a logic analyzer. We used every input on both headers. Another tool we used in debugging was the oscilloscope. We used this extensively, especially on the analog portions.

The first thing we built was the bus controller. We wired the MSM straight from our carefully designed schematic. Unfortunately, it was 'blindly' wired without thinking of the operation of the machine as a whole, and thus a few errors were made. Several hours were spent locating one missed wire. That was the the only problem in this part of the device construction.

The next phase was to build the ADC, DAC and bus. We first tested the ADC and DAC on an LES breadboard to make sure of their functionality. This went by without a hitch and we moved the circuitry onto our board. When we finally had this section built we encountered some strange behaviour on the part of our DAC. The two level gating system of our DAC appeared to be transparent, and the result was that null data on the bus was being sent to the output register. This was due to a timing glitch. This error disappeared when we unplugged the logic analyzer from our headers.

We then moved on to the 'simple' MSM of the switching logic. Since there are nearly 256 states in this machine we wrote a C++ program to construct this microcode. This turned out to be our most problematic compenent. The highest hurdle in this phase was synchronizing this circuitry with the rest of the system, since both were running on different clocks. This when we realized the need for handshaking between the two. This eliminated many problems.

At this point we already had the live/live morph working and we decided to try our luck with the live/record morph mode. Everything related to this was already wired so we plugged in the RAM chip and pushed the record button. To our surprise the recording function worked on the first try and there were high fives all around.

Although this sounds simple here, each minor step meant many hours of wiring and debugging with the logic analyzer and oscilloscope.

We feel that the Morphmaster is efficiently designed and implemented. We heeded the wise advice of Doug Frasier to use a bus controller to direct our bus devices. This makes it a very flexible design allowing for changes and addition of features by simply reprogramming the ROMs. We are limited here only by the number of possible states of our bus controller. We could add another 4 state bits to allow for greater funtionality and more features. For example we never morph backwards. We also would like to be able to record our output, and utilize the non-volitile nature of the RAM to save recordings through power cycles.

Our goal from the outset was to create an unusual musical device. The device we came up with is very interesting to us, and it's certainly a unique sound. We were very specific in our original proposal about its functionality, and accomplished this with few modifications. The only thing we exluded was the capability to morph between two recorded sounds. Instead we morph between one recorded sound and a live input stream.

Knowledge of analog electronics was vital to the implementation of the analog component of our system. We wouldn't suggest that a group take on this project without that knowledge.

We would like to thank the following: Doug Frazier for his ideas regarding the bus controller and intelligent design. Prof. Wilson for practical help debugging in the lab. Prof. Sullivan for help with our analog circuitry. Maxim Integrated Circuits for the ADCs and DACs and then for more ADCs when we learned that we ordered the wrong ones. Swati Joshi and Tricia Hendershot at Dallas Semiconductor for their help in getting us the RAM chip.

The work in our group was divided evenly between Andrew and Hawkeye. We each took an equal part in designing and construction each and every part of our device. Some of the weight however was shifted in some phases. For example Andrew was handled most of the analog circuitry, while Hawkeye wrestled with the microcode for the two state machines. Andrew and Hawkeye contributed equal time and energy debugging and problem solving.

 

 

References:

Linda F. Wilson, ENGS 31 class notes, Dartmouth College, Summer 2000.