Jump to content


Photo

New Tool (3.1) xRules

midi performance live coding

  • Please log in to reply
88 replies to this topic

#76 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6303 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 29 August 2016 - 16:29

I can insert MidiNotesToCC as FX plugin on the track or inside the plugin, not as a instrument

 

I think it's supposed to be an instrument. At least, this is how it shows up on my system. 

I downloaded the "complete" pizmidi_x64.zip bundle, using x64 builds for Windows, both plugin + Renoise - no sandboxing.


Tracking with Stuff. API wishlist | Soundcloud


#77 Akiz

Akiz

    Guruh Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPip
  • 966 posts
  • Gender:Male

Posted 29 August 2016 - 19:07

Ive unpacked the whole bundle and rescaned plugins.
Still didnt see Notes2cc in synth plugins just in fx plugins. When i selected it Renoise told me (didnt before) something like: "this plugin seems to be synth, restart renoise"
dont know what is going on but after restarting renoise its here and its working. 
Thanks again
 


Edited by Akiz, 29 August 2016 - 20:11.


#78 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 10 posts
  • Gender:Male

Posted 19 September 2016 - 21:50

I am an absolute beginner to xRules and lua.
I want to convert incoming MIDI-CC #20 to NRPN to control the cutoff of my Prophet VS.
The attached script is recognizing incoming MIDI-CC #20 and sending a proper NRPN string. But unfortunately I can't figure out how to pass resp. map the incoming MIDI-CC #20 value_2 to the NRPN MIDI-CC #6 value_2.
Can anybody help me?
Thanks a lot in advance.

Attached Files



#79 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6303 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 20 September 2016 - 13:30

I want to convert incoming MIDI-CC #20 to NRPN to control the cutoff of my Prophet VS.

 

I can see you're splitting the CC message into multiple messages, to create an NRPN message. 

 

I took a quick look, because the built-in NRPN message should be *way* more comfortable to use. 

But it seems that (and this is probably what threw you off), there is a need to define the following 

bit_depth = 14

(this really shouldn't be necessary but also won't hurt. In this particular case, it seems to make the NRPN message work as intended). 

 

So the way I'd suggest it would be like this (3 steps)

 

1. Define a 'call_function' that configures xRules to output 14-bit NRPN messages

message_type = 'nrpn'
bit_depth = 14

Of course, you could use the 'set_message_type' via the graphical UI too - the snippet above is basically just killing two birds with one stone. 

 

If you need to change, scale values somehow, this can be done as simply as adding the following statements to the code snippet above:

values[1] = 200          -- Number: set to fixed value
values[2] = values[2]*2  -- Data: increase by x2

Splitting into the MSB/LSB parts are done automatically on output. In other words, the message is turned into this kind of message:

-- ### build NRPN message
--  0xBX,0x63,0xYY  (X = Channel, Y = NRPN Number MSB)
--  0xBX,0x62,0xYY  (X = Channel, Y = NRPN Number LSB)
--  0xBX,0x06,0xYY  (X = Channel, Y = Data Entry MSB)
--  0xBX,0x26,0xYY  (X = Channel, Y = Data Entry LSB)

-- TODO optionally, when 'terminate_nrpn' is specified...
--  0xBX,0x65,0x7F  (X = Channel)
--  0xBX,0x64,0x7F  (X = Channel)

2. Define which output port to use ('set_port_name'). 

3. Define the output method ('output_message' -> 'external_midi')

 

Also, check if NRPN is enabled and that the desired output port has been enabled in Preferences > MIDI


  • j(b++) likes this

Tracking with Stuff. API wishlist | Soundcloud


#80 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 10 posts
  • Gender:Male

Posted 20 September 2016 - 20:04

Thanks a lot for your helpful advice!
The script is working perfectly. :)

Edited by j(b++), 20 September 2016 - 20:14.


#81 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 10 posts
  • Gender:Male

Posted 22 September 2016 - 20:32

I am not quite sure, but I think, that there's a little issue left in my use case.

It arises as soon as I want to modulate two parameters in an interleaved manner.

The Prophet VS expects NRPN as:
Select Parameter LSB (98dec)
Select Parameter MSB (99dec)
Data Entry LSB (38dec)
Data Entry MSB (06dec)

Because the script is transmitting MSB first instead of LSB first, I think the intended modulation is going to be a little messed up.

Ist there a way to swap MSB and LSB in NRPN Messages?

#82 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6303 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 23 September 2016 - 12:48

Ist there a way to swap MSB and LSB in NRPN Messages?

 

Sure, I'll make this a global option. Need to put out a new version anyway  :)


Tracking with Stuff. API wishlist | Soundcloud


#83 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6303 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 23 September 2016 - 15:57

Done.

 

Install the new version, then go to xRules options > MIDI and expand the NRPN panel to set the MSB/LSB order. 


  • j(b++) likes this

Tracking with Stuff. API wishlist | Soundcloud


#84 j(b++)

j(b++)

    Member

  • Normal Members
  • PipPip
  • 10 posts
  • Gender:Male

