<<

Analog-Digital Hybrid

Final Paper

Group 28 members:

Clapp, David Engineering Herr, Matt Electrical Engineering Morcombe, Kevin Electrical Engineering Thatcher, Kyle Electrical Engineering

Table of Contents 1. Executive Summary ...... 4 2. Project Description ...... 6 2.1 Project Inspiration ...... 6 2.2 Project Goals ...... 7 2.3 History of ...... 12 2.4 Requirements and Specifications ...... 14 2.5 Quality of House Analysis ...... 16 3. Project Related Research ...... 21 3.1 Current Marketed Products ...... 21 3.2 Relevant Technologies ...... 25 3.3 Evolution of Methodology/Part Selections ...... 27 3.3.1 Voltage Controlled Oscillator ...... 27 3.3.2 Signal Mixer ...... 33 3.3.3 Low Frequency Oscillator Research ...... 36 3.3.4 Voltage Controlled Filter ...... 39 3.3.5 Attack Release Envelope Generator...... 46 3.3.6 Voltage Controlled ...... 51 3.3.7 Microcontroller ...... 56 3.3.8 Human Interface Devices ...... 58 3.3.9 MIDI Transmit Port...... 59 3.3.10 Power Supply ...... 59 3.4 Part Selection Summary ...... 62 4. Related Standards and Design Constraints ...... 66 4.1 Related Standards...... 66 4.2 Realistic Design Constraints ...... 67 4.2.1 Economic and Time Constraints ...... 67 4.2.2 Health and Safety Constraints ...... 68 4.2.3 Manufacturability and Sustainability Constraints ...... 70 5. Project Design Details ...... 71 5.1 Voltage Controlled Oscillator ...... 71 5.2 Signal Mixer ...... 78 5.3 Low Frequency Oscillator Hardware Design ...... 79

2

5.4 Voltage Controlled Low Pass Filter ...... 83 5.5 Attack Release Envelope Generator ...... 84 5.6 Voltage Controlled Amplifier ...... 86 5.7 Microcontroller and Peripherals ...... 88 5.8 Design ...... 95 5.9 Power Supply ...... 105 5.10 Summary of Design ...... 106 6. Project Prototype Construction and Coding ...... 108 6.1 Final Coding Plan ...... 108 6.2 Printed Circuit Board ...... 112 7. Project Prototype Testing Plan ...... 114 7.1 Hardware Test Environment ...... 114 7.2 Hardware Specific Testing ...... 115 7.3 Software Test Environment ...... 118 7.4 Software Specific Testing ...... 118 8. Project Operations Manual ...... 122 9. Administrative Content ...... 125 9.1 Budget and Finance Discussion...... 125 8.2 Milestones Discussion ...... 125 8.3 Conclusions ...... 130 Appendices ...... 131 Appendix A - Copyright Permissions ...... 131 Works Cited ...... 132

3

1. Executive Summary Throughout the years musicians have strived to find originality and artistry in the they produce. One of the primary ways of a musician revealing their true talent is choosing an instrument that allows their creativity to flow consistently. In modern society, the most versatile and quickest instrument to begin expressing one’s self is through use of the electronic synthesizer. These devices are capable of producing a wide variety of , from futuristic space effects, to the replication of a classical or even a full . It’s no wonder that the largest trending musical style of today is the electronic genre.

Saying that the electronic instruments of today are far and plenty is an understatement. The industry has been booming since the creation of the first electronic instrument a century ago. In recent years however most producers of electronic instruments are unfortunately following the trend of creating completely digital sound production devices. The pursuit for consistency, compact setups and affordability is driving the world of music creation towards a sterilized, completely digital means of audio replication and synthesis. An industry which once contained dynamic and expressive devices with human characteristics is slowly being waned out by devices which generate perfect pitch, and nearly expressionless, almost robotic qualities.

This is where the revitalization of the comes into play. By using physical components and classical circuit design, the possibility of maintaining natural worldly and (in some cases) outer-worldly sounds are still within the modern grasp. These devices create sound through oscillation of , similar to how a string on a produces sound once plucked. Natural oscillations using physical properties tend to have imperfections that are generally perceived as more fluid and rich in tone. However, analog synthesizers typically come with a cost: they are large, bulky, modular devices that require a substantial financial backing to support their expansion of versatility.

The question then arises as to how might one acquire the smooth natural sounding qualities of an analog synthesizer, while keeping the package size and cost relatively small, as well as having a large variety of producible sounds to keep up with the ever growing popularity of fully digital synthesizers. The answer to that question is simple: create versatility through digital control methods, while maintaining the natural oscillations and audio production of analog circuits. The use of a digital microcontroller as the brain and control center will greatly expand the versatility of the machine, allowing control of many modular systems and allowing for a large capability in what the synthesizer is able to produce. All this holds true while maintaining a reduced cost, size along with a consistent level of control. The expansion capabilities are further increased by the use of MIDI to allow integration into many production setups.

Therefore, through the understanding and research of analog circuit design, as well as digital/embedded systems comprehension, an Analog and Digital Hybrid Synthesizer will

4 be constructed that could be competitive other popular synthesizers in the electronic instrument industry. Doing so will meet expectations in regards to size, affordability, versatility and the ever popular factor of sound quality.

5

2. Project Description

2.1 Project Inspiration The drive and inspiration that led to the decision of working on this project comes from a goal of striving to understand the physical application of electronics and the relation to processing and creation. The original project idea comes from one member of the group’s lifelong passion for music and the presentation of wishing to fulfill something beyond the scope of simply performing. This project idea is also but also understanding how the world of music is projected on a scientific level. Alongside these wishes, being able to apply the several years’ worth of theoretical study into an application which implements nearly all of those ideals seemed to be quite the sought after goal. Thankfully, the Analog and is capable of meeting all the requirements of these dreams and expectations.

Among these virtues, the project itself presents an interesting challenge: produce something that can produce noticeable results while also allowing a large range of creativity, experimentation and expandability. The explanation of creativity in regards to this project is because of the artistic nature of the instrument itself, the ability to shape and cater the sounds which will be made within the unit from the construction and design phase is a huge impact on the overall expressive nature of the instrument. While many musicians seek to find the right instrument that will create the desired sounds needed for an application, we’ve sought out the ability to create our own means of acquiring this expressive nature.

As for experimentation, finding the designs for creating the set goals and desires for the instrument design often require a lot of circuit testing and experimentation. In this case, finding the sound generated from the Voltage Controlled Oscillators, or perhaps the sweep range from the high pass filter is things that can be taken from a qualitative perspective. An opinionated expression can be gathered from these experimentations that overall result in a greater grasp and feel for the overall end product design.

The synthesizer presents a huge range of possibilities for learning and implementing various different circuits. The scalability of the project was what finally led to the agreement to follow through with the idea. Being able to start with something simple enough to just generate a tone, and further eventually implementing a digital component to allow a lot of interesting factors such as MIDI integration really helped this project flesh out the creativity and love for learning that we all possess. The possibilities are truly endless, and while a completed design may be set for the creation of this project, there are still means and methods for integrating other components to further advance the capabilities for what is possible with this machine.

In the grand scheme of things, although originally conceptualized by one member, the rest of the group was able to pull together, and realize different factors involving the industry that wasn’t quite understood prior. A large amount of information and

6 know how, as well as a high level of problem solving and teamwork was required as a necessity to come together and create a great design for a project that could expand and see formidable as an interesting and fun idea.

2.2 Project Goals The goals of the project were split into four categories: Analog goals, Digital goals, Cost goals, and Stretch goals.

Analog Goals Analog goals encompass all goals that pertain to the analog aspects of the device, including, but not limited to, the VCO, Power Supply, and the AR.  Safe, cost effective, and stable DC Power Supply o The purpose of our power supply is to provide power while eliminating the need for spending on batteries. We require a DC power supply and we have determined with the amount of testing and prolonged use of power, batteries are not practical, economically. We do not have any funding on our project, so we are spending out of our own pockets for every part we need. Our group specifically does not have a plethora of disposable income, so we must eliminate cost waste where we can. The power adapter we have chosen is $10 with shipping. The rectifier circuit is virtually free considering the amount of analog circuitry we have. We are also saving money by salvaging large electrolytic capacitors from other synthesizers that we having laying around.

o Size of the power supply is an important requirement when we are considering PCB design. PCBs are relatively small which can prove to be an issue when designing the rectifier circuit. The rectifier requires very large electrolytic capacitors to function properly. At this time we do not have specific board dimensions, however we will have to keep in mind the radial size of the large capacitors that we use in the design. We will connect four to six of these capacitors in parallel so that we do not have a capacitor that has too large of radial symmetry.

o Functioning ability of the power supply is necessary to guarantee that all other components are working correctly. It is possible that all of our components in our synth appear to be not working because of the faulty power supply, when in reality they are working and it is the fault in the power supply. We know from experience that op-amps will deliver inaccurate results when Vcc and Vee are not applied. It is very easy to overlook the most simple of issues, like, we are not delivering power to all of our components. Also, it is important that our power supply is working effectively because if it is not, we will have to spend money on batteries to alleviate our issue. Our previous goal of cost effectiveness will not be met if we have to purchase batteries to make up for the lack of functioning

7

ability of the current power source, so it is imperative that it works the first time around.

o Safety is always first. We will be dealing with mid to high ranged currents to power our components. Our research and functional expertise is absolutely necessary so that we do not electrocute ourselves. As this is our first analog circuit project, our goal is to maintain the utmost safety. We must ensure that our components are grounded in the proper locations, because it is very easy to introduce unwanted voltages which could destroy parts or even cause serious bodily harm to ourselves. Our project will be useless if one of our members suffer injury from it.

 Construct a functional Low Frequency Oscillator capable of modulating the Voltage Controlled Oscillator output. o The main goal of the LFO is to produce at very low frequencies below the range of human hearing that are capable of modulating and producing effects on the VCO. This goal will be achieved if the LFO can successfully produce ramp, sawtooth, and triangle waveforms at frequencies below 10 Hz.

 Construct a Voltage Controlled Amplifier capable of taking in signals from the Voltage Controlled Filter and the Attack/Release envelope generator and outputting a clean signal. o The synthesizer is really only as strong as its weakest link. With a below par VCO, the synthesizer will not be able to get . However, one could have a masterfully crafted analog synthesizer, but if there is no amplifier or module to turn your signal into an audible output then nobody will ever hear how good your music sounds. This goal will be achieved if the amplifier can produce a clean signal that takes in the required signals above and allows for a master volume control.

 Voltage Controlled Oscillator. o Our goal is to have a knob or selector switch on the faceplate of our synth that allows each individual VCO to output a certain to input into the signal mixer. We know from experience that different waveforms offer different sound at a given frequency. For synth design, we will require multiple waveforms from both of the operating VCOs. It is important that we meet our goal on proper waveform design because the VCO is the staple of any synthesizer.

o Our goal for frequency is that we are operating on all audible frequencies. This is a range from around 20 Hz to 20kHz. If we are operating below or above these frequencies, our project will be a failure because we will not be producing tones that can be heard to the human ear. The analog circuitry has to be very precise so that we are operating on the specified frequencies. The math behind the design must be completely correct because even just one incorrect resistor value can result in an incorrect frequency value.

8

o We require a certain voltage range from each of the outputs of the VCO before inputting to the signal mixer. Our goal is for each of our output waveforms to be operating on a range from positive 5 volts to negative 5 volts.

o For our cost goals, we must eliminate any integrated parts that can be created through our expertise in analog circuitry. As the parts required for the VCO are fairly cheap, we must reduce spending cost on shipping. Shipping has proven to be the most cost heavy aspect of the VCO so our goal is to have all parts ordered two to three weeks in advance so that we are spending the minimum amount on shipping cost.

Digital Goals: Digital goals encompass all goals that pertain to the digital aspects of the device, including, but not limited to, the microcontroller, I/O Expanders, and digital potentiometers.  Achieve real-time MIDI output o The responsiveness of the device is crucial for the effectiveness as an instrument. If the Analog-Digital Hybrid Synthesizer is unable to transmit MIDI in real-time, it will be akin to playing a piano and having the sound play after a second. It becomes unusable and unplayable for musicians to use as an instrument. This goal is considered achieved if the MIDI output is received by a second device with .5 seconds.

 Software be fully modular and expandable o Software modularity and expandability is crucial for creating a product with a long efficacy. If future hardware iterations incorporate more components and the software is not modular, the software will need to be rewritten, costing time and money in the process. This goal is considered achieved if the addition or removal of hardware can be adjusted within the code in less than an hour.

 Hardware response has minimal o The responsiveness of the device is crucial for the effectiveness as an instrument. If the Analog-Digital Hybrid Synthesizer is unable to change the hardware aspects in real-time, it will be akin to playing a piano and having the sound play after a second. It becomes unusable and unplayable for musicians to use as an instrument. This goal is considered achieved if the hardware responds with .5 seconds.

 Software is stable o Code stability is the core of any successful . If the program is buggy or crashes constantly, the product becomes unusable. Code is stabilized through rigorous testing and careful writing of the program. This goal is considered achieved if the code remains running for 90% of all use time.

9

Cost Goals:  Low Cost per Unit o Entire unit overall cost no greater than 500 dollars and total cost to group including shipping no greater than 700 dollars. The goal as stated in our House of Quality Analysis is to have the total cost of everything that goes into the amplifier below 500 dollars. As seen in our budget and finance discussion towards the end of this paper, this goal is achieved.

Stretch Goals: The Goals stated here forth explain goals that we wish to implement if the time allows the completion of said goals. These goals are NOT the intended base presentation for the project, but are intended as functionalities to further advance increase the versatility of the analog/digital hybrid synthesizer’s capabilities.  Presets. o The idea of Presets were one of the ideas thought of from the start of this project. The idea behind the presets would be to have the ability to recall a saved setting at the push of a button or the turn of a knob. In this instance, the user would be able to also possible save their settings for use at another time. This idea is still set as a potential function as it seems like such an interesting idea to incorporate that will truly increase the functionality and capabilities of this synthesizer to another level.

 Expansion of the Attack Release Envelope Generator to Attack Decay Sustain Release Envelope Generator. o The Attack Release Envelope was original chosen as a simpler means of producing amplitude response variation to enable a large versatility in the synthesizers output. However, implementing a more complex Envelope that incorporates Decay and sustain will significantly increase how much the user of the synthesizer is capable of changing their desired sounds. With the decay added into the functionality, the volume amplitude of the synthesizer will reach a peak before falling off slightly and the sustain will enact after that point to allow the user to change the volume for which the synthesizer will ring out for the duration of the press. In the final functionality list for the ADSR, the time period for the Decay would be a changing variable and the amplitude of the Sustain as well.

 Tube Amp Output Warmer. o Another goal that would like to eventually be implemented if the time constraint for the final project allows is to implement a tube warming. By warming, the idea is the ability to add a set of desired extra harmonics created by tube distortion to add to the synthesizers output. The premise of a tube amp not only would add to the synthesizer’s creative value but also serves as a marketing stand point. Tubes amplification circuits in the electronic musical instrument industry are highly sought after for their “Retro” appeal of the classic days when a lot of the electronic instrument industry was based off of circuitry. The possible

10

implementation of a vacuum tube would not actually be responsible for amplifying the output of the circuit however, and would only exist as a means of adding a distortion affect to the instrument.

 LED display. o LEDs are always a great impacting marketing standpoint for just about anything. The ability to catch the eye in some visual type of way can greatly sell a product. For this reason, a possible implementation of LED lighting to the case could be in the future. This type of display could include lights on the the knobs for visual to the user, or even just some asthetic lighting around the case that could brighten the appeal of the synthesizer.

 Control Display. o A final idea we wish to implement if time allows during the creation of this device is a control display that will assist with interaction of the features within the synthesizer. This could be anything ranges from an interaction with presets if that feature were ever implemented into the device. Other uses could include feedback to the current values for which each potentiometer is adjusted to. Adding these features would greatly help impact the marketability of the device and serve as another means of creating a worthy and loveable device for a music enthusiast.

 Voltage Controlled Low Pass Filter o Variable Cutoff range: One of the main functionality goals for the Voltage Controlled Filter is to feature the ability to change the cutoff range. This change is intended to be done either through the use of a potentiometer which allows the user to directly control the cutoff frequency at the turn of a knob. The other way the cutoff frequency is expected to be varied is through the use of a voltage controlled resistor that will be impacted by an external component called the LFO which will send an automated alternating current to change the resistance to alter the cutoff frequency in this way. The expected range of this filter will essentially be up to 18kHz and drop down to about 20Hz. This is for the most part the limitations of the human hearing.

 Variable Quality Factor: o Similar to the variation of the cutoff frequency, the VCF should have the ability to have its quality factor altered by the user through the turn of a knob. This functionality will be only from a manual control from the user.

 Signal Mixer. o Mix signals: The intended goals of the signal mixer will be to be capable of separating and combining signals from the two Voltage Controlled

11

Oscillators. The user should be able to turn a single knob to change the degree to which each Oscillator is sent out of the signal mixer to channel through the remaining line of circuitry.

 Attack Release. o Act on a trigger response: The attack release generator is expected to be capable of sending an attack or release signal to begin the of the envelope generator.

o Adjustable time based Attack shape: Half of the functionality of the attack release envelope generator is to create a time based attack factor which will either be lengthened or shortened based on the variation of a potentiometer.

o Adjustable Release time: Similarly to the attack time, the envelope generator needs to have the ability to adjust the time of the release segment, which will judge the minimum length for which a note can be played on the synthesizer.

2.3 History of Synthesizers An analog synthesizer is a synthesizer that uses analog circuitry and analog signals to generate sound electronically. The earliest analog synthesizers in the 20s and 30s were built with a variety of vacuum-tube and electro-mechanical technologies. The shown in figure 2.3.1 is a monophonic electronic musical instrument invented in 1928 by Frierich Trautwein in Berlin. After the 1960s, analog synthesizers were built using operational amplifier integrated circuits that use potentiometers (variable resistors) to adjust certain sound parameters. Analog synthesizers also used low pass and high filters to modify the sound.

The 1960s synth era introduced the Moog, which used a number of independent electronic modules connected by patch cables. Years later, Figure 2.3.1: Trautonium analog synthesizers were developed

12 that integrated circuits into single units, eliminating patch cords to favor integrated signal routing systems. These were considered devices.

Many electronic instruments were developed between 1920 and 1950, however, they were not considered analog synthesizers by standards of later instruments. The first high sophistication device was the Trautonium mentioned above. Some electric instruments were produced in bulk such as ’s , shown in figure 2.3.2.

The Ondioline was an electronic capable of creating a wide variety of sounds. Its keyboard had a unique feature; it was suspended on special springs which made it possible to introduce a natural if the user used moved keyboard from side to side with their playing hand. The result was an almost human-like vibrato that lent a wide range of expression. The keyboard was also pressure-sensitive and also contained a knee level for volume control. The Ondioline did feature a ring controller to control pitch as the “Ondes” did. The Figure 2.3.2: Ondioline Ondes was similar to the , its sonic capabilities were expanded by the addition of timbral controls and switchable . The Ondes’ eerie wavering notes were produced by varying the frequency of oscillation in vacuum tubes. The production of the Ondes stopped in 1988, however, several conservatories in France still offer Ondes instruction to students of the instrument.

Early analog synthesizers used technology from electronic analog and laboratory test equipment. These early synths were generally “modular” synths, consisting of independent electronic modules connected by patch cables. From the 1960s-1970s, analog synthesizers included voltage controlled oscillators, voltage controlled filters and voltage controlled . Additionally, the introduced envelope generators, low frequency oscillators and ring modulators. Many of these modules took input sound signal while also processing Figure 2.3.3: Minimoog Synth them so an analog synth could be used both as a sound generator and a sound-processing device. Moog established standards recognized worldwide for control interfacing on analog synthesizers. Moog introduced 1- volt-per-octave pitch control and separate pulse triggering signal. These signals were

13 routed using the same types of connectors and cables that were used for routing synthesized sound signals.

In 1970 Moog designed an innovative synthesizer with a built-in keyboard, without any modular design. Normalization made the instrument more portable and easier to use. Figure 2.3.3 shows the popular Minimoog synthesizer. Because of the complexity of generating even a single note using analog synthesis, most synthesizers remained monophonic. In 1978 the first microprocessor controlled analog synthesizer was created by Circuits. The microprocessors were used for system control and control voltage generation, but the main sound generating path remained analog. The MIDI interface standard was developed for these digital hybrid systems. During the middle to late digital synthesizers and samplers largely replaced analog synthesizers. By the early 1990s, musicians from , and DJ scenes wanted to produce electronic music but lacked the budget for large digital systems. This in turn created a market for the then cheap second hand analog equipment.

There was an increased demand for analog synthesizers towards the mid-1990s as a large number of musicians gradually rediscovered analog qualities. Thus, analog synths became popular once again. Over time this increased the demand for used units like Roland TR-808 , shown in figure 2.3.4. The Roland TR-808 was one of the first programmable drum machines, designed for musicians to record demos. Like earlier Roland drum machines, it did not sound very much like a real . There was a lapse of patents in the recent years where digital synths boomed. Such patents as for the Figure 2.3.4: TR-808 ladder filter, spurred a return for do-it-yourself kit synthesizer modules as well as an increase in the number of commercial companies selling analog modules.

2.4 Requirements and Specifications Due to the nature of the Analog and Digital Hybrid synthesizer, the requirements for the overall product are divided into two categories: Hardware and Software.

Hardware: As this is an Analog synthesizer in its very essence, a large majority of the operation and functionality is executed through various hardware components. The hardware components need to be designed in order to provide the appropriate functionality imagined for that particular module, as well as provide a low level of noise interference and transmission throughout the progression of the circuit. The following is the explanation to the various set hardware components:

Figure 2.3.2 14

VCO: When setting requirements for the hardware, the settled features agreed upon include having a dual Voltage Controlled Oscillation. By implementing two VCOs into the system, the versatility of possible tones to be generated essentially doubles. Two VCOs allow for increased harmonics in the original tone output from the combination of multiple waveforms which allows the user to generate various effects.

Effects: A second requirement for the hardware aspect of the synthesizer is that there will be various effects following the VCO to further at to the possibilities of sounds which can be produced. Effects that were determined a necessity include and LFO modulator with a general frequency range of 5hz to 60hz, Low Pass Filter, and an Attack Decay Sustain Release Envelope generator. These are seen as standards amongst the industry as far as synthesizers are concerned.

Amplification: Outside of the effect range for hardware, an internal Amplification system, either generating a line out level output or a variable headphone output is set as a requirement for allowing the user to hear the sounds created. The supported output includes a quarter inch jack for connectivity with most standard instrument out to external amplification connections.

Power: The power supply should be capable of delivering the appropriate power without being overly excessive. The product needs to meet proper efficiency standards while maintaining a low cost.

Human Interface Devices: This Synthesizer will also feature several human interface devices. The intention is to have a twelve to twenty-four-key keyboard which will have chromatic output capabilities and will interface with the software side of the project to be interpreted as note values to be sent to the VCO. Other Human Interface devices include multiple rotary encoder devices which will send information to the microcontroller for variable adjustment for features such as tuning of the VCO, as well as adjustment for the various digital potentiometers across the synthesizer which will control the multiple effects exhibited.

15

Figure 2.4.1 Basic Project Flowchart

Seen in figure 2.4.1 is a visual representation as to how the various hardware components required for the project are expected to interact with each other. The microcontroller is responsible for receiving inputs from the various human interface devices, including the capability of interacting with an external device. After the signals are received, the microcontroller can send information to the Digital potentiometers within the VCO circuits which will change the voltage level and control the pitch of the instrument. An incorporated signal mixer is then implemented to mix both of our two output signals of the VCOs, which are sent to Filters and effects. The filters and effects are then controlled by the microcontroller as well as an LFO , either of which paths can be bypassed. The Output signal finally reaches the Audio amplification circuit, which can be controlled by the ADSR Envelope to shape the overall output signals amplitude response.

