Tuesday, October 27, 2009

RAM Music: The Audio Contortionist

Background and Overview
I have started working on what I am calling "RAM Music" after my previous exploration of EPROM Music. In many ways, this is an extension of EPROM Music, as it shares many traits. In particular, this idea of manipulating digital sound directly, without the need for pre-programmed parts, or anything that computes (such as a microcontroller).

What I love about projects like these is the physical nature of the setup - because all of the components are very simple parts, plenty of breadboarding must be done in order to get something work. And when something like this does work nicely, then it is a very satisfying experience. I can see this sort of idea being pushed quite a bit further, with multiple RAM loops that are synced together.

I am thinking of getting some PCBs made up, so that I can more easily use these circuits during performance without getting fearful of everything falling apart. If anyone is interested in getting hold of such a PCB (and perhaps related components), drop me a line.

The circuit can basically record a short section of sampled audio, from an external source (computer / guitar / microphone / whatever). This section of audio is stored in a RAM-based area of memory. The memory is constantly being played back in a loop (unless RECORD is activated). At any point in time, the user can "drop in" a new snippet or chunk of audio by clicking the record button. The input level for the analog to digital converter can be changed via a potentiometer. The sampling rate / speed of the circuit can be changed via a potentiometer. The loop itself can be made longer or shorter by adding or removing address lines from the address bus (up to 512KB). Manipulating the address lines can also hack up and granulate the audio.



How it Works
The circuit is made up of some basic components, as shown below:
• oscillator
• 2 x binary counters
• RAM
• analog to digital converter
• digital to analog converter
• 2 x potentiometers
• 1 x switch
• associated resistors and capacitors

As usual for many of my ideas, the cost of these items is not high at all.


(click to see a larger version)
(click to see a larger version)


Above, there is a basic representation of this circuit. The oscillator (the basic clocking mechanism that sets the sample rate for record and playback) is a 40106 inverter with a resistor / capacitor type configuration. The output of the oscillator is routed to the first binary counter, whereby the lower twelve address bits (A0 - A11) are generated.

The twelfth address bit also acts as a "carry count" for the second binary counter, which then generates the higher address bits (A12 - A18). Both binary counters are 4040 chips. All of these address lines make up the address bus, which is directly connected to the RAM chip (which is a 628512).

The RAM chip has an I/O bus, which means that the input pins are the same pins as the output pins. The I/O bus is eight bits wide. The RAM I/O is simultaneously connected to two places; the digital to analog portion of the circuit (the audio output), and the analog to digital portion of the circuit (the audio input).

There is a switch that switches the circuit to record mode. This is a push-type, normally-open switch. The default (not pushed) position of the switch is the playback mode.

The output pins of the analog to digital converter chip (an ADC801-type chip) are directly connected to the I/O bus of the RAM. When in playback mode, the chip select line of the analog to digital converter is set to deselect the chip, placing the output pins into a high impedance. This is so that the analog to digital output does not interfere with the RAM I/O bus, which is set to read mode.

As the binary counters count from 0 to 524287 (which equals 512 x 1024), each sample is read back from the RAM chip, and presented on the I/O bus, where the pins are in an output mode. Each sample is then sent to the digital to analog converter, which is simply a resistor network.

When in record mode, the chip select line of the analog to digital converter is set to select the chip, making the output pins present the results of the analog to digital conversion to the RAM on its I/O bus. As the RAM is set to write mode, it's I/O pins are set to input. As a result, the RAM samples / records the audio from the analog to digital converter. As the RAM's I/O bus is shared between the ADC and the DAC, the input is monitored on the output during recording.



Contorting the Audio
This circuit currently has a few ways to manipulate audio. These are:
• A record button allows the user to sample incoming audio to a RAM buffer
• A potentiometer sets the input level
• A potentiometer sets the sample rate / pitch for playback. The changing of sample rate can be recorded if desired, by physically changing the position of the pot during recording.
• The address lines A0 - A18 can be manipulated ie. moved around, removed, replaced, giving a wide range of effects such as stuttering, repeating and basic granulation.