Posted 25 September 2016 - 16:56

Working as expected :)

#85 LamptonWorm

LamptonWorm

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 143 posts
  • Gender:Male

Posted 07 October 2016 - 09:05

Hi,

 

Is it possible to configure a simple on/off switch with xRules (with feedback)? For example,

 

IF CC = 20 THEN my_toggle = NOT my_toggle

IF my_toggle = 0 THEN don't light up ELSE light up

 

This is just for lighting up the launchpad - I'd CTRL+M CC #20 and map to say the on/off for a track effect, mute etc.

 

Cheers,

LW.



#86 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6303 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 07 October 2016 - 10:45

Sure, add this lua snippet before outputting/routing the message (select 'call function') 

-- run once: initialize our variable
if (type(cc_toggle)=="nil") then
  cc_toggle = false
end

-- respond to press, ignore release
if (values[1] == 20) then
  if (values[2] == 127) then
    cc_toggle = not cc_toggle
  end
  values[2] = cc_toggle and 127 or 0
end

  • LamptonWorm likes this

Tracking with Stuff. API wishlist | Soundcloud


#87 LamptonWorm

LamptonWorm

    Super Advanced Member

  • Normal Members
  • PipPipPipPip
  • 143 posts
  • Gender:Male

Posted 07 October 2016 - 10:47

Brilliant - will try this later, thanks *again* :)

 

Cheers,

LW.



#88 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6303 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 16 January 2017 - 01:50

A new release of xRules is ready, v0.79

FIXED xLib: automation class could produce glitchy values [bug]
FIXED xRules: comparison (string, number) could break due to missing cLib reference in sandbox [bug]
FIXED popup dialog titles
CHANGED log window gone (uses the scripting console instead)
FEATURE click toolbar to view source and documentation

It also contains two new rulesets

 

One I made for Athaphian (convert aftertouch to midi-cc)

http://forum.renoise...er/#entry354918

 

And one for LamptonWorm (visual feedback on launchpad)

http://forum.renoise...-row-behaviour/

 

Both are included with xRules (click Add > Locate file on disk > "examples" to find them)


  • ffx and kopias like this

Tracking with Stuff. API wishlist | Soundcloud


#89 kytdkut

kytdkut

    Member

  • Normal Members
  • PipPip
  • 41 posts
  • Gender:Male
  • Location:Buenos Aires

Posted 22 March 2017 - 23:17

Hey danoise thanks for this tool!

 

I did a ruleset to override some of renoise's default actions, kind of. A thing that bothered me about macros is that whenever I map certain macro to a knob, it would control that macro even if that instrument is not selected (this is expected), but if you map that knob to a vst parameter using the vst's mapping functionality (if any) it would only work when the instrument containing the vst is selected (also expected).

 

What I did with your tool is mapping the knobs of my controller to the selected instrument's macros :D this is a think I've been looking for a long time. Oh, and also mapping program changes to selected_instrument_index.

 

-----------------------------------------------------------
-- Ruleset definition for xRules
-- More info @ http://www.renoise.com/tools/xrules
-----------------------------------------------------------
return {
osc_enabled = false,
manage_voices = false,
description = "",
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "Input",
  ["actions"] = {
      {
          ["route_message"] = "Current Ruleset:➜ Notes",
      },
      {
          ["route_message"] = "Current Ruleset:➜ CC",
      },
      {
          ["route_message"] = "Current Ruleset:➜ Macros",
      },
      {
          ["route_message"] = "Current Ruleset:➜ Instr. Selection",
      },
  },
  ["conditions"] = {},
  ["match_any"] = true,
  ["midi_enabled"] = true,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ Notes",
  ["actions"] = {
      {
          ["output_message"] = "internal_raw",
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "note_on",
          },
      },
      {
          2,
      },
      {
          ["message_type"] = {
              ["equal_to"] = "note_off",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ CC",
  ["actions"] = {
      {
          ["output_message"] = "internal_raw",
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "controller_change",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ Macros",
  ["actions"] = {
      {
          ["call_function"] = "renoise.song().selected_instrument:macro(value_1 - 20).value = math.min(1.0, math.max(value_2/127, 0.0))",
      },
      {
          ["output_message"] = 1,
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "controller_change",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
},
{
  ["osc_pattern"] = {
      ["pattern_in"] = "",
      ["pattern_out"] = "",
  },
  ["name"] = "➜ Instr. Selection",
  ["actions"] = {
      {
          ["call_function"] = "renoise.song().selected_instrument_index = values[1]+1",
      },
      {
          ["output_message"] = "internal_auto",
      },
  },
  ["conditions"] = {
      {
          ["message_type"] = {
              ["equal_to"] = "program_change",
          },
      },
  },
  ["match_any"] = true,
  ["midi_enabled"] = false,
}
}

(I don't know how to fold code snipets, sorry for the long post)


I will be slowly adding stuff to this ruleset. In the meantime I would like to know if someone uses this tool to add similar functionality to renoise.


Chau!







Also tagged with one or more of these keywords: midi, performance, live coding