The PSoCamorph

First thoughts on the PSoCamorph, a PSoC3-based music synthesizerBy Kendall Castor-Perry
First thoughts on the PSoCamorph, a PSoC3-based music synthesizer
By Kendall Castor-Perry
The 1970s produced several major analogue music synthesizer projects from the key hobbyist electronics magazines of the time – Elektor, Practical Electronics and Electronics Today International high on the list. These complex beasts represented the pinnacle of electronic engineering aimed at the serious amateur. I built a hybrid of the PE Minisonic and the ETI 4600 synth designs for a school friend of mine. It was assembled to a constructional standard that I would nowadays be ashamed of, but I still remember the great excitement from hearing the raw, raspy, modern sounds that it produced, in an English suburban bedroom in the mid-70s.
Elektor’s contender for the Heavyweight Championship of Home-Built Electronics was the Formant synthesizer. The complete set of articles for this well-conceived, well-executed instrument can still be downloaded from the Elektor website. At over 100 pages, this compendium of design (and usage) techniques represents a triumph of technical journalism.
You might ask “Why all this old analogue guy nostalgia?” One reason is that it’s hard to think of a system that can demonstrate more of the skills required in both circuit design and signal processing theory. Lessons I learned from studying analogue synthesizer design, and then trying to build the things, have lasted through to today. It’s quite possible that my life-long love affair with filters was initially triggered by building, and listening to the effects of, the classic Moog-style “ladder VCF”.
These days, the power of digital processing is such that the vast majority of synthesizer work is carried out entirely in the digital domain. The synthesis and emulation of musical sounds is achieved with millions or even billions of digital instructions per second, with no analogue in sight except at the voice-coil of the loudspeaker. Sadly, as an old-fashioned kind of electronics guy, I can’t get too excited about projects that just boil down to creating and coding algorithms. It seems entirely too ‘virtual’ to me. Nevertheless, digital processing and control has brought a host of advantages to the music synthesizer in the last 25 years or so.
Those classic hobbyist synthesizers were built from discrete components and simple ICs, with not a micro or digital signal processor in sight. However, nearly 40 years on, there are more compact devices and more compact design methods for us to employ. In this article, I argue that the time is right to revisit some of the more fundamental, primitive and visceral ways of synthesizing musically-useful sounds with simple mixed-signal electronics.
This is not the start of a series of articles on how to build a music synthesizer, with all the circuits completely designed, prototyped and tested. It’s a mission statement – a proposal for a collective design and development process, seeded by more articles with architectural commentaries and theoretical background on what is useful in such a synthesizer. My goal here is threefold:
- bring a satisfying, compact and usable music synthesizer platform into being;
- showcase the flexibility of Cypress’s latest mixed-signal SoC devices;
- contribute to a crowd-sourced collaborative project that brings the best out of the wide electronics community.
Because – hopefully anyway – there will be so many of you out there working on alternate realizations of key elements, we may end up with both analogue and digital variants of the key processing blocks. Why a mixed-signal synthesizer? Well, the flippant answer would be “because we can”! One significant reason is that it illustrates that there’s usually both an analogue domain and a digital domain solution to any particular engineering challenge. The comparison between the design methodologies will be invaluable for teaching people both about synthesizers and about design on a mixed-signal platform.
So, it’ll mostly be up to you, dear readers, to put flesh on the architectural skeleton that I’ll try to lay out here and in some follow-up articles. There’s a mass of useful information out there on the web (Prof. Julius Smith at CCRMA in Stanford is particularly prolific) The classic “Musical Applications of Microprocessors” by Hal Chamberlin contains some quaint eighties-style circuitry, from the era when an 18bit DAC cost $1000! But there’s a tremendous amount of learning in that book. The original magazine articles on their grand synthesizer designs also contain great tips that are just as relevant now as they were a generation ago.
While I do want this design to be cheap – and all of you out there to be cheerful – I don’t want too many corners to be cut. The end result – or results, since I’ve no doubt that this project will fork into multiple designs in the wild – still ought to be both an interesting project and a capable musical instrument Some of you will inevitably want to, or be able to, get involved more than others. If you’re willing to sign up to work on a specific block of the synthesizer as a sort of ‘team leader’, we’ll make sure that a PSoC development system will beat a path to your door.
If (and I’m hoping that there’s not too much ‘when’) people have questions about how to persuade the blocks in the PSoC devices to carry out some particular function, report the issue to the Elektor design forum, and someone will help find the necessary information within Cypress to help you out.
Discussion (12 comments)
BifrostDevGrp 11 years ago
I have only started to go over the architecture of this project, so forgive me if I am treading already paved ground :) If the intent is to only perform emulation of already-known analog synthesis modules using mixed-signal devices, that is one thing and good luck to you for it.
If, on the other hand, a desired feature is to process and filter sample sources outside the unit many things come to play in a big hurry (seems like you know this, being an afficionado of filters and such).
My particular expertise in these sorts of things is in sample-rate conversion. If you can constrain the handling of sampled data streams to internally-derived sources, that would simplify matters a great deal.
If, however, sampled data streams can be introduced from external sources, such as CD players, MP3 players, software sources, and commercial devices such as DAT drives, things can get 'interesting'.
For example, the internal sample-rate for the PSoC (and other logic) can be constrained to something like 48KSa/s or 96KSa/s, which makes the math work out nicely while it is inside the unit. Accepting streams from devices that supply 44.1KSa/s (CD players and other consumer devices) is vastly more difficult. The approach I undertook for a project was to feed the samples to a polyphase low-pass reconstruction filter, which would reduce both harmonic and phase-distorting effects of the rate conversion.
Part of what I have not yet seen in the architectural discussion (sorry if it is really there) is any particular set of resource constraints, such as processing speed and memory. In a memory-constrained system, such as the one I worked on, doing any kind of polyphase FIR reconstruction filter becomes, um, 'interesting', to say the least. Suffice it to say that an accurate reconstruction of a signal source at 44.1KSa/s to 48KSa/s requires one of 147 polyphases (Floating point? Fixed point? Filter aperture?) to be selected in real-time for each sample. In my project I was given a time budget of 21.8 usec to switch the polyphase and perform a multiply-accumulate pass in a network of processor cores with 64 words total memory each. In a memory budget of less than stellar proportions that requires a lot of thought. Eventually the polyphase coefficients had to be fed from external memory in-band with the sample stream.
I notice that much attention to the thermal properties of the modular processes. Good. Unfortunately, rate drift can be reduced, but never eliminated. That required me to introduce a servo feedback system to constantly correct the phase-distortion of the rate drift. A good correction reference clock is therefore required. A good one is a 2.688MHz stable clock, which is easy to design using cheap components.
Vonaan 11 years ago
In adding to kendall's initial thoughts of the project I would like to add some of my own. Owning a modular synth is a blessing and curse at the same time. A modular is very flexible and is loved for the sound due to the analog components used in the design. At the same time they are large, expensive and most of the time don't realy integrate well into modern studio's and their way of working.
I should explain a bit more what I mean with integration into modern studio's and their way of working. We can safely assume most setups are now using a PC or MAC running DAW software like Cubase and Ableton and a host of soft synths and effects. Modern musicians also start working more and more with automation due to the fact most parameters now can be automated via midi or other protocols. Polyphony, multilayering, effects and in the box creativity are all being integrated into the modern way of making music and everything can be stored and recalled with the click of a mouse button.
It would be nice if there was a modular system that could integrate more with this way of creativity and be more cheaper at the same time. I therefore have defined soem of my own design goals and priciples:
I will try to use the above first three design goals in my first design. The other TCP/IP related goals are more difficult to implement and I want to concentrate on the core design and principles first. I have no idea how feasable they are and what the limitations the PSoC has in this respect. I also need to spend some time in developing the hardware side of the design. I hope to share some more information soon and don't hasitate to comment on the above or share your idea's.
Vonaan 12 years ago
showell 12 years ago
Vonaan 11 years ago
Hi,
I'm the proud onwner of an Formant system containing 30+ modules from the first book. It's being refurbished and I will definatly add more modules to it over time from the second book and the MSS2000 book. I will also build an ET4600 and EMM, just for the fun of it.
I'm new to programming Ardiuno's and inspired by some internet open source project was thinking of using it to create new models and replace the old one's with new technology, similar to the idea of this project.
I will now investigate if I will use the PSoC5 instead to be able to contribute to this project. Apart from the cypress website, what are recommended sites to check out and to buy the development kit?
ClemensValens 12 years ago
yoko 11 years ago
Hi,
This is certainly a fun project. My knowledge of analog circuits is very limited but do have a great expertise in embedded software. This project is certainly going to need software. I am also very busy but would like to contribute as much as I could in the software developement of this project.
Hoan
Feroze 11 years ago
I'm a 3rd year electronics undergrad from Chennai, India. As a kid, I've spent many evenings playing with a Casio synth. I've used AVR and MSP430 microcontrollers for projects and built a rudimentary tone generator with a few tact switches, potentiometers and a buzzer using the ATmega168.
I realise the Formant must have been quite a feat to build using only analogue components. The PSoCamorph is a great idea and I think it would be a lot of fun to implement it.
I went through the modules and I'm looking forward to design the PSoCamorph.
eminence2001 11 years ago
What a brilliant idea! I cut my teeth in the 70s building the Practical Electronics synth while still at school. Then I became an impoverished student and could only dream of building the Formant with its expensive PCBs. Folowing a career in microelectronics and retirement on health grounds, I now have the time (and money!) to build one. I have managed to acquire various bits which are slowly taking shape. I too have dabbled with digitising parts of it (e.g. the keyboard interface). I would really like to become involved in this project, so if you still have kits going spare...
ClemensValens 12 years ago
MasterMD 11 years ago
I am still a great fan of the Elektor Formant. I have built several modules, the keyboard, etc. but never finished it. All components are still waiting to be used someday. In the meantime I had several ideas to 'digitize' parts of it, but lack of time is the reason that nothing happened yet.
This appears to be a great project, and I would like to contribute.
At this moment however, I have no detailed ideas yet!
ClemensValens 12 years ago
Kendall 11 years ago
Hello PSoCaMorphers out there!
The Editor asked me to clarify that all the architecture stuff I've uploaded so far is relevant either to PSoC 5 (the Cortex M3-based one) or PSoC 3 (the single-cycle 8051 one). That's because they are very similar devices at the level of the programmable analogue and digital fabrics. As you know, we plan to entice you to start working on your own implementations of these design ideas by offering development kits, and they'll be PSoC 5 kits. That's primarily because we know you guys out there get more excited by the modern 32-bit ARM processors and will want to try them out on other tasks too!
Just so there's no confusion when you read PSoC3 in something I wrote!
best / Kendall
Kendall 11 years ago
Kendall 11 years ago
image-2-psocamorph-vco-1.png (48kb)
Kendall 11 years ago
PSoCaMorph is a mixed-signal synthesizer concept. What does this mean? Simply that I’m not wedded to all-analogue or all-digital approaches to synth design. Some of the great synthesizer designs have combined analogue tone generation with digital forms of modification and control. Having several ways on hand to solve a problem will always simplify a design done on a compact mixed-signal device such as PSoC. Determining the tradeoffs in resource utilization is part of the fun. And, in the case of the PSoCaMorph, my goal is to demonstrate that for each of the core processes that go on in a classical performance synth, there are a range of techniques from the all-analogue to the all-digital.
As well as the classic Chamberlin text I’ve already recommended, another recent well-received book is “Sound Synthesis and Sampling”. It’s a good addition to your (physical or electronic) bookshelf, and some chapters from it have been serialized on Audio DesignLine. Well worth a read if you’re rusty or unfamiliar with synthesizer basics. With that, let’s get right down to business.
The core pieces of a synth voice channel are: a source of signals at musically relevant frequencies, some modifiers that can help produce a wide palette of different timbre types, and a source of control signals for the source and modifiers. The old-school source is invariably a controllable oscillator, capable of generating a range of waveforms with varying harmonic structures (and hence starting timbres).
We’ll look at possible digital synthesis approaches in a later article; for now, I’ll focus on the musical core of any great old-school analogue synth, the VCO, in which the pitch of the note produced is controlled by an applied voltage. Before we get any further, this implies that we need to plan the relationship between voltage and note frequency in our synth architecture. We also need to figure out where the control voltages will come from.
So the first architectural decision I’ve made is to separate the design into ‘note housekeeping’ (where control voltages come from) and ‘voice generation’ (where the actual musical notes are produced). I’m assuming that in a production polyphonic instrument, one PSoC will be devoted to creating the various control voltages required (from MIDI messages or whatever physical user interface is constructed), while other PSoCs will implement individual voice channels in the instrument. For a monophonic instrument it should hopefully be possible to combine these into a single device. But I’ll continue to refer to housekeeping and generation as two separate functions.
Nearly always, the mapping between voltage and frequency is chosen to be exponential rather than linear. This means that, whatever the current frequency being produced, changing the control voltage by a specific increment produces the same percentage change of oscillator frequency. This maps perfectly onto musical scales; “going up an octave” means multiplying the frequency by two, wherever you started.
Using this exponential relationship gives us a subtle musical advantage. A small offset voltage always corresponds to a slight change of pitch, but it affects all notes equally. It was quite common for early analogue synths to drift in frequency under the heat of stage lighting. This is the result of the changing current/voltage relationship of a bipolar transistor over temperature. But the core relationships between the notes don’t change, and it’s easy to have a master “tuning knob” to pull things back into tune. This is just the same behaviour as adjusting the tension in a guitar string and is the reason why it’s possible to make playable stringed instruments.
Supply voltages and control ranges
Old-school synths use large numbers of discrete and SSI components running on generous supply voltages (usually +/-15V). The standard for control voltages has generally been that 1V of voltage change caused a doubling of oscillator frequency. But my goal here is to create a design that will run on more ‘modern’ supply voltages for compact mixed-signal circuitry. PSoC devices will run happily on a 5V supply, so that’s my chosen value. Working backwards from some VCO fundamentals led me to the nice round 378mV/octave (at 28 degrees Centigrade). The oscillators will be ranged so that with zero voltage differential from the 2.5V half-supply voltage, they will run at some multiple of A440. There are several places where the ‘native pitch’ of the proposed VCO design can be adjusted, and we’ll see that when the circuitry is described.
Oscillator control law
Following in the footsteps of most synth designers, I’ll exploit the well-understood exponential relationship between the collector current of a bipolar junction transistor (BJT) and its base-emitter voltage. We didn’t put any bipolar transistors in PSoC so these have to be external, but that’s hardly a big deal.
Just using a single transistor to do this job is fraught with problems. This is mainly because of the very complicated and process-dependent way in which temperature appears in the current-voltage relationship. Using a pair of transistors solves most of these problems, because we end up relating a voltage difference to a current ratio. That’s going to be really useful when we get to designing our oscillator cores. Synth guys talk about VCOs but actually all good oscillators are really controlled by a current that’s derived from the applied control voltage. The temperature issue doesn’t go away, but it becomes much more predictable.
If we look at the inherent voltage we have to provide to double the current in the ‘output’ transistor – hence increasing the CCO’s frequency by an octave – we find that it is now accurately proportional to absolute temperature. So the voltage required to shift pitch by an exact semitone also needs to be proportional to Tabs. This was usually fixed in past designs by using resistors in some key positions that had the required temperature coefficient. It’s actually not that hard, since many pure metals have a resistivity that’s proportional to absolute temperature. It didn’t stop people from charging an arm and a leg for dedicated devices to go into those blocks. We could use that approach here too, but it somehow seems a better idea to design in some kind of temperature compensation using the digital smarts in PSoC.
I contemplated using the die temperature monitoring built into some variants of PSoC, but decided against it because the die temperature of the housekeeping device can’t ever be a good representation of the temperature within the instrument, on account of its own variable power dissipation. The resolution and accuracy of the detector also didn’t seem quite as tight as we need. Instead, the housekeeping section uses a high resolution method to determine the local temperature from an external sensor, and introduce the necessary scaling factor into the control voltages. In principle, any of the methods used in the standard Cypress temperature measurement reference design can be used. The two-current delta-VBE method is probably the best choice. Using the same type of transistors as are used in the VCO design should give very close tracking of temperature.
At the temperature of a hot stage (28 degrees C), the change in base-emitter voltage required to double a transistor’s collector current is 18mV. In other words, the ‘natural’ control law of a synthesizer exploiting bipolar transistors is 18mV per octave (1.54mV per semitone). This is quite a small voltage, and easily contaminated by other offset and layout-induced voltages in the system. So we’ll generate and distribute higher control voltage values than this, and attenuate them by a suitable factor right at the bases of the exponentiating transistors in the voltage-to-current converters.
Supplies and references
In a dual supply system, 0V can readily be used as a reference point around which voltages can vary. Most control voltages in an old-school synth, running on +/-15V supplies, never got anywhere near the supply voltages. This left plenty of “safety margin” for op-amps and transistors. In a single-supply system we must be more careful with our choice of reference and bias voltages.
In this design, I’ll lean heavily on the 5V supply, and a 2.5V line derived from it. I think it’s reasonable to request that the 5V supply is of good quality, with a low impedance across the entire frequency range. A synthesizer is a pretty busy collection of circuitry and could be capable of injecting significant noisy currents into the supply and ground traces. I’ve always had good results from the LT1763 and its family members, when good-sized bypass caps are fitted to the output and feedback paths.
PSoC 3 and PSoC5 have versatile on-chip 8-bit VIDACs that we can use for some fine trimming and biasing, but they are not accurate enough to be used to generate the primary control voltages for the musical notes produced by the synthesizer. The size of adjacent steps in the DAC output needs to be consistent to a very small fraction of an LSB, and regular DACs are not specified in this way. Fortunately, stable voltage differentials with very accurately matched steps can be created straightforwardly using PWM techniques, and PSoC is good at that. The housekeeping PSoC will translate incoming MIDI (or other user interface) note information into duty cycle settings for PWM blocks, one per voice channel. 8-bit PWM can give good results over most of the 255:1 range of mark/width ratio, and at one LSB per semitone, this more than covers the note range of a performance instrument.
The PWM creates an output voltage by switching a mux between two stable voltage levels. These voltage levels are created by an IDAC (or possibly two in parallel for coarse and fine control) and an op-amp-based inverter. This is where we implement the PTAT portion of the control law, and the basic ‘span’ control for the instrument (the setting that makes an octave an octave). The signals are then buffered and lowpass filtered to remove the unwanted high frequency components of the signal. We’ll need at least a 2nd order output filter, but this is no problem. One pole will be on the note generation output, and the other will be on the VCO input as part of the input attenuator that pots down our 378mV/octave by a factor of 21 to get 18mV per octave at the transistor base. Image 1 shows a basic schematic chunk for this piece.
Requirements for a good synth VCO
The design of a stable VCO with a tightly controlled control law and predictable temperature behaviour is much harder than you’d think. For the analogue version of the PSoCaMorph note generator, we need a VCO with:
* A predictable exponential relationship between control voltage and output frequency
* A predictable linear relationship between control voltage and temperature
* Linear modulation input for vibrato, pulling, modulation and fine pitch control
* Span control to ensure consistency over the whole keyboard
* No “reset time” flattening at high frequencies
* No large circulating reset currents
* Optional sync pulse input for injection locking effects
* Stable output voltage level (to ease alternative waveshape generation)
Addressing this long laundry list will be the subject of the next installment!
Kendall 11 years ago
Hello PSoCaMorph friends! I've been slow at producing more material to give you greater depth on the PSoCaMorph architecture. I blame pressure of work, a poor excuse but the only one I have.
In the next few days I'll post some thoughts on the control architecture for the analogue variants of the PSoCaMorph circuit blocks, starting with the most essential component of a classical synth, the VCO. It wasn't until I started working through this in more detail that I realized just what I've taken on and how much there is to think through.
Once we've got the analogue ball rolling, I'll describe a potential alternative digital synthesis method that's starting to look like a good fit for the Digital Filter Block that's found in several of the PSoC 3 and PSoC 5 family members. I am really keen to see which produces the 'better' synthessizer voice channel. Hope to upload some more stuff real soon now! best / Kendall