2.5 Quality of House Analysis The House of Quality represents the overall goals and constraints of the project. The basic structure is a table with starts with the product’s marketable features, such as cost and quality, as the labels on the left. The engineering requirements are labeled across the top. The body of the house is a matrix of "Engineering Requirements vs. Marketability". The matrix is filled with indicators of whether the interaction of the specific item is a strong

16 positive, a strong negative, or somewhere in between. Figure 2.5.1 is the House of Quality analysis of the Analog-Digital Hybrid Synthesizer.

Figure 2.5.1: House of Quality Analysis

The each correlation for the Analog-Digital Hybrid Synthesizer is listed below with explanation of importance.

Power Consumption vs. Sound Quality Sound Quality is dependent on the provided voltage. Without a sufficient voltage supply, small fluctuations in the source voltage can alter the resultant waveform significantly. Conversely, the large the voltage source, the Analog-Digital Hybrid Synthesizer will have a higher overall power consumption. It is for this dependency that the two are consider to have a strong negative correlation in relation to each other.

Power Consumption vs. Versatility of Sound Versatility of Sound comes from the ability to modify the resultant waveform with more accuracy or with different patterns. Modifying the waveform relies on digital potentiometers to regulate the resistance of the source. For more precise modifications to be made, more digital potentiometers will need to be used, increasing the overall power consumption by a variable amount. It is for this dependency that the two are consider to have a negative correlation in relation to each other.

Power Consumption vs. Latency Latency in the device responsiveness is a factor of the microcontroller. Using a low- powered microcontroller to control the device will lower the overall power consumption,

17 but decrease the instructions per second of the device. Lower instructions per second increases latency between a human input and device response. It is for this dependency that the two are consider to have a negative correlation in relation to each other.

Power Consumption vs. Features The number of marketable features built into the Analog-Digital Hybrid Synthesizer is a factor of power consumption due to each feature requiring additional electrical components. Each electrical component will add to the overall power consumption of the Analog-Digital Hybrid Synthesizer. It is for this dependency that the two are consider to have a negative correlation in relation to each other.

Computational Power vs. Cost per Unit Computational power is dependent on the microcontroller used in production. As computational power increases, the price of the microcontroller also increases. It is for this dependency that the two are consider to have a negative correlation in relation to each other.

Computational Power vs. Latency Computation power is the number of instructions per second that a processor can execute. Latency of the device is the time that is taken to react to a command. Increasing the number of instructions per second executed decreases the time taken to respond to commands. It is for this dependency that the two are consider to have a positive correlation in relation to each other.

Computational Power vs. Features Computation power is the number of instructions per second that a processor can execute. Features are controlled through the microcontroller, which must execute instructions to enable the features. As the number of features increases, the number of instructions per second required increases. It is for this dependency that the two are consider to have a negative correlation in relation to each other.

Cost per Unit vs. Sound Quality Sound Quality is dependent on the quality of the parts used. Limiting the cost per unit will limit the quality of parts that can be obtained. It is for this dependency that the two are consider to have a strong negative correlation in relation to each other.

Cost per Unit vs. Versatility of Sound Versatility of sound is dependent on the quality of the parts used and quantity of features built into the device. Limiting the cost per unit will limit the quality of parts that can be obtained as well as limiting the number features that can be added to the device. It is for this dependency that the two are consider to have a strong negative correlation in relation to each other.

Cost per Unit vs. Latency Latency of the device is dependent on the microcontroller used. More powerful units reduce latency, but are more expensive as a result. Decreasing latency means buying a

18 more powerful microcontroller, which in turn increases the cost per unit. It is for this association that the two are consider to have a negative correlation in relation to each other.

Cost per Unit vs. Features The number of marketable features built into the Analog-Digital Hybrid Synthesizer is directly proportionate to the number of electrical components. Each electrical component will add to the overall cost per unit of the Analog-Digital Hybrid Synthesizer. It is for this association that the two are consider to have a strong negative correlation in relation to each other.

Sound Modifiers vs. Sound Quality Sound Quality is the clarity of the resultant audio output, sound modifiers can increase the clarity of the produced sound. It is for this dependency that the two are consider to have a positive correlation in relation to each other.

Sound Modifiers vs. Cost per Unit The number and quality of sound modifiers built into the Analog-Digital Hybrid Synthesizer is a factor of cost per unit due to each modifier requiring additional components. Each component will add to the overall cost per unit of the Analog-Digital Hybrid Synthesizer. It is for this dependency that the two are consider to have a strong negative correlation in relation to each other.

Sound Modifiers vs. Versatility of Sound Sound modifiers are capable producing numerous unique effects, increasing the versatility of the sounds able to be produced by the device. It is for this dependency that the two are consider to have a strong positive correlation in relation to each other.

Sound Modifiers vs. Latency Sound modifiers require code to be executed for the functional integration and control from the microcontroller. Adding sound modifiers to the device will increase the load on the microcontroller, which in turn will increase the latency of the device. It is for this association that the two are consider to have a negative correlation in relation to each other.

Sound Modifiers vs. Features Sound modifiers are marketable features. This one-to-one relation results in being given a strong positive correlation in relation to each other.

Weight vs. Small Size While size and weight are not directly related, marketing a product as “small” generally means “lightweight” as well. It is for the sake of marketability that the two are consider to have a strong positive correlation in relation to each other.

Weight vs. Cost per Unit Weight increases the cost of the unit due to needing increased shipping materials and the costs associated with shipping a heavy product. It is for this association that the two are consider to have a positive correlation in relation to each other.

19

Weight vs. Features Features require more components to be added to the device. As more components are add, the weight of the device will increase. It is because of this association that the two are consider to have a negative correlation in relation to each other.

Dimensions vs. Small Size Dimensions and size are a one-to-one relation. As the relation is one-to-one, the two are consider to have a strong positive correlation in relation to each other.

Dimensions vs. Cost per Unit The large the device, the more materials will be needed to house the device. An increase in material cost translate to an increase cost per unit due It is because of this association that the two are consider to have a positive correlation in relation to each other.

Dimensions vs. Features Features require more components to be added to the device. As more components are add, the space required for the device will increase. It is because of this association that the two are consider to have a negative correlation in relation to each other.

20

3. Project Related Research

3.1 Current Marketed Products With the digital era only growing by the day, the thought of an analog synthesizer seems distant. It is true, digital based synthesizers have become more profound in comparison to its analog counterpart. However, music lovers cannot deny the pure unaltered sound of a classic analog synth. There are a few big names in the analog synth world that need to be addressed before specific products are mentioned. Moog, , and are all heavyweight producers in the analog synth world. As every musician is different, there is even genres for analog synth users. We will discuss three main synth user genres to help detail these marketed products. These genres are: “The Desktop Beat Slinger”, “The Seasoned Professional” and “The Mad Scientist”. Each section will detail the types of marketed synths with the product model bolded.

The Desktop Beat Slinger: This genre of synth appeals to music types such as; EDM, , house and techno. This musician use a synth to perfect a “wobble ” sound with rhythmic buildups and drops. Here, keyboard performance is less important than crafting DJ-ready beats. To illustrate, the user would make music on the synth and save as he/she goes along, to play at a later time. These synth users will have multiple boxes synced to a master clock. “Beat Slingers” generally prefer multiple tools, all under tight synchronization, to create their musical vision. Full-size keyboards could find a place in a studio of these techno enthusiasts, however, you’re more likely to see compact desktop sound modules all connected and daisy- chained to a common Figure 3.1.1: Daisy Chain Synths master clock as shown in figure 3.1.1. Among the most diminutive of these sound- generating boxes is the affordable Korg Volca series. The Korg Volca series comprises an analog drum machine with a monophonic bass synth all controlled by a polyphonic keyboard. One of their key features is the ability to link them together via their sync in/out jacks, making it possible to sync 3 machines at once. The King Volca series is relatively affordable for desktop synth use (not so affordable for studio use). This series offers a great foundation for beginning synth users looking to expand their systems. However, skilled

21 producers may look for something with more advanced sound synthesis. This series is limited to expanded audio, MIDI, and interfacing with computer based systems and software. Dave Smith instruments offer a slightly more advanced synth for the “Beat Slinger”. Desktop modules by Dave Smith Instuments offer MIDI standard while also incorporating analog and digital technologies. Dave Smith units such as; the , Mopho and Tetra all offer digitally controlled oscillators, integrated step sequencers and highly flexible modulation routing. These instruments still relatively basic in nature rival even with the most complex modular systems on the market. A Swedish manufacturer Elektron produced a trilogy of products which are prized for their deep synthesis capabilities and performance oriented controls, making them ideal for computer-free music making and even live performance. The product trilogy are; the Octatrack, the Analog Four and Analog Rytm. Figure 3.1.2 displays the Octatrack along with some featured highlights.

Figure 3.1.2: Octatrack

Elektron has a fourth instrument coming out, called the Overbridge. Overbridge will be a mostly digital piece allowing bi-directional processing between computer and synth. It will allow for recording and processing as part of the internal effects.

The Seasoned Professional: This type of synth user is more invested in the keys, as opposed to the Desktop Beat Slinger. This synth user can operate on large banks of keyboards either on stage or in the studio. As the name suggests, they are seasoned among the synth world and know their way around a chord inversion or two. It would be best to categorize this synth user as a musician who can play in front a large group of people and hold their own against guitarists and vocalists. These synth users are interested in stockpiling several keyboards together to get the vintage sounds they want. A classic set up would comprise up to 6 large key polyphonic synths for a wide variety of percussive sounds. Introduced here are the velocity sensitive keys, where hitting a key harder produces a louder sound. Such instruments such as Dave Smiths’s Prophet 12 allow for more expression for key players. Figure 3.1.3 displays the Prophet 12 along with some featured highlights.

22

Figure 3.1.3: Prophet 12

For many of these Seasoned Professionals, no synth rig is complete without a monosynth by Moog, who’s original Minimoog Model D is prized for its use of rock, and even . The Minimoog instruments are especially well known for their “fat” sound as a result of stacking several individual tunable oscillators. These instruments develop whats arguably the warmest-sounding low pass filter on the market. The Minimoog grew with such popularity in the 70s and 80s such that the vintage instrument was retooled and released as the . Figure 3.1.4 displays the Voyager along with some featured highlights.

Figure 3.1.4: Voyager

For these professionals, there is another necessity in the synth rig. The duophonic ARP Odyssey is distinguished from the Minimoog by its ability to play two simultaneous notes. The Odyssey also features hard sync-able oscillators. This feature creates a sound that is aggressive and rich in harmonics while also proving a pleasing musicality. Korg has reissued this classic synth in its popular Mark 3 design. The retooled design is about 86% the size of the original Odyssey as well. The Mark 3 also includes filter designs of all three iterations; 2-pole, or 4-pole, low pass with resonance characteristics ranging from smooth to sharp. This feature can be selected via switch on the interface module of the instrument.

23

The Mad Scientist: The mad scientist genre is for the atypical, eccentric types in the world of synths. These synth users are more interested in tinkering with the ins and outs of the system, working on tireless experiments to explore new sounds. These users have very little interest in preset, designed sounds. Whereas, they prefer developing sounds from the group up by patching together voltage- controlled oscillators, filters, clocks, quantizers, random generators and other unusual devices. These users most likely find their interest by sculpting Figure 3.1.5: Model 15 sounds out of pure analog signal path, as opposed to listening to some cool noises coming out of a black box. Naturally, this user prefers the modular type synthesizer, an instrument that has been around since the very earliest days of sound synthesis. Modulars, with custom modules allow ultimate flexibility in constructing unique sounds. Modulars differ from most synths in several ways. They offer no fixed signal path, so to create a sound a signal path must first be constructed by the user through interconnected patch cables. This flexibility allows for unparalleled sound. These modular systems are the utmost complex. Moog has reissued three of its large format systems; System 55, System 35 and Model 15. In limited quantities the prices for these instruments start at $10,000 and top out at around $35,000. Figure 3.1.5 displays a Model 15 along with some featured highlights. Eurorack format offers an affordable entry point for modularists with a budget less than $35,000. One Eurorack module; Roland’s System-1m, enables the hardware to load computer plug-in versions of classical hardware synths. Figure 3.1.6 displays an image of the System-1m along with some featured highlights. This format version includes patch points to allow voltage control of different synth parameters with other Eurorack modules while maintaining a single hard-wired signal path. This feature gets rid of the need for external modules for signal path routing. The System-1m is a digitally modeled synth that replicates analog circuitry, enabling it be just one module in a highly customized set up.

24

Figure 3.1.6: System 1-M

There are a wide variety of types of synthesizers. The make and model of synthesizer required widely depends on how experienced you are with the instruments. For example, if you are a beginner you would want to stick with a relatively cheap Korg Volca series synthesizer. As you become more proficient with synths and develop keyboard skills, you might look to upgrade a Prophet 12 or Model D to acquire a finer tune of sounds. If you are extremely proficient with calibrating and tampering of circuitry and patch cables, you may look to a Moog Model 15 to deliver that “fat” smooth sound found in the most expensive of modular synthesizers. An interesting paradox exists of the digital technology that is meant to mimic analog synthesis, however, will never truly sound like traditional analog. This hybrid method presents interesting times for musicians who want the best of both worlds.

3.2 Relevant Technologies Over the years, electronic instruments such as the synthesizer have developed use of various technologies which have helped to substantiate the growth and appeal of said instruments to musicians and hobbyists alike. It is with these technologies that the electronic instrument industry has burst into a wide audience and consumer basis.

The Analog and Digital Hybrid Synthesizer features both new and old technologies combined together, bringing forth versatility and market appeal. These technologies include digital microcontroller systems which incorporate Musical Instrument Digital Interface (MIDI) as well as the usage of Digital to Analog and Analog to Digital conversion devices. On the Analog side of the project, signal filtration, power supplement, waveform oscillation/generation, amplification, and envelope generation are represented.

Microcontroller Systems: This Analog and Digital Hybrid Synthesizer includes a microcontroller system dedicated to interpreting information from external sources such as analog or digital human interface devices, then sending this data to the various components amongst the synthesizer. Through the utilization of a microcontroller, the capabilities of the instrument are expanded

25 vastly, allowing for enhanced customization of sounds as well as creating an easier means of operation for the user.

Musical Instrument Digital Interface: MIDI is an industry and technical standard set in place circa 1983 for interfacing electronic instruments with other musical devices, effect modules, and computers. The information which can be transmitted across MIDI includes musical notation, pitch and velocity. The technology is also capable of sending control signals which adjust parameters such as volume, vibrato and clocks for global quantization [1]. Often confused with transmission methods, MIDI is not a means of transmitting sound, but is instead solely responsible for sending data signals. This feature allows MIDI to maintain a compact nature, taking up small amounts of computational time and data to allow real-time control between multiple devices while maintaining low latency delivery.

The standard means of hardware interfacing in midi includes a five-pin DIN connector which utilizes two pins as a balanced pair. These two pins are responsible for carrying a signal at +5 volts, as well as a ground [2]. The other two pins are unused. The balanced pins provide a means low noise signal delivery when introduced to a differential amplifier [3]. Because of the limited connection type for transmitting data, the connections used are strictly and the MIDI device will generally contain two to three Figure 3.2.1 MIDI ports/connections; one port each for Input, MIDI Connection Ports Output, and a Thru connection for transmitting clock signals.

Due to limitations in early microcontroller devices which typically operated at 1MHz, MIDI was developed to deliver 8-bit words serially at a rate of 31.25kbits/second [1]. The information transmitted is typically 10 bits per transmission, 1 bit leading and following strictly for framing purposes, while the first bit of actual information is responsible for identifying the byte as a status or data instruction [1].

Digital to Analog and Analog to Digital Control: A prominent feature for the Hybrid Synthesizer revolves around implementation of modern analog to digital control methods such as the use of digital potentiometers. The digital potentiometer cooperates with the onboard microcontroller to receive information and convert that information into a means of controlling the voltage inputs which are sent to the various analog modules within the synthesizer. As for the Analog to digital control methods, rotary encoders are used as a method of turning dialed information into readable data for the microcontroller for eventual transmission to the digital potentiometers. These, in combination with buttons and keys are used as human interface devices to acquire information from the user to the microcontroller to be transmitted to the various modules within the Synthesizer or External components.

26

Analog Signal Filtration: Due to the importance of audio quality for the Digital to Hybrid Synthesizer, signal filtration is an important technology to incorporate. Utilization of low noise audio focused op amps integrated within the various filters provides for a versatile means of reducing external electrical signals from the desired output of the synthesizer. Utilization of voltage controlled Filter Technology provides a method of expanding the range and versatility of sounds the user is capable of creating from the synthesizer. Such Filters generally include sweepable high pass and low pass filters, which in turn enhance the bass (low) and treble (high) frequencies.

Electronic Waveform Oscillator/Generator: The most essential component to the Analog and Digital Hybrid Synthesizer is the . This component is vital in providing the basic building block for which all sounds will be expanded upon. Evolved from primitive Vacuum tube oscillators of the early 1900’s, today’s modern waveform generators utilize semiconductor devices and op amps to generate various waveforms including the sine, triangle and sawtooth waves.

Envelope Generator: A secondary technology being put to use in the synthesizer include Envelope generators. This type of technology implements control factors such through the use of either a Low Frequency oscillator, or other means of creating a shaping format for which the components are impacted. For example the ADSR generates a format for the amplification circuits and controls the voltage inputs to give a specified amplitude response based on the desired Envelope shape.

3.3 Evolution of Methodology/Part Selections

3.3.1 Voltage Controlled Oscillator

The Voltage Controlled Oscillator (VCO) is the staple of all analog synthesizers. The VCO is the main tone-producing module. VCOs are delicate pieces of circuitry that require temperature compensation and careful calibration to be used for musical purposes. Most large scale analog synthesizers include several VCOs for tone stacking. Sound is produced by vibrating the air around us. Sound waves propagate through the air as variations in air pressure. The shape of the vibrations makes a huge difference in the harmonic characteristics and (tone color or tone quality) of the sound. VCOs generally produce several waveforms with different shaped impulses with which vibrate the air. Typical waveforms generated by VCOs include; sawtooth, ramp, square, rectangle, sine and triangle. One of the main features of a VCO is its response to control voltage. Once calibrated, a VCO can track one volt per octave over eight or more octaves. The range of frequencies for a VCO are typically the same that of human hearing, 20 Hz to 20 kHz. There are many electronic components that make up a Voltage Controlled Oscillator. See

27 the VCO section in chapter 5 for specific design details along with further background research.

LF351N Operational Amplifier (Op-amp): The LF351N is a wide bandwidth, high speed JFET input operational amplifier with an internally trimmed input offset voltage. The LF351N Op-amp was chosen because it has proven to be a reliable Op-amp to everyone in the group. 75% of our group is EE and we have used this Op-amp over the span of many semesters. It was decided that since we have not had any issues with this part in the past, that it would be best for our project. The LF351N offers very low input noise voltage and current at 25nV/√Hz and 0.01pA/√Hz, respectively. This is very important to the VCO because noise can cause disruptions in frequency. Even a minor disruption in frequency is noticeable, as the human ear can Figure 3.3.1.1: Op-amp detect when a VCO is only a few cents out of tone. A reliable Op-amp and careful calibration is paramount in these musical purposes. This part was also chosen because of its low cost and popularity among all electronic manufacturers. Among the plethora of Op-amps, this part in particular is widely stocked across the board, giving the sense that it is favored above the rest. Figure 3.3.1.1 is an image of one of the LF351N op-amps used in the breadboard design of the voltage controlled oscillator. Each VCO will contain 10 op-amps (possibly 11 for buffering), to deliver the desired result. The final project will have two VCOs for tune stacking purposes, which means there will be up to a total of 22 op-amps used for just the VCO portion of our analog synthesizer.

2N3904 Bipolar Junction Transistor (BJT): The 2N3904 is a common NPN bipolar junction transistor used for general purpose low-power amplifying and switching applications. This part was chosen for its performance ratings along with its low cost.

The 2N3904 is designed for low current power, medium voltage and can operate at very high speeds. Similar to the LF351, this BJT is stocked widely among major electronics manufacturers, making it easily attainable for DIY projects. Our Figure 3.3.1.2: BJT

28 group is familiar with the 2N222 NPN BJT, however, the 2N3904 has very similar characteristics. Although the 2N222 transistor has a greater current carrying capacity, it offers no advantage when dealing with low current devices. This BJT was chosen for its reliability in respect to variable frequency oscillators, which is the staple of our VCO. This transistor has many applications where lower currents are used to minimize thermal heating. Thermal heating consequents thermal drift of the fundamental frequency, which is disastrous when dealing with such a fine tuned frequency dependent system such as a VCO. The 2N3904 is also very popular among hobbyists who venture out into electronic projects. Figure 3.3.1.2 is an image of NPN BJTs that we will be using in the project

2N5459 Junction gate Field Effect Transistor (JFET): The 2N5459 junction gate field effect transistor (n-type) is a three-terminal semiconductor device that can be used as an electronically-controlled switch, amplifier, or voltage-controlled resistor, to name a few. Unlike the BJT mentioned before, JFETS are exclusively voltage controlled, as they do not need a current bias to operate. Electric charge flows through the semiconducting channel between the source and drain terminals. The 2N5459 was chosen because it works very well as a low level audio amplifier as well as a switching transistor. Compared to many other JFETS, it has a low total power dissipation at 625 mW. Figure 3.3.1.3: JFET The 2N5458 also has a very high thermal resistance rating from junction to case and junction to ambient with values at 83.3°/W and 200°/W, respectively. As mentioned before the VCO operates on relatively low power, which makes the 2N5459 advantageous for audio amplification and switching. Figure 3.3.1.3 is an image of the JFET that we will be using in the VCO for this project.

P160KNP Potentiometers (pots): The P160KNP potentiometers are a three-terminal resistor with a sliding contact that forms an adjustable voltage divider, or in other words, a variable resistor. The P160KNP pot is standard and widely used. This part was chosen because it meets design specifications while also having a low cost. As pots are not the cheapest electronic items, finding this cost effective piece will help bring down the total cost of this project. This part (100k ohm pot, specifically) has a wide range of resistances varying from 500Ω to 1MΩ. It also has low residual Figure 3.3.1.4: Pots

29 resistance which indicates low loss. This part was chosen for its exceptional rotational life of 100,000 cycles, plenty more than needed for our purposes. This model was chosen for values including; 10k ohms variable, 100k ohms variable and 1M ohms variable. Figure 3.3.1.4 is an image of the three different pots we will be using in the VCO design of this project.

1N4004 General Purpose Diode: A diode is a two-terminal electronic component that conducts primarily in one direction. It has low resistance to the flow of current in one direction and extremely high resistance into the other direction. This diode is standard among electronic manufacturers and also cost effective. This part is readily available while also meeting our design specifications, making it a desirable choice among diode models. Figure 3.3.1.5 is an image of this diode that we will be using in the project. Figure 3.3.1.5: Diode

General resistors and capacitors: The VCO requires many resistors and capacitors with varying values. As there are a plethora of manufacturers that offer different prices for different components, it is impractical to list each item individually. However, when capacitors are being sought, we use Mouser electronics as it is an exceptionally helpful website when determining the most cost effective item. For the VCO resistors will vary from 4kΩ to 2MΩ. For simplicity purposes, only 0.01μF and 0.1μF capacitors will be used.

There were a few underlying strategies for part selection for the VCO. First, we would make sure that the part would meet design specifications. In this case, we were looking for low current, low voltage components that were reliable and had minimal noise. Once that requirement was met we were able to focus on less pressing details. Details such as cost effectiveness. We are not made of money so obtaining all these components at a low cost is beneficial. Giving that this is our first attempt at building an analog synthesizer, it is safe to say there will be user error and we will need to replace broken or defective parts. Although not mentioned in the individual component sections, all items were stamped with an EU RoHS compliant mark. These items were recommended and proven safe via regulation standards.

