Very simple synth idea ?

Jeremy Leach

Senior Member
This is just an idea, but thought I'd throw it in for comment/interest. I'm interested in music synths and wonder whether there's any potential for a VERY simple Synth - using PICAXEs. I won't be hurt if people think it's a wast of time ! And I know there's a whole host of potential issues (speed, resolution, tuning etc !)

<b> Typical analogue synth stages: </b>

* Voltage Controlled Oscillator (VCO) - set the pitch of the note being played. This often has an associated Pitch Envelope Generator (PEG) that varies the pitch as a note is played.

* Voltage Controlled Filter (VCF) - Adjusts the 'colour' of the sound. This has an associated FEG.

* Voltage Controlled Amplifier (VCA) - sets the attack, decay, sustain and release (ADSR) levels of the sound. Has an associated AEG.


<b> Ideas using a PICAXE: </b>

1. Virtual VCO. Although may sound wasteful, could use a PICAXE08M just as a virtual VCO. Serin from a master PICAXE receives the note name. Tune command plays a steady note of the required frequency.

2. Virtual VCF. Although there are specific filter chips, it MIGHT be possible to make a low-pass filter with controllable cut-off using this principle:

<code><pre><font size=2 face='Courier'>
______
Signal_______| |____________ Signal Out
In |______| |
_|_
\ /
_v_
|
|
_|_
___ C
|
PICAXE Output____|

</font></pre></code>

****UPDATE: This VCF circuit WONT WORK. See posts below. *****

When the PICAXE output goes low it adds the capacitor into the circuit, which provides low impedence to higher frequencies, depending on the value C. Could use 3 PICAXE outputs each with it's own value of capacitor. This would give 8 combinations of overall capacitance - ie 8 different cut-off frequencies.

3. Virtual VCA. Again, although specific VCA chips, it MIGHT be possible to vary the amplitude of a square wave as follows:

<code><pre><font size=2 face='Courier'>

0 to 5V Square Wave -----+
Input |
_|_
| |
| R |
| |
|___|
|
+---------&gt; Amplitude modulated
___|___ Square wave output
PWM _______ | MOSFET|
Out ----| |-+----| |
|_______| | |_______|
_|_ |
C ___ |
| |
| |
GND-----------+--------+---------

</font></pre></code>

The PICAXE generates a PWM signal, and the width of the pulse determines the average voltage across C, which is the bias voltage of the MOSFET. When the Square wave input is 'on' the bias to the MOSFET determines the output 'on' voltage - which is therefore set by the pulse width.

<b>Putting together </b>

So, need two PICAXE08Ms, both driven from a Master PICAXE:

VCO_PICAXE (08M): On startup this listens for note value and then blasts out a long note of this frequency.

VCFandVCA_PICAXE (08M): This receives note 'duration' and 'voice' value from the master PICAXE. It then manipulates the PWM signal and the filter outputs and generates the necessary FEG and AEG 'envelopes'.

<b> Polyphony </b>
In theory the two 08Ms could form a 'module'. There could be, say, 4 or even 8 (!!) of these modules. The master PICAXE detects key-press information from a keyboard (or just reads an internal 'score') and then assigns the next free module the task of playing the required note.


Edited by - Jeremy Leach on 02/05/2006 17:35:49
 

hippy

Ex-Staff (retired)
Here's a very simple analogue synth which may well lend itself to being controlled by a PICAXE and the ideas may point the way to how a PICAXE could be used ...

http://www.musicfromouterspace.com/analogsynth/YOUR_FIRST_SYNTH/YOUR_FIRST_SYNTH.html
 

Dippy

Moderator
I'd try it out jeremy.
In your VCA are you intending to use the FET as a voltage-controlled-resistor?
FETs in that 'zone' can be very sensitive to temperature and bias fluctuations.
If its not crucial then go for it.

P.S. Why have you called it 'virtual'? It looks pretty 'real' to me.
PPS. Say, I didn't see any elastic bands in this design? Tee Hee!
 

jodicalhon

New Member
Now I'm never going to finish my latest picaxe project! I'm going to have to make one of these first! So many projects, so little time...
 

Jeremy Leach

Senior Member
Thanks Hippy for that site - interesting. I've messed about with these things a little before and it's good fun.

Dippy - yes, it's basically a variable resistor. I suspected it might be a bit temperature dependent, but it isn't that critical. It's generating an envelope and the whole thing wouldn't be that precise.

I know what you mean about 'virtual' but what I was trying to imply was that it's a synth solution that tries to model the behaviour of standard analogue synth components but doesn't work in the same way. But I agree - it's not like I've modelled it purely in software.

Jo C - yes, my problem too : too many interesting ideas and not enough time ! This one comes behind experiments with variable capacitors, so not sure when I'll try it.
 

pbunyan

Member
hey, i built a really simple synth with a 28X. its just 2 potentiometers and a speaker. one pot adjusts pitch, one adjust pulse length for the sound command, and a second mode each pot controlls the pitch of an alternate sound pulse. its really simple, but fun.

anyway, i just though id let you share my idea for a custom keyboard. it would be simple to buy a cheap keyboard, and use the keyboard IC to make your own button grid, so you can have them in different custom button arrangements. then its a simple case of using keyin to gt the button code and do the right thing to the sound output. hope that helps.

