User Tools

Site Tools


scratchcontroller

Hi. I'm making a MIDI scratch controller.

The problem

MIDI DJ controllers generally come with “JOG” wheels, designed to allow the user to move through the track in a similar fashion to vinyl. These wheels are unfortunately nowhere near sensitive enough for scratching. In addition, the crossfaders included in such controllers are usually of low quality and/or too stiff to allow quick cutting.

The aim of this project is to build a MIDI controller that can be used by scratch DJs. This can be broken down into two main requirements :

  • A very high-resolution, accurate jog wheel
  • A smooth, reliable, high quality crossfader with curve control.

The solution

Crossfader

The crossfader is the simplest part of the project. There are a number of faders on the market specifically designed for scratch DJs. For example :

The analogue ins of the PIC mean the fader can be used with no additional circuitry. Hooray!

Jog Wheel

The jog wheel is slightly more complicated. After considering a number of options, I settled on an optical quadrature wheel design. This consists of two photodiodes spaced slightly apart, and a wheel with a pattern of slits round the circumference. By watching the slits go past the photodiodes, you can determine the speed and direction of the turning wheel. Wikipedia has a good page on this.

Old (ball) mice use this exact technique. Which is handy, because if you have any old mice lying around, you can harvest them for optical sensors and LEDs. This is what I did. You can rig up something out of individual photodiodes and an infrared LED if you prefer.

An optical encoder wheel can be made using a transparent acetate sheet and a laser printer.

I put the two photodiodes into two voltage dividers and wired them into pins 4 and 5 of the PIC. The comparators of a PIC18F4620 (or 4685) can be used to avoid extra circuitry.

Software

The MIOS code tracks the encoder wheel, and counts the number of forward and backward steps. Then every couple of milliseconds it sends the relative position as a CC event. The value of the CC is equal to 64 (0x40)plus/minus the number of steps, for example for 10 steps back the value would be 54 (0x36).

There are quite a few DJ applications that support MIDI scratching in this format, the two I've tried are Mixvibes DVS and Native Instruments Traktor 3. M-Audio Torq doesn't work as of the current version (1.0.6) as it has a bug in the MIDI code.

How To Build

This is how to build the device the way *I* did it. It's not pretty (see photos) but works acceptably. It could be improved upon immensely if you have any actual construction skills, metalwork experience, access to a CNC mill, etc.

Ingredients

You will need :

Electronics

  • A MIDIBox core module, or some derivative thereof (see schematics section)
  • A linear fader, preferably one designed for scratching
  • An Infrared LED. Can be obtained from an old ball mouse.
  • A Dual IR Photodiode (two closely-spaced photodiodes in the same package). Again, can be found in an old ball mouse.

Mechanics

  • An electrically conductive scratch wheel. Either spray a 7” vinyl with conductive paint, or cut a circle out of sheet metal.
  • A few felt slipmats stacked together for the wheel to slip on
  • An encoder wheel. Print one onto a transparent sheet (pdf to come soon), or CNC one out of opaque plastic.
  • An M8 brass bush, to hold the spindle in place
  • An M8 engineering stud, to connect the two wheels together, and to make contact with the bush.
  • Some M8 nuts and washers to hold everything in place
  • A case to put everything in.

Assembly

Here is the assembly diagram.

Notes/Hints :

  • There should be washers between the nuts and the scratch wheel.
  • Solder a wire to the brass bush (connects to “TOUCH SENSOR” in the schematic) - this enables the scratch wheel to act as a big capacitive touch sensor.
  • Glue the encoder wheel to a nut - then you can just screw it on to the bottom part of the stud.

Good Stuff

Code

Code can be found in this forum post.

Schematics

This schematic shows how to wire everything up to the PIC. Should be trivially adaptable to work with a “real” midibox core module.

Components

Here are the RS stock numbers for some of the necessary components.

  • 303-1013 - M8x40mm Engineering stud - £0.28 (min order 5)
  • 837-256 - Bag of 100 Hex steel pressed nut - £4.25
  • 689-170 - Bore reducing bush, 8mm ID - £3.32 (min order 2)
  • 503-650 - Grey standard ABS case, 250x200x65mm - £7.69
  • 568-483 - Nickel Conductive Spraypaint - £19.84

Photos

scratchcontroller.txt · Last modified: 2010/04/14 11:48 by nils