User avatar
flozki
Posts: 583
Joined: Fri May 19, 2006 4:40 am
Location: switzerland
Contact:

FLopen_midi, the flozki open source Midi remote for lathes

Post: # 24298Unread post flozki
Sat Mar 23, 2013 5:05 pm

Hello
while waiting for some glue drying on cutterheadrepair i did a quick&dirty
midi remote control.
open source as i promised. i used an arduino and some other parts.

it works on Midi channel 1 and uses 4 notes starting from C3 on upwards.
it sets the pin to ground for 100ms. I also have a status LED for each command. which i guess can be removed.
only for testing. most pitch controllers anyway indicate a pressed button.

START=PIN2 and START LED=PIN3= Midi note "C3" =36
STOP =PIN4 and START LED=PIN5= Midi note "C3" =37
FAST =PIN6 and START LED=PIN7= Midi note "D" =38
MARK =PIN8 and START LED=PIN9= Midi note "D*" =39

you need
any kind of arduino board
a 5pin din socket
a 6N139 optocoupler or anything similar
a 220 ohm resistor
a 1k resistor
a small breadboard or a arduino shield
some cables
30 min of time

how to connect the optocoupler check here
http://www.google.ch/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&docid=y3Az0M1AnWqpiM&tbnid=d2Y3wrAQRFq17M:&ved=0CAUQjRw&url=http%3A%2F%2Fwww.instructables.com%2Fid%2FMIDI-Tester%2Fstep2%2FSchematic-diagram%2F&ei=5uxNUYO6L4TfPZmkgIAB&bvm=bv.44158598,d.ZGU&psig=AFQjCNEUQFyrFmhKrJgA_hgOMBsDojwDIA&ust=1364147744852263

on the picture you can see an empty 8pin socket. i later on will use a ATiny or a pic controller instead of the arduino.
but for someone who wants to just play around and build it quick i guess the arduino is great.

Image

here you can find the arduino sketch. it will work with any arduino board. make sure pin2 (RX) is disconnected for uploading the sketch.

happy bricolage.
f.

Code: Select all

/* Midi to Lathe V0.1 flo@floka.com
 *midi in is  based on code done by kuki 
 * 
 * ----------------- 
 * listen for midi serial data, and light leds for individual notes and set coresponding output to ground 
 
 
 Function:
 this is a midi remote for (neumann lathes)
 listen to midi serial data
 if one of the four  Notes for START,STOP,FAST, MARK is recieved the output and its led is set for 100ms
 START=36="C3"=OUTPUT2=LED3
 STOP=38="D3" =OUTPUT4=LED5
 FAST=40="E3"=OUTPUT6=LED7
 MARK=41="G3"=OUTPUT8=LED9
 
 we dont wait for note off. just set the output for 100ms
 IMPORTANT:
 your arduino might not start if it receives data directly after a reset, because the bootloader thinks you want to uplad a new progam.
 you might need to unplug the midi-hardware until the board is running your program. that is when that statusLed turns on.
 
#####################################################################################################################################################
SOMETHING ABOUT MIDI MESSAGES
 midi messages start with one status byte followed by 1 _or_ 2 data bytes, depending on the command
 
 example midi message: 144-36-100
   the status byte "144" tells us what to do. "144" means "note on".
   in this case the second bytes tells us which note to play (36=middle C) 
   the third byte is the velocity for that note (that is how powerful the note was struck= 100)
   
 example midi message: 128-36
   this message is a "note off" message (status byte = 128). it is followed by the note (data byte = 36)
   since "note off" messages don't need a velocity value (it's just OFF) there will be no third byte in this case
   NOTE: some midi keyboards will never send a "note off" message, but rather a "note on with zero velocity"
  
#####################################################################################################################################################

HARDWARE NOTE:
The Midi Socket is connected to arduino RX through an opto-isolator to invert the midi signal and seperate the circuits of individual instruments.
connect 4 outputs and 4 otional leds  to pin2-pin9 on your arduino.
Midi Channel1, 
START=PIN2 and START LED=PIN3= Midi note "C3" =36
STOP =PIN4 and START LED=PIN5= Midi note "Cis3" =37
FAST =PIN6 and START LED=PIN7= Midi note "D3" =38
MARK =PIN8 and START LED=PIN9= Midi note "Dis3" =39
####################################################################################################################################################

 
 */

//variables setup

byte incomingByte;
byte note;
byte velocity;