(i just wish i had one or to 08M's so i could play around with the tune command, infinitely better than the sound command :))
 

BeanieBots

Moderator
Your controllable filter won't work as shown.
Remove the diode and switch the PICAXE connection between input and output to get the desired effect. That will then change the capacitive path between high and low impedance.
 

Jeremy Leach

Senior Member
Hi Beaniebots. I thought the controllable filter bit would work, even though I haven't seen it before. I did gloss over some detail though:

The order of the stages in my case is: VCO &gt; VCA &gt; VCF. The output of the VCA is level-shifted with the centre voltage at half-supply:

<code><pre><font size=2 face='Courier'>

+V ---------+------------
|
_|_
| |
| R |
| |
|___|
|
|| |
From ---||---+-----&gt; To VCF
VCA || |
_|_
| |
| R |
| |
|___|
|
|
GND --------+----------


</font></pre></code>


In the VCF, the output of the PICAXE, when low, adds the capacitor into the circuit. When the PICAXE output is high the diode prevents the capacitor from having any effect on the signal. Multiple PICAXE outputs add multiple capacitors in parallel.

As long as the input signal voltage to the VCF is above the forward voltage drop of the diode then I would have thought the capacitor would behave normally and act as a low-pass filter. Wouldn't it ??
 

BeanieBots

Moderator
No, absolutely not.
A capacitor is an AC device, your concept assumes a DC device.
(think about it, capacitor, diode AC....)
 

Dippy

Moderator
Jeremy, you've got a scope.
Try it and you'll see what BB means.

(Always best to breadboard before posting)
 

Jeremy Leach

Senior Member
Ah , Beaniebots ...I've been a prize plonker !! What's the emoticon for a blush ?!

It looked so simple , I'm embarrased at this simple mistake. I've put a note by the original VCF diagram above.

So, it's back to the drawing board on the VCF bit. Were you offering an alternative solution ,If so I didn't get it !

I'm after a SIMPLE alternative VCF idea if possible. Minimal components, so there's a chance of being able to make multiple modules. Any ideas anyone?



Edited by - Jeremy Leach on 02/05/2006 17:42:01
 

BeanieBots

Moderator
Yes, I did offer a solution.
I'm not proposing that it is a good solution or one that is ideally suited to PICAXE but if you desire to follow the path of changing the AC impedance of a circuit without extra hardware, then this will do it:-
(I don't do ASCII art)
Signal feeds into resistor.
Capacitor connected between other end of resistor and IO pin on PICAXE.
Signal should be DC biased to Vcc/2 and not exceed +/- Vcc/2 peak modulation.
When the PICAXE IO pin is set as an input, it &quot;looks like&quot; a high impedance (as long as the signal conditions above are met) and so the capacitor plays no part.
When set as output, it looks similar to a resitance of a few hundred ohms.
It does not matter if the output is high or low because the the capacitor will remove any DC bias.
To get better linearity, the output should be loaded slightly but don't forget that any load impedance will be &quot;seen&quot; as being in parallel with the IO output impedance and must be taken into account with your frequency cut-off calculations.

As suggested by Dippy, knock it up and put your 'scope on it. Then you will see what is going on. Pay attention to what happens as signal modulation level increases.

You can use the same principle for your VCF.
All you need to do is add the non PICAXE end of the capacitor to any part of the reactive feedback path in your oscillator to change its frequency. (one step per PICAXE IO).

Your voltage controlled gain is close but will suffer greatly from temperature and bias as already mentioned by Dippy.
You can minimise the effect by putting a fairly low value resistor between the FET and ground and keeping a DC bias current flowing through the FET. That way, any undesired bias change or temperature related gain change will cause a change in net current and hence the bias voltage on the FET will to some degree self regulate.
Unfortunatley, that will also affect your AC gain. To reduce that effect, you will need a large capacitor across the resistor you have just added. (maybe 100uF or so). Now of course, the AC gain is so high it could become unstable, but that is easily cured by adding a low value resistor in series with the cap (about 1/3 of the value of the first resistor added).

Well... would you beleive it, we're beginning to design a voltage controlled amplifier!

Get your 'scope out and try these things, sit back and think about what is going on. Add a few components that you think might correct whatever undesired effect you see, then add another one to get rid of the undesired effect that the last change introduced and before long you will a circuit that does what you want....
Have fun.

Edited by - beaniebots on 02/05/2006 18:25:25
 

Jeremy Leach

Senior Member
Beaniebots, you're a genius. I hadn't thought of changing the status of an IO pin between input and output. There's a lot to experiment with and I will try these things out when I get some time.

I'm not aiming at a perfect solution, but something that will work and give an acceptable/interesting result. I really like the idea of trying a polyphonic solution too. I've already got keyboards that are brilliant and I can never match these, but it's the interest factor in creating a system myself. 25 years ago (!) I made a keyboard with an oscillator per key (square wave, top octave divided down). It had so much wiring and sounded like there was a bee-hive in the background!


Actually, the idea to change the status of IO pins during execution could be really useful. I've got another idea I'll put in another topic...

Anyway, thanks again for that.
 
Top