Showing posts with label modular. Show all posts
Showing posts with label modular. Show all posts

Wednesday, February 11, 2015

Four Quadrant Wave Multiplier / Ring Modulator with Distortion Feedback (Part 2)

This will just cover some of the pictures of the build of the last project:

http://lolofi.blogspot.com/2015/02/four-quadrant-wave-multiplier-ring.html


Stretch out the jack leads so they can be soldered to the board



This is the ground wire that is connected to all the jacks


Continue adding all the jacks. Notice here that I short the ground to switched side of the jacks. These will disconnect the ground to the 'tip' of the jack when a cable is plugged in.



Now the jacks are on I add the headers and the chip.


I solder the DPDT directly to the board by bending two of the connections. I also have the wires that I'll connect pushed through the other side and wound on onto these two terminals to give it a little more support. This will eventually be held in a metal front panel so i'm not that worried about it breaking off.


Below is how the eurorack header should be soldered on the underside.


Here are the completely populated boards. Ready to sound check.




The board is a little to big for a eurorack so i use a Dremel to cut it back.





Getting ready to construct the front panel



For getting the holes right on the front panel I take a sheet of paper and place it over the module. I then shine a light under it so that i can better see the where the jacks are aligned. I then mark each hole with a pen.






This will be my drill pattern that I can take to my metal sheets to drill. Front panels will be a different topic  i'll post later on.





Four Quadrant Wave Multiplier / Ring Modulator with Distortion Feedback (Part 1)

This has to be the one of the simplest and most useful modules I've built for my eurorack. The name makes it sound really complicated and I guess it could be if you built it from scratch but I'm using these Analog Devices AD633 chips that do it all for you.

Basic Operation

It simply multiplies two signals together and the '4 quadrants' come from the fact that it has both inverting and non inverting inputs for each channel. Therefore you get (X1 - X2) * (Y1 - Y2).  

This chip also has additional summing input (Z). You can mix another signal into the output of the multiplier or you can feed it back into its self. Always a crowd pleaser. 

So What Does it Really Do?

Like I said before this is really good utility module. It can do a lot of things depending on how you wire it. For example:
  • Voltage Controlled Amplifier
  • Tremelo
  • Ring Modulator
  • Wave Doubler (in Theory .. harder in practice)
  • Voltage Controlled Mixer (kinda.. this is a stretch)


Here is my basic circuit diagram. If you just want a basic Wave Multiplier then do this. You need a resistor, the AD633 and some switched jacks. The switched jacks ensure that 0 volts is going into the inputs if no signal is plugged in.

I wanted a little more interesting sound so I built this distortion feedback circuit that can be enabled with a DPDT switch. This overdrives the amplifier and provides clipping with the diodes.

Below is how the EuroRack Power header is to be wired.









This whole project can be built in a few hours for less than 50 USD. Here is the parts list:

   6 - S6/BB Mono Switched 3.5mm Jack Panel Mount Solder Tag (Euro Rack Sized)
   1 - AD633
   1 - Circuit Board - 2200 Holes - 160 x 115mm
   1 - Switch DPDT
   4 - Diodes
   1 - 10 Pin EuroRack Power Header


Here it is in operation

I first start using the Maths as a Envelope Generator and use the circuit as a VCA. Later on I increase the speed and it transitions from tremolo to ring modulation. Then you can use another LFO to subtract signals from each other to create beating frequencies. There is also some switching of the feedback switch to add gain and clipping (distortion). Enjoy and let me know what you think.

Next post will show more details on the build of the project.

Thursday, January 29, 2015

Building a Joystick Controller


Recycling old joysticks for synths.

I modified this old joystick controller to give me an X-Y control over some of my synth parameters. I use this a lot with my MS-20 where X controls High Pass and Y controls the lowpass. This project is super easy to build and these old joysticks are generally pretty cheap on ebay or thrift stores. 


Details:
  • IN - Any input signal. You can feed in straight DC signal or output from an LFO. You can even use it a just a simple attenuator since thats really all it its.
  • X- the x axis output
  • Y- the y axis output
  • B - Black button output
  • R - Red button output
Things needed:
  • An old analog joystick
  • 2 resistors
  • A small breakout box. (easy found at radio shack)
  • A soldering iron.
The operation of IN, X, and Y should be obvious. B and R are just like triggers. They send 0 volts out until the button is pressed and then emits what your receiving on the IN. This works pretty well but i need to replace the switches on mine. They are old and don't work so well.


Here is how to rewire it (the header on the right represents the striped end of the joystick controller):
  1. Cut off the connector end of the joystick and strip the wires out.
  2. Find the wire that will be your IN. This is usually a red wire and would have previously been wired to the power pins. You may need to use a volt meter to find this. The Power wire will be wired to one end of both of the joystick pots and the GND will be wired to the other end. Center pins of the pots are the outputs.
  3. Find the Ground wire. This one is usually black.
  4. In your breakout box start connecting the Ground wire is on the sleeves of all the jacks in your breakout box.
  5. Wire each jack's tip to the proper wire as shown above.
  6. I added two 100k Resistors to the inputs of each button (this could be anything really. I just had them laying around though 1k would be better i guess). These are solely to ensure that the IN does not go to ground for any reason when the buttons are pressed. Wire them as in the diagram below.

Mine looks like this:

The big green wire above connected to the resistors is  added by me  to bridge the IN wire back around to these resistors. The IN (red) wire is connected to one end of both potentiometers in the joystick controller.


That's pretty much it!. 