int statusLed = 13;   // select the pin for the LED
int action=2; //0 =note off ; 1=note on ; 2= nada


//setup: declaring iputs and outputs and begin serial 
void setup() {
  pinMode(statusLed,OUTPUT);   // declare the LED's pin as output
  pinMode(2,OUTPUT); 
  pinMode(3,OUTPUT);
  pinMode(4,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(7,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(9,OUTPUT);
  
  //start serial with midi baudrate 31250 or 38400 for debugging
  Serial.begin(31250);     

  digitalWrite(statusLed,HIGH);  
  digitalWrite(2,HIGH);  // set all ports high because inputs of pitch 
  digitalWrite(4,HIGH); // controller are low active. you might use
  digitalWrite(6,HIGH); //  optocouplers to prevent any ground loops or other troubles. 
  digitalWrite(8,HIGH); // in this case the outputs 2,4,6,8 must be inverted
}

//loop: wait for serial data, and interpret the message 
void loop () 
{
  if (Serial.available() > 0) 
  {
    incomingByte = Serial.read();// read the incoming byte:
    // wait for as status-byte, channel 1, note 
     if (incomingByte== 144)//144
        { // note on message starting starting
            action=1;
        }
     else if ( (action==1)&&(note==0) )
         { // if we received a "note on", we wait for the note (databyte)
            note=incomingByte;
         }
     else if ( (action==1)&&(note!=0) )
         { // we just read the velocity to be sure it is a regular midi note on sequence.an option could be to use the velocity to set lenght of the mark-time
            velocity=incomingByte;
            playNote(note);
            note=0;
            velocity=0;
            action=0;
          }
     else{
            //do nothing 
         }
  }
}



void playNote(byte note)
{ 
 //since we don't want to "play" all notes we wait for a note between 36 & 44
 if(note>=36 && note<44)
     {
       byte myPin=note-34; // to get a pin number between 2 and 9
       digitalWrite(myPin, 0); //low active key
       delay(100); // wait for 100ms key stroke
       digitalWrite(myPin, 1); //reset pin 
// this part is for led indication only can be removed 
      
        digitalWrite(myPin+1, 1); //set led
       delay(250);
       digitalWrite(myPin+1, 0);//led off
       delay(250);
     } 
}



User avatar
Nickou
Posts: 278
Joined: Mon Jun 01, 2009 1:09 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 24303Unread post Nickou
Sun Mar 24, 2013 5:50 am

Merci Flo !!!!!!!!!!

User avatar
JayDC
Posts: 849
Joined: Sat Jan 13, 2007 5:45 pm
Location: Philadelphia

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 25345Unread post JayDC
Sun May 12, 2013 11:32 am

sometimes you dream something, and it appears.. thanks flo..
generally its for reproduction.. but i like to play wif it sometimes.. :P

User avatar
flozki
Posts: 583
Joined: Fri May 19, 2006 4:40 am
Location: switzerland
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 25501Unread post flozki
Sat May 18, 2013 5:45 pm

didnt had the time to make the 8pin pic 12F675 or 683 version
but in the meantime a good friend of mine made a
mini-gnusbuino.

this is a 8pin atmel (ATTINY85) based arduino clone. 2 pins for the usb and 4 pins left for other stuff.
so theoretically you can go directly from usb to the 4 pins (start,stop,fast, mark)
so this interface costs you like $5 to build. ok you maybe need 4 additional relais and 4 fets to drive them
but i guess you can figure out that..

all programming goes via normal arduino software.

http://wiki.sgmk-ssam.ch/index.php/Babygnusbuino-v2

for the pitch98/13 i will make a
usb to I2C version. then i can control almost everything from the computer.
watch out for that. and in the meantime use the solution above.

User avatar
Nickou
Posts: 278
Joined: Mon Jun 01, 2009 1:09 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 25592Unread post Nickou
Fri May 24, 2013 4:26 am

[quote="flozki"

for the pitch98/13 i will make a
usb to I2C version. then i can control almost everything from the computer.
watch out for that. and in the meantime use the solution above.[/quote]

Very Cool ! , many thanks
It can be nice to have also a midi out with Midi start comming from the pitch controller to the DAW

User avatar
opcode66
Posts: 2700
Joined: Sun Nov 08, 2009 10:56 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 25596Unread post opcode66
Fri May 24, 2013 10:43 am

yeah, then it would be just like mine...
Cutting, Inventing & Innovating
Groove Graphics, VMS Halfnuts, MIDI Automation, Professional Stereo Feedback Cutterheads, and Pesto 1-D Cutterhead Clones
Cutterhead Repair: Recoiling, Cleaning, Cloning of Screws, Dampers & More
http://mantra.audio

User avatar
Nickou
Posts: 278
Joined: Mon Jun 01, 2009 1:09 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 25600Unread post Nickou
Fri May 24, 2013 1:09 pm

I ordered the chip to farnell , it costs 1.50 euro ! all less than 5 euros

Flo , we have to reasign the pins to make the code working with this chip .

is there other modifications to do ?
thks

User avatar
flozki
Posts: 583
Joined: Fri May 19, 2006 4:40 am
Location: switzerland
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 25609Unread post flozki
Sat May 25, 2013 3:18 pm

[quote]Very Cool ! , many thanks
It can be nice to have also a midi out with Midi start comming from the pitch controller to the DAW
[/quote]

no i dont think. why?
i dont see the advantage.
but there is i2c commands comming from the pitch. so you can have that translated to whatever. but. still why?

User avatar
Nickou
Posts: 278
Joined: Mon Jun 01, 2009 1:09 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 25630Unread post Nickou
Sun May 26, 2013 10:31 am

we can send from the DAW a start by midi , but this start is to begin to cut : we have before recording music the lead in time
So we have to think to add a kind of pre roll for the lead in time,

another solution is than the pitch controller send a midi start to the DAW at the end of the lead in time.
It will do the same thing , but we don t have to think to add pre roll ,.
also , lead in time are changing depending of the diameter , so it can be comfortable to have this start funcion at the end of the lead in time .

User avatar
dimi751
Posts: 266
Joined: Fri Sep 07, 2012 9:24 pm

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28530Unread post dimi751
Tue Jan 14, 2014 5:08 pm

Hi guys

I found this online maybe another midi
IN solution for your lathe.

Looks pretty cool, drives up to eight
Motors, motor has to be 1amp max.

Here's the link

https://www.tindie.com/products/hotchk155/midi-switcher/

Best

Dimi

User avatar
opcode66
Posts: 2700
Joined: Sun Nov 08, 2009 10:56 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28532Unread post opcode66
Tue Jan 14, 2014 6:11 pm

Or you can order the real thing... I've modified my design to also allow for control via different frequency tones. This allows for the use of my device without MIDI. Most high end DAW's do not support MIDI. But, do support you adding another track of audio in which you can copy and paste my provided tones to trigger the functions on the lathe.
http://deepgroovesmastering.com/store.aspx
Cutting, Inventing & Innovating
Groove Graphics, VMS Halfnuts, MIDI Automation, Professional Stereo Feedback Cutterheads, and Pesto 1-D Cutterhead Clones
Cutterhead Repair: Recoiling, Cleaning, Cloning of Screws, Dampers & More
http://mantra.audio

User avatar
THD
Posts: 33
Joined: Mon Oct 27, 2008 11:12 am
Location: Oslo, Norway

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28534Unread post THD
Tue Jan 14, 2014 7:31 pm

And if you don't want to blow $550 for a Midi kit, another option is this one for $69:

http://www.orgautomatech.com/epages/3b85d6ba-28b0-11e2-b53b-000d609a287c.sf/en_GB/?ObjectPath=/Shops/3b85d6ba-28b0-11e2-b53b-000d609a287c/Products/Midi2Org_32/SubProducts/Midi2Org_32-0001

If you mention it to the man who sell them, he'll program it for you (for free) so that you can get you Lathe to start the DAW too. I use this kit and are very happy with it. He got an even cheaper version (with 16 channels), but for the moment it's out of stock.

User avatar
opcode66
Posts: 2700
Joined: Sun Nov 08, 2009 10:56 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28616Unread post opcode66
Mon Jan 20, 2014 3:26 pm

Here is what you get for the $500 I'm asking. I'll let the reader decide if the value is there or not.

1. Fully and completely fabricated item that comes with a power supply.
2. Special cable with clearly marked leads that makes installation into the lathe a snap.
3. Inclusion of relays. The unit linked above doesn't have relays built onto the board. Only transistor arrays. You need to be switching the functions on the lathe via a relay.
4. Reacts to both Start and Stop impulses from the lathe. Will perform a start and a stop via MIDI as well as MMC for you DAW to start and stop automatically.
5. Separate LED indicator for each function so you know for sure things are working.
6. Easier to use in the sense that one note is mapped to one function regardless of octave. So, C1-C10 will perform the Time function, etc. So, you can use any C note. Not just one C note of one octave.
7. Can be used with either MIDI or Audio (frequency based control). DAWs like Sequoia don't support MIDI.
8. Fully tested on a real VMS70 before being sent to you.
9. Detailed instructions with pictures and troubleshooting guide.
10. Support from me. I actually own, operate, repair and modify a Neumann VMS70. The maker of the board listed above does not. I can assist with installation over the phone. The maker of the board listed above wouldn't even know where or how to integrate this into your cutting system.

Finally, I am open to negotiation. That is the list price....
Cutting, Inventing & Innovating
Groove Graphics, VMS Halfnuts, MIDI Automation, Professional Stereo Feedback Cutterheads, and Pesto 1-D Cutterhead Clones
Cutterhead Repair: Recoiling, Cleaning, Cloning of Screws, Dampers & More
http://mantra.audio

User avatar
stanislav
Posts: 26
Joined: Sun Jan 19, 2014 6:36 am

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28627Unread post stanislav
Mon Jan 20, 2014 4:36 pm

VMS70 beautiful machine!, Opcode, you can make a screenshot of the midi what you have in your computer?, I'm interested in

User avatar
opcode66
Posts: 2700
Joined: Sun Nov 08, 2009 10:56 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28628Unread post opcode66
Mon Jan 20, 2014 5:03 pm

Play the video above. You will see in my DAW (ProTools 10) that I have three tracks. From top of the screen to bottom: MIDI, Preview, Program. You can see a MIDI note between the two tracks on the one side that I'm cutting. That MIDI note triggers the Time function on the VMS 70 which puts the track spacer in.

Here is a screenshot from the video playback.
You do not have the required permissions to view the files attached to this post.
Cutting, Inventing & Innovating
Groove Graphics, VMS Halfnuts, MIDI Automation, Professional Stereo Feedback Cutterheads, and Pesto 1-D Cutterhead Clones
Cutterhead Repair: Recoiling, Cleaning, Cloning of Screws, Dampers & More
http://mantra.audio

User avatar
jtransition
Posts: 85
Joined: Fri Apr 18, 2008 7:39 am
Location: Saarf London

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28800Unread post jtransition
Thu Jan 30, 2014 7:49 am

opcode66 wrote:Or you can order the real thing... I've modified my design to also allow for control via different frequency tones. This allows for the use of my device without MIDI. Most high end DAW's do not support MIDI. But, do support you adding another track of audio in which you can copy and paste my provided tones to trigger the functions on the lathe.
http://deepgroovesmastering.com/store.aspx
Hello Opcode
It looks interesting but what frequencies can it react too?

Regards
Jason

User avatar
opcode66
Posts: 2700
Joined: Sun Nov 08, 2009 10:56 pm
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lath

Post: # 28803Unread post opcode66
Thu Jan 30, 2014 1:36 pm

Whatever frequency bands I program it to.
Cutting, Inventing & Innovating
Groove Graphics, VMS Halfnuts, MIDI Automation, Professional Stereo Feedback Cutterheads, and Pesto 1-D Cutterhead Clones
Cutterhead Repair: Recoiling, Cleaning, Cloning of Screws, Dampers & More
http://mantra.audio

User avatar
Mavis
Posts: 5
Joined: Tue Nov 28, 2023 4:53 am

Re: FLopen_midi, the flozki open source Midi remote for lathes

Post: # 64855Unread post Mavis
Tue May 14, 2024 11:14 am

Fantastic information in this thread

User avatar
flozki
Posts: 583
Joined: Fri May 19, 2006 4:40 am
Location: switzerland
Contact:

Re: FLopen_midi, the flozki open source Midi remote for lathes

Post: # 64862Unread post flozki
Wed May 15, 2024 3:43 am

haha.totally forgot that i linked it here. great
there is even a little pcb since a very long time. kind of standard for pitch98/13/18 installations. but due to optocouplers its useable almost everywhere.

Image

i think thats the code most use:
https://github.com/flokasonaudio/pitch/blob/main/midi2lathe_0518.ino

for pitch 98/13/18 users there is also a direct link to i2C bus possible.


happy cutting.

Post Reply