SM-8 Univox Sound Master 1 Drum Machine MIDI triggering and Mods

Started by thedefog, August 07, 2011, 11:54:50 PM

Previous topic - Next topic

thedefog

I know this isn't exactly an effect stomp box, but it was intended as a companion for guitar players, so I figured I'd give it a shot and share.

So my goal for this guy is that I wanted to remove the built-in preset beats chip, add midi triggering in place, add Pitch and Decay mods for the snare and kick section, and also add in mix controls for it. So far, I have gotten an arduino in combination with a 6n138 OptoIsolator chip to trigger 5v pulses running to where the LM8972 used to do the work. That tested out perfectly and works well. I then added decay mods for the Kick and Snare by running 10k pots from the 22k resistors going to the positive rail off of the transistor. That also worked like a charm.

Where I'm scratching my head here is what needs to be done to adjust the pitch of the Kick and Snare. Also, I'm debating on how to control the individual volumes. Since there is a single white-noise generator for the Open Hat, Closed Hat, and Snare sounds, all three of them will be controlled with a single pot which is running it place where the trimmer used to be to control that. But I'm wondering if there is a better method for the volumes of the kick/snare/clav/etc. Would running a pot between the trigger output from the Arduino and gnd work as a velocity/volume control? I haven't tested that out yet, but I wanted to pick the brains here first to see if it there is a better method first.

Here is my really crappy temp layout I did. I built it on perf based on this wiring, but didn't follow this layout (mounted the chip horizontally instead). I used the Midi2CV converter by Ray Wilson as a reference running the 6n138 to the arduino.


Here is the schematic for the SM8:


And some pictures of it:









thedefog

Here is the Arduino Code. BTW, I picked up one of these on eBay for like $40, so it's a steal of a deal with some great drum sounds in it. I'm assuming this triggering method would work for many other old stand-alone non sequencing type drum machines as well.

/*
* MIDI Drum Kit
* -------------
* Convert Arduino to a MIDI controller using various inputs and
* the serial port as a MIDI output.
*
* This sketch is set up to send General MIDI (GM) drum notes
* on MIDI channel 1, but it can be easily reconfigured for other
* notes and channels
*
* It uses switch inputs to send MIDI notes of a fixed velocity with
* note on time determined by duration of keypress and it uses
* piezo buzzer elements as inputs to send MIDI notes of a varying velocity
* & duration, depending on forced of impulse imparted to piezo sensor.
*
* To send MIDI, attach a MIDI out jack (female DIN-5) to Arduino.
* DIN-5 pinout is:                               _____
*    pin 2 - Gnd                                /     \
*    pin 4 - 220 ohm resistor to +5V           | 3   1 |  MIDI jack
*    pin 5 - Arduino D1 (TX)                   |  5 4  |
*    all other pins - unconnected               \__2__/
* On my midi jack, the color of the wires for the pins are:
*   3 = n/c
*   5 = black  (blue)
*   2 = red    (red)
*   4 = orange (yellow)
*   1 = brown

Pin 0 - Pin 6 of Opto
GND - Pin 8 of Opto
Pin 5 Arduino TX - Pin 5 Midi Jack off of 200ohm Resistor and Pin 2 of Opto

*
* Based off of Tom Igoe's work at:
*    http://itp.nyu.edu/physcomp/Labs/MIDIOutput
*
* Created 25 October 2006
* copyleft 2006 Tod E. Kurt <tod@todbot.com
* http://todbot.com/
*
* Updates:
* - 2 May 2009 - fixed noteOn() and noteOff()
*
*/

// what midi channel we're sending on
// ranges from 0-15
#define drumchan           1

// general midi drum notes
#define note_bassdrum     60
#define note_snaredrum    61
#define note_hihatclosed  62
#define note_hihatopen    63
#define note_click        64
#define note_tom1         65
#define note_tom2         66
#define note_extra1       67
#define note_extra2       68
#define note_extra3       69
#define note_extra4       70
#define note_extra5       71

// define the pins we use
#define switchAPin 1
#define switchBPin 2
#define switchCPin 3
#define switchDPin 4
#define switchEPin 5
#define switchFPin 6
#define switchGPin 7
#define switchHPin 8
#define switchIPin 9
#define switchJPin 10
#define switchKPin 11
#define switchLPin 12

#define ledPin     13  // for midi out status

int switchAState = LOW;
int switchBState = LOW;
int switchCState = LOW;
int switchDState = LOW;
int switchEState = LOW;
int switchFState = LOW;
int switchGState = LOW;
int switchHState = LOW;
int switchIState = LOW;
int switchJState = LOW;
int switchKState = LOW;
int switchLState = LOW;
int currentSwitchState = LOW;

int val,t;

