Map A Midi Cc Without "learn"?

Hello.

I’m a total newbie when it comes to midi-related issues, so I’m puzzled by this. Let me start by describing my goal:
I have the native meta mixer device put on a certain track, and I want to assign a specific midi CC-parameter change to control the meta mixer device’s Input A -control.

My problem is that the controller I use (the free “Control” -app for iPad, gyro layout) sends a continuous stream of cc-parameters (cc0 - cc8). That seems to make it impossible to map a specific CC-parameter into a specific control.

What I hoped to find in renoise was a way to manually (not by midi learn) tell a control to listen to “this channel, this cc”. But I cannot find such method. There’s only the midi learn, which just won’t cut it in this case.

What am I missing here?

While the name cc implies a constant flow of data, the device should only transmit data when a change is made, otherwise, if you try using your program to control legacy midi hardware the cable will be clogged with data and the note event latency will be bad. Could this be fixed with an adjustment in the control software or indicate a problem with the touch calibration of your iPad?

Otherwise, I think there is a way to set up midi in the ctrl-p menus but it’s unfriendly…

It can’t really be the touch calibration, as on the layout I’m using the pad sends cc:s according to positional changes such as tilting, rolling etc. I’d guess the pad actually does update this info continuously, and the controller app blindly sends all info forward as a stream of cc data. Or it’s picking up really, really tiny accelerations.

Yes, I briefly skimmed through the available options, but could not find anything to help mapping specific cc:s by hand. It seems such a basic job I’m sure I’ve just missed something.

Analyzing the problem, I think what COULD help, is a way for me to send out a specific cc-change on a specific midi channel for the renoise midi learn -function. Then I’d just take over with the control. Too bad i don’t have any other midi capable hardware… I wonder if there’s some kind of software for that?

Or maybe I could go at this with Lua? Hmmm… Questions. Questions…

Ha. I found at least 1 way to solve my specific problem with this, using the old “Copy-paste-xml” thing.

Starting out, I had my meta mixer set up so that the Input A was already mapped to channel 0, cc8. (It seemed to always map this with learn). So I:
1)Focused the device
2)Copied it
3)Pasted it on my text-editor of choice
4)Found out that the set midimapping are stored with the device XML under each control.
5)Edited channel and CC info
6)Copied the xml back to clipboard
7)Pasted it back on the track dsps-area.

Worked.

If there’s a more humane way to set mapping by hand (channel and cc specifically), I’d be interested, though.

As far as i could see it, you can fetch and set the device propeties using the raw xml string through the API:

renoise.song().tracks[track].devices[device_no].active_preset_data

It doesn’t fetch the midimappings, but i suspect if you cram the midimappings XML snippet in the whole snippet for the specific parameter and send it to the device, it might swallow it anyway.

  
<midimappings><br>
    	<midimapping><br>
      	<mappingmode>Controllers</mappingmode><br>
      	<controllermode>Absolute 7 bit</controllermode><br>
      	<notemode>Trigger</notemode><br>
      	<channel>0</channel><br>
      	<ccnumberornote>1</ccnumberornote><br>
      	<min>0.0</min><br>
      	<max>1.0</max><br>
    	</midimapping><br>
  	</midimappings>  
  

It is just a matter of simply trying.

Tried on test pad, does not work. (Device with no mappings, pulled out data into terminal, copy-pasted into a new local string, added above definition to the position this info would be, pushed modified string back to device.)

I can set device values with this method, but this extra midi mapping-data has no effect. This I checked by doing the above and bringing up the midi mapping view with the list and the colored controls. → Sadly no mappings there.

A pity.
You did added the midi mapping directly underneath the actual control parameter that you wanted affected? the mapping is control related…

Yep. Could double check this one, but I’m quite sure I placed it exactly where it was when I did the copy-edit-paste xml shenanigan. Pity indeed, but was a good idea anyway! :D

I’m trying the same type of thing with mapping a Hydras Input, took a few minutes in vim to get the correct command on the clipboard, but when I try to add in a midi mapping on a hydra via scripting and the devices ‘active_preset_data’ I get this error:

[code][string "renoise.song():track(1):device(2).active_preset_data = “<?xml v…”]:1: unexpected symbol near ‘1.0’[/code
:(

EDIT lol joking. it seems to work via copy paste and via scripting, thanks to vV and topic starter! this is awesome.
What I did wrong: I don’t think anybody wants programming lessons 101 again from me but you can laugh. I had a “” string with “”"s in it. :)
Anyway KMaki, when doing this trick, you should keep in mind that Renoise will keep the setting on the MIDI bind screen called “Allow mapping the same Note/CC more than once” so if you already mapped a certain control it also won’t work no more.

Oh?! Damn, I must’ve misplaced something or had that tick box unchecked / whatnot. Wow, great If this works, awesome! Got to debug my act now. :D

EDIT:
Okay: What am I doing wrong here? I’ve got a Meta Mixer on track 1. I’ve got the “Allow mapping the same Note/CC more than once”. I have no mappings whatsoever. I then proceed to execute this:

  
local new_ddata=[[<?xml version="1.0" encoding="UTF-8"?>  
<filterdevicepreset doc_version="9"><br>
  <deviceslot type="MetaMixerDevice"><br>
    <ismaximized>true</ismaximized><br>
    <destscaling>Linear</destscaling><br>
    <destmin><br>
      <value>0.0</value><br>
    </destmin><br>
    <destmax><br>
      <value>1.0</value><br>
    </destmax><br>
    <inputa><br>
      <value>0.15</value><br>
      <midimappings><br>
        <midimapping><br>
          <mappingmode>Controllers</mappingmode><br>
          <controllermode>Absolute 7 bit</controllermode><br>
          <notemode>Trigger</notemode><br>
          <channel>0</channel><br>
          <ccnumberornote>1</ccnumberornote><br>
          <min>0.0</min><br>
          <max>1.0</max><br>
        </midimapping><br>
      </midimappings><br>
    </inputa><br>
    <inputb><br>
      <value>0.0</value><br>
    </inputb><br>
    <inputc><br>
      <value>0.0</value><br>
    </inputc><br>
    <weighta><br>
      <value>0.5</value><br>
    </weighta><br>
    <weightb><br>
      <value>0.5</value><br>
    </weightb><br>
    <weightc><br>
      <value>0.5</value><br>
    </weightc><br>
  </deviceslot><br>
</filterdevicepreset>]]  
  
renoise.song():track(1):device(2).active_preset_data = new_ddata  
  
  

No mappings appear. The value changes to 0.15, though. Hmm.

Bump! C’mon Cas, what’s your secret? I can’t figure this out. :(

Alright alright.
What I’m thinking right now, without trying, is that

  • reaction to active_preset_data changes may be different in MMix device than Hydra
  • i had the final string that worked in 's (had no idea even of this [[]] thing)
  • i had zero newlines/enters in the string that worked

anyway hth

PS. so when I ‘debug’/experiment this kind of stuff it’s really handy to have a VIM instance in the background to do copy/edit/paste stuff, if you know how to work it a little bit, e.g. removing the enters in some code is as simple as JJJJJJJ

Can you post a working xrnx?
VIM is nice for Linux, but is not standard on Windows. And ofcourse, with tools like PSPAD, you can copy paste in hex-view mode, but there should be a more easy way to do this.

No. like I said, my music making machine is disconnected from the internet.

Yeah. Well I use it on windows too. gVIM. Fucking Awesome. :D

Aaaaanyway. I’ve done a little research on another PC. So for KMaki, I really hope this works, as I really cannot test it and don’t need it anymore myself… Also it’s easiest if you just save your Hydra(1) through (8) with these MIDIbinds as soon as you have them, I hope for you the midi binds are saved in an .xrnt, much easier. otherwise, you’ll probably be left with ‘notepad’ copy/paste options still.

to work with this example
first install the .xrnx
launch renoise with scripting tool (of course) and edit the main.lua file… on top is a XML piece starting with MidiMapping or MidiMappings or sth. Carefully (!) replace this with your own bindings. Now load the .xrns and test it. It should put a midi binding on the second hydra device if you launch the Tools menu option (“Switch it on em”) (I think it works, I only tried it on my computer with no midi hardware connected, but it did bind I guess since it hit the filters reso to 10x over its limit :D)
only thing you have to know is, “Switch it on em” is not a very well chosen name, since with lua code in renoise it seems you can bind stuff one time, but not rebind / remove a certain cc number.

3433 nl.jeweett.RenoiseDeviceXmlTest_Rns280_V1.xrnx
3434 renoise_device_xml_test.xrns

(help thing used while dev-ing)
3435 renoise_device_xml.txt

It’s a negative, sir. Nothing maps. Damn…

But thank you anyways for this, I appreciate you taking the time to work this out!