30

Background and Research

Control Voltage Mixer and Exponential Converter: The term voltage controlled in VCO expands from the control voltage mixer and exponential converter. For a majority of analog synthesizers, a certain standard was developed. This standard is “one volt per octave” referring to control voltage. To illustrate, an increase in 1V the frequency increases a full octave; 100Hz to 200Hz. A second increase by 1V will increase the frequency from 200Hz to 400Hz, and so on. A summing amplifier, figure 3.3.1.6 is used to combine and attenuate three voltage control inputs. The output voltage of the summing amplifier is adjusted using a trimming pot Figure 3.3.1.6: Summing Amplifier (P160KNP) in order to calibrate the ratio between voltage and frequency. The linear change in the summing amplifiers output voltage can be converted to exponential change in current using 2 matched NPN (2N3904). The Op-amp feedback controls base-emitter voltage of the first transistor. A linear change in the base-emitter voltage of the second transistor would cause an exponential change in that transistor’s collector current. Thus, creating a linear change in frequency due to the feedback amplifier.

Waveform Generation: We know from experience that configuration of an Op- amp can provide numerous results. Just about any waveform can be achieved through the use of an Op- amp. For our purposes, we need to realize the circuitry to create a VCO. As mentioned in 3.3.1, a VCO can produce many different waveforms. The ones we will be generating for this synthesizer are; sine, square, triangle, sawtooth and ramp. Most synthesizers are Figure 3.3.1.7: Integrator ramp core design, meaning that waveform generation is created initially from the ramp wave.

31

The current drawn by the exponential current converter is fed into an integrator circuit, see figure 3.3.1.7. The integrator generates a waveform with a positive linear slope due to the constant current sink at the input. The output of this Op-amp leads an exponential current converter, figure 3.3.1.8, so that the comparator is triggered whenever the integrator output rises above a certain threshold voltage. The comparator output drives the gate of the JFET (2N5459), whose source and drain are Figure 3.3.1.8: Exponential Converter connected across the capacitor of the integrator. The capacitor is discharged when the JFET gate is high and the integrator output goes back to ground. The comparator output are driven low and the integrator circuit begins this process over again. This will generate the raw ramp waved used to create the other waveforms. Here, we must do further modification on this raw ramp wave to meet further design specifications, noted below. The ramp waveform is inverted and amplified using an inverting amplifier to create a . However this sawtooth wave acts like a ramp, decreasing to zero, repetitively. A proper sawtooth will have a range of +X voltage. To achieve this an adjustable offset using a potentiometer (P160KNP) will need to be introduced. Figure 3.3.1.9 demonstrates this inverting amplifier with adjustable offset. For the next waveform we will need a ramp wave at the same offset as the sawtooth. Once again we invert the output of the sawtooth using a unity gain inverting amplifier. The saw and ramp waveforms are combined using two diodes (1N4004-B) so that the waveform with the higher voltage is passed through. When half of the sawtooth and half of Figure 3.3.1.9: Inverting Amp with Adjustable Offset the ramp waveforms are combined this way, they represent a single triangle wave. The ramp wave is fed into the comparator; one port acting as an inverter, the other port non-inverting. When the amplitude of the ramp wave applied to the non-inverting input is above the average ramp wave voltage applied to the inverting input the output of the non- inverting jumps to positive saturation. When this input is below, the output jumps to

32 negative saturation. In turn, creating a square wave output. An example of this comparator circuit is given in figure 3.3.1.10. This example shows the input as a triangle waveform, with a square wave output. The output is generated from the triangle Figure 3.3.1.10: Comparator Circuit waveform using 3 trimming pots (P160KNP) to calibrate the output waveform so that it resembles a smooth sine wave.

3.3.2 Signal Mixer

The signal mixer is a simple yet vital component for creating a diverse selection of sounds within the analog/digital synthesizer. This device falls in the chain of components immediately following the voltage controlled oscillators and is responsible for blending or isolating their signals to be sent to the remainder of the synthesizer circuitry.

The first expectation of dealing with this component came down to the basic essential of a of a potentiometer, simply taking in a signal to each of the two ports on the potentiometer and sending the mixed value out through the wiper of the potentiometer. Unfortunately, two problems are met while using this method. The first being that the selected digital potentiometers used for the project are not capable of inputting two values at once. The other issue that arises is a significant loss in signal amplitude.

In figure 3.3.2.1, the selected design for the signal mixer is shown. This circuit includes a summing amplifier with an input singles representing either of the two VCOs. A potentiometer is placed after each VCO which will be controlled in the actual synthesizer by a microcontroller. The microcontroller’s intended functionality in this situation is to simultaneously control both of the resistors while a single rotary encoder is turned to alter the value. Once the signal reaches the first amplifier, the output will result in an inverted signal, so another inverting op amp is placed after in order to replace the signals to their original phase and polarity.

33

Figure 3.3.2.1 Signal Mixer Circuit

When the two signals are combined at even intervals, the expected output would be similar to what is displayed in figure 3.3.2.2. in this case, a square wave and a sine wave are input from either of the two signal generators shown in the schematic and the outputs of both are placed through the summing amplifier chain to reveal the desired output.

Figure 3.3.2.2 Equal Output of Both Signals Mixed

Figures 3.3.2.3 and 3.3.2.4 demonstrate the appearance of both of the signals singled out. Therefore allowing an understanding as to the two types of signals exemplified within the circuits use from the VCO.

34

Figure 3.3.2.3: Sine Wave Function Muted While Second Signal Square Wave is Output

Figure 3.3.2.4 Square Wave Function Muted While Second Signal Sine Wave is Output

35

3.3.3 Low Frequency Oscillator Research

The Low Frequency Oscillator (LFO) has been a staple of analog synthesizers since it was first introduced in the modular synths of the 1960s and 1970s. An LFO is very similar to the Voltage Controlled Oscillator (VCO) previously discussed wherein they can typically produce all of the waveforms that a VCO can. However, while the typical VCO can range as low as a few cycles per second, the cycle time of the LFO can be several minutes long. LFO oscillation can range from millihertz to audible frequencies slightly above 20 Hertz. Since this operating range is mostly below what the human ear can detect, the LFO is most often used as a modulator for the VCO to produce audio effects. The most common examples are vibrato, or a regular, pulsating change of pitch used to produce a stronger, richer tone, , a wavering or trembling effect in a musical tone, typically produced by rapid reiteration of a note or rapid repeated variation in the pitch of a note, and phasing which basically creates a sweeping effect.

The practical applications of an LFO are plentiful and are really up to the design goals of the engineer. In order to modulate the signal from the VCO the LFO for our design would need to input a waveform into our Voltage Controlled Filter (VCF) where it will modulate the signal that is outputted from the signal mixer.

Due to the practicality and usefulness in altering the VCO signal to produce audio effects and the end goal of our project, to create a functioning analog synthesizer that has musical potential, it was an obvious, if not essential decision to include an LFO in our overall design. In order to produce an effective and functional LFO several existing designs were examined to determine the advantages and disadvantages of including various attributes in our own design. The first of which is shown in Figure 3.3.3.1. This figure shows a circuit capable of producing both a ramp and sawtooth functions at very low frequencies, as low as 1 Hz.

Figure 3.3.3.1: Ramp/Sawtooth LFO

36

Ramp Wave analysis: the following figures located on this page all show the waveforms produced by Figure 3.3.3.1. The first of which is located in Figure 3.3.3.2 and shows the ramp wave produced when Switch 1 is in the up position, R10 is at 90%, and Switch 2 is in the open position. This waveform shows a clean ramp function outputting at close to +5 and -5 Volts which is perfect to output into the Voltage Controlled Filter designed by Kyle Thatcher. The frequency level in this figure is still relatively high, about 10 Hz, however it should be noted that the “Low” Figure 3.3.3.2: LFO Ramp, R10 90% switch is still open when this reading was taken. The next figure shown, Figure 3.3.3.3 shows the output of the ramp wave when all of the factors are kept the same except R10 is adjusted to be 50%. Here you can see that while the amplitude remains mostly the same, the frequency jumps up into the 50 to 60 Hz range. This change in frequency between Figure 3.3.3.3 and Figure 3.3.3.2 is due to the fact that the potentiometer R10 controls how much of the voltage from the output of U1B is available to sink current from it’s inverting input. Figure 3.3.3.4 is a demonstration of when this LFO’s “low” switch, in this case switch 2, is moved to the closed position. As you can see on the oscilloscope reading, the frequency starts in the 50-60 Hz range with the potentiometer R10 still at 50%, however, as soon as the switch is thrown the LFO starts operating at a very low frequency around 1 Hz which will be perfect for our desired modulation effects.

Figure 3.3.3.3: LFO Ramp, R10 50% Figure 3.3.3.4: LFO Ramp Wave (Low)

Sawtooth Wave analysis: the following figures located on this page all show the waveforms produced by Figure 3.3.3.5. The first of which is located in Figure 3.3.3.2 and shows the

37 sawtooth wave produced when Switch 1 is in the up position, R10 is at 90%, and Switch 2 is in the open position. This waveform shows a clean sawtooth function outputting at close to +5 and -5 Volts which is perfect to output into the Voltage Controlled Filter designed by Kyle Thatcher. The frequency level in this figure is still relatively high, about 10 Hz, however it should be noted that the “Low” switch is still open when this reading was taken. The next figure shown, Figure 3.3.3.6 shows the output of the ramp wave when all of the factors are kept the same except R10 is adjusted to be 50%. Here you can see that while the amplitude remains mostly the same, the frequency jumps up into the 50 to 60 Hz range. This change in frequency between Figure 3.3.3.6 and Figure 3.3.3.5 is due to the fact that the potentiometer R10 controls how much of the voltage from the output of U1B is available to sink current from it’s inverting input. Figure 3.3.3.7 is a demonstration of when this LFO’s “low” switch, in this case switch 2, is moved to the closed position. As you can see on the oscilloscope reading, the frequency starts in the 50-60 Hz range with the potentiometer R10 still at 50%, however, as soon as the switch is thrown the LFO starts operating at a very low frequency around 1 Hz which will complement the ramp wave, and be perfect for our desired modulation effects.

Figure 3.3.5: LFO Sawtooth, 50% Figure 3.3.6: LFO Sawtooth, 90%

Figure 3.3.7: LFO Sawtooth (Low Frequency)

38

The next logical step to confirming the practicality of this design would be to test it in the lab and make sure the experimental results match the theoretical values achieved by the simulation Fig

Figure 3.3.8: Ramp/Sawtooth Breadboard Schematic

As was previously discussed there are plenty of practical applications for an LFO. However, to achieve many of the modular effects desired by most users, the LFO must be capable of producing more than just a simple ramp or sawtooth wave. To achieve a “sweeping effect” that is desirable in many synthesizers, a triangle or sine wave generator must be added. For example by applying the LFO’s sine output at around 10 to 12 Hz to the VCO’s linear control voltage input, a vibrato effect can be achieved. This realization that additional outputs would be needed from the LFO led us to our final schematic and design for the LFO which can be found in chapter 5.3 of this paper

3.3.4 Voltage Controlled Filter The Voltage Controlled Filter is a staple device in musical synthesis. Generally used with , the VCF is responsible for removing frequencies from the produced sound of the oscillator stages. By adding a control variable through voltage variation, the user is granted the ability to change the range of the removed frequencies to create interesting effects that can further improve and expand the versatility of the intended output. In general, the most prominent type of VCF is the low pass filter. This is because the reduction of upper frequencies is typically more noticeable than the reduction of low frequencies, especially on lower quality speakers. It is for this reason that the VCF included within this project focuses primarily on the reduction of upper frequencies through the means of low pass filtration methods.

39

Typically there are two control factors for the VCF to account for. These factors include the cutoff frequency and the resonance frequency. When dealing with low pass filters, the Cutoff frequency is the upper point where the frequency response begins to reduce rather than pass through. In other words, at the cutoff point, the frequencies that are above this point begin to be diminished as can be seen in figure 3.3.4.1. An example of the impact of changing the cutoff frequency would sound like a sweeping, almost vocal sound similar if you sing a note and cuff your hands over your mouth. The most effective types of waveforms for which the VCO interacts with are those with several harmonics occurring during the voicing, for instance: square waves or triangle waves. As mentioned before, the subtractive nature of reducing the higher frequencies helps to change the overall characteristic of the waveform in general.

Figure 3.3.4.1: Low Pass Filter Frequency Response

The resonance on the other hand impacts the gain of the frequencies around the cutoff region. This is typically referred to as the quality factor (Q) and can be seen in the Figure 3.3.4.2. One way to describe the impact of the resonance control would be a slight ringing effect around the resonant frequency. On the synthesizer, the resonance will contain it’s own method of control, as similar will the cutoff frequency.

40

Figure 3.3.4.2: Resonance (Q-Factor Impacted) Frequency Response

The Q factor can be officially defined as the ratio of energy stored in the circuit over the energy lost while the resonant frequency is reached. To better define resonance in retrospect to this definition would be to say that it is a reinforcing quality of sound, either deep, full, or reverberating that would be produced by a prolonged production through reflection or reverberation within the circuit.

Design Constraints: When designing the VCF for our synthesizer, one of the achieved goals in mind is to implement a circuit that will sweep through and cutoff the appropriate level of frequencies. In many cases the frequencies sought to function around include those audible to the human ear. These frequencies typically lie between 20Hz-20kHz. Although, some people are able to hear beyond this range, the design constraints of the filters here will cut out anything above 18kHz.

Design process: One method for deriving the appropriate circuit for the VCF started with the use of a two op amp Current Generalized Immittance Structure (CGIC) Based Low pass Biquad. This Type of filter design allows for easy variation in the cutoff frequencies as well as the Quality factor for the filter by the two potentiometers. The Butterworth filter, by definition would appear to be the best suited filter for the application. The reason for this is that this type of filter is known for providing the flattest frequency response in the pass ban as possible while typically having a generally linear fall off region. For this reason, the Butterworth filter was the observed filter type to be tested for use in this audio application. The typical Transfer function for this selected low pass filter is shown in equation 3.3.4.1.

2 2 2 푇2(푠) = 푅 퐶 푠 1 푆2 + + 푅퐶푄 푅2퐶2 Equation 3.3.4.1 Transfer Function of CGIC Low Pass Filter

41

With this in mind, solving for the values of the cutoff frequency is found to be simply in equation 3.3.4.2. Which describes the cutoff frequency is equal to the inverse of the general rester values times the general capacitance values. When stating general values, for this particular circuit, all the resitive values and capacitive values are maintained as the same value, except for the two potentiometers which are there to alter the cutoff frequency and resonance Q-factor. 1 휔 = 0 푅퐶 Equation 3.3.4.2 Definition of Cutoff Frequency

The relation for the potentiometer resistor values and the capacitor values with the cutoff frequency is displayed in equation 3.3.4.3 In these equations, the 푅푐푢푡표푓푓 value is the value of the potentiometer for which will vary the cutoff frequency.

1 푅 = and 푅푐푢푡표푓푓 = 푅푄. 퐶휔0 Equation 3.3.4.3 Related Potentiometer (Rcutoff) to the capacitance and Q-factor

The design for this particular style of Low pass filter can be seen in figure 3.3.4.3. Where the output of a square waveform at 1.8kHz was placed through the filter to observe the output. Adjusting of the two potentiometers did happen to reveal a filtered result as can be seen in figure 3.3.4.4, where it’s noticeable that the generated output is no longer perfect square wave form shaped but instead is starting to show a more curved top due to the filtration of some of the harmonics within the waveform.

Figure 3.3.4.3: CGIC Low Pass Filter with Q-Factor Attenuation

42

Figure 3.3.4.4: Filtered Square Wave Output of CGIC LPF

Unfortunately, as shown in the bode plot for the Low pass filter, the output response curve doesn’t exactly meet a desired shape for the filter as specified above. The curve should display a flat response amongst frequencies lower than the the cutoff frequency, however, the frequency response shown for the CGIC shows a falling gain just before the cutoff frequency, which for the case of the synthesizer, is not an acceptable output.

Figure 3.3.4.6 AC analysis of CGIC Filter

43

Taking a step back from the CGIC filter, another type of filter design researched for use as the VCF was the Kerwin-Huelsman-Newcomb circuit. This style of circuit involves a summing amplifier along with two integrator amplifiers. Although not necessarily used for this project, the KHN circuit allows for the implementation of each a high pass, pass and low pass filter depending on where the output pin is located amongst the circuit. The transfer function dictating the operation of this particular circuit is displayed in equation 3.3.4.4

푅5 1 + 푅6 2 ( 푅3) 휔0 1 + 푅4 푇(푠) = 2 휔0 2 푆 + ( 푄 ) 푆 + 휔0 Equation 3.3.4.4 Transfer function for the Kerwin-Huelsman-Newcomb Circuit

Similarly to the other CGIC filter mentioned above, the values for finding the cutoff frequency are derived in a similar manner. The Q-factor however, can be determined from equation 3.3.4.5.

푅4 1 + 푄 = 푅3 푅6 푅5푅2퐶2 (1 + )√ 푅5 푅6푅1퐶1 Equation 3.3.4.5 Q-Factor Equation for Kerwin-Huelsman-Newcomb Circuit

Shown in figure 3.3.4.7 is the overall schematic for the VCF filter utilizing a Kerwin- Huelsman-Newcomb circuit. For the basic rundown, this circuit is essentially the base idea with some modifications. The circuit outputs based on the Low Pass output, as mentioned before, but also features the two nessesary potentiometers for changing the Cutoff frequency and Resonance Q-Factor.

Amongst the general rundown of the filter design with just potentiometers for voltage control and variation, it is important to remember that designing the filter portion of the VCF may be a large process for the entire modules creation; however an important factor to be implemented still was the voltage control portion.

The VCF is expected to be controlled by a low frequency oscillator that will deliver a -5v to +5v fluctuation that will control the VCF alongside the potentiometers. The way of doing this is to utilize a JFET as a variable resistor. This will allow the incoming voltage to control the JFET device which will then alter the resistance within the Low pass filter as necessary to adjust the cutoff frequency. With a switch and another JFET it is possible to adjust the resonance frequency in the same manner, but for this filter and synthesizer, the voltage control functionality will be reserved for the cutoff frequency as this provides the greatest impact on sounds being created, not to mention, the simplicity to maintain a standalone feature, as the resonance is determinant on the overall cutoff frequency.

44

Figure 3.3.4.7 Kerwin-Huelsman-Newcomb Circuit

Figure 3.3.4.8 Demonstration of High Q-Factor

45

Figure 3.3.4.9 Demonstration of Low Q-Factor

Seen from figure 3.3.4.8, the output Bode Plot and phase diagrams are viewable describing the Kerwin-Huelsman-Newcomb circuit. The important aspects to be viewed here is the general shape of the curve. It compares well to what was originally sought after in the designing criteria for this module. In observation to its noticeable that the Q- factor reaches a fairly sharp point. This was set with an adjustment to the related potentiometer in the circuit. In comparison, it is possible to view the same style output shown in figure 3.3.4.10. In this figure, the Q-Factor was dialed down to smoothen out the curve response.

In these two previously mentioned figures, it is possible to notice that the filter never completely excludes frequencies. Due to the capabilities of the human ear and the fact that this is simply an audio affect and not a means of noise reduction, this is deemed allowable. The higher range frequencies on the spectrum even less important; this is because the human ear is only capable of hearing up to 20 kHz typically. This range is significantly reduced with age as well. The typical user base for this equipment will not be capable of hearing the difference that the small upper band signals leaking through would produce.

3.3.5 Attack Release Envelope Generator The Attack Release Envelope Generator, shortened to AR is a vital secondary component within the synthesizer. Its function is to give the user an expanded range of versatility to

46 their desired audio output. This is done by modifying the shape for the amplitude response of the output waveform. The shape that is created is typically broken down into segments as mentioned by the name of the envelope.

Attack: The Attack segment of the envelope generator is what will eventually dictate how quickly the note being played on the synthesizer will reach its peak. A short or fast attack will result in an almost instantaneous sound production; where as a long attack will have an almost vocal approach. Understanding this can be important for potentially mimicking other types of instruments. For instance, if the synthesizer is generating a noise type wave function, a fast attack can help to produce percussive/drum like sounds, where as having a longer attack on a sine wave or square wave can sound similar to that of a . The attack time can also allow a long fade in for an automated crescendo affect.

Release: As for the release segment however, this is what will determine the overall length of the note. When the key is released after the start of the note, the release of the envelope generator begins. It is based on this trigger response that starts the either fast or slow diminishing of the outputting amplitude and sound of the synthesizer. Figure 3.3.5.1 demonstrates the overall envelope shaping for the Attack Release envelope generator, where a key press starts the buildup of the attack amplitude, and the release of the key begins the release cycle.

Figure 3.3.5.1 Attack Release Envelope Generator Shaping

Design Constraints: When designing the Attack Release envelope generator, a couple of important factors were needed to be taken into consideration. Firstly, and most importantly, the attack time and

47 release time were needed to be decided upon. Observing popular synthesizers on the market, as well as the typical user requirements, it’s necessary to have an attack time that can be short enough to provide a quick instantaneous production of sound, but also long enough to provide the user the capability of having that faded in crescendo affect. Similarly, when looking into the idea of the release time, it’s sought after to have an instantaneous release for many situations, such as quick fast paced music production, or to have a long release time to give the impact of a long fading tone to replicate something such as a space craft drifting off in the distance.

Another important constraint to understand during the designing of this component is the need to impact the ac signal of an audio wavelength where it is evenly affected by the rise of the attack, and diminish of the release. The general form of the envelope may appear to only lie in the positive domain, but needs to cut on the positive and negative amplitude ranges simultaneously.

Finally, the design needs to be triggered by an external source such as a button press, or in the case of this synthesizer, an impulse from the microcontroller which will act as a gate/trigger that will start the desired effect of the envelope generator.

Overall Project Integration: As this component can be generally viewed as a “modular device” that the synthesizer can operate with or without, the integration for this device. The generator outputs a voltage to control a Voltage Controlled Audio Amplifier, and acts as the control voltage to impact the overall amplitude of the output signal from the amplifier. When the attack, and release are set to their quickest settings, and the Sustain is set to it’s maximum magnitude, the perceived effect of the envelope generator is that it is no longer being observable. This is because at these settings, it’s as if the component is nonexistent and the pure interaction of the components prior to the audio amplification is allowed to reveal their actual functionality.

Design process: While coming to a conclusion of the design for the Attack Release envelope generator, many possible ideas were experimented with to find the best functioning method. From a basic standpoint, the design will revolve around an RC circuit design, where the time for the capacitors within the circuit to charge and discharge can be controlled separately. The charge time equating to the Attack while the discharge to the release. This idea though seems better in paper in the simplest means, however, as found through much experimentation, the peak voltage output is greatly impacted by the varying resistor values. This can be seen in figure 5.5.3, where the output amplitude decreases, even though the time it takes to reach its peak is elongated.

The first iteration of the circuit made these mistakes, but helped to shed light on possible evolutions to the design criteria. Shown in figure 3.3.5.4, the base schematic for the design principles is displayed. This first iteration of the design allows for a variable charging time to the capacitor as well as a variable release time. For the most part, the two potentiometers set to control each factor seem to alter their desired functions in some way, however,

48 because of the nature of the circuit, they also control the other function as well, which does not fit well into the specified design criteria. A need to evolve the circuit from this point arose to meet all the design criteria.

Figure 3.3.5.4 First Iteration of the AR Generator

For the most part, the two potentiometers set to control each factor seem to alter their desired functions in some way; however, because of the nature of the circuit, they also control the other function as well. Although it functions to a basic point for the design criteria, the general consensus was to consider other methods of implementing the circuit. Through a substantial amount of research, some implementations of the desired circuit involve the use of a 555 timer. This is common in the similar functioning Attack Decay Sustain Release (ADSR) Envelope Generators. Utilizing a typical 555 monostable arrangement, it was possible to create a triggered circuit that would create the appropriate curve for the attack and release. This design is shown in figure 5.5.5.