void setup() {
  pinMode(switchAPin, INPUT);
  pinMode(switchBPin, INPUT);
  pinMode(switchCPin, INPUT);
  pinMode(switchDPin, INPUT);
  pinMode(switchEPin, INPUT);
  pinMode(switchFPin, INPUT);
  pinMode(switchGPin, INPUT); 
  pinMode(switchHPin, INPUT);
  pinMode(switchIPin, INPUT);
  pinMode(switchJPin, INPUT);
  pinMode(switchKPin, INPUT);
  pinMode(switchLPin, INPUT);
  digitalWrite(switchAPin, HIGH);  // turn on internal pullup
  digitalWrite(switchBPin, HIGH);  // turn on internal pullup
  digitalWrite(switchCPin, HIGH);  // turn on internal pullup
  digitalWrite(switchDPin, HIGH);  // turn on internal pullup 
  digitalWrite(switchEPin, HIGH);  // turn on internal pullup
  digitalWrite(switchFPin, HIGH);
  digitalWrite(switchGPin, HIGH);
  digitalWrite(switchHPin, HIGH);  // turn on internal pullup
  digitalWrite(switchIPin, HIGH);  // turn on internal pullup 
  digitalWrite(switchJPin, HIGH);  // turn on internal pullup
  digitalWrite(switchKPin, HIGH);
  digitalWrite(switchLPin, HIGH);
  pinMode(ledPin, OUTPUT);
  Serial.begin(31250);   // set MIDI baud rate
}

