Project

Transmitting MIDI IN Note Data to MIDI OUT (?)

Started by Puzzlegob on .

Sign in or create an account to join the conversation.

12 posts

Topic starter
Hello,

This is my first post, and like most n00bs, I have an annoying question.

I want Lemur to take MIDI IN data from my X-Station controller keyboard (Note on, aftertouch, velocity ...) and transmit it out to my MKS-80 Synth Rack. I want Lemur to sit between the controller keyboard and the synth, to edit synth parameters.
I've tried simply assigning the iPad Midi (IN/Out) to lemur's MIDI 0: (In/Out), hoping that this would pass MIDI messages from the keyboard to the synth, but it doesn't seem to work. (Although the line6 MIDI interface lights up to indicate that it IS receiving MIDI messages)

I built a simple test interface, and I have had success in sending sysex messages from lemur to the MKS-80 (all of it's parameters are controlled by sysex rather than MIDI CCs) - But this MIDI problem mentioned above has me stumped. I've tried the search engine on the forum, and read the manual twice, but no luck.

Any help would be greatly appreciated!
Lemur does not pass MIDI data automatically from midi in to midi out. But you could try the following:
- Create a script triggered by an ON MIDI expression. Filter by MIDI message type (note, control change, etc.) and the midi port your keyboard is sending to.
- In the script the incoming midi data is received in the vector MIDI_ARGS (each array entry is one byte of the midi message).
- Manipulate, change or massage the midi message and send it out to port your MKS-80 is receiving midi data using the midiout(target,msg[]) command.
Hope that helps,
B.
bxsj wrote:Lemur does not pass MIDI data automatically from midi in to midi out. But you could try the following:
- Create a script triggered by an ON MIDI expression. Filter by MIDI message type (note, control change, etc.) and the midi port your keyboard is sending to.
- In the script the incoming midi data is received in the vector MIDI_ARGS (each array entry is one byte of the midi message).
- Manipulate, change or massage the midi message and send it out to port your MKS-80 is receiving midi data using the midiout(target,msg[]) command.
Hope that helps,
B.
Thank for pointing me in the right direction! This will also be useful for my next goal - Getting Lemurs knobs/sliders to update to reflect their parameters when cycling through banks/patches on the MKS-80. It's going to be a huge undertaking, but IF I manage to do it, it'll be a beautiful thing!
I would like to know how this MIDI_ARGS vector is defined. What is the sequence? Channel, type, value, or type, channel, value, or something else? How did those who know find it out? Trial and error? Or is there a documentation? I didn't find anything in the manual or at Jazzmutant sites or on the internet.
Z3B wrote:I'd love to know if you get that working - It'd be fantastic to see some working examples of lemur templates that update to reflect the software it's connected to...
I did get it working *kinda* a few days ago. It works about 50% of the time :?

When you change patches on the MKS-80, (depending on a few factors) it sends one or more sysex strings containing all the parameter values. My script just assigns these values (from MIDI_ARGS) to variables, and uses setexpression() to update the faders. Sometimes only *some* of the faders get updated, because when setexpression() sets a fader, lemur sends a message to the MKS-80, which in turn sends a separate sysex message from the MKS-80's MIDI OUT (to lemur's MIDI IN) - interrupting the original, long sysex string...

I will try and re-write the script to collect all the relevant sysex bytes from MIDI_ARGS, and send them to another defined array attached to a separate script that updates the faders etc. That way I can be sure that the 'collecting sysex data' part of the script isn't interupted by 100+ individual fader adjustments and their associated sysex messages...
rippin' I hope you get that going...

I'm rocking ableton, with the Lemur as the main control (and other generic midi controllers,) and would like Kapture Pad to be on my iPhone; but without my Lemur interface updating to reflect when Kapture changes something, It's impractical.

I'm an accomplished multimedia artist, but I've always been a hack with code languages. I've got some of these scripting tutorial templates from the liine site - it feels like lights are coming on in me head ;)

These are my first steps to understanding scripting, so hook me up (please) if you know answers.
Z3B wrote:rippin' I hope you get that going...

I'm rocking ableton, with the Lemur as the main control (and other generic midi controllers,) and would like Kapture Pad to be on my iPhone; but without my Lemur interface updating to reflect when Kapture changes something, It's impractical.

I'm an accomplished multimedia artist, but I've always been a hack with code languages. I've got some of these scripting tutorial templates from the liine site - it feels like lights are coming on in me head ;)

These are my first steps to understanding scripting, so hook me up (please) if you know answers.
I'm a hack coder too! This is my first lemur template, and there's been a lot of trial and error, revisiting the manual and analysing other people's projects to figure it all out!

I don't have any experience with Kapture, or writing Lemur templates that interact with Ableton, so I don't have any answers (sorry!)
The fader loop problem is a problem that I have worked on.
I solved it in the DSI Mopho template by setting a flag variable after input from the instrument.
That flag is checked by a single output function that sends the MIDI data out or not then it resets the flag.

Key here is having that one output function that filters stuff going back out.

I use a similar technique just to stop buttons/knobs that run a script 'on expression variable' when the values are initially loaded. Like in sections of config page changes or startup. Then the flag is cleared after one or two frames.
Another example is a button that does the same function but on different interface pages:
When you click it on/off we want the other interface buttons to show the current state.. so set the switch on the other pages using a script on all buttons.
The problem is since the script will try to set all of the other buttons which also are programmed to do the same we need to stop this recursion using up all the sweet Lemur CPU cycles.
So variable flags and checking before (or during) running the button scripts.

Have fun, this sysex stuff is complicated to setup and you've done great work so far. 8-) Keep us posted and I look forward to seeing what you do with the Moog filter stuff too!
cheers~
J
Puzzlegob wrote: Sometimes only *some* of the faders get updated, because when setexpression() sets a fader, lemur sends a message to the MKS-80, which in turn sends a separate sysex message from the MKS-80's MIDI OUT (to lemur's MIDI IN) - interrupting the original, long sysex string...

I will try and re-write the script to collect all the relevant sysex bytes from MIDI_ARGS, and send them to another defined array attached to a separate script that updates the faders etc. That way I can be sure that the 'collecting sysex data' part of the script isn't interupted by 100+ individual fader adjustments and their associated sysex messages...
analog604 wrote:The fader loop problem is a problem that I have worked on.
I solved it in the DSI Mopho template by setting a flag variable after input from the instrument.
That flag is checked by a single output function that sends the MIDI data out or not then it resets the flag.

Key here is having that one output function that filters stuff going back out.

I use a similar technique just to stop buttons/knobs that run a script 'on expression variable' when the values are initially loaded. Like in sections of config page changes or startup. Then the flag is cleared after one or two frames.
Another example is a button that does the same function but on different interface pages:
When you click it on/off we want the other interface buttons to show the current state.. so set the switch on the other pages using a script on all buttons.
The problem is since the script will try to set all of the other buttons which also are programmed to do the same we need to stop this recursion using up all the sweet Lemur CPU cycles.
So variable flags and checking before (or during) running the button scripts.

Have fun, this sysex stuff is complicated to setup and you've done great work so far. 8-) Keep us posted and I look forward to seeing what you do with the Moog filter stuff too!
cheers~
J
Thanks!

I'll download your template and look under her skirt and see how you've handled these MIDI-out flags.

I've put that sysex feature on hold and posted a 'Version 2' with some other features. It has a better GUI now, and can send/receive CC# to control the sysex-based parameters, (so I can now program automation in Ableton). I now have a method of controlling this great old synth that isn't cumbersome or riddled with bugs.