Although this does not sound like heaps of manipulation, keep in mind that this circuit can absolutely mangle a sound beyond recognition. The ADC is running at its maximum speed, and as such the sample rate can be varied greatly for example.

Future additions may include additional RAM slots, synchronisation for other devices including EPROMs and more manipulation. Nonetheless, I am very happy with these initial results.




Photos




Video Example

21 comments:

Michael Una said...

Wow, that sounds great.

Dope Game Tom said...

Awesome! Looks so simple, but sounds like you're doing some neat tricks :D

Would be really easy to put under voltage control as well with a currant sink set-up on the 40106 oscillator.

Would it also be possible to replace the 4040s with counters that can count in forward & reverse? That would be ALOT of fun!

hotchk155 said...

genius!

Chad said...

Fantastic project. I would definitely be interested in some PCBs.

apophene [at] gmail {dot} com.

Jasonn said...

Awesome! Been looking to make something like this, do you have a schematic??

Unknown said...

Very cool; any chance you could send a schematic my way, or post? I'd love to play around with this.

Kevin Rowney said...

Really interesting. Sounds fun.

I'd be super-interested in schemas and/or eagle files for a board.

About how much in total price for all of the components?

Kevin

Kevin Rowney said...

Really interesting. Sounds fun.

I'd be super-interested in schemas and/or eagle files for a board.

About how much in total price for all of the components?

Kevin

Anonymous said...

hello... im really interested in something like this. it's kinda similar to an idea i had . please email me @ flashbangband a t yahoo d o t . c o . u k - >>> that would be cool x Cheers, Andy

Anonymous said...

What A/D and D/A are you using?

d said...

Sounds a lot like what Todd Bailey has done with the "Where The Party At?" 8-bit sampler/looper. http://www.narrat1ive.com

I don't know if he has any kits left, but a second version will be coming out in the future.

Sebastian Tomczak said...

@ anonymouse: ADC is a ADC802 IC, DAC is simply and 8bit r2r :)

Unknown said...

Awesome! I would be very interested in PCBs.... or at least schematics of some sort..... could you send me some?


justice0@brandeis.edu!!!
Justice McIsMyEmailAddress

Delan said...

Hi Sebastian, I'm currently taking a basic circuits physics course and for our final project I've been searching about for how to make an overdubbing loop pedal. Your looper would be perfect for this project, and if you wouldn't mind sharing the schematic, I'd really appreciate it! Unfortunately, this is the first experience I've had with circuits, so my understanding of RAM use is somewhat limited, but I'd love to take a look at this none the less--I guess it's sort of a necessity if I wanna make a loop pedal, huh?

My email is: delan_tai@berkeley.edu

Thanks for your time!

Delan said...

Hi Sebastian, I'm currently taking a basic circuits physics course and for our final project I've been searching about for how to make an overdubbing loop pedal. Your looper would be perfect for this project, and if you wouldn't mind sharing the schematic, I'd really appreciate it! Unfortunately, this is the first experience I've had with circuits, so my understanding of RAM use is somewhat limited, but I'd love to take a look at this none the less--I guess it's sort of a necessity if I wanna make a loop pedal, huh?

My email is: delan_tai@berkeley.edu

Thanks for your time!

Tokyo Witch said...

Hi,

This is really great I would love a pcb schematic or anything really to help me build my own.

thanks

miss.tokyo.witch (at) gmail dot com

Loris said...

hi Sebastian, your project and 'really interesting, it would be possible to have the pattern of ram music? Hello from pierpaolo.i@alice.it

Loris said...

hi Sebastian, your project and 'really interesting, it would be possible to have the schematic diagram of ram music?Thanks and hello from pierpaolo.i@alice.it

Anonymous said...

Hi! This project is really great, please could you send me the schematics? PNG format would be ideal.

philmore.mcbogus@gmail.com

digital potentiometer said...

Great work.I really admire you of what you have done.You are so brilliant.Keep up the good work.More power.

joshua said...

Fantastic!
Is there anyway you could provide me a schematic and/or any other information, I would be ever so grateful.

Thank you
Joshua

Shroyerj@azscience.org