Jump to content


Please note: You can easily log in to MPN using your Facebook account!

First step to a CP4 Midi SysEx tool


Theo Verelst

Recommended Posts

To my knowledge, nobody in the whole world has created a Midi computer tool for the Yamaha CP4 (didn't check very recently, but there wasn't anything for a long time).

 

So I put some script tools for Linux (sorry about that) together, so people with Linux and Midi interface (maybe a simple Usb one with a Rasberry should do), or a little skills and Windows Cygwin or a Gnu compiler on Osx (I have no idea), can try this experiment, or at least it might give people with other needs than Linux the exact source example they need for a consumer program.

 

Anyhow, I wanted to know whether sysex worked over a traditional Midi connection (A Lexicon Omega connected to Fedora on a I7) because there's no Linux driver for the CP4 for Linux, so that mainly, that was my primary goal, I can set up a performance, change the main layer's sound, and force it to have insert effects I want (often the same one for one of them), without having to menu dive for minutes without end.

 

So here's the C program for Jack Midi (I had to try), and the script with minimal comments, probably self explanatory for computer savvy guys, of which there are some here:

 

midimes.c jmsendhex.tcl

 

both are small,and hey, nobody pays for this, so it's hobby code, alright ? Anyhow, there's no easy Midi interface for Tcl/Tk, so I use two (Linux) processes to copy to and from Midi interfaces.

The commands I use for achieving my purposes (could be put in a UI as a button or something):

 

pack [text .t]
pack [button .b -text doit -command doit]
proc doit {} {
  global mib ; set mib ""
  .t replace 0.0 end  $mib ; update
  sm "F0 43 20 7F 1A 0E 5F 00 F7"
  waitfor 2.0 ; .t replace 0.0 end  $mib
  update idletasks ; waitfor 0.5; 
  update idletasks;
  foreach k [split [.t get 0.0 end]  '\n'] { 
     if {[llength $k] > 1} { 
        if [string eq [string range $k 0 \
           [string length "F0 43 00 7F 1A 00 28 39 00 00"]] \
            "F0 43 00 7F 1A 00 28 39 00 00 "] { 
         sm "F0 43 00 7F 1A 00 28 39 00 00 0D 50 02\
                    00 00 00 00 01 00 06 00 08 00 1E 00 00\
                    00 3C 00 00 00 00 00 08 00 06 00 00 00\
                    07 00 00 00 00 00 00 00 00 01 00 41 F7" 
    } { sm $k}
     }
  }
}

So, that kills my (text) midi buffer (might want to put Mid clock off in util menu), sends a sesex request for edit buffer, records the reply, which I put in the screen visible text window, and then transmit back with a single changed bulk midi element, for insert effect B of layer one.

 

I also recorded all the performances by using the Yamaha midi spec, and an send them back to the Cp4, so that's alright, too.

 

http://www.theover.org/CP4/Editor/sc20171129211719.png

 

T.V.

Link to comment
Share on other sites



  • Replies 1
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...