void loop() {
  // deal with switchA
  currentSwitchState = digitalRead(switchAPin);
  if( currentSwitchState == LOW && switchAState == HIGH ) // push
    noteOn(drumchan,  note_bassdrum, 100);
  if( currentSwitchState == HIGH && switchAState == LOW ) // release
    noteOff(drumchan, note_bassdrum, 0);
  switchAState = currentSwitchState;

  // deal with switchB
  currentSwitchState = digitalRead(switchBPin);
  if( currentSwitchState == LOW && switchBState == HIGH ) // push
    noteOn(drumchan,  note_snaredrum, 100);
  if( currentSwitchState == HIGH && switchBState == LOW ) // release
    noteOff(drumchan, note_snaredrum, 0);
  switchBState = currentSwitchState;

  // deal with switchC
  currentSwitchState = digitalRead(switchCPin);
  if( currentSwitchState == LOW && switchCState == HIGH ) // push
    noteOn(drumchan,  note_hihatclosed, 100);
  if( currentSwitchState == HIGH && switchCState == LOW ) // release
    noteOff(drumchan, note_hihatclosed, 0);
  switchCState = currentSwitchState;

  // deal with switchD
  currentSwitchState = digitalRead(switchDPin);
  if( currentSwitchState == LOW && switchDState == HIGH ) // push
    noteOn(drumchan,  note_hihatopen, 100);
  if( currentSwitchState == HIGH && switchDState == LOW ) // release
    noteOff(drumchan, note_hihatopen, 0);
  switchDState = currentSwitchState;
 
    // deal with switchE
  currentSwitchState = digitalRead(switchEPin);
  if( currentSwitchState == LOW && switchEState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchEState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchEState = currentSwitchState;
 
  // deal with switchF
  currentSwitchState = digitalRead(switchFPin);
  if( currentSwitchState == LOW && switchFState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchFState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchFState = currentSwitchState;
 
// deal with switchG
  currentSwitchState = digitalRead(switchGPin);
  if( currentSwitchState == LOW && switchGState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchGState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchGState = currentSwitchState;
 
  // deal with switchH
  currentSwitchState = digitalRead(switchHPin);
  if( currentSwitchState == LOW && switchHState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchHState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchHState = currentSwitchState;
 
  // deal with switchI
  currentSwitchState = digitalRead(switchIPin);
  if( currentSwitchState == LOW && switchIState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchIState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchIState = currentSwitchState;
 
  // deal with switchJ
  currentSwitchState = digitalRead(switchJPin);
  if( currentSwitchState == LOW && switchJState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchJState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchJState = currentSwitchState;
 
  // deal with switchK
  currentSwitchState = digitalRead(switchKPin);
  if( currentSwitchState == LOW && switchKState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchKState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchKState = currentSwitchState;
 
  // deal with switchL
  currentSwitchState = digitalRead(switchLPin);
  if( currentSwitchState == LOW && switchLState == HIGH ) // push
    noteOn(drumchan,  note_click, 100);
  if( currentSwitchState == HIGH && switchLState == LOW ) // release
    noteOff(drumchan, note_click, 0);
  switchLState = currentSwitchState;
}
// Send a MIDI note-on message.  Like pressing a piano key
// channel ranges from 0-15
void noteOn(byte channel, byte note, byte velocity) {
  midiMsg( (0x90 | channel), note, velocity);
}

// Send a MIDI note-off message.  Like releasing a piano key
void noteOff(byte channel, byte note, byte velocity) {
  midiMsg( (0x80 | channel), note, velocity);
}

// Send a general MIDI message
void midiMsg(byte cmd, byte data1, byte data2) {
  digitalWrite(ledPin,HIGH);  // indicate we're sending MIDI data
  Serial.print(cmd, BYTE);
  Serial.print(data1, BYTE);
  Serial.print(data2, BYTE);
  digitalWrite(ledPin,LOW);
}

Thomeeque

 

Other resistors around could be used for pitch adjust too. For more dramatic frequency change you may need to change capacitors. You could add more drums, just duplicate e.g. bass drum sub-circuit with different set of capacitors.

Other possibility to alter volume is to replace 22k in collector by pot and take signal from it's central lug. Or you could adjust 220k in mix branch, but it would slightly alter color as RC pair in these branches forms high-pass filter (depends on how much you wish to be able to alter the individual volumes), especially with cymbal/hi-hat.

You could go even stereo if you would double output mixer..

Btw. snare and cymbal/hi-hat volumes could be controlled independently..

And, open hi-hat? Where?

T.

Do you have a technical question? Please don't send private messages, use the FORUM!

thedefog

Quote from: Thomeeque on August 08, 2011, 07:45:55 AM

And, open hi-hat? Where?

Thanks for helping me out!

Ah, I just started calling it that. It's the one labeled "cymbal", but it sounds like a nintendo hi-hat... Just a big blast of white noise.

Thanks for the insight on volume and pitch control. I figured it was one of those 22ks in the cap chain there., but I wasn't sure if I'd have to change the cap value also or if I'd be able to get away with just altering the value. I'll implement these tonight and see if I can get it going.

thedefog

uGGGhh.. Is it just me, or does this scenerio happen with anyone else here - So, just as I'm about to cross the finish line with the new mods installed, the white-noise triggering stops working. This seems to happen way too often with projects. And of course this one uses those fossilized Roland 2SCblahblahblah transistors, so it'll be a pain if I have to source and replace any of them.

Anyway, I can touch the diodes near and around the noise section and I hear it working, so it has to be something in the actual triggering section. Spent an hour testing diodes and checking wire and solder joints to no avail last night. Something shorted out on it. At least it's all discrete.

thedefog

Still trying to debug this. I've replaced all of the transistors in the noise section with 2n3904s (bending pins to match 2sc536f) and it didn't restore the noise section. I'm thinking it has to do with the 200mH inductor maybe? How would I test that to see if it is bad? I've never worked on anything that has had one. Thanks.

Thomeeque

Quote from: thedefog on August 10, 2011, 10:07:36 AM
Anyway, I can touch the diodes near and around the noise section and I hear it working

So what exactly it does and what it does not?

Does SNARE still have it's noise part ("springs") or is it just bare drum sound now?

If you would take wire leading originally to pin 13 of LM8972 and touch VCC (or GND, I'm not sure about logic here), would you hear cymbal sound? Pin 15 - hi-hat?

If both answers are NO, have an audio probe and test signal at noise generator (middle lug of 10k trimpot or what is it now).

To quickly test inductor, you just measure it's resistance - it should conduct and have some non-zero resistance..

T.
Do you have a technical question? Please don't send private messages, use the FORUM!

thedefog

There is no noise at all. The snare is bare, The hat just has a very quiet resonant click to it, and the cymbal(HH) does similar, only quieter. I'll play around with the audio probe on it tonight and see what I can find. Thanks again for the info.

thedefog

Nothing on the noise section with the probe. The way I've been triggering the sounds to test is wih a wire from VCC to appropriate pad. Seems like the inductor is okay, passes continuity testing with a very small non-zero resistance.

thedefog

Got it working again. Traced it down to a bad noise transistor. Replaced it with a 3904 and back in business. Thanks for your help again Thomeeque.

thedefog

Just realized I uploaded the wrong code on here. DO NOT use that code for Midi In projects, it was meant for another midi OUT project I had done. Copied the wrong one.

thedefog


pigsnoot

Hello, very old topic....but ..I'm messing with this machine trying to add a trigger input....I've had some random success connecting a +5 pulse to the clock in lug of the IC....but It's not really steady
I'm also experiencing a very weak hihat/noise section, would like to get it louder....
Any help very appreciated!

anotherjim

That trigger method may not be giving enough time for a trigger pulse to the generators, and only those programmed to sound on the current step will be heard?
Probably better to override the rhythm chip as in the old thread - may not be necessary to take the chip out - depends on how it's outputs work.

There is a 10k preset to adjust white noise level for the snare/hats/cymbal sounds. The noise transistor might not be the best  - they often need selecting for the job. Supply voltage is also critical - consider 9v the minimum needed for good noise.