Here is how it sounds. Button pressing changes the pitch so that it sounds kinda like an arpeggiator. X and Y are connector the the CVs of the High and Low pass inputs.


Wednesday, January 28, 2015

BitCrushing with the Arduino

Now that I have the previous examples working fairly easily its time to do some more interesting effects with the Arduino due. Time to make a bit crusher! This blog will be all about downsampling the input signal in real time. This creates an effect called aliasing. Aliasing happens when then audio frequency being processed is below the Nyquist rate. It creates really grainy distorted sounds. I personally love this effect. I like digital effects that try to sound digital but hate digital effects that try to sound analog.


Here is the code:


#define MAX_ADC_RESOLUTION 12 void setup() { // Serial.begin(9600); REG_ADC_MR = (REG_ADC_MR & 0xFFF0FFFF) | 0x00020000; analogReadResolution(MAX_ADC_RESOLUTION); // analogWriteResolution(MAX_ADC_RESOLUTION); //adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX*2, 3); pinMode(ADC0,INPUT); pinMode(DAC0,OUTPUT); } void loop() { int value = sampleAndHold(analogRead(ADC0), lfo()); analogWrite(DAC0, value); } int i=0; int hold; int sampleAndHold(int input, int holdTime){ if(i==0){ hold=input; i++; }else if(i < holdTime){ i++; }else if(i >= holdTime){ i=0; } return hold; } int _lfo=0; int wait=0; int lfo(){ if(wait==0){ _lfo++; wait++; if(_lfo >= 500){ _lfo=0; } }else{ wait++; if(wait >= 1000){ wait=0; } } return _lfo; } Above a created a really simple sawtooth LFO to change the sample rate time. This controls the rate of the sampleAndHold function that basically stores and replays previous samples until the holdTime is reached. Once the holdTime is reached it samples again and will continue replaying the new sample. Here is what it sounds like:

Tuesday, January 27, 2015

Arduino Due Audio Tests


I have had this Arduino due for a while and have wanted to make a music project out of it. It has been hard to find any really good examples of using this thing for audio. I finally found these few sites that have helped me speed up the ADC conversions so they are good for audio.

http://forum.arduino.cc/index.php?topic=156849.0

http://www.djerickson.com/arduino/


So from those two posts I was able to build these two projects and I'm overall impressed with the results:


Simple Audio Delay with Feedback

Note that the ADC's only track ~0-3V and most audio signals go negative  (example: -1V to 1V). You will mostly likely need to add a DC offset to your input to avoid clipping the signal. (cutting off the lower half of the waveform). You can do this in many of different ways. I happen to have some modular synth gear and one module in particular is the MATHS by Make Noise. I use this to amplify and offset the input signal. In a later post I might build a circuit to perform the DC offset. They are very simple but right now I want to just do some simple tests without spending too much time if it sounds terrible. For now here is an image of a DC offset amplifier:






Here is the code to create a very simple audio delay with feedback using the Arduino Due. Not all of this code will run on other Arduino's as they might be to slow or not have enough memory and setting of the ADC registers is specific to this version.





#define MAX_ADC_RESOLUTION 12 #define L 20000 int array[L]; // audio buffer to store previous input levels. This makes the delay line. int p=0; int d=0; void setup() { Serial.begin(9600); REG_ADC_MR = (REG_ADC_MR & 0xFFF0FFFF) | 0x00020000; analogReadResolution(MAX_ADC_RESOLUTION); analogWriteResolution(MAX_ADC_RESOLUTION); adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX*2, 3); pinMode(ADC0,INPUT); pinMode(DAC0,OUTPUT); } void loop() { int value = analogRead(ADC0) + array[p]; analogWrite(DAC0, value); array[p++]=value>>1; // bit shift to fade out over time if(p > L) p=0; }
Here is an example of what it sounds like. Not bad but there is a lot of room for improvement. The noise is the first issue that needs to be addressed. I found that this comes from the delay line and I will most likely need to add some type of filter to overcome this.



If you take the loop function above and change it to just the following code then this will simply pass the signal through without modification. Notice that the signal output is much cleaner.






void loop() { int value = analogRead(ADC0); analogWrite(DAC0, value); }
In my next post I will try to clean this up. But for right now this at least gets me started.

LFO for CV Control 

The below application uses a potentiometer on A0 to control the speed of the LFO. One end of the pot is tied to the 3.3 V header, center is tied to A0, and the other end is tied to GND. This is just a test as this is a terrible CV controller since the output only goes to about 3 volts while most CV signals can get up to 10 volts. I may try to put an amplifier on the end to get the voltage to real CV levels.

 








#define MAX_ADC_RESOLUTION 12 void setup() { REG_ADC_MR = (REG_ADC_MR & 0xFFF0FFFF) | 0x00020000; analogReadResolution(MAX_ADC_RESOLUTION); adc_init(ADC, SystemCoreClock, ADC_FREQ_MAX*2, 3); pinMode(DAC0,OUTPUT); pinMode(ADC0,INPUT); } int i=0; void loop() { int val = analogRead(ADC0); analogWrite(DAC0, sinx(val)); } float sinx(int skip){ float x = (125.0*sin(2*PI*i/90000.0))+125.0; // 125.0 is my DC offset. You need to get the sine wave so it does not ever go negative or it will clip i=i+skip/125+1; // The 125 in this skip is arbitrary and not at all related to the dc offset. if(i >= 90000) i=0; return x; } Below is the board i use for these projects:
Arduino Due