ELEN146 Weird Sound Generator 1 Polyphon nic Syn nthesizer
2 Construction The system is comprised of two main components the synthesizer and the power amplifier. For practicality reasons, a custom PCB was designed for the keyboard, while the synthesizer bank was constructed on a breadboard. The low component count of the power amplifier made construction on a solderless breadboard both easy and compact. Figure 1: 3D Rendering of the Keyboard (Altium Designer) Synthesizer Operation The synthesizer was implemented using six, 556 dual timer ICs operating as astable oscillators. To simplify construction, the same value of timing capacitor and R1 resistor was used for the entire synthesizer bank while the classic R2 resistor was varied. While this results in an inconsistent duty cycle across the oscillator bank, the tonal difference in the audio output was negligible, and if anything added to the weirdness of the sound. Figure 2: 555 Timer Configured as an Astable Oscillator The schematic on the following page shows two oscillator channels implemented on a single 556 dual timer IC. In the oscillators comprising the upper six notes of the octave, R3 and R4 were replaced with 1kΩ resistors to bring the total series resistance below 2kΩ in order to achieve the desired frequency. The standard astable oscillator configuration calculation was used to select the potentiometer resistance value for each note, as shown below: 1 ln 2 1 Ω 2 470 The above equation was input into Microsoft Excel and used to calculate a table of predicted resistor values. R2 was comprised of a resistor and a potentiometer in series to allow precise tuning of each oscillator while minimizing the number of unique components required. The use of a potentiometer also negates the need for precise component values in the rest of the circuit.
3 Frequency (Target): R1 (Ohms): R2 (Ohms): C1 (Farads): Calculated: High (ms): Low (ms): 440 1000 2988 0.00000047 440.0 1.299 0.973 43% 466 1000 2800 0.00000047 465.1 1.238 0.912 42% 494 1000 2600 0.00000047 495.1 1.173 0.847 42% 523 1000 2440 0.00000047 522.0 1.120 0.795 41% 554 1000 2270 0.00000047 554.1 1.065 0.739 41% 587 1000 2114 0.00000047 587.1 1.014 0.689 40% 622 1000 1966 0.00000047 622.4 0.966 0.640 40% 659 1000 1828 0.00000047 659.3 0.921 0.595 39% 698 1000 1698 0.00000047 698.3 0.879 0.553 39% 740 1000 1573 0.00000047 740.4 0.838 0.512 38% 784 1000 1457 0.00000047 784.3 0.800 0.475 37% 831 1000 1346 0.00000047 831.4 0.764 0.438 36% 880 1000 1244 0.00000047 880.0 0.731 0.405 36% Duty Cycle (%): The series R2 resistance of the first six oscillators can be varied between 2kΩ and 3kΩ, making them tunable anywhere between 439Hz and 614Hz. The seventh note onwards contains a 1kΩ resistor in place of the 2kΩ resistor, providing a 1kΩ to 2kΩ adjustment range. This equates to a frequency range of 614Hz to 1023Hz, allowing us to easily achieve our goal of implementing a single octave with only two unique fixed resistor values. Though the same range could have been achieved by instead using a 3kΩ potentiometer and eliminating the series resistor, the instrument would have been more difficult to tune unless expensive multi-turn precision potentiometers were used. At $0.93 each, the single-turn 1kΩ potentiometers used provided the best value for dollar and the greatest flexibility in regards to instrument tuning. The last column on the table above shows the oscillator duty cycle as calculated using the formula: % 2 100% While it is clear that the duty cycle varies widely across the octave, this effect is hardly noticeable unless the audio output is viewed on an oscilloscope. Figure 3: Two Oscillator Channels Implemented on a Single LM556 Dual Timer IC
4 Construction and Testing After the PCB had been fully populated and connected to the synthesizer bank, the completed assembly was connected to a digital storage oscilloscope to aid in tuning. The pitch of each of the twelve oscillators can be individually adjusted via a 1kΩ potentiometer mounted on the keyboard, as shown below: Figure 4: Tuning the Oscillator using a Precision Screwdriver
5 Filtering As with any logic IC, the output of the 555 timer suffers from an effect known as ringing or overshoot. Thought this effect is completely inaudible, it does have the potential to hinder the tuning process if it is preformed using an oscilloscope, depending on the trigger settings used. Figure 5: Unfiltered Output Figure 6: Close-up of overshoot (ringing) The above screenshots were taken from a Tektronix TDS3012 Digital Phosphor Oscilloscope. The image on the left shows several periods of the square wave produced by a single key. A close-up of the transition ringing is shown on the left. From the 1µS time base, we can see that the oscillations in the output are occurring at roughly 1MHz. To smooth out the signal, a simple RC low-pass filter was constructed. To preserve the quality of the audio, 50 khz was chosen as the cut-off frequency, and component values were selected as shown: 1 48.2 2 330Ω 10 Figure 7: Smoothed Output Transition Figure 8: FFT of Square-Wave Output Left: Output after passing through the RC Low-Pass Filter Right: Fast-Fourier Transform of the filtered output
6 Power Amplifier The LM380 2.5W power audio amplifier IC was selected due to its availability and ease of implementation. Features such as internally fixed gain, a self-centering output (1/2 supply voltage), and a standard DIP14 package make this component ideal for simple audio amplifier circuits. The output of each timer IC was connected to a common Keyboard Mix rail through a 10kΩ resistor to isolate the sources from one another. The mixed signal was then passed through a capacitor to block DC before being applied to the low-pass filter. The amplifier configuration was based on a design shown in the components datasheet with only a few minor component value changes needed to achieve satisfactory performance. Volume control is achieved with the addition of R10, which acts as a variable voltage divider for the incoming signal from the keyboard. The gain of the amplifier is internally set at +34dB, further simplifying calculations. The LM380 datasheet guarantees a minimum input impedance of 150kΩ, which when coupled with the potentiometer and low-pass filter network provides adequate signal levels with negligible distortion. The selection of the remaining components was largely based on availability, as variations were likely to have little to no impact on performance. C6 serves to AC couple the speaker to the amplifier, and any capacitor able to handle the relevant working voltages and effectively couple the AC signal from the amplifier will do the job. At 1 khz, C6 provides approximately 340mΩ of impedance and therefore excellent power transfer to the speaker. Figure 9 LM380 Power Audio Amplifier and Low-Pass RC Filter Network
7 Power Supply Originally, the synthesizer had been designed to operate off of two separate DC power supplies: one +12V supply for the amplifier, and a separate +5V supply for the oscillator circuitry and keyboard lighting. While this arrangement is perfectly practical in a laboratory setting, the nuisance of dual supplies is obvious. A simple LM7805 +5V regulator circuit was constructed as shown below to negate the need for an external +5V supply. As the power amplifier is able to operate off of any input voltage between 10V and 20V the entire synthesizer can now be operated off of any convenient voltage source within this range. If the power supply were to be constructed on a PCB, a bridge rectifier could easily be added to permit operation off of AC voltages as well. Figure 10 Power Supply Circuit
8 Instructions for Use The intuitive user interface makes the Genesis X1 easy to use for even the novice. After connecting power and speakers to the device, simply press a key to hear the sound it generates. Forget complicated musical lettering schemes - for your convenience, the frequency generated by each key has been printed next to it for easy reference! Tuning Instructions Though your new Genesis X1 has been carefully tuned at the factory, over time it may be necessary to recalibrate the internal oscillators to ensure perfect pitch. Follow the procedure outlined below to recalibrate your instrument: 1. Connect an oscilloscope to the Keyboard Mix line of your Genesis X1 2. Press and hold the first key (440Hz) 3. Adjust the voltage and time base of the oscilloscope until one or two periods of the generated waveform appear on the screen. You should see a square wave at a frequency of approximately 440Hz. 4. Using a precision flat or Philips screwdriver, slowly adjust the potentiometer above the key you are holding. The pitch of the tone should vary up and down. The frequencies and periods of the keys have been provided in the table below: Frequency (Hz) Period (ms) 440 2.273 466 2.146 494 2.024 523 1.912 554 1.805 587 1.704 622 1.608 659 1.517 598 1.672 740 1.351 784 1.276 831 1.203 880 1.136 If you are using a digital oscilloscope, invoke the frequency measurement function to facilitate the above adjustments. Calibration using an analog oscilloscope is most easily done based on the period, as provided in the second column.
9 Resources Chromatic Scale: http://ptolemy.eecs.berkeley.edu/eecs20/week8/scale.html LM380 Datasheet: http://www.national.com/ds/lm/lm380.pdf LM556 Datasheet: http://www.national.com/ds/lm/lm556.pdf 555 Astable Diagram: http://www.csgnetwork.com/ne555timer2calc.html Acknowledgements I would like to thank Professors David Williams, Randy Brown, and Kevin Bradshaw of Okanagan College for their continued support through the course of this project.