Friday, June 26, 2015

MIDI 3pedal for Pianoteq 5 (Metal case version)


I built a 3-pedal (RPU-3) to MIDI converter box for Pianoteq5 using Arduino nano. Functions are essentially the same as the converter box last built but, this time much smaller metal case, Takachi YM-100 (10cm x 3cm x 7cm) is used.

 
  


This is Roland RPU-3, pedal unit

    


This is Roland UM-ONE, MIDI to USB converter. UM-ONE USB OUT connect to PC.

 

 

Drilling holes

This is panel layout drawing. HSS drill bits (Three axis 21876) and Shinto mini hole saw 11mm, 12mm and 15mm. Scale is Shinwa 13005. Section paper is Kokuyo ホ-14B. 2.54mm pitch single-sided universal board is Picotec P-00517. Caliper (Tamiya 74030, not pictured) is used to measure diameter of connectors.


Boring holes using drilling machine (Proxxon Bench Drill Press TBM 115).




Soldering the circuit

Circuit diagram is the same as the previous build. see my previous post for detail.

My Soldering iron(Goot CX-40), solder(Almit KR-19RMA) and reverse-action tweezers (Goot TS-16 and Tamiya 74102).
Voltage regulator mounted on the universal board is TA4805S.  AC adapter is GF06-US09065A (9V 0.65A rated, not pictured).


Top view of circuit board. It looks clean.


Bottom view. looks messy...


This is the most messy part. 3-dimensional wiring of pull-down resistors. This is due to space limitation. If more space is available, circuit wiring is relaxed and bottom view looks better...


Creating harness


AWG22 wire(Kyowa UL3265 AWG22 7 colors) is used. Molex 5051 contact is crimped using Hozan P707. Faston 187 connector is crimped with Pro'sKit 6PK-230C. Insulated ring terminal is crimped with Pro'sKit 6PK-301H.







I use heat shrink tube (Sumitube F) to insulate MIDI terminal where soldered wire exposed



Preventing ground loops


There are wide variety of TRC connectors in the market but metal case prefers plastic screw connector to prevent unnecessary ground loop. I used polyimide tape to prevent accidental electrical contact with metal chassis and circuit board. Also spacers to mount universal board should be made of plastic not metal. I used solder-less ring terminal to connect metal chassis to circuit GND.









 This is King Jim Label Writer TEPRA. Used to create “Sustain Sostenuto Soft” and “DC9V” label.


Flashing software


Download Arduino Software from following website and install
https://www.arduino.cc/en/Main/Software

Connect Arduino to PC with USB cable. COM port to communicate PC to Arduino should show up in device manager.



Cut and paste the program to the editor window. Choose Arduino nano and communication port (In my case COM3. YMMV) and press upload button to flash the program onto Arduino.




This is Arduino program I flashed.


int gController[] = {64, 66, 67};
int gPrevValue[] = {0, 0, 0};
int gPort[] = {A0, A1, A2};

// the setup function runs once when you press reset or power the board
void setup() {
  // MIDI signal frequency=31250Hz
  Serial.begin(31250);

  // set AREF pin as A/D converter reference voltage input
  //analogReference(EXTERNAL);
}

// the loop function runs over and over again forever
void loop() {
  for (int i=0; i<3; ++i) {
    int sensorValue = analogRead(gPort[i]);
    int encoded127 = sensorValue / 8;
   
    if (gPrevValue[i] != encoded127) {
      gPrevValue[i] = encoded127;
      sendMidi(0xb0, gController[i], encoded127);
    }
  }
}

void sendMidi(int cmd, int secondByte, int thirdByte) {
  Serial.write(cmd);
  Serial.write(secondByte);
  Serial.write(thirdByte);
}


Power consumption measured



Power consumption = 0.4 Watt

Afterthoughts

It worked flawlessly.

I changed pedal position to MIDI value mapping curve so I must recalibrate pedal curve setting of  Pianoteq.

DC9V jack was too close to edge and interfered with chassis mount screw. Also MIDI DIN5pin connector must be rotate 90 degree not to interfere with faston 187 from TRC jack :)

YM-100 case is too small for this application and build difficulty increased by limited real estate. Circuit board must be mounted vertically to accommodate. TRC jack wiring looks busy. I recommend YM-150 (15cm x 4cm x 10cm) for more relaxed layout and easier build.