Figure 3.3.5.5 555 Monostable Attack Release Circuit

49

This design however has a couple of difficulties with its implementation. As far as simulations are concerned, the 555 timer run in this setup receives an impulse, which charges the capacitor and can be varied using a potentiometer to change the attack time. However, if the input trigger lasts longer than a short pulse, problems with the chip causing errors which could lead to instability in the circuit.

Because the user is expected to play more than short simple notes while performing with the synthesizer, this was deemed as not an appropriate response for the given circuit set forth to be designed. The output of the circuit does generate some promising results however mostly only the release time is impacted by changing of the potentiometer values, as can be seen in figure 3.3.5.6.

Figure 3.3.5.6: Output of the 555 Monostable Attack Release Circuit at Varying Impedances

After realizing that the results were not in fact appropriate for the design, other methods were researched to determine what would work best. Another attempted method of achieving the desired design criteria involved the use of opposite facing diodes to regulate the voltage being used at different times within the circuit. This basic premise of this design can be seen in figure 3.3.5.7.

50

Figure 3.3.5.7 AR Circuit Utilizing Looping Diodes

The basic premise for this circuit is that the switch acts as the trigger which will send the positive voltage through the diode D1, this voltage charges the capacitor C1, simultaneously sending the ramped output through the op amp. When the switch is removed, the capacitor begins to discharge, sending the voltage back through the early segment of the circuit via diode D2 and being cut down by the two potentiometers. As capacitor discharges, the voltage is diminished further and further by the two resistors. The LED on the output helps to demonstrate the effect of the circuit, which displays a gradual brightening when the switch is pressed, then dimming gradually based on the potentiometer values within the circuit. To prepare the circuit for a larger versatility in the possible time duration for the attack and realize, this circuit also features a larger potentiometer value, ranging in to the Mega ohms values, in this case two mega ohms are used.

Overall, the simplicity of the AR circuit Utilizing Looping Diodes makes for ease of utilization as well as a simple to remedy circuit if something were to break or cause problems. The basic premise of an Attack release isn’t very advanced, so the circuit design can maintain a level of simplicity. Which is why the overall goal of the module will be fulfilled using this style of circuit.

3.3.6 Voltage Controlled Amplifier A Voltage Controlled Amplifier (VCA) sometimes referred to as a variable gain amplifier, is an electronic amplifier circuit that takes a control voltage and varies its gain based on that input. VCAs have numerous applications in audio devices and synthesizers, including audio level compression and amplitude modulation, however, for our purposes we will be looking at the applications of VCAs in analog synthesizers. In specific relation to synthesizers, the VCA is the last functional block that a signal will pass through before being passed onto an internal or external power amplifier. As the last functional block, the VCA will often times will determine the instantaneous volume level of the note form the user input keyboard controller, while simultaneously quieting the output at the end of the note. This is necessary because most Voltage Controlled Oscillators circuits do not have amplitude control built into them or have the ability to end their oscillations on their own.

51

This means that without the VCA the synthesizer would continuously sound once the control voltage was applied to the VCO, making it an essential part of any synthesizer project. Before we felt comfortable diving into designing our own VCA that was capable of performing the basic necessities of the paragraph above, we felt it necessary to do some research on basic audio amplifiers to familiarize ourselves with the concepts. When we originally began the formulation of our synthesizer idea at the beginning of the semester, it was thought that all that would be necessary as the last functional block would be a simple audio amplifier that was capable of driving an 8 ohm speaker. Therefore, a simple circuit was designed that was able to accomplish this task.

Figure 3.3.6.1: LM386 Audio Amplifier (Gain 20) The LM386 Low Voltage was chosen and ordered in order to provide a gain of 20 to 200 for an input voltage of up to 400 mV. In order to build and test this circuit, the electronic schematic capture and simulation program NI Multisim 13.0 was used. However, since the owned version of Multisim did not contain the LM386 Op Amp, before any steps could be taken, a custom part had to be created with all the specifics of the LM386. This part was created in Multisim using a .cir file downloaded from the internet that contained the LM386 SPICE model to simulate the LM386 as closely as possible. The file that was downloaded can be found in the appendix. After the LM386 component was successfully created the circuit shown in Figure 3.3.6.1 was created. By adding a 10 microfarad capacitor between pins 1 and 8 of the LM386, the gain could reach maximum values of up to 200 (shown in Figure 3.3.6.2). If a specific gain is required, all one must do is add a resistor in series with the 10 microfarad capacitor and the 10k potentiometer will allow for a range of gains up to that maximum.

52

Figure 3.3.6.2: Audio Amplifier (Gain 200) Figure 3.3.6.3 shows the oscilloscope readings across R5 of Figure 3.3.6.1 and Figure 3.3.6.2. With a sine wave input that has an amplitude of 5 mVp and a frequency of 10 kHz the output showed a gain of 20.52 and 182.67 which was right around what we expected to see. It should be noted that the potentiometer on Figure 3.3.6.1 shows 65% when the oscilloscope output was reading the potentiometer at 0%.

Figure 3.3.6.3: Oscilloscope Reading of Fig. 3.3.6.1 and Fig. 3.3.6.2 After this design came to fruition, and the more we as a group researched and materialized the scope of what we wanted our synthesizer to be, we quickly ascertained that this simple circuit, while a useful learning tool, would not be a sufficient VCA for our project. Our VCA, at the very least, needed to be able to take in an input from our Voltage Controlled Filter as well as have the ability to be modulated by an Attack/Release envelope generator and provide some sort of user interface to be able to control the overall volume of the entire system. To state the obvious, this simple audio amplifier, would not even provide the simple taper we needed to quiet the output after the user releases the note on the keyboard.

53

This understanding led us to look into more complicated amplifiers that were capable of completing the objectives we needed.

All sounds have amplitude envelopes. Which means all sound start off with a specific amplitude, sustain/decay that amplitude over time and then the amplitude eventually returns to zero. Some sounds start with a high initial amplitude and then decay slowly, for example a bell being struck, and some can decay very quickly such as a loud clap. The reason this is important is because it affects how our VCA will be built. The human ear responds better to a logarithmic response from the VCA, in that it will sound more organic and natural, rather than a linear response like the one in the LM386 amplifier circuit. The VCA needs to be able to take input from the Attack/Release generator and produce a response that sounds correct to the human ear, as well as allow for the volume to be shifted in a way that makes sense to the ear.

After realizing this, it was determined that we would need a logarithmic amplifier somewhere in this module. In order to simplify this need we decided to use the Texas Instruments LM13700M Dual Operational Transconductance with Linearizing Diodes and Buffers. This component consists of two current-controlled transconductance amplifiers, each with differential inputs and a push-pull output. The linearizing diodes help to reduce distortion levels and allow higher input level. Other features include an adjustable gain over 6 decades, excellent gain linearity, high impedance buffers and high output signal-to- noise ratio making it perfect for our applications.

Figure 3.3.6.4: 13700M Transconductance Amplifier Additionally, the Texas Instruments datasheet provides typical applications for the LM13700, which, conveniently includes a schematic for a voltage controlled amplifier. Formulating a design around this material the following schematic was created.

54

Figure 3.3.6.5: Logarithmic VCA

This circuit has just about everything we need from our VCA including: a master volume potentiometer, an input from the VCF(XFG1), an input from the AR envelope generator and a CV allowing for an acceptable response that can be modulated by the user. This oscilloscope reading shows the difference when the 10k ohm potentiometer (R16) is varied and the effect is has on the amplitude of the output.

Figure 3.3.6.6: Oscilloscope output of Fig. 3.3.6.5 While there is nothing wrong with this logarithmic VCA, and we were able to learn a lot from it, after more carefully examining the needs of our synthesizer we decided that we would prefer a VCA that had both logarithmic and linear capabilities. Due to this we

55 moved on to another design for our project that can be found in Chapter 5.6, which details the final schematic we went with.

3.3.7 Microcontroller

The main component needed to control the analog signals and convert them to digital needed to be selected from various computational devices. The three researched devices are microcontroller, microprocessor, and FPGA. Each device was weighed on its merits. Ultimately, microcontrollers were selected for their flexibility and usability.

Microcontroller vs. Microprocessor – A Microprocessor is a computational engine. Its sole functionality is computing numbers. It is very powerful when optimized for the task; however, it is primarily a hardware programmed device. A Microcontroller is a self- contained computer. It houses a microprocessor as well as ROM, RAM, and I/O. A microprocessor alone will not be able to handle the needs of the project.

Microcontroller vs. FPGA - FPGAs and microcontrollers (MCUs) are two possible options for the processing unit of this project. Both have the flexible capability of being programmed to perform the actions necessary for computing the I/O needs of the project, the problem arises as the complexity jumps to bit-addressed I/O devices, such as digital potentiometers. FPGAs are programmed using hardware description languages (HDLs) which program logic functions into an executable file that the FPGA can read. The HDL file is generally based off a higher-level program's mathematical model, such as those created in MATLAB. FPGAs are generally their own PCBs and may be large.

MCUs contain some similar features to FPGAs but also offer other options. Rather than an HDL, MCUs can be programmed in assembly or a high-level programming language, such as C. These chips contain their own integrated timers, crystal oscillators and many I/O ports. Another feature found in MCUs are internal analog-to-digital converters (ADCs) and digital-to analog converters (DACs) to allow for signal processing.

MCUs typically come with various modes of serial communications. The fairly common modes are Universal Asynchronous Receiver/Transmitter, Serial Peripheral Interface, and Inter-Integrated Circuit. MCU size play a factor in the number of slave devices that can be connected through these modes.

Since the goals of this project necessitate small size, FPGAs are not ideal for this design. Additionally, the design team is more familiar with programming languages allowed by an MCU. With their ADCs, DACs, and various other features possible; the MCU was selected for this project.

The project includes a large number of components that need to be controlled by a digital signal. For this reason, a large amount of I/O ports is required and compatibility with serial communications modes. The modes required are Universal Asynchronous

56

Receiver/Transmitter, Serial Peripheral Interface, and Inter-Integrated Circuit. The selected MCU must be able to connect to a minimum of three devices through SPI and through I2C, simultaneously.

The following devices were researched as being most compatible with the aims of the project:

● EFM32™ Wonder Gecko 32-bit ARM® Cortex®-M4 Microcontroller ● Texas Instrument TMS320F2807x Piccolo™ Microcontrollers ● Microchip Atmel ATUC256L3U

These microcontrollers were considered since they all have the three serial communication interfaces that are capable of controlling the required number of slave devices. The MCU families offer varying sizes, though smaller sizes limit the number of I/O ports available.

With the three compared MCUs all meeting the requirements of the project, the decision came down to ease of use and reliability. Ultimately, the Texas Instrument TMS320F2807x Piccolo™ Microcontroller family was selected due to the general consensus among online communities that it was an easier and more reliable MCU for first time firmware developers.

As microcontrollers are board-mounted devices that are incompatible with breadboards, the prototype device needed a substitute microcontroller that would be similar enough to the microcontrollers that transitioning later on in the design process would not require any extravagant amount of time or effort.

For the initial prototyping, the Raspberry 1.2GHz 64-bit quad-core ARMv8 Pi 3 model B was used. The Raspberry Pi 802.11n Wireless LAN used allowed for live testing of code with Bluetooth 4.1 components to provide a proof-of-concept Bluetooth Low Energy (BLE) design. The Raspberry Pi was selected 1GB RAM over various alternatives, such as the 4 USB ports Arduino UNO Rev3 [2] and the 40 GPIO pins BeagleBone Black [3], due to the Pi’s Full HDMI port large amount of GPIO pins. The Ethernet port Raspberry pi was also selected its high 3.5mm audio jack level environment that lowered the Camera interface (CSI) difficulty of design and implementation of Display interface (DSI) new components. Micro SD card slot

VideoCore IV 3D graphics core The Raspberry Pi runs a distribution, modified for specifically for the Raspberry Pi, called Raspbian [1]. Table 3.3.7.1: This operating system runs a full 64-bit Raspberry Pi 3 model B Specifications environment with support for both C and Python.

57

3.3.8 Human Interface Devices Human Interface Device (HID) are any form of input device that will be actionable but the operator, this includes all knobs, buttons, keys, and dials. The HIDs needed for this project, in non-technical terms, are buttons and dials. Tactile switches will be used to control voltage that operates the VCOs, altering the frequency and pitch of the resultant waveform. Additionally, the tactile switches’ events will be converted to MIDI format and transmitted to any compatible device connected. Dials will be used to select or alter the waveform through the use of digital potentiometers. These interactions will be mediated by the MCU, where it will be analyzed to prevent any form of lag or jumping the Research revealed that buttons and dials come in various styles. The most basic of style of button is a tactile switch, and a dial is most similar to a rotary encoder.

Tactile Switches: Tactile switches, as shown in Figure 3.3.8.1, consist of a simple open/close electromechanical circuit that when depressed, completes the circuit. These switches are inexpensive, reliable, and easily integrated. These tactile switches can easily have a secondary surface attached to increase appeal as well as hide important circuitry. Tactile switches are typically a four pin component with two pins connected and considered the input and the remaining two pins connected considered the output. Pressing the switch, Figure 3.3.8.1: moves a metal piece that connects the input to the output. Tactile Switch

Rotary Encoder: Rotary encoders are electromechanical dials that either transmit a quadrature signal that can be translated to a simple -1/+1 signal by a MCU, or an absolute state that will transmit a binary encoded location of the dial. Quadrature rotary encoders are typically a three pin component. Terminal A and Terminal B are the input terminals. The ground pin is located between the two terminals. When the rotary encoder is rotated, a circuit is completed in either Terminal A or Terminal B. On the completion of the detent, the remaining terminal circuit is completed. This gives a two pulse signal style of communication.

Quadrature rotary encoders are volatile memory that does not save state on loss of power. Absolute rotary encoders are non-volatile and will save state on memory loss. Quadrature rotary encoders are cheaper and will use less I/O ports to transmit a state change, though are prone to “jumping” or “lagging”. Figure 3.3.8.2:

Both device types will be implemented as various functions Rotary Encoder of the system. Tactile switches will be implemented as keys to control the state of the

58 analog signal. The switches will be hidden under a secondary key that will hide the circuitry and offer a greater aesthetic appeal. Other possible implementations of tactile switches are as preset-state selectors. The preset-selector would have save and restore the current state of the device by emulating toggles.

Rotary encoders will be implemented as dials to increment the state of the analog signal. A quadrature signal rotary encoder was chosen for its price as well as the ability to work through the various faults.

3.3.9 MIDI Transmit Port One feature to be implemented into the device is the ability to intercept and convert button events into Musical Instrument Device Interface (MIDI). The MIDI standard uses the DIN 41524 port connector for all transmissions, as shown in Figure 3.3.9.1.

The DIN 41524 port consists of a circular metal skirt around five pins. The five pins are four transmission pins and one grounding pin. These pins are located in a semicircular fashion inside the metal skirt. The port orientates the female end using a groove cutout along the top of the port. Figure 3.3.9.1: DIN The MIDI standard does not use all five usable ports on the DIN 41524 port, leaving two completely unconnected. Transmission is based a Universal Asynchronous Receiver Transmitter (UART) signal. The UART signal must be synced to match the 31,250 Baud for the signal to be read by the receiver.

The baud rate is the unit rate of signal transmission or modulation per second. Baud rate can be expressed in bits per second, though it is rarely done. Baud rate presents a challenge when selecting the microcontroller. The MCU must be able to sync to the specific baud rate that the standard of MIDI uses. This could potentially affect other aspects of the project as the MCU might be altered and be unable to operate with other components. This will be factored into the selection MCUs, as the UART must be able to transmit at that specific baud rate without slippage. Any slippage will not deliver the correct MIDI timing, an important feature to musicians, to the receiving device.

3.3.10 Power Supply The power supply is the beginning, and arguably one of the most crucial components of this project. A power supply generates power for our analog circuitry and the computers that allow us to program in the digital realm of this project. There is no part of this synthesizer that is a capable of working without a power supply. Batteries seem to be a favored route because of its pure simplicity and reliability. The downfall with batteries is

59 cost effectiveness. Constantly having to replace dead batteries is cumbersome, expensive, and can be detrimental to the design of our synthesizer. Given Murphy’s Law, there is a good chance that the batteries (including the back-ups and spares) that we use on day are all dead. We decided on a more concrete power supply design. We know that the power generated from the wall is extremely reliable. Given that there are no sudden blackouts or power surges, we can almost guarantee that if we stick a fork in the wall socket that we are going to be electrocuted with straight 120VAC, 60Hz, 15W raw power.

We use this reliability to our benefit by introducing a wall wart. A wall wart is a power adapter that we will buy from an electronic retail store. The wall wart takes the 120VAC, 60Hz, 15W input from the wall and output a 12VAC, 1000mA power for our use. However, we are in need of straight DC voltage to power our components, as a battery would.

Through our electrical engineering expertise we can regulate and rectify the 12VAC to deliver the desired +/- 12V DC. The circuitry is fairly simple, we will design rectification with two voltage regulators, four diodes, and various resistors and capacitors. See the power supply section in chapter 5 for specific design details. Another advantage of this power supply design is that only a few parts are required, mentioned below.

Background and Research:

Jameco 12VAC, 1000mA Wall Wart: The Jameco 12VAC wall wart, or power adapter was chosen for its cost effectiveness and reliability. Reviews online have determined this is a suitable piece of equipment for providing a steady 12VAC output. For our purposes, we require +/- 12VDC. There are power adapters that are already regulated and rectified to the specified DC voltage, however, we chose this piece of equipment because it is cheaper than its DC output counterparts. Based on synth DIY research it was determined that at least Figure 3.3.10.1: Power Adapter 1000mA be the minimum requirement of the adapter. The whole purpose for this power supply is to eliminate the use of batteries, so we need to provide similar currents and provide similar capacity of running multiple modules at once. This Jameco wall wart has proved good quality for other synthesizers as mentioned by synth users and designers. Figure 3.3.10.1 is a web image of this particular power adapter. As of right now, we are still waiting for this component to come in. The need for a power adapter is not necessary as of now as we have been able to simulate all circuitry without it, as we have been using the equipment in the senior design lab.

60

LM7812 and LM7912 Voltage Regulator: Research determined that 12VAC power adapters when rectified tend to output a +17V to -17V spread. For this reason a voltage regulator component is needed to cut off the top and bottom 5V. Once clipped, the output voltage will be the desired +/-12V. However, two different voltage regulators are needed for the positive voltage and negative voltage outputs. The LM7812 component is the voltage regulator used for positive voltage regulating purposes only. The LM7912 component is the voltage regulator used for negative voltage regulating purposes. Figure 3.3.10.2: Voltage Regulator These parts were chosen in particular because they are fairly cheap and the parts themselves are designed for 12V inputs. The last two digits in the part number indicate the 12V specification. Figure 3.3.10.2 is an image of the specific voltage regulator being used for the negative voltages in the power supply. The LM7812 voltage regulator poses the same image so it is not posted here as it would just appear to be a duplicate of the LM7912.

1N4004 General Purpose Diode: Diodes are most important for AC to DC voltage rectifying. The diodes will steer positive or negative excursions into capacitors to be fed into the voltage regulators mentioned above. Diode in power supplies are also for safety and protection purposes. As we know, the diodes allow for current in one direction so that we are not incorrectly polarizing our voltage regulators. This diode in particular was chosen because it is a simple general

purpose diode with suitable forward voltage specifications. Figure 3.3.10.2: Diode Also, this component is used widely throughout our project, so it makes for good continuity. Figure 3.3.10.3 is an image of the actual diode component to be used in the power supply.

General resistors and capacitors: The requirements for the capacitors in the power supply are slightly more rigorous in comparison to the analog circuitry we use them for in our other components. The capacitors needed in the power supply have to have a high voltage capacity. Again, the purpose of the power supply is to eliminate the need for batteries, so it is important to have high voltage carrying capacitors. As these high-rated capacitors are generally expensive, we will salvage them from the power supplies of synthesizers that we own. Resistors are not necessarily needed for the power supply, however, they might be introduced for load testing at the

61 output to ensure that we are outputting the correct DC voltage. Also, numerous capacitor tantalums connected in parallel were recommended by National Semiconductor for operational stability. These are also safety and electric standard specifications that are mentioned further in chapter 4.

3.4 Part Selection Summary VCF The Voltage Controlled amplifier features various painstakingly selected components to offer the best functionality for the desired output.

LF351N Wide Band Single Operational Amplifier: This operational amplifier was selected for the purpose of the Voltage Controlled Low Pass Filter because of its low cost and high speed operation. Because of its low operation power demands, the Filter also offers the potential for low internal noise, making it suitable for Audio applications such as this. The filter featuring this device contains three LF351N Operational Amplifiers.

J310D JFET: This device is used within the VCF as a voltage controlled resistor. By limiting the input voltage, the impedance across the terminals varies at the range just under the biasing voltage. 1% resistor values: 1% resistor Values were selected for precise operation within the circuits

50volt Ceramic Capacitor: The intention of the selection of a ceramic capacitor was to handle the input alternating current created by the audio wave function that will be sent into the filter. Lower Capacitance values are a common feature in audio filters such as this. These low values are typical in the ceramic capacitor type. Also as the current will go negative at times because of the alternating current, Electrolytic capacitors are deemed inappropriate.

1N4148 General Purpose Power Switching Diode: The use of General Purpose diodes were used in this circuit to create a full wave rectifier for the use in voltage controlled resistor for the VCF. The reason for this is the low cost was appealing, and their capability to perform the required task made the selection of these components the right choice. Digital Potentiometers: The use of digital potentiometers is a strong reoccurring feature for use in this project. They allow for the digital control of the VCF via a microcontroller.

Signal mixer: The Signal Mixer features the following components to realize the proper outcome. LF351N: The LF351N Wide band operational amplifier makes it appearance once again for this component due to its fast response low cost and wide bandwidth response. 1% resistor values: 1% resistor Values were selected for precise operation within the signal mixer circuit.

62

Linear B100K potentiometer: This series of potentiometer offers a perfect response for a volume controlled application such as a signal mixer. These are also priced quite reasonably compared to other similar functioning devices.

Attack Release Envelope Generator The Attack release envelope features the following components to realize it’s desired outcome.

LF351N: The LF351 once again makes it’s spectacular reocurrance in another circuit. This time simply selected for I’s convenience offered by it’s ease of availability. The primary reason for utilizing this amplifier in so many circuits is the cost effectiveness of ordering in bulk supplies.

1% resistor values: 1% resistor Values were selected for precise operation within the circuit.

Linear B100K Potentiometer: The Linear B100k Potentiometer was selected for this application for affordability and ease of use. Considering the capacitors within the circuit, a linear response is sought after to promote a proper curve time for the circuit to realize during voltage buildup and release.

Electrolytic Capacitors: This module features Electrolytic capacitors. Higher capacitance values were sought after when creating this circuit to allow for increased release durations and more impactful attack times. These higher capacitance values are easier to achieve when selecting an electrolytic capacitor.

1N14148 General Purpose Power Switching Diode: The use of these diodes is primarily associated with their wide practical use and low cost. The diodes selected for the Attack Release Envelope work fantastic for current direction associated with the nature of the circuit.

LED Blue: Featuring a relatively low turn on voltage, this diode works as an excellent source of visualization for the Attack release Circuit. The only impact this LED serves is strictly aesthetic, yet provides a decent understanding to the functionality of the circuit for testing.

VCA: LM13700 Dual Operational Transconductance Amplifiers with Linearizing Diodes and Buffers: The LM 13700M consists of two current-controlled transconductance amplifiers with differential inputs and a push-pull output. It has several useful features including adjustable gain, reduced output distortion and high impedance buffers. It is the main driver in the VCA.

63

TL084 JFET-Input Operational Amplifier: The TL084 quad JFET-Input operational amplifier incorporates well-matched, high-voltage JFET and bipolar transistors in a monolithic integrated circuit. Some of the features include high slew rate, low power consumption, and low total harmonic distortion. They are a common amplifier used in personal electronics.

2N3904 Small Signal NPN Transistor: The 2N3904 Small Signal NPN transistor is a small load switch transistor with high gain and low saturation voltage that is well suitable for tv and appliance equipment.

Linear B100K Potentiometer: The Linear B100k Potentiometer was selected for this application for affordability and ease of use. Considering the capacitors within the circuit, a linear response is sought after to promote a proper curve time for the circuit to realize during voltage buildup and release.

2N3906 Small Signal PNP Transisitor: The 2N3904 Small Signal NPN transistor is a small load switch transistor with high gain and low saturation voltage that is well suitable for tv and home appliance equipment.

1% resistor values: 1% resistor Values were selected for precise operation within the circuit.

Electrolytic Capacitors: This module features Electrolytic capacitors. Higher capacitance values were sought after when creating this circuit to allow for increased release durations and more impactful attack times. These higher capacitance values are easier to achieve when selecting an electrolytic capacitor.

LFO: TL084 JFET-Input Operational Amplifier: The TL084 quad JFET-Input operational amplifier incorporates well-matched, high-voltage JFET and bipolar transistors in a monolithic integrated circuit. Some of the features include high slew rate, low power consumption, and low total harmonic distortion. They are a common amplifier used in personal electronics.

1N914 General Purpose Power Switching Diode: The use of these diodes is primarily associated with their wide practical use and low cost. The diodes selected for the Attack Release Envelope work fantastic for current direction associated with the nature of the circuit.

Linear B10K Potentiometer: The Linear B10k Potentiometer was selected for this application for affordability and ease of use. Considering the capacitors within the circuit, a linear response is sought after to promote a proper curve time for the circuit to realize during voltage buildup and release.

64

2N3904 Small Signal NPN Transistor: The 2N3904 Small Signal NPN transistor is a small load switch transistor with high gain and low saturation voltage that is well suitable for tv and home appliance equipment.

1% resistor values: 1% resistor Values were selected for precise operation within the circuit.

Electrolytic Capacitors: This module features Electrolytic capacitors. Higher capacitance values were sought after when creating this circuit to allow for increased release durations and more impactful attack times. These higher capacitance values are easier to achieve when selecting an electrolytic capacitor.

Digital Control Module Raspberry PI 3 Model B: The Raspberry Pi is being used as the substitute microcontroller during this stage of the device development cycle. It is fully capable of emulating all features of the microcontrollers on the market, including the asynchronous and synchronous serial interfaces used, such as I2C, SPI, and UART.

MCP 23017-E/SP I/O Expander: The MCP 23017 I/O Expander uses the I2C serial interface to provide an additional two banks of 8 GPIO pins. It is fully capable of hardware addressing up to 3-bits, allowing a total of eight MCP 23017 I/O Expanders to be used simultaneously.

MCP 4251-104E/P 100kOhm Digital Potentiometer: a SPI enabled digital potentiometer capable of 256 steps, at approximately 390 Ohms per step. The MCP 4251 is a dual potentiometer chip, capable of independent operation on each potentiometer. The MCP 4251 is capable of handling a 5V input source through each potentiometer.

EN12-HN22AF25 Quadrature Rotary Encoder: This rotary encoder is a 3 pin incremental encoder. It employs two outputs A and B, which are quadrature in nature. The rotary encoder has 24 detents, with unrestricted rotation in either direction.

FSM4JH Tactile Switch: These switches are a 4 pin, with the input and output connected to two pins, respectively.

KCDX-5S-S2-PS DIN 41524: This DIN is a 5 pin circular port capable transmitting serial through a single pin. This DIN is the standard port used by MIDI-capable devices. .

65

4. Related Standards and Design Constraints

4.1 Related Standards The following related standards have been compiled through research into the related standards organization and are directly used within the Analog-Digital Hybrid Synthesizer.

 Python 2 o Title: Style Guide for Python Code o Authors: Guido van Rossum, Barry Warsa, Nick Coghlan o Created: Jul-2001 o Description: This document gives coding conventions for the Python code comprising the standard library in the main Python distribution.

 ANSI C99 o Title: Rationale for International Standard-Programming Languages-C o Authors: INCITS J11 o Created: Apr-2003 o Description: This Rationale summarizes the deliberations of INCITS J11 and SC22 WG14, respectively the ANSI Technical Committee and ISO/IEC JTC 1 Working Group, charged with revising the International Standard for the C programming language; and it retains much of the text of the Rationale for the original ANSI Standard

 I2C o Title: I2C-bus Specification and User Manual o Authors: NXP Semiconductors o Created: Apr-2014 o Description: This document assists device and system designers to understand how the I2C-bus works and implement a working application. Various operating modes are described. It contains a comprehensive introduction to the I2C-bus data transfer, handshaking and bus arbitration schemes. Detailed sections cover the timing and electrical specifications for the I2C-bus in each of its operating modes.

 MIDI Specification o Title: The Complete MIDI 1.0 Detailed Specification o Authors: MIDI Manufacturers Association o Created: 1996 o Description: This document is an overview of the standards, practices and terminology associated with the generation of sound using the MIDI protocol. Including, but not limited to, hardware design and constraints, software protocol and algorithmic conversion to raw MIDI format for serial transmission.

66

 MIDI Reference o Title: MIDI Reference Tables o Authors: MIDI Manufacturers Association o Created: 1996 o Description: These reference tables are the quick and easy way to look up the meaning of a particular MIDI message number, find a Manufacturer ID number, find international standards that incorporate MIDI, and more.

 UART o Title: KeyStone Architecture Universal Asynchronous Receiver/Transmitter (UART) o Authors: Texas Instrument o Created: Nov 2010 o Description: Asynchronous Receiver/Transmitter (UART) performs serial-to-parallel conversions on data received from a peripheral device and parallel-to-serial conversion on data received from the CPU. The UART includes control capability and a processor interrupt system that can be tailored to minimize software management of the communications link.

4.2 Realistic Design Constraints

4.2.1 Economic and Time Constraints Economic There are many economic constraints that we are confined to. Currently and most likely by the time we have completed our project, will have received no outside funding. All expenses are paid out of our individual pockets. Some components and parts are more expensive than others, so attempts at divvying up costs are taken on a regular basis. As this is an on-going project we are constantly spending money on new equipment, parts and even paper. This paper alone will need to be printed in color. Color ink is actually more expensive than blood, by volume. This just goes to show the forceful economic weights that are put on when dealing with a project such as this. It has been discovered that a large amount of part costs have not come from the parts themselves, but from another area.

Shipping costs have proved to be the most expensive aspect of this project thus far. As we quickly learn more and more about specific hardware, we have ordered a plethora of different parts of what we think we need. There have been times where we have received the PCB components instead of the breadboard ones that we require at this stage of testing. These mistakes have caused us to re-order the correct parts which is only more money spent on shipping. Standard shipping is relatively cheap, however, we often find ourselves in a time crunch where we cannot move forward until we obtain an individual part. For this reason, we spend extra money on expedited shipping so that we are not cutting into our

67 time constraints that are mentioned in the section below. This must be the origin of the phrase “time is money”.

Time There are also many time constraints that must be met. There are many factors that must be taken account of in determining timeliness of this design project. As mentioned above, shipping can prove to be very time ineffective. Standard shipping for parts the size of your nail can take up to two weeks, if you are not paying for expedited shipping. Also, stock and availability must be considered when in a time sensitive situation. However this situation has yet to arise for us, there could be a case where the particular part or model we are trying to obtain is on back order for manufacturing. Upon ordering specific parts there is almost always a disclaimer to be aware of manufacturing delays.

PCB assembly and shipment can also take a lot of time. Past senior design classes have told us of one to two month waits for a single PCB. A time constraint here would be to have our final integrated schematic completed at least two and a half months prior to presenting the project. As mentioned in chapter 6, we have narrowed in on what seems to be a very reliable PCB vendor (Avanti Circuits), that we feel confident will deliver their product in a timely manner. Reviews online and word of mouth from other ECE students have only backed up the reputation that Avanti stands behind, which gives us peace of mind when working such a time sensitive project. However, we will not allow time to get the best of us. We plan to be fully prepared with our final project ready to present at least 3-4 weeks prior to presentation.

4.2.2 Health and Safety Constraints

Health The health constraints for the featured project are fairly limited. Possible needs observations required to ensure a healthy experience from both the development standpoint to the end user could be contributed mostly through the materials used in the creation of the synthesizer. In some cases, within the finished product there could be the need to reduce and monitor the types of materials received from overseas suppliers which could contain harmful toxic materials such as lead or mercury. Each of these is a fairly common conductive material and may times found in lower quality painted products. In other cases, the development of the keyboard structure could require the need to maintain a proper size to avoid disorders such as arthritis. Although not likely due to the limited exposure many will have with the synthesizer, these are some potential health concerns which were checked into during the creation of this project design outlay.

68

Safety There are many safety constraints with respect to this project. All hazardous actions that could lead to bodily harm can be prevented through proper safety. About 75% of this project involves analog circuitry. When dealing with live voltages, currents and power, it is often quite easy for someone to be shocked or burned. Our group alone has witnessed incidents where electronic components such as op-amps have exploded on sight. More commonly, circuits have been made where a resistor has very high current going through it, which cause the resistor to heat up to high temperatures. Circuit mishaps such as this can cause serious burns to the skin. Safety also ties into time constraints. Often when mistakes are made it is due to unnecessary hastiness. It is important to always taking your time especially when dealing with something that could harm you, or worse, someone else.

Often we find ourselves experimenting on the breadboard with circuits we have never constructed before. The equipment in the lab is built with safety mechanisms that prevent serious problems from occurring. However, when building and designing this project, we must work with equipment that do not have fail-safe mechanisms such as the ones in lab. In a few months, the need for soldering on the PCB will come into play. Soldering irons can get to extremely high temperatures, which will most certainly result in burns if handled incorrectly. Solder must also be handled very carefully as in some cases solder will boil and spit up like bacon in a pan. Molten solder is extremely hot and will also cause severe burns, more times than not.

As mentioned in chapter 3 and 5, we will be building our own power supply. A power adapter will be purchased to transform the 120VAC from the wall to 12VAC output. This precaution was taken because of safety. As we are not experts of circuitry, it was a team decision to not dabble with high power that could definitely cause bodily harm and to buy a power adapter from a manufacturer that knows what it is doing. Still, the power supply design is not completely guaranteed safe.

A circuit will rectify and regulate the voltage to output +/- 12V DC. With a flipped diode or voltage regulator, the whole circuit could cause a catastrophic failure that not only harms our components, but us as well. The power supply has large electrolytic capacitors that tend to have inadvertent current paths. As a measure of safety, 4 diodes will be used to ensure single direction current paths, and to reduce the possibility of electric shock.

At all times, it is imperative make sure that all the necessary components are grounded correctly. Circuitry needs to be handled with the utmost precision and care, because in the real world errors tend not be forgotten. Life and limb are at stake when dealing with high voltage, high current devices. Safety cannot be overlooked, whether it be working with 5V voltage regulators or 120VAC from our wall socket.

69

4.2.3 Manufacturability and Sustainability Constraints Currently, there is only a plan for manufacturability of our synthesizer. We have yet to begin to integrate all of our schematics and order a printed circuit board. In the upcoming months, more progress will be made and we plan to have the final working schematic for the entire system. Once that is complete it will be possible to delve into producing our working models for commercial use.

Again, we have yet to impose our total design on a PCB so it is difficult to discuss sustainability. However, the plan is to complete one working model and then expand on our design to incorporate more human interface controls. Once that is completed we can eliminate wasteful circuitry that can be accomplished through simpler means when we have improved functional expertise in the realm of synthesizer construction.

70

5. Project Design Details

5.1 Voltage Controlled Oscillator Specific Waveform Generation Design Raw Ramp It is important to know that the input of this circuit is the exponential current converter found in figure 5.1.10 and 5.1.11. The output is the raw ramp waveform. The term raw is to signify that this ramp waveform is shifted up starting from 0V as opposed to have a +voltage. Also, this VCO is a ramp-core design, meaning that all other waveforms are created through the ramp waveform. Figure 5.1.5 is the specific circuit used to create the raw ramp waveform. The LF351N was used in the simulation schematic as our model wasn’t available in my version of Multisim.

Strategic components from section 3.3.1. Operational Amplifier, LF351N – 2 JFET, 2N5459 – 1 Diode, 1N4004 – 1 Various resistors and capacitors

Figure 5.1.1: Raw Ramp Wave Generator

71

Ramp and Sawtooth Although the raw ramp waveform has been generated, we need a ramp waveform that has an even + peak voltage. Notice the connecting components between the previous circuits. The circuit in figure 5.1.6 is the specific circuit used to create the ramp and sawooth waveforms. Again, the LF353N will be replacing our model (LF351N). The raw ramp is amplified through the inverting amplifier. The adjustable offset using the potentiometer allows to calibrate the voltage to the correct level. See the background section above in this section for further design details.

Strategic components from section 3.3.1. Operational Amplifier, LF351N – 2 Diode, 1N4004B - 2 Potentiometers (P160KNP) -10k – 1 Various resistors and capacitors

Figure 5.1.2: Ramp and Sawtooth Wave Generator

72

Triangle The saw and ramp waveforms are combined using two diodes. The waveform with the more positive voltage is passed. When half of the saw and ramp are combined this way, a triangle waveform is created. Again, the LF353N will be replacing our model (LF351N). The circuit in figure 5.1.7 is the specific circuit used to create the triangle waveform. It is important to know that the output of the circuit in figure 5.1.6 is the input for the circuit in figure 5.1.7. See the background section above in this section for further design details.

Strategic components from section 3.3.1. Operational Amplifier, LF351N – 1 Diode, 1N4004B - 2 Potentiometers (P160KNP) -10k – 1 -100k – 2 Various resistors and capacitors

Figure 5.1.3: Triangle Wave Generator

73

Sine The sine wave output is generated from the triangle waveform through the use of the circuit below. There are three trimming pots used to calibrate the output waveform so that it resembles a smooth even, sine wave. The circuit in figure 5.1.8 is the specific circuit used to create the sine waveform. Again, the LF353N will be replacing our model (LF351N). It is important to realize that the input for figure 5.1.8 is the outputs of the previous circuit represented in figure 5.1.7.

Strategic components from section 3.3.1. Operational Amplifier, LF351N – 1 NPN BJT, 2N3904 – 2 Potentiometers (P160KNP) -1M – 1 -100k – 2 Various resistors and capacitors

Figure 5.1.4: Sine Wave Generator

74

Square The square wave output is generated through the use of a comparator circuit. The input to the op-amp is the ramp waveform from figure 5.1.6. The ramp wave is fed into both the positive and negative inputs of the op-amp. A resistor on the positive input allows the ramp wave to be seen at a lower voltage. A separate resistor and a capacitor are connected into the negative input to generate a low pass filter. The inverting input (negative on the op- amp) recognizes the average voltage of the ramp wave. Hence, when the amplitude of the ramp wave applied to the positive input is higher than the average voltage applied to the negative input, the output shoots to positive saturation. When the amplitude of the ramp applied to the positive input is lower than the average voltage applied to the negative, the output shoots to negative saturation. Thus, a square wave is produced. Remember, the LF353N will be replacing our model (LF351N). The circuit in figure 5.1.9 is the specific circuit used to create the square waveform.

Strategic components from section 3.3.1. All components needed to make a ramp wave (see figure 5.1.6) Operational Amplifier, LF351N – 1 Various resistors and capacitors

Figure 5.1.5: Square Wave Generator

75

Control Voltage Mixer Design As mentioned earlier in this section there will be two VCOs for tune stacking. For the purposes of discussion, only one VCO will be mentioned, as the second will only be a duplicate of the first. There will be little to no variations between the two voltage controlled oscillators. The VCO uses a summing amplifier to attenuate and mix the voltage control inputs. There will be 3 voltage controls as user inputs to the VCO for frequency attenuation. Two controls will be that of the course and fine tuning, for large frequency tuning and low frequency tuning, respectively. The third voltage control and final input will be that from the keyboard interface allowing output frequency attenuation via key presses on the keyboard. The output voltage of the summing amplifier circuit is adjusted through the use of a pot to calibrate the ratio between control voltage and frequency. Previously, we declared a 1V/octave scale, meaning that a 1V increase in control voltage will double frequency, or increase 1 octave. Figure 5.1.9 shows the control voltage and summing amplifier circuit. The output is fed into the exponential converter which is discussed next and displayed in figure 5.1.10.

Strategic components from section 3.3.1. Operational Amplifier, LF351N – 1 Potentiometers (P160KNP) -100k - 3 Various resistors and capacitors

Figure 5.1.6: Control Voltage Summing Circuit

76

Exponential Converter Design The output of the summing amplifier and the right-most portion of the circuit in figure 5.1.9, drives the exponential converter. The 1V/octave trimming potentiometer labeled as R12 allows for voltage control attenuation to this converter. The linear change in the summing amplifier circuit is converted to an exponential change in current using a matched pair of NPN BJTs (2N3904) and an op-amp for feedback. The op-amp feedback controls the base to emitter voltage of the first BJT. The emitters of the two transistors are directly connected so the second emitter changes with this feedback control. However, the base of the second transistor does not change because it is fed directly to ground. The linear change in the base emitter voltage from the summing amplifier in figure 5.1.9, causes an exponential change in the collector current from of the second transistor. A control voltage input at exit labeled “Linear” causes a proportional change in the current of the first transistor which also causes a linear change in frequency due to the feedback op-amp design. Figure 5.1.10 is the exponential converter circuit design. As mentioned before, this circuit is what ultimately creates the raw ramp waveform, which is the core of the design for all waveform generation in the VCO.

Strategic components from section 3.3.1. Operational Amplifier, LF351N – 1 Potentiometers (P160KNP) -100k – 2 Diode 1N4004 – 1 General Purpose NPN BJT (2N3904) - 2 Various resistors and capacitors

Figure 5.1.7: Exponential Current Converter Circuit

77

As mentioned before in section 3.3.1 the VCO is a delicate piece of circuitry that must be calibrated correctly. Varying voltage is used to control the frequency of a sound-producing oscillator. The VCO is the staple of an analog synthesizer, so it is extremely important that each component meet design requirements. The human ear can tell when something is slightly out of tune. The “cent” system divides the distance between two adjacent semitones on the equally tempered scale into 100 divisions, and your ear can tell when the sound is only a few divisions out of tune. The ear’s perception of loudness is not anywhere near as precise as its perception of frequency. For this reason, the design details for the VCO are most important. Components in section 3.3.1 will be discussed in detail along with its impact on the design of the VCO. Each component part number will be bolded to indicate its use in the design of the Waveforms section.

5.2 Signal Mixer Figure 5.2.1 shows a prototype of the designed signal mixer for the synthesizer. When actually assembled with the remaining factors of the project, the potentiometers are replaced with digital potentiometers for connectivity with the microcontroller. From left to right, the wires are as follows. The Output signal is the first wire. This is the where the two signals mixed into one will be output to the remainder of the synthesizer. The next wire, labeled in bright green is the input 1; this is one of the two inputs from the VCO. The red labeled wire is the same, but is the other VCO input. The yellow and Orange wires are for the respective negative and positive input voltage supplies for the Operational amplifiers. The Black wire on the far right is simply the Figure 5.2.1 Signal Mixer Circuit on Breadboard ground.

The schematic for this circuit can be found in figure 3.2.2.1 under the Signal mixer design criteria section of the paper. There it is possible to see that the two signals are implemented

78 through the use of a summing amplifier and varied by the potentiometers, which, once digital will operate simultaneously to reduce and expand the voltage individually.

The breakdown for the module components can be found in table 5.2.1. This is the general breakdown of minimal needed parts to operate. These components are likely to change by the completion of the final product to account for erroneous calculations when determining specific resistor values. The Operational amplifiers will remain the same.

Schematic Price Ext. Product Detail Qty. Code (USD) (USD) Mfr. #: LF351N Wide Band Single LF351N 3 $0.72 $2.16 Desc.: Operational Amplifier Mfr. #: FG001 R3-R7 7 $0.02 $0.14 Desc.: 1% 1/4W Various Resistor Values Mfr. #: RV16AF-10-15FR-B100K-LA R1-R2 2 $1.96 $3.92 Desc.: Linear B100K Potentiometer Mfr. #: N/A N/A 16 $0.07 $1.12 Desc.: Jumper Wire Table 5.2.1 Product Cost Breakdown

5.3 Low Frequency Oscillator Hardware Design The research and design process for the Low Frequency Oscillator found in Chapter 3 led our group to decide that our LFO needed to be capable of outputting 4 different kinds of waveforms to modulate the VCO signals. These included ramp, sawtooth, triangle, and sine waves, essentially the same waveforms that the VCOs could generate only at much lower frequencies. Figures 5.3.2, 5.3.4, and 5.3.6 are the materials included that are necessary to build the circuit in addition to whatever extra parts were ordered. The ramp/sawtooth generator shown in Figure 5.3.1 is virtually identical to the version in Chapter 3 except that it will feed into a subcircuit to produce a triangle wave.

79

Figure 5.3.1: LFO Ramp Sawtooth Generator

Order Price Ext. Product Detail Schematic Code Qty. (USD) (USD) Mfr. #: TL084CDR TL084 5 $ 0.47 $ 2.35 Desc.: Operational Amplifier Mfr. #: 1N914 1N914 20 $ 0.06 $ 1.16 Desc.: General Purpose Diode Mfr. #: 2FA53-73 SPST 4 $ 4.21 $ 16.84 Desc.: Toggle Switches Mfr. #: 2N3904 2N3904 8 $ 0.51 $ 4.08 Desc.: Bipolar Transistors Mfr. #: PDA241 R 4 $ 3.57 $ 14.28 Desc.: Potentiometers Mfr. #: ZW-MM-20 N/A 4 $ 4.90 $ 19.60 Desc.: Jumper Wires Mfr. #: N/A N/A 10 $ 0.06 $ 0.60 Desc.: Electrolytic Capacitors Mfr. #: N/A DIN_5 10 $ 0.06 $ 0.60 Desc.: Various Resistors Table 5.3.2: LFO Ramp Sawtooth BOM After the ramp/sawtooth waveform generator has created a low frequency waveform, this waveform can simply be fed into the same triangle/sine waveform generators that are present in the VCO. It should be noted that instead of the L353N op amp the TL084 will be used.

80

Figure 5.3.3: LFO Triangle

Order Price Ext. Product Detail Schematic Code Qty. (USD) (USD) Mfr. #: TL084CDR TL084 5 $ 0.47 $ 2.35 Desc.: Operational Amplifier Mfr. #: 1N914 1N914 20 $ 0.06 $ 1.16 Desc.: General Purpose Diode Mfr. #: 2N3904 2N3904 8 $ 0.51 $ 4.08 Desc.: Bipolar Transistors Mfr. #: PDA241 R 4 $ 3.57 $ 14.28 Desc.: Potentiometers Mfr. #: ZW-MM-20 N/A 4 $ 4.90 $ 19.60 Desc.: Jumper Wires Mfr. #: N/A N/A 10 $ 0.06 $ 0.60 Desc.: Electrolytic Capacitors Mfr. #: N/A DIN_5 10 $ 0.06 $ 0.60 Desc.: Various Resistors Table 5.3.4:LFO triangle BOM

Finally, much like the VCO, the LFO triangle output will be fed into the circuit shown below in Figure ____ to produce a sine wave. Again it should be noted that the TL084

81 will be used in place of the L353N. The low frequency carried through the previous two circuits will carry through the low sine output here as well.

Figure 5.3.5: LFO Sine Generator

Order Price Ext. Product Detail Schematic Code Qty. (USD) (USD) Mfr. #: TL084CDR TL084 5 $ 0.47 $ 2.35 Desc.: Operational Amplifier Mfr. #: 1N914 1N914 20 $ 0.06 $ 1.16 Desc.: General Purpose Diode Mfr. #: 2N3904 2N3904 8 $ 0.51 $ 4.08 Desc.: Bipolar Transistors Mfr. #: PDA241 R 4 $ 3.57 $ 14.28 Desc.: Potentiometers Mfr. #: ZW-MM-20 N/A 4 $ 4.90 $ 19.60 Desc.: Jumper Wires Mfr. #: N/A N/A 10 $ 0.06 $ 0.60 Desc.: Electrolytic Capacitors Mfr. #: N/A DIN_5 10 $ 0.06 $ 0.60 Desc.: Various Resistors Table 5.3.6: LFO Sine BOM

82

5.4 Voltage Controlled Low Pass Filter Figure 5.4.1 shows a prototype of the designed signal mixer for the synthesizer. When actually assembled with the remaining factors of the project, the potentiometers are replaced with digital potentiometers for connectivity with the microcontroller. Amongst the top left potion of the circuit is the Voltage controlled resistor circuit. The intention here is to convert the incoming LFO signal to a strictly negative fluctuating current in order to operate the JFET as a variable resistor. The segment to the right of the voltage controlled resistor is in charge of voltage supply for the operational amplifiers. Overall the circuit features three primary inputs. The LFO input, which as stated before goes to the Voltage controlled resistor. The signal in takes the input signals from the mixed VCO waveforms. Finally the output, shown on the vary bottom right of the image outputs the modified signal to the Voltage controlled Amplifier.

Figure 5.4.1 Voltage Controlled Low Pass Filter

83

The schematic for this circuit can be found in Figure 3.3.4.7. It features a Kerwin- Huelsman-Newcomb Circuit design with some alterations to account for the voltage controlled aspect of the design requirements. Although the image displays the use of analog potentiometers, the final prototype for the project will most likely incorporate digital potentiometers to allow control from the microcontroller.

The breakdown for the module components can be found in table 5.2.1. This is the general breakdown of minimal needed parts to operate. These components are likely to change by the completion of the final product to account for erroneous calculations when determining specific resistor values. The Operational amplifiers will remain the same.

Order Price Ext. Product Detail Schematic Code Qty. (USD) (USD) Mfr. #: LF351N Wide Band Single Operational LF351N 3 $0.72 $2.16 Desc.: Amplifier Mfr. #: FG001 R3-R7 4 $0.02 $0.08 Desc.: 1% 1/4W Various Reistor Values Mfr. #: RV16AF-10-15FR-B100K-LA R1-R2 2 $1.96 $3.92 Desc.: Linear B100K Potentiometer Mfr. #: N/A N/A 28 $0.07 $1.96 Desc.: Jumper Wire Mfr. #: K224K20X7RF5UH5 C1-C2 2 $0.99 $1.98 Desc.: .22uf capacitor ceramic Mfr. #: 1N4148 General Purpose Power switching D1-D4 4 $0.10 $0.40 Desc.: Diode Table 5.4.1 Product Cost Breakdown for VCF

5.5 Attack Release Envelope Generator Figure 5.5.1 shows a prototype of the designed signal mixer for the synthesizer. When actually assembled with the remaining factors of the project, the potentiometers are replaced with digital potentiometers for connectivity with the microcontroller. The Attack release Envelope Generator only features a single DC voltage input. This input is altered by the circuit to create the envelope. The attack and decay time are adjusted individually by the two potentiometers. The output of the envelope can be seen on the diode, which will grow bright and dim based on the the attack and release time as well as weather the trigger is on or off. The schematic for this module can be found in Figure 3.3.5.7.

84

Figure 5.5.1 Attack Release Circuit on Breadboard

The breakdown for the module components can be found in table 5.5.1. This is the general breakdown of minimal needed parts to operate in the prototype stage of the device’s developmental cycle. These components are likely to change by the completion of the final product to account for erroneous calculations when determining specific resistor values, potentiometer replacement, and overall part cooperation with the entire synthesizer as a whole. The Operational amplifiers will remain the same throughout the remainder of the project. The schematic codes refers to the codes used to represent the parts in the relevant schematics.

85

Schematic Price Ext. Product Detail Qty. Code (USD) (USD) Mfr. #: LF351N Wide Band Single LF351N 1 $0.72 $0.72 Desc.: Operational Amplifier Mfr. #: FG001 1% 1/4W Various Resistor R3-R7 2 $0.02 $0.04 Desc.: Values Mfr. #: RV16AF-10-15FR-B100K-LA R1-R2 2 $1.96 $3.92 Desc.: Linear B100K Potentiometer Mfr. #: N/A N/A 5 0.07 $0.35 Desc.: Jumper Wire Mfr. #: ULD2G2R7MPD1T C1 1 $0.99 $0.99 Desc.: 2.7uf capacitor Electrolytic Mfr. #: 1N4148 General Purpose Power D1-D2 2 $0.10 $0.20 Desc.: switching Diode Mfr. #: CR150311E0004 LED 1 $0.04 $0.04 Desc.: LED Blue Table 5.5.1 Product Cost Breakdown for the Attack Release Module

5.6 Voltage Controlled Amplifier After much deliberation regarding the needs of our project from the voltage controlled amplifier, it was finally decided that a dual logarithmic/linear amplifier would be needed. The design was based upon the previous design that was built using the TL072 JFET-Input Operational Amplifiers and the LM13700 Dual Operational Transconductance Amplifiers with Linearizing Diodes and Buffers to produce a logarithmic amplifier and simply added a switch to allow the user to choose between linear and logarithmic responses. The final schematic can be found below in Figure 5.6.1 and continued in 5.6.2. The Bill of Materials for the schematics can be found in Table 5.6.1.

86

Figure 5.6.1: VCA Schematic

Figure 5.6.2: VCA Schematic (Continued)

The LM 13700M works in conjunction with the cascaded TL084s to provide the user with an optional linear/logarithmic VCA. The input voltage is converted to a log response by the first op amp U1B in partnership with the transistors. After that the voltage is sent to U1A for reamplification and application to the LM13700. The built in buffers for the LM13700 drive the output.

87

Order Price Ext. Product Detail Schematic Code Qty. (USD) (USD) Mfr. #: TL084CDR TL084 5 $ 0.47 $ 2.35 Desc.: Operational Amplifier Mfr. #: 1N914 1N914 20 $ 0.06 $ 1.16 Desc.: General Purpose Diode Mfr. #: 2N3906 2N3904 8 $ 0.51 $ 4.08 Desc.: Bipolar Transistors Mfr. #: PDA241 R 4 $ 3.57 $ 14.28 Desc.: Potentiometers Mfr. #: ZW-MM-20 N/A 4 $ 4.90 $ 19.60 Desc.: Jumper Wires Mfr. #: N/A N/A 10 $ 0.06 $ 0.60 Desc.: Electrolytic Capacitors Mfr. #: N/A DIN_5 10 $ 0.06 $ 0.60 Desc.: Various Resistors Mfr. #: 2N3904 N/A 8 $ 0.51 $ 4.08 Desc.: Bipolar Transistors Mfr. #: LM13700M 4 $ 1.27 $ 5.08 Desc.: Transconductance Amplifier Table 5.6.1: VCA Bill of Materials

5.7 Microcontroller and Peripherals

The microcontroller and peripherals are the digital framework that integrates the analog modules, such as the Voltage Control Oscillator and the signal mixer. As shown in Figure 5.7.1, the microcontroller is the central processing unit that will mediate and parse all data and events. The prototype device substitutes a microcontroller with a Raspberry Pi 3 model B[1]. The substituted Raspberry Pi is connected to three 16-bit I/O expanders. The 16-bit I/O expanders are divided into two 8-bit bank each. Three banks will be used for tactile switch input, two banks will be used for rotary encoder input, the final bank will be to supplement the SPI Chip Enable.

88

Figure 5.7.1: Component Layout

The Raspberry Pi 3 has a limited number of GPIO pins. This limit ultimately was turned into an advantage after researching how to expand the I/O pins. The Raspberry Pi 3 Model B has four serial buses, three of which are used concurrently. The Raspberry Pi’s Inter- Integrated Circuit (I2C) bus is used to expand the GPIO pins. These pins are used to read all input signals from the tactile switches and rotary encoders. A bank of pins is used as output pins to work in conjunction with the Serial Peripheral Interface (SPI) bus. The Integrated Circuits (IC) that use the SPI bus require a signal to enable functionality. The Raspberry Pi has two pins dedicated for enabling SPI ICs. To allow for more than two devices to use the SPI bus, the I2C bus supplements the limited Chip Enable ports. As mention previously, one bank of I/O pins on an I2C I/O expander is dedicated to writing.

89

As shown in Figure 5.7.2, the I/O bank that is reserved as output is used to enable the SPI Digital Potentiometers. Picture 5.7.1 shows the schematic realized on a breadboard.

Figure 5.7.2: I2C I/O Expander Supplementing Chip Enable Pins Schematic

90

Picture 5.7.1: I2C I/O Expander Supplementing Chip Enable Pins

The third serial bus that is used is the Universal Asynchronous Receiver/Transmitter (UART) bus. The UART bus is connected to the port that is directly to the left of the center port, as seen in Figure 5.7.3. The connection is routed through a 220 ohm resistor, as specified in the MIDI Standard. The port directly to the right of the center port is a 5V power supply resisted by 220 ohms, again, this is specified in the MIDI Standard. The center port is ground, while the remaining two ports are left unconnected. Picture 5.7.3 shows the schematic realized on a breadboard.

Figure 5.7.3: UART to MIDI DIN Schematic

91

Picture 5.7.2: UART to MIDI DIN

The I2C bus are connected to MCP 23017 I/O Expanders, which in turn are connected to the Human Interface Devices. The MCP 23017 I/O Expanders are connected to the Raspberry Pi through the clock line, SCL in Figure 5.7.4, and the data line, SDA in Figure 5.7.4. The address pins, A0-2 in Figure 5.7.4, on the MCP 23017 I/O Expander are grounded to represent low and connected to Vdd to represent high. Vdd is connected to the 3.3 volts source on the Raspberry Pi and Vss is grounded. The input pin on each tactile switch is connected to a GPIO on the MCP 23017 I/O Expander. The output pin is connected to ground. Figure 5.7.4 shows an example of how sixteen tactile switches would be connected to a single MCP 23017 I/O Expander. Using the I2C bus is ideal for large scale input banks, like the device requires, due to its ability to poll all pins simultaneously. Picture 5.7.4 shows the schematic realized on a breadboard.

Figure 5.7.4: I2C Controlled Tactile Switches Schematic

92

Picture 5.7.4: I2C Controlled Tactile Switches

Figure 5.7.5 demonstrates how four rotary encoders would be controlled through the MCP 23017 I/O Expander, via the I2C bus. The drawback of using the MCP 23017 I/O Expander with rotary encoders is the possibility of polling both a clockwise and counter-clockwise pulse simultaneously. This would potentially break the software, unless properly accounted for within the code. Since the I2C bus is a serial communication bus, additional devices can be added onto the same clock line, labeled SCL in Figure 5.7.5, and the same data line, labeled A0-2 in Figure 5.7.5, through addressing pins, labeled A0-2 in Figure 5.7.5. The I2C bus can control eight slave MCP 23017 I/O Expanders for a total of 128 possible pins, or sixteen banks of eight pins.

Figure 5.7.5: I2C Controlled Rotary Encoders Schematic

93

The final design implements the schematics in Figure 5.7.2, Figure 5.7.3, Figure 5.7.4, and Figure 5.7.5 to realize the design layout shown in Figure 5.7.1. The final design uses a total of three MCP 23017 I/O Expanders and six MCP 4251 dual 100kOhm digital potentiometers. All parts were purchased from either Amazon.com or Mouser Electronics. As predicted, the price of digital components, microcontroller excluded, were all relatively inexpensive, with the most expensive singular part being the MCP23017 I/O Expanders at $1.26 per unit.

Price Ext. Product Detail Schematic Code Qty. (USD) (USD) Mfr.#: MCP4251-104E/P MCP4251 6 $1.02 $6.12 Desc.: Digital Potentiometer Mfr.#: EN12-HN22AF25 ENCODER- 11 $0.81 $8.91 Desc.: Rotary Incremental Encoder QUADRATURE Mfr.#: FSM4JH SW 35 $0.08 $2.63 Desc.: Tactile Switches Mfr.#: 920-0031-01 N/A 3 $7.95 $23.85 Desc.: Breadboards 830pin Mfr.#: MCP23017-E/SP MCP23017 3 $1.26 $3.78 Desc.: I/O Expanders 16bit I2C Mfr.#: ZW-MM-20 N/A 4 $4.90 $19.60 Desc.: Jumper Wires Mfr.#: SLX-LX5093ID N/A 10 $0.06 $0.60 Desc.: Standard LEDs Mfr.#: KCDX-5S-S2-PS DIN_5 1 $1.14 $1.14 Desc.: Circular DIN 41524 Mfr.#: SDSQUNB-016G N/A 1 $7.09 $7.09 Desc.: SanDisk 16 GB micro SD Mfr.#: LYSB01D92SSX6 RASPBERRY_PI_3 1 $49.99 $49.99 Desc.: Vilros Raspberry Pi 3 Kit Mfr.#: EL-EB-001 N/A 1 $10.99 $10.99 Desc.: Breakout Board Kit

Total: $134.70 Table 5.7.1: Bill of Materials for Microcontroller and Peripherals

94

5.8 Software Design As the prototype of the device substitutes the microcontroller with a Raspberry Pi, this changes the software significantly, though the core logic behind the code is easily translated any other high-level programming language. The programming language that is used to interact with the peripherals is Python 2. The reason that Python was chosen was that while the Raspberry Pi supports other languages, Python is the easiest to use in terms of interacting with its GPIO ports.

One of the problems encountered with using the Raspberry Pi as a substitute microcontroller was that shortage of I/O pins. The minimum number of pins required for the device was initially judged to be between 60 and 100 pins for the entire device. Though the range was large, the Raspberry Pi has only 26 usable GPIO pins which was not close enough to the range to be considered adequate.

To work around the shortage of GPIO pins, research into I/O expanders were researched. These device work as a bidirectional multiplexer, expanding pins using binary expansion, as demonstrated in Table 5.8.1. This is done by encoding a pin as a binary address that can be deciphered using software.

While researching I/O expanders, the serial communication mode called Inter-Integrated Circuit Bus was discovered. Inter-Integrated Circuit Bus, often referred to as I2C or I-Squared C, is a multi-master, multi-slave, single-ended, serial computer bus It is typically used for attaching lower-speed peripheral integrated circuits to processors and microcontrollers in short-distance, intra-board communication. Using this bus allowed the Raspberry Pi to implement more pins using significantly fewer pins. Instead of needing 3 pins for every 16 additional pins, I2C uses two dedicated pins as the bus. This means the number of slave devices is only limited by the master and slaves, which put practical limits for the Raspberry Pi at approximately 7-10 slave devices. With each slave device being able Table 5.8.1: enable the usage of 16 more I/O pins, I2C was the ideal Binary Expansion solution to the problem of limited pins.

Before the Raspberry Pi could be used, it needed to be configured to match the requirements of the microcontroller. This included enabling both Inter-Integrated Circuit Bus and the Serial Peripheral Interface Bus for communication with the I/O as well as changing the Baud Rate from the default of 115,200 baud rate to 31,250 baud rate designated by the MIDI Manufacturers Association standard.

Following instruction published online, the SPI bus were easily enabled by navigating to the Raspberry Pi’s terminal. Upon entering the terminal, using the command “sudo raspi- config”[Fig. 5.8.1]. A window will appear displaying a list of items. Using the arrow keys

95 to navigate to “advanced option” [Fig. 5.8.2] and pressing Enter, navigates to a second list of items. Using the arrow keys to highlight “SPI” [Fig. 5.8.3] then pressing enter will prompt the user with the option to enable the SPI bus [Fig. 5.8.4]. Selecting “Yes” will enable the SPI bus and prompt the user if they want to automatically load the kernel module. After selecting “Yes” again, selecting “finish” will bring the user back to the menu [Fig. 5.8.5]. Another prompt will ask the user if they would like to reboot. The changes did not go into effect until the device was rebooted.

Figure 5.8.1: Navigating to Raspberry Pi Configuration

Figure 5.8.2: Step 2 to enable SPI

96

Figure 5.8.3: Step 3 to enable SPI

Figure 5.8.4: Step 4 to enable SPI

97

Figure 5.8.5: Step 5 to enable SPI

The process can be repeated to enable the I2C bus, with some slight variations. First the user navigates to the Raspberry Pi’s terminal. Upon entering the terminal, using the command “sudo raspi-config” [Fig. 5.8.6]. A window will appear displaying a list of items. using the arrow keys to navigate to “advanced option” [Fig. 5.8.7] and pressing Enter, navigates to a second list of items. Using the arrow keys to highlight “I2C” [Fig.5.8.8] then pressing enter will prompt the user with the option to enable the I2C bus [Fig. 5.8.9]. Selecting “Yes” will enable the I2C bus and prompt the user if they want to automatically load the kernel module. After selecting “Yes” again, selecting “finish” will bring the user back to the menu [Fig. 5.8.10]. Another prompt will ask the user if they would like to reboot. The changes did not go into effect until the device was rebooted.

Figure 5.8.6: Step 1 to enable I2C

98

Figure 5.8.7: Step 2 to enable I2C

Figure 5.8.8: Step 3 to enable I2C

99

Figure 5.8.9: Step 4 to enable I2C

Figure 5.8.10: Step 5 to enable I2C

100

As the Raspberry Pi uses a Baud Rate of 115,200 by default, small configuration needs to be done. Two problems were encountered when changing the baud rate. The first being is that the Raspberry Pi uses the UART to display console messages, any changes to the Baud rate would affect other console based applications. Second, the Raspberry Pi 3 switched from having a single modifiable UART to having a mini-UART that was linked to the clock speed of the Raspberry Pi and a non-configurable UART that they used for Bluetooth capabilities.

After researching heavily, it was discovered that there was an “escape” from the Bluetooth configuration that freed up the UART for the project’s purposes. Using overlays, preset blocks of code that can be swapped, to disable the Bluetooth and restoring previous builds of the Raspberry Pi’s code. To configure the overlay, first the user must open the Raspberry Pi’s terminal. Using the terminal, the user must navigate to the “boot” folder and open “config.txt” [Fig. 5.8.11]. The line “dtoverlay=pi3-disable-” was added to the end of the file[Fig. 5.8.12]. After saving the file, the Raspberry Pi had to be rebooted.

After rebooting, the terminal was reopened and navigated to the “boot” folder and the file “cmdline.txt” [Fig. 5.8.13] was opened using root access. A section of the file containing “console=serial0,115200” was deleted [Fig. 5.8.14]. The file was saved and the Raspberry Pi was rebooted again. After rebooting, the Bluetooth service needed to be disabled. The command “sudo systemctl disable hciuart” [Fig. 5.8.15] was input into the terminal to disable the Bluetooth service. To effectively change the Baud rate, the terminal was then navigated to the “boot” folder and the file “config.txt” was opened using root access in nano. The line “init_uart_baud=31250” was added to the file to change the baud rate to the required speed. The file was saved and the Raspberry Pi was rebooted to preserve the configuration.

Figure 5.8.11: Navigating to config.txt

101

Figure 5.8.12: Changing Overlay

Figure 5.8.13: Navigating to cmdline.txt

102

Figure 5.8.14: Disabling Console UART

Figure 5.8.15: Disabling Bluetooth Service

With the various configurations done to the Raspberry Pi, the actual software complexity was reduced significantly. As seen in Figure 5.8.16, the software is a simple polling architecture. This reduces complexity, but increase computational power needed. It also means that the program can get stuck, as nothing is done concurrently. To avoid the possibility of getting stuck, each action has as an action that has minimal resource requirements.

The software’s polling architecture is only possible due to the very low resource requirements of polling through the I2C bus. The I2C bus allows the Raspberry Pi to read eight GPIO pins at a time, drastically cutting the time, code, and resources necessary to poll each pin individually. As the prototype is using a microcontroller with an operating system, there will be a considerable delay between powering on and initialization of the program. To indicate the program is ready, a Light Emitting Diode (LED) will be turned on program launch. This functionality will be removed in the final iteration of the device. After the initialization, the program will loop through polling each GPIO pin, reading the states for all buttons and dials. The software polls the I/O expander controlling the tactile switches first. The software will parse which buttons were pressed, if any, then apply the required changes to the hardware. The next stage of the polling sequence reads from the I/O expander controlling the rotary encoders. The rotary encoder clock signal order determines the direction of the rotation. The software prevents skipping and keeps track of the location of the encoder. After the rotary encoders have been polled, the software applies the changes to the digital potentiometers through the SPI bus. The settings are then saved to non-volatile memory to be loaded during next initialization, future iteration may require that settings are saved after an undetermined number of cycles. After this stage, the process loops back to the polling stage.

103

Figure 5.8.16: Software Flow Diagram

104

5.9 Power Supply Overview Design requirements for our synthesizer specify for a +/- 12V DC output. The easiest way about achieving clean DC voltage would be to through the use of numerous batteries. The only problem is that batteries are very limited in providing sustaining power. As this is our first time building a synthesizer, we have and are going to spend a lot of time attempting to power a device that we are somewhat unfamiliar with. Given our situation and our commitment to analog circuitry for this project, we are going to regulate and rectify AC power from a wall wart. A wall wart is a power adapter that can be purchased from various electronic retail stores such as RadioShack. The purpose of this device is to take the 120VAC, 60Hz, 15W input from the wall and output a 12VAC, 1000mA power for our use. However, we need 12VDC as opposed to 12VAC. Through careful circuitry we can regulate and rectify the power coming in and convert it to the desired +/- 12V DC. We have done thorough research in designing this power supply. This component requires the utmost safety and attention to detail, as it could destroy other components or cause serious bodily harm to one of us.

Rectifier Design The wall wart supply power adapter uses half-wave rectification to make positive and negative DC voltage. The diodes in the circuit design are used as protection diodes recommended by National Semiconductor Application for protecting terminal voltage regulators from unwanted current paths. The large electrolytic capacitors can cause inadvertent current paths, for which reason we use the diodes. The smaller capacitors connected to the voltage regulator nodes are also recommended by the National Semiconductor Application for operational stability. Once again, the purpose of this power supply design is to eliminate the use and waste of batteries. Large electrolytic capacitors are connected in parallel for a greater capacitance. To be safe, these capacitors will need to have a voltage capacity of at least 25V. Larger capacitors connected in parallel are useful for high current processes, although we are expecting low to mid-range current as our synth design is not especially advanced in respect to current marketed products. The circuit in figure 5.9.1 was tested in Multisim and is expected to generate +/-12.5V. This is slightly higher than what we expected, however, the small extra voltage on both ends could prove useful, as there is likely to be some loss. From prior experience we know that Multisim results are generally slightly higher than experimental results. We are expecting these losses to be accounted for by non-conditions.

PCB It is also important to connect these capacitors in parallel as opposed to having one or two giant caps because there is a size requirement for the PCB design. Our design will have

105 four large electrolytic caps that have small radial symmetry so that they fit nicely onto the PCB. Prior to assembling the PCB with the power supply, we will connect resistors at the output voltage of the power supply for testing purposes. The power supply on the PCB will not have any resistors, as shown in the figure 5.9.1.

Figure 5.1.10: AC to DC voltage

5.10 Summary of Design Individual Modules For this analog-digital hybrid synthesizer, there are 11 individual modules (12 if you count the duplicate VCO). Those components are the; voltage controlled oscillators (VCOs), low frequency oscillator (LFO), attack-release (AR) envelope, voltage controlled amplifier (VCA), voltage controlled filter (VCF), signal mixer, microcontroller, keyboard interface, secondary human interface, MIDI device and the power supply. For this synthesizer to work, all modules must be working in without failure. The system as a whole is not fail safe, meaning that if one of the devices is not operating correctly, the whole system will fail. The individual modules will be discussed in the sections below as they apply to the design of the entire system that is our analog-digital hybrid synthesizer.

Human Interface Design The microcontroller is responsible for taking the inputs given by the user via the human interface devices and act as a mediator between the signals being created as well as the signals to be modulated and amplified prior to audio output. The microcontroller also has the capability of interacting with the external MIDI device. The microcontroller interfaces with the other components via digital potentiometers. Potentiometers are needed all throughout each individual module, so the digital potentiometer allows them to communicate with the microcontroller. As the signals are received, the microcontroller sends the information to the digital potentiometers in each component to control the

106 intricacies in the analog circuitry of that individual component. Certain aspects such as control voltage in the VCO is explained below and its impact on the design of the synthesizer.

Voltage and Frequency Control Design As mentioned above, the microcontroller interfaces with other components via digital potentiometers. The VCO is responsible for controlling frequency through a 1V/octave scale while also outputting several different waveforms. The microcontroller will vary the resistance in the digital pots to control the voltage in the VCO to ensure the desired frequency of 20 Hz to 20 kHz of audible frequency. Another voltage dependent device is the VCA which is associated with loudness in dB. Once again, our microcontroller will directly vary the digital pots in the VCA design to work as a volume control device. These interfaces that usually appear as knobs and switches on the faceplate of a synthesizer will be recognized as system programmable controls.

Power Supply Design The power supply design utilizes the power from any wall socket to produce the desired +/- 12V. For safety reasons, we decided to not dabble in the analog circuitry of transformers for adaptive power, but to instead purchase a power adapter. It was decided that $10 was less expensive than the well-being of our team. The adapter inputs 120VAC and outputs 12VAC, 1000mA. Here is where we need an analog circuitry design for our desired power needs. All of our components can be powered through +/- 12V DC voltage. Our design rectifies and regulated the 12 VAC and outputs around +/- 12 V DC. Although this component has not been assembled yet, the Multisim schematic model shows an output voltage closer to +/- 12.6 V. Some loss is sure to be associated with the actual components, given non-ideal conditions, which will bring down our voltage to the desired 12.0.

Digital Control Design The Digital Control module handles all human input as events, converting the appropriate inputs to raw MIDI then transmitting the results through the UART bus to any connected MIDI-capable receivers. Other inputs are applied to the digital potentiometers that individually control the separate modules. The Digital Control module would be consider the brain and nerve system of the device. The microcontroller is expected to be able to handle all tasks assigned in real-time, having no perceptible delay between input and output.

For further detail and explanation, specific circuitry design can be found in chapter 5 under their respective module name. For even further detail and explanation, specific parts and model numbers can be found in chapter 3 under their respective module name.

107

6. Project Prototype Construction and Coding

6.1 Final Coding Plan The initial coding environment was Python 2. This worked well with the Raspberry Pi during the beginning stages. Python also decreased coding time, but was incompatible with the microcontroller. The microcontroller’s programing tools compiled from C, so the final program needs to be converted from Python to C.

As Python is an interpreted language, it is vastly different from C, which is a compiled language. Though the languages are massively different in operation, Python is actually written in C. This means the syntax and underlying logic is the same, allowing for a simple translation from Python code to C code.

As seen in Figure 6.1.1, the code is implemented in stages and modules. The basic functions of the code, tactile switch and encoder event handling, are built in as modules, then in stage 2, they are implemented into the main program. This style of modular coding was introduced after the first attempt to code a prototype had to be rewritten due to being unable to find a bug that plagued the program.

Figure 6.1.1: Software Design Stages

The final methodology for the coding plan came after several iterations of programs. The first iterations were designed to simple making individual components work, independently of each other. The very first program was an attempt to detect the pressing of a tactile switch. Due to the limited knowledge of hardware programming at the time, this program had several iterations, in it of itself. In order to register a button event, the GPIO pins on the raspberry pi needed to be understood and operated correctly. Initial attempts at wiring the button ended almost catastrophically, as the button was wired from

108 a voltage source to the GPIO. This wiring almost fried the Raspberry Pi. The error was cause due to a misunderstanding of how the Raspberry Pi registers input signals. The misunderstanding involved treating the GPIO as a ground pin, where the GPIO would detect a change in voltage, when in actuality, the GPIO pin detects when a circuit is completed. This means that the GPIO pin will attempt to go HIGH and detect if the signal was properly grounded. In the event of button push, the act of depressing a button completes a circuit, grounding the GPIO. Fortunately, the mistake was caught and corrected before and major damage was done. The next iteration of buttons were properly wired with the GPIO pin as the voltage source.

The next program to be coded was to control the MCP 23008, an 8-bit I/O expander controlled through the I2C bus that was used for initial testing before being replaced with the MCP 23017, a 16-bit I/O expander controlled through the I2C bus. Extensive time was spent researching both the technology and code involved in operating the MCP230XX series of I/O expanders. The first attempt to operate ended up almost causing the chip to overheat due to using a 5 volt source, rather than the recommended 3.3 volt source. The program was designed to turn on an LED, sleep 1 second, turn off the LED, sleep 1 second, then loop to the beginning. This alone took the better part of a week to complete due difficulty understanding the I2C bus and the interfacing software, SMBus. This was further complicated by the nature of the registers built into the MCP 230XX series I/O expanders. Each chip must have several registers set before operating, if these registers are not set to the proper value, the chip will not function.

The next iteration of controlling the MCP 23008 I/O expander tried to incorporate what was learned in the previous program involving tactile switches. A tactile switch was wired into the MCP 23008 I/O expander, and the code was written to poll the pin that the tactile switch was connected, endlessly. The first attempt was a partial success. The program was able to read the event, but would also read events randomly. Research indicated that pull- up resistors would be required to correct this phenomenon. Pull-up resistors a pull-up resistor is a resistor connected between a signal conductor and a positive power supply voltage to ensure that the signal will be a valid logic level if external devices are disconnected or high-impedance is introduced. The MCP 230XX I/O expanders have built- in pull-up resistors that can be used by writing to the correct register. Introducing pull-up resistors corrected the random events, immediately.

The program was then expanded to be able to turn on an LED when it detected an event from a tactile switch. Encountering no problems with this, the program was written to control 2 tactile switches and 2 LEDs. This iteration involved rewriting how the system polled the MCP 23008 I/O expander. Up to this point, the system would read a value from the MCP 23008 I/O expander, with every bit in that value representing a separate pin. Bitwise operations were used to check every single individual value and executing code after every comparison. This would not be practical when scaled up to multiple 16-bit I/O expanders. The method used to correct this was to poll every bit, log it, then execute the required code. While being more resource intensive, it is consistent, providing similar timing requirements every cycle.

109

The next program was an attempt at using rotary encoders. The first problem encountered with them was a hardware programming issue. With the output being connected to a 3.3 volts source and the inputs connected GPIO pins, this issue was corrected, only after several iterations of code. After the rotary encoder output was connected to ground, the second problem was encountered. The rotary encoders send pulses in sequence to indicate direction of rotation. With the current mode of detection, the program would detect a clockwise rotation as a clockwise rotation, then immediately after detect a counter- clockwise rotation. This made counting impossible as the program would add then subtract, resetting the value to zero. To remedy this, a method to ignore the second pulse was required. This meant that the code had to ignore the second half of the signal.

Based on the timing of the signals that were sent in sequence, the code needed to be manipulated to either not read the second signal or ignore the signal once read by the code. To achieve this result, the code was initially adapted to not read the second; however, this was deemed impractical due to the inability to ignore the second signal reliably without ignore the counter rotation. The solution discovered was to adopt a time based flag. A Boolean value would be checked to see whether a predetermined delay period had be reach since the first signal. This time based flagging worked in all cases, with the minor exception of half rotations that cause a continuous signal to be sent.

Adding this code to the main code and scaling up to enable the usage of four rotary encoders worked with minimal problems. A digital potentiometer was then wired into the system, using the SPI bus. With the minimal documentation online, the digital potentiometer took a considerable amount of time to wire into the system, even with the datasheet provided. After trial and error wiring the digital potentiometer into the Raspberry Pi, the next step was stymied by the complexity of the SPI bus and the complex nature and hardware focused nature of datasheets. Initial attempts to set the wiper terminal resistance failed. A SPI tutorial was discovered on the internet that enabled one of the two digital potentiometers to dim and brighten a LED on command. Unfortunately, the tutorial did not provide examples to control the second digital potentiometer. It was discovered that the digital potentiometer uses a style of serial data interpretation that was not previously accounted for within the program. After adjusting the code to transmit the correct packet, the code was incorporated into the main program, enabling the rotary encoders to change the resistance.

The MIDI out portion of the code was written as two functions. One function was responsible for the transmission of the resultant raw MIDI signal, the second function converted and packaged the input signal into transmittable raw MIDI. The conversion function referred to the MIDI reference tables [7] to structure input parameters into “Note on” and Note off” commands. Raw MIDI consists of a start bit zero, followed by a byte of data, then ended with a bit of one. Every byte sent requires a start and end bit of zero and one respectively. The first byte dictates the command and number of bytes to receive after the command byte. “Note off” has the command byte of 0x8n, with n being the channel. “Note on” has the command byte of 0x9n, with n being the channel. Both “Note on” and “Note off” have two byte parameter, meaning that the next two bytes sent will be part of the command. The first byte is the note to be played or turned off, with a maximum of 128

110 notes capable of being set. The next byte is the velocity of the note to be set, it also has the maximum of 128 possible states. Though there are 128 possible states for the velocity byte, zero is considered special, and in the absence of velocity sensors, 0x40 is used. The commands can be seen in action in Figure 6.1.2 with the note the note C 4 being sent over channel 16 and encoded as 0x3C, with a velocity of 0x7F.

Figure 6.1.2: Raw MIDI

The draft code was written together; however, bugs plagued the functionality of the program. The code was rewritten using the knowledge acquired from previous builds but written modularly, and tested at every stage of the life cycle. The modules are packaged as event handlers, such as the tactile switch event handler, rotary encoder event handler, MIDI conversion/transmission handler, and the digital potentiometer handler. Packaging the handlers together to form a library to be used by the main program also reduces code size and resource requirements of the microcontroller. This modular programming has also helped alleviate the burden of debugging by making adjustments simple to commit.

The final two stages of the coding are to convert the prototype software from Python, an interpreted language, to ANSI C99 standard C, a compiled language. The difference in execution style will present possible issues, but the modular design of the code will make debugging simpler. Once the functionality is realized in a compiled language, the code will be adapted to the selected microcontroller’s framework and compiled using the program compiler distributed by the microcontroller’s manufacturer. The final code will be embedded in the microcontroller through either the Joint Test Action Group (JTAG) interface or the SPI communication.

111

6.2 Printed Circuit Board A printed circuit board (PCB) mechanically supports and connects electronic components using conductive tracks, pads and other features. The PCB components are etched from copper sheets and then laminated onto a non-conductive substrate. Physicals components such as resistors capacitor and integrated parts are soldered onto the PCB to match the specified schematic design in question. Each individual module from chapter 5 has specific schematic designs that will need to be integrated together to create one complete schematic model. The final schematic will be imposed on the PCB to generate the desired results. For analog intensive designs such as ours, multi-layers are required to fit all of the electronic components onto a single board, if desired.

The printed circuit board vendor we have chosen is Avanti Circuits. We have done research on many manufacturers and have determined Avanti will be the best to suit our needs. Our synthesizer prototype design is already very analog intensive so it is imperative that we have the best quality PCB. We must pay attention to other factors as well, that will influence our manufacturer. Our first order will be two PCBs. No one in our group has actually worked on a printed circuit board, so we are ordering two, given the likely scenario that we fry one of them.

There are many consumer reviews that claim that Avanti Circuits provides the best quality PCB while also maintaining a timely delivery. We must cover all bases to ensure that we have a working model, ready to demo, and prior to the demo date. It was appealing to find on the front page of the Avanti website, a satisfaction guarantee with a short excerpt on their efficiency and timeliness. Avanti has provided customers with PCBs for over 34 years; which seems like the time of birth for the printed circuit board in the first place. Although, we have not used any of their products, it is apparent that their commitment to quality will only benefit us.

EAGLE PCB Design software will provide the tools necessary to map the schematic geography of the synthesizer design. Given the excessive schematic designs needed at this point, it is planned that at least two layers will be needed to implement all modules and components. The size of the PCB planned is to be no more than 11’’ x 8.5’’. The PCB size will be shaped to fit the synthesizer box container. Keyboards are shaped with a long length and a short height. However, we have planned to have the operating faceplate above the keyboard, so this allows for added height to the PCB. The goal is for the PCB to be the size of a piece of paper, but in landscape size to fit its container.

The power supply will also have its own PCB that will connect parallel power to each of the modules listed in chapter 5. As we are using a power adapter with a rectifier, the power supply PCB will provide sustainable power for all modules at once. To reduce size for this

112

PCB we have researched suitable sizes. Most of the space on the power supply PCB will be taken up the large electrolytic capacitors with high voltage capacities. The size of these capacitors can be the area of a nickel with a height of one to two inches. To ensure a fit size for this PCB we plan to connect four to six of the large electrolytic capacitors in parallel, while also placed across from each other on the PCB. It is planned to have a similar shaping PCB to the main one, so a rectangular formation between the capacitors will be assumed for continuity and size purposes.

As of now, we are fairly unfamiliar with PCB specifications. However, we have done research on PCB design for marketed analog synthesizers. Simply gauging by averages we are expecting IC pad holes about 1/10 inch apart and 3/10 inch across. Soldering will need to be learned and practiced to ensure quality output. Currently, all of the equipment needed to solder on the PCB is readily available, so it will not be an issue when the PCBs arrive in a few months.

113

7. Project Prototype Testing Plan

7.1 Hardware Test Environment The majority of the testing for our project will take place in the Senior Design Laboratory in room 456 of the Engineering 1 building on the University of Central Florida campus. This laboratory will give our group access to just about everything we need, provided we bring some our own supplies, in a safe environment with 24 hour surveillance. Another restriction on the environment is the requirement of having two team members present at all times. This is enforced as a safety requirement.

Layout The overall layout of the laboratory is a large room with 10 work stations each equipped with the following: a Tektronix MSO 4034B Digital Mixed Signal Oscilloscope, 350 MHz, 4 channel, a Tektronix AFG 3022 Dual Channel Arbitrary Function Generator, 25 MHz, a Tektronix DMM 4050 6.5 Digit Precision Multimeter, an Agilent E3630A Triple Output DC Power Supply, and a Dell Optiplex 960 computer, as well as equipment available for checkout. There is also additional space in the room for groups to spread out a larger project if necessary, and work on it. There are storage lockers for groups to store their projects so they don’t have to transport them back and forth. The room is under 24 hour surveillance to ensure the safety of the projects which means that at any time there must be at least two people in the lab.

Tektronix MSO 4034B Digital Mixed Signal Oscilloscope, 350 MHz, 4 channel This oscilloscope allows the user to quickly find and diagnose problems in complex designs. Some key performance specifications include: 4 channel modes, up to 5GS/s sample rate on all channels, up to 20 M record length on all channels, greater than 340,000 wfm/s maximum waveform capture rate, and up to 42 automated measurements that provide the user an easy avenue for waveform analysis.

Tektronix AFG 3022 Dual Channel Arbitrary Function Generator, 25 MHz This function generator provides the user 2 analog channels with 25 MHz bandwidth and 25 MHz output frequency. Other features include: 2k – 128k, 250 MS/s Sample Rate, amplitude up to 20 Vp into 50 Ohm loads, a 5.6 inch display for user ease, and the ability to produce several waveforms for electronic test and design.

Tektronix DMM 4050 6.5 Digit Precision Multimeter This precision multimeter offers volts, ohms, and amps measurements, true rms measurements, frequency and period measurements, 6.5 digit resolution, and a basic VDC Accuracy of up to 0.0024%

114

Agilent E3630A Triple Output DC Power Supply The triple output DC Power Supply provides two 0 to plus/minus 20 V tracking outputs rated at 0.5 amps with an additional single output that is rated at 0 to 6 V and 2.5 amps. The +20 V and -20 V tracking outputs can also be used in series as a single 0 to 40 V 0.5 amp output. This will supply all the DC power we will need to test our device through all stages of its development cycle.

7.2 Hardware Specific Testing As this is a hardware intensive project, there are many components and devices requiring extensive levels of testing in various conditions to ensure proper quality and functionality. From a lab level environment, to a practical setting, the following describes each components means of testing for functionality and quality assurance.

Voltage controlled Oscillator: The voltage controlled oscillators probably have the most elaborate needs for testing the appropriate functionality amongst all the other components within the synthesizer. Because the nature of the oscillator is to generate waveforms, and in this case the ability to generate multiple waveforms, the primary function to test is the ability to output each of these waveforms and the ability to change frequencies with a varying voltage input. To test these features, the device is connected to an oscilloscope to view the waveforms. By changing the DC voltage to the Oscillator, the frequency at which the waves oscillate should change in a relative manner. In other words, an increase to the voltage should cause the Oscillator to increase the output frequency. This method of testing will be used for each waveform generation contained within the oscillator.

The importance of consistency is another matter to test. While observing the frequency range at varying voltages, the output frequency when correlated to what the microcontroller will eventually send as specific note values needs to match with the standard understood audio pitch values for each varying frequency. Aside from the use of an oscilloscope it is also possible to then set up powered speakers using a line out system to identify whether the audio signal being produced is of an appropriate quality. This is more of a qualitative approach to deciding whether the component is functioning properly, but in the end, is pertinent for the type of project at hand.

Signal Mixer: As the signal mixer is more of a simple device within the synthesizer, it’s means of testing is also simple. Placing two signals from any function generator into the inputs of the device will provide the ability to observe the output on an oscilloscope. These outputs should show one of the two generated function when the device is fully tuned in one direction, and the other function when tuned in the opposite extreme. Testing the audio output utilizing a speaker is also a possibility by allowing to hear the difference and combination of sounds as the multiple waveforms are mixed.

115

Low frequency Oscillator Modulator: The low frequency oscillator is another component with a rather simple test plan. The functionality of this device requires a slow moving oscillation to occur to control other devices amongst the synthesizer, so to test this; the LFO is connected to an oscilloscope as was done with the VCO’s above. In this case however, the purpose is not to generate audio, but modulate other effects. The frequency and amplitude of the device will be visible allowing for the realization as to whether the device is performing as specified. A final check will be the breadboard test in combination with one of the various devices that are intended to be modulated by the LFO and observe if they are in fact being controlled.

Voltage Controlled Filter: Although there are various filters in this category, the test plan is to cover that of a low pass filter. The filter needs to be observed amongst a range of input frequencies depending on the device specification. In this case, the filters are variable in nature and will be adjustable. The overall extended range at the maximum and minimum values should be tested in an oscilloscope to ensure that the sweep range covers the desired design needs. To test this, the frequency of a signal will be varied while setting the value on the cutoff potentiometer. As the filter is a low pass, setting the potentiometer to cutoff at 500Hz will remove the frequencies above this point

This filter also features a resonance adjustment that will change the quality factor of the frequency range. In other words, while adjusting the frequencies as stated for the cutoff test, an increase in the quality factor will show a rise in amplitude of the frequencies that are surrounding

To test the voltage controlled factor and automation aspect to the filter, a signal can be input through the voltage controlled resistor. The frequency can be set to a rather high value, for instance in the 2kHz Range and the voltage controlled resistor will change to change the cutoff frequency of the filter which should result in a fluctuation of the amplitude at the current frequency. Changing values within the expected frequency range for the cutoff frequency should gather the same impact.

Again, as this is an audio component, and in this case, an effect for the synthesizer, objective sampling of the device in an actual audio application is also a need. Connecting the device to a speaker, as done with the other devices and sweeping through the range of the filter will allow a specific sound to be heard depending on the type of filter. The high pass filter will exhibit an increasing “tininess” to its tone, where as the Low pass will be observable as becoming more vocal and deep in its tonality.

Attack Release Envelope: The AR has a similar pattern to the LFO modulator. Instead of controlling with a constant oscillation, it generates a particular shaping for use with an audio amplifier. Because of this, testing the device is easiest by connecting it to the amplifier circuit which it will be controlling to observe its functionality. The envelope form is also viewable on an oscilloscope if that isn’t possible and will typically allow the shape of the wave form to show. However, while using the combined amplifier, it is possible to observe how the

116 amplitude of the audio being transmitted out is being impacted by the overall shape of the envelope. For example, while observing the typical form which the envelope takes, there will be a rise in amplitude during the attack region, with a slight drop off during the decay, after this point, during the sustain region, the amplitude of the audio wave form will remain constant until the release is reached.

In order to test full functionality, there is also the factor of the trigger for the system. The AR is a trigger activated circuit, which means a button is required for testing that will enable the circuit to start its shaping. When the button is released, the Sustain of the envelope ends and the release segment activates. When testing this circuit in full connectivity with the other components of the synthesizer, it is possible to hear the increase in volume for the note pressed then slightly declining till the note is released, then fading out.

Aside from the basic points of the envelope generator, the testing features involve the adjustability of the envelope. Reducing the Attack time should increase how quickly the amplifier reaches max volume. The release time will determining how long it takes to fade out.

Voltage Controlled Amplifier: The voltage controlled amplifier is another simple circuit to test using an oscilloscope. Being as its primary purpose is to amplify the voltage signal within the synthesizer to an appropriate output level, the entire test process is to determine whether or not it is reaching the those criteria. When connecting to the oscilloscope, the amplitude of the input signal should be output based on the setting of the potentiometer that is connected. Reducing the resistance within the potentiometer will increase the amplitude to a specific value. This specific value is based on the overview of the amplifier as specified earlier in the paper.

Integration with other hardware components in the synthesizer is also necessary. The Amplifier needs to be tested in conjunction with the ADSR envelope generator as these two devices work hand in hand together to produce the desired effect. The procedure for this is already mentioned in the ADSR section of the hardware testing plan.

Audio Out: The audio out component has not active tributes. The primary functionality of this is to provide a means of connecting external audio devices such as or a line out device such as an external . To test this device would simply be to connect to the proper terminals and identify that the signal is in fact being output. A secondary means, after assuring that the voltage output is appropriate is to connect the desired external device and observe it’s functionality.

Human Interface Devices: Human interface devices can be tested along side of the microcontroller. A press of a key or rotation of a rotary encoder should identify a connection within the microcontroller. Otherwise, just ensuring that a connection is being made is enough to test this series of devices.

117

Power Supply: Testing of the power supply revolves around identifying the ability to translate the wall current to a dc voltage and output the appropriate current to a load. To observe this, setting the device up with an appropriate load and checking the voltage and current output over the load will help to shed light as to the proper functionality of the power supply. When testing the power supply it is necessary to take into consideration proper safety guidelines of dealing with wall power devices as these can be lethal if not treated properly.

7.3 Software Test Environment Since the entire device is controlled by the software, the testing environment must be strictly controlled to provide optimal results in software tests. Problems that can occur from an improperly controlled environment vary, but can be catastrophic, requiring new components or even loss of data.

The software environment was a Raspberry Pi 3 model B, running Raspbian, a Linux distribution based on Debian [1]. All code was written in Python 2, an interpreted language programmed in C.

As the software was designed to interact with hardware, the physical testing environment is considered as a factor for the software. The Raspberry Pi was wired to a breadboard using a breakout board designed for the Raspberry Pi 3 model B, as seen in Figure 7.3.1. When testing a component, the software had to be carefully written and monitored to ensure that nothing was damaged in the process.

To test the code, the required components also had to be wired correctly. This was ensured through expansive research and datasheet analysis. Figure 7.3.1: Breakout Board After being wired correctly, the code could be tested by running the code within Python. All test were conducted by testing hardware response.

7.4 Software Specific Testing The software is designed as a multi-stage modular program. As such, the software was tested on the completion of each module. After the modules were completed, they were

118 integrated into a framework that was expanded into the main program. Each this multi- stage modular design made testing a continual process, but reduced potential for catastrophic failures that would require full rewrites of code or extensive coded debugging.

As shown in Figure 7.3.1, the 4 stages of the software consist of designing the Handler modules, implementing the modules into a cohesive program, integrating the software into the device, then fine tuning the software to produce the required results.

Figure 7.4.1: Software Design Stages

Stage 1: Module Design Testing during Stage 1 used a combination of LEDs and screen printing to test the functionality of the code being designed. Each module had a slightly different set up to test. Tactile switches initial test involved printing “High” or “Low” continuously to the console. The second test for the tactile switches introduced multi-switch input handling, as such the console would print and arbitrarily designated identification continuously while each switch was pressed.

Rotary encoders produce two signals in sequence for each detent, as such testing in initially was purely detecting both signals then printing to screen. Testing then progressed to counting the signals. This was done by printing the current value counted for each rotation. The value started at zero and for each detent clockwise, the value would be increased by one, for every detent counter-clockwise the value would decrease by one.

To test the digital potentiometers, an LED was wired to the wiper terminal and the brightness was used as an initial indicator of functionality. A multi-meter was then used to accurately detect the resistance that the device was currently set.

The MIDI output required a personal computer and a MIDI-to-USB cable, as seen in figure 7.3.2, to test the functionality and accuracy of the transmitted notes. Special software was

119 also required to test the signals. For the test, MIDI-OX was used to monitor the data stream from the device to the personal computer.

Figure 7.4.1: MIDI OX Monitor

Stage 2: Implementation Implementing the modules together cause the manner off testing to evolve. The tactile switch events now executed code to transmit MIDI and the rotary encoder events effected the digital potentiometers wiper state. To effectively test the interconnected modules, the intended effect was checked as well as displaying text on the screen at each step of the software.

To test the tactile switch to MIDI out implementation, both the tests for the tactile switches and the MIDI out were combined. The test began by pressing each tactile switch in turn. The text identifier of the tactile switch pressed was printed on screen. Following a tactile switch event, the MIDI to be transmitted was printed on screen. The test was considered a success if a matching signal was read in the MIDI OX monitor on the testing computer.

To test the tactile switch to digital potentiometer implementation, both the tests for tactile switch and digital potentiometers were combined. The test began by pressing each tactile switch in turn. The text identifier of the tactile switch pressed was printed on screen with the current internal value of the digital potentiometer. The test was considered a success if the LED of the corresponding digital potentiometer dimmed while the tactile switch remained pressed and brightened upon the release of the tactile switch.

To test the rotary encoder to digital potentiometer implementation, both the tests for rotary encoders and digital potentiometers were combined. The test began by rotating each rotary encoder in turn, both clockwise and counter-clockwise. The text identifier of the rotary encoder being rotated was printed on screen with the current internal value of the digital potentiometer. The test was considered a success if the LED of the corresponding digital

120 potentiometer dimmed if the rotary encoder was rotated clockwise or brightened if the rotary encoder was rotated counter-clockwise.

Stage 3: Integration Integrating the digital components into the analog modules used the same test from the previous stage in combination with the tests used in the hardware testing. LEDs were replaced with the various modules and the output was tested using an oscilloscope.

To test the tactile switch to digital potentiometer implementation, both the tests for tactile switch and digital potentiometers were combined. The test began by pressing each tactile switch in turn. The text identifier of the tactile switch pressed was printed on screen with the current internal value of the digital potentiometer. The test was considered a success if the changes in waveform measured by the oscilloscope matched the calculated resultant waveform.

To test the rotary encoder to digital potentiometer implementation, both the tests for rotary encoders and digital potentiometers were combined. The test began by rotating each rotary encoder in turn, both clockwise and counter-clockwise. The text identifier of the rotary encoder being rotated was printed on screen with the current internal value of the digital potentiometer. The test was considered a success if the changes in waveform measured by the oscilloscope matched the calculated resultant waveform.

Stage 4: Tuning Testing during the tuning stages repeated the Stage 3 tests, measuring the resultant waveforms with an oscilloscope.

The testing as described prevented major problems further along in the project through early detection of any and all bugs within the software.

121

8. Project Operations Manual The Analog-Digital Hybrid Synthesizer comes jam packed with a huge assortment of Features and functions to meet the needs of the avid electronic musician. The following is a walk through guide to jump right in and begin creating an assortment of winding spacey sound effects, or even the next grand electronic symphony to be featured on the top of the popular music charts.

Basics: Upon first observation of the A/D Hybrid synthesizer there will typically be an overwhelming sensation to the unfamiliar user. The Large number of knobs and keys each serve their own purpose. However, the first step n line is to not simply power up and go. First, it is imperative to ensure that an output source is connected, whether a set of headphones, or even an external amplification source is connected via the line output. Once this situation is satisfied, ensure that the volume adjustment knob is set to the lowest setting. This is a hardware specific knob that does not have any impact on the digital aspects of the synthesizer.

Once the above is taken care of, the fun can begin. The next step in the chain of operating the synthesizer is to turn on the power. There will be a short moment in time where the synthesizer will prepare for operation. After the boot time has completed, an indicator will light, signaling that all is ready to go. It’s at this point that sound creation can begin.

To first observe the sound of the synthesizer, the volume control needs to be adjusted to best suit the conditions of the rooms atmosphere. Pressing a key on the synthesizer and slowly turning the volume knob to increase the volume can insure that the appropriate audio levels are reached.

At this point, all the safety precautions have been carried out to ensure that a malfunction of the synthesizer or even damage to other equipment. From here it is possible to play a few notes, even a song. The base settings can be heard as each key is pressed. As the keys are played in ascending order up the keyboard, the pitch/frequency will increase by a full note value. Similarly, playing in decreasing order will result in a reduction of pitch/frequency.

This synthesizer is equipped with Oscillators capable of jumping and falling a full octave (12 chromatic pitch values) at the press of a button. There will be two buttons featured on the face of the synthesizer. One will cause the increase in octave and the other will decrease. The intended span here will grant a total of 5 octaves between the two buttons.

Apart from simple frequency control, the synthesizer is equipped with two multi functioning voltage controlled oscillators. To operate these, simply adjust the switch for each oscillator to change the type of voicing which they will produce. The output of these oscillators will be heard down module chain; which brings attention to the next step to operate.

122

Following the changing of the voice (wave type) produced by each of the oscillators is another module which controls the volume of each oscillator. This is the signal mixer. To operate the signal mixer, simple rotate the knob to either direction to change the output amplitude for each signal. When the knob value is centered, both voices will sound at the same amplitude. When the knob is fully turned in one direction, only one of the oscillators will be heard, whereas when turned in the opposite direction, the other voice will ring out. It is at these points that the non-specified oscillator will essentially be muted.

Now that the method for using the Voltage Controlled Oscillator and signal mixer has been covered, the next step in line is to realize the functionality of the Attack Release Envelope Generator. It’s possible to notice at this point that pressing the key will instantly sound a pitch. Also when releasing the key press the sound will instantly cut out. The first step in understanding the use of this functionality is to turn the Attack knob a slight amount. After doing so, press a key on the keyboard to initiate a pitch and notice that the pitch will fade in slightly. To experience an extreme case for the attack portion of this envelope, increase the value of the corresponding knob to its limit and press a key again. This time it is possible to notice that the pitch will very gradually fade in. This is the expected result of the Attack control of the Attack release envelope.

To test the functionality of the Release control for the envelope, perform similar steps to the above description for the attack control. For best results, turn the value of the attack envelope down to its minimum value. Turn up the release a small amount and notice the impact as a key is pressed then released. The pitch will present a gradual cutoff. Increasing this value to its highest value and performing the same action, it is possible to witness an exceedingly longer duration for the pitch to be held for. Now that the attack and release functionality is understood, mixing the values for each knob between the attack and release can issue some interesting qualities. The best step following this is to experiment with the varying potentials for the module.

Following the functionality of the Attack/Release Envelope, the next module to discover is the Variable Low Pass filter. The LPF on this synthesizer features two adjustable factors. The cutoff frequency is the primary component amongst these two factors and is responsible for a large chunk of the effect this component will produce. The general basic setting for this component is to have it fully turned up on the dial setting. The reason for this is that all audible frequencies will be passed through the filter at this point. By adjusting the filters calibration, the cutoff frequency will change and sweep through its entire range, cutting out all the frequencies above the newly set cutoff throughout the entire sweep.

The other control factor presented in the Low Pass Filter is the Resonance adjustment. The Resonance makes an adjustment to the Quality factor of the filter, which essentially amplifies or diminishes the frequencies surrounding the cutoff range. To use this, simply turn the knob in either direction. Turning the knob in the clockwise direction will increase the quality factor and therefor increase the amplitude of the frequencies at the cutoff range. The sound heard as a result could be compared to that of a ringing sensation. By turning the knob in the opposite direction, the extra amplification in the Resonance will be removed

123 and therefore result in the flat sound of the pitch in what could be considered in the music world as “dry”.

Taking a step to the side away from the primary functions a final component to test is the Low frequency oscillator. This device features a single knob that acts similar to the sound producing Oscillators mentioned earlier. The primary difference is that this knob creates a slow moving wave form that will control the other modules in the synthesizer. To Test the functionality, turn the knob in a direction to adjust the oscillating frequency. For this example, the Low Pass Filter will be used. Switch on the LFO control for the Low pass filter and witness the impact that is being created. The Sweeping range for the filters cutoff range should automatically progress and decline. A good way to describe this sound would be an almost talking characteristic. By turning the knob on the Low Frequency Oscillator, the speed at which the controlled unit operates at will either increase or decrease. The functionality can also be used on other devices, for instance in this synthesizer, the Oscillators in charge of audio production can be swept to create a constant increasing and decreasing pitch sound describable as almost siren like.

From this point, all the internal components of the synthesizer have been covered, however, this synthesizer includes a MIDI interfacing that can be observed. The first step is to plug in a MIDI device. There are two MIDI ports Featured on the backside of the synthesizer. By plugging one end of a MIDI cable into the Out port on this synthesizer and the IN port of another synthesizer, while also plugging a cable in the opposite means between the same two synthesizers allows the two to communicate note and control factor information. With this cable arrangement, it is possible to play a note on one of the two synthesizers and have the note information play through the other as if you were playing that one on its own. It is also possible to remove one of the cables and make one of the synthesizers act as the lead keyboard control while the synthesizer receiving the Cable to the IN port will act as a slave unit to be strictly controlled by the other unit without the opportunity to send outward control capabilities.

From here out, all the functionalities have been described as to their operation methods. The only remaining thing to do at this point is to experiment with the possibilities this synthesizer has to offer.

124

9. Administrative Content Early in the semester we realized the importance of maintaining a steady flow of communication and comfort between group members. As three of our members have been familiar with each other since 2013 via the Air Force Reserve Officer Training Corps here at UCF, it was relatively easy to achieve a good rapport between group members. The group communicated electronically using several methods including the GroupMe messaging app, Facebook messenger, Google drive and standard email. In addition to maintaining almost daily contact via these messaging apps, the group met on average twice a week, on Tuesday and Thursday during class time to discuss problems, status updates and other weekly business dealings. We plan to stick to this schedule throughout the Spring 2017 semester to maintain on schedule for our prototype and demo.

9.1 Budget and Finance Discussion The budget estimate shown in Figure 9.1.1 breaks down the estimated cost of all the components per module that can be found on previous block diagrams. The shipping costs are included as well, as they were not included in the Bill of Materials in Chapter 5.

Budget Description Vendor Price Quantity Total Cost Microcontroller $ 15.00 1 $ 15.00 Custom PCB $ 50.00 1-5 $50 - $250 VCO $ 18.76 1 $ 18.76 LFO $ 24.32 1 $ 100.00 VCF $ 11.65 1 $ 11.65 VCA $ 22.51 1 $ 22.51 AR envelope generator $ 6.31 1 $ 6.31 Housing Unit $ 60.00 1 $ 60.00 Shipping $ 120.00 1 $ 120.00 Misc Unforseen Costs $ 100.00 1 $ 100.00 Total $ 554.53 Table 9.1.1: Estimated Budget

8.2 Milestones Discussion The milestone discussion for each member details weekly whatever stage of the project they will be working on in that timeframe. We plan to stick to this as closely as possible to finish on time, minimize stress, and maximize quality. Additionally the breakdown of each member’s responsibilities and contributions are included in the following pages in Figures 9.2.1, 9.2.2, 9.2.3, and 9.2.4.

125

David Clapp – Computer Engineer Project Responsibilities/Contributions: David, as our lone computer engineer, is in charge of the “digital” side of our analog/digital hybrid synthesizer. He has taken care of all the programming needs for the digital potentiometers we will be using and is simply the brain of our synthesizer. Without him the project would be impossible.

Fall 2016 Week Description 26-Aug Create a Project Idea 2-Sep Form Group, decide on project 9-Sep Finalize idea, individual research Initial Project Documentation - 9 Sep 18-Sep Research individual assignments 20-Sep Meeting with Lei Wei 9-Oct Continue individual research Combine research, project materializes, 30-Oct begin Table of Contents 4-Nov Finalize Table of Contents Table of Contents - 4 Nov 11-Nov Prepare draft of final paper Current Draft of Senior Design Documentation - 11 Nov Final Prototype design and completion of 4-Dec documentation 6-Dec Review Final Senior Design 1 Document Final Document Due - 6 Dec Winter Break - Working prototype, design 9-Jan PCB Spring 2017 9-Jan Finalize PCB Design 16-Jan Order PCB 23-Jan PCB Quality Inspection 30-Jan PCB Testing 6-Feb System Testing 13-Feb Finalize Prototype 20-Feb Conference Paper/Middle Term Demo 27-Feb Redesign/Order new PCB if necessary 6-Mar MCU Programming 13-Mar MCU Programming 20-Mar MCU Programming 27-Mar MCU Programming 3-Apr MCU Programming 10-Apr Prepare Final Report 17-Apr Showcase Final Demo 24-Apr Showcase, SD Day/Exit Interview Figure 9.2.1: Clapp Milestones

126

Matthew Herr – Electrical Engineer Project Responsibilities/Contributions: Matthew is part of the trio of electrical engineers in this electrical heavy project and is in charge of the LFO and VCA as well as the audio output.

Fall 2016 Week Description 26-Aug Create a Project Idea 2-Sep Form Group, decide on project 9-Sep Finalize idea, individual research Initial Project Documentation - 9 Sep 18-Sep Research individual assignments 20-Sep Meeting with Lei Wei 9-Oct Continue individual research Combine research, project materializes, 30-Oct begin Table of Contents 4-Nov Finalize Table of Contents Table of Contents - 4 Nov 11-Nov Prepare draft of final paper Current Draft of Senior Design Documentation - 11 Nov Final Prototype design and completion of 4-Dec documentation 6-Dec Review Final Senior Design 1 Document Final Document Due - 6 Dec Winter Break - Working prototype, design 9-Jan PCB Spring 2017 9-Jan Finalize PCB Design 16-Jan Order PCB 23-Jan PCB Quality Inspection 30-Jan PCB Testing 6-Feb System Testing 13-Feb Finalize Prototype 20-Feb Conference Paper/Middle Term Demo 27-Feb Redesign/Order new PCB if necessary 6-Mar System Testing 13-Mar System Testing 20-Mar System Testing 27-Mar Test 3-Apr Test 10-Apr Prepare Final Report 17-Apr Showcase Final Demo 24-Apr Showcase, SD Day/Exit Interview Table 9.2.2: Herr Milestones

127

Kevin Morcombe – Electrical Engineer Project Responsibilities/Contributions: Kevin took on the tough task of creating a musically accurate Voltage Controlled Oscillator as well as making many contributions to this documentation itself.

Fall 2016 Week Description 26-Aug Create a Project Idea 2-Sep Form Group, decide on project 9-Sep Finalize idea, individual research Initial Project Documentation - 9 Sep 18-Sep Research individual assignments 20-Sep Meeting with Lei Wei 9-Oct Continue individual research Combine research, project materializes, 30-Oct begin Table of Contents 4-Nov Finalize Table of Contents Table of Contents - 4 Nov 11-Nov Prepare draft of final paper Current Draft of Senior Design Documentation - 11 Nov Final Prototype design and completion of 4-Dec documentation 6-Dec Review Final Senior Design 1 Document Final Document Due - 6 Dec Winter Break - Working prototype, design 9-Jan PCB Spring 2017 9-Jan Finalize PCB Design 16-Jan Order PCB 23-Jan PCB Quality Inspection 30-Jan PCB Testing 6-Feb System Testing 13-Feb Finalize Prototype 20-Feb Conference Paper/Middle Term Demo 27-Feb Redesign/Order new PCB if necessary 6-Mar System Testing 13-Mar System Testing 20-Mar System Testing 27-Mar Test 3-Apr Test 10-Apr Prepare Final Report 17-Apr Showcase Final Demo 24-Apr Showcase, SD Day/Exit Interview Table 9.2.3: Morcombe Milestones

128

Kyle Thatcher – Electrical Engineer Project Responsibilities/Contributions: Kyle provided the inspiration for the project itself and took on the task of creating the VCF, the signal mixer, and the AR envelope generator.

Fall 2016 Week Description 26-Aug Create a Project Idea 2-Sep Form Group, decide on project 9-Sep Finalize idea, individual research Initial Project Documentation - 9 Sep 18-Sep Research individual assignments 20-Sep Meeting with Lei Wei 9-Oct Continue individual research Combine research, project materializes, 30-Oct begin Table of Contents 4-Nov Finalize Table of Contents Table of Contents - 4 Nov 11-Nov Prepare draft of final paper Current Draft of Senior Design Documentation - 11 Nov Final Prototype design and completion of 4-Dec documentation 6-Dec Review Final Senior Design 1 Document Final Document Due - 6 Dec Winter Break - Working prototype, design 9-Jan PCB Spring 2017 9-Jan Finalize PCB Design 16-Jan Order PCB 23-Jan PCB Quality Inspection 30-Jan PCB Testing 6-Feb System Testing 13-Feb Finalize Prototype 20-Feb Conference Paper/Middle Term Demo 27-Feb Redesign/Order new PCB if necessary 6-Mar Panel Wiring/Housing Unit 13-Mar Panel Wiring/Housing Unit 20-Mar Panel Wiring/Housing Unit 27-Mar Panel Wiring/Housing Unit 3-Apr Panel Wiring/Housing Unit 10-Apr Prepare Final Report 17-Apr Showcase Final Demo 24-Apr Showcase, SD Day/Exit Interview Table 9.2.4 Thatcher Milestones All group members have collaborated with each other and helped with various schematics, ideas, brainstorming, ect. This truly is a high functioning team that gets along quite well.

129

8.3 Conclusions As the first semester of our two semester journey comes to a close, it is truly amazing to see how far we’ve come from day one. Forming as a group to create an idea that has slowly become a part of our everyday lives has truly been an enjoyable experience. All of our contributions have come together to form the basis for a successful second semester. We plan to fully integrate all of our schematics and order a PCB design by the third week of next semester and we’re looking forward to prototyping and creating a finished product.

130

Appendices

Appendix A - Copyright Permissions No copyright permissions necessary. All content contained within document is original content or is public domain.

131

Works Cited [1] Raspberry Pi, "Raspberry Pi 3 Model B," [Online]. Available: https://www.raspberrypi.org/products/raspberry-pi-3-model-b/. [Accessed 7 Nov 2016].

[2] Arduino, “Arduino Uno Rev3”, [Online]. Available: https://store- usa.arduino.cc/products/a000066. [Accessed 7 Nov 2016].

[3] Beagle Board, "BeagleBone Black," [Online]. Available: http://beagleboard.org/BLACK. [Accessed 7 Nov 2016].

[4] NXP Semiconductors, “I2C-bus specification and user manual”, [Online]. Available: http://cache.nxp.com/documents/user_manual/UM10204.pdf. [Accessed 20 Nov 2016]

[5] Texas Instrument, “KeyStone Architecture Universal Asynchronous Receiver/Transmitter (UART) ”, [Online]. Available: http://www.ti.com/lit/ug/sprugp1/sprugp1.pdf. [Accessed 18 Nov 2016]

[6] MIDI Manufacturers Association, “The Complete MIDI 1.0 Detailed Specification“, [Online]. Available: https://www.midi.org/specifications/category/midi-1-0-detailed- specifications. [Accessed 9 Nov 2016]

[7] MIDI Manufacturers Association, “MIDI Reference Tables”, [Online]. Available: https://www.midi.org/specifications/item/table-1-summary-of-midi-message. [Accessed 12 Nov 2016]

[8] ANSI, “Rationale for International Standard-Programming Languages-C”, [Online]. Available: http://www.open-std.org/jtc1/sc22/wg14/www/C99RationaleV5.9.pdf [Accessed 12 Nov 2016]

[9]S.Rise. Voltage-Controlled Filter (VCF)[Online Tutorial] Available: http://synthesizeracademy.com/voltage-controlled-filter-vcf/

[10]Unknown Author, (2016, October 13) Voltage-Controlled Filter[Encyclopedia] Available: https://en.wikipedia.org/wiki/Voltage-controlled_filter

[11]R. Shaumann and M. Van Valkenburg, “The General Impedance Converter”, in Design of analog Filters, New York, United states. Oxford University Press, 2001, Ch 4, sec 5.3, pp178-186

[12]M.E VanValkenburg, “Butterworth Lowpass Filters”, in Analog Filter Design, New York, USA, CBS College Publishing, 1982, Ch 6, sec 1-7, pp. 157-188

[13]EEL 4140 Analog Filter Design Laboratory Manual, University of central Florida Department of Electrical & Computer Engineering, Orlando, Fl, 2005, pp53-60

132

[14]R. Wilson, “Analog Synthesizer Building Blocks”, in Make:Analog Synthesizers, USA, Maker Media Inc, 2013, Ch 3,pp37-54

[15]Unknown Author, (2016 December 2) “MIDI”, [Encyclopedia], Available: https://en.wikipedia.org/wiki/MIDI

[16]Unknown Author, (2016, November 8) “DIN Connector”[Encyclopedia] Available: https://en.wikipedia.org/wiki/DIN_connector

[17]Unknown Author, (2016, October 24) “Balanced Line” [Encyclopedia] Available: https://en.wikipedia.org/wiki/Balanced_line

[18]A. Ghassaei, “555 Timer”[Tutorial] Available: http://www.instructables.com/id/555- Timer/step2/555-Timer-Monostable-Mode/

[19]R. Wilson, (2015) “Synth-DIY Experimenter Board AR Envelope Generator” [Article] Available: http://musicfromouterspace.com/index.php?MAINTAB=SYNTHDIY&PROJARG=EXP ERIMENTERBOARD/page4.html&VPW=1910&VPH=822http://casperelectronics.com/ images/finishedpieces/benjolin/BenjAREnvGen2.jpg

[20]R. Wilson, (2015) “Synth-DIY Experimenter Board Voltage Controlled Filters” [Article] Available: http://musicfromouterspace.com/index.php?MAINTAB=SYNTHDIY&PROJARG=EXP ERIMENTERBOARD/page4.html&VPW=1910&VPH=822http://casperelectronics.com/ images/finishedpieces/benjolin/BenjAREnvGen2.jpg

[21]Unknown author, (2016, November 18), Q factor [Encyclopedia] Available: https://en.wikipedia.org/wiki/Q_factor#Relationship_between_Q_and_bandwidth

[22]T. Stilson and J. Smith “Analyzing The Moog VCF with Considerations for Digital Implementation” Music Department, , Stanford, CA, Available: https://ccrma.stanford.edu/~stilti/papers/moogvcf.pdf

133