New Tool (3.1) xRules

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?

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 :slight_smile:

Done.

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

Working as expected :slight_smile:

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.

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

Brilliant - will try this later, thanks again :slight_smile:

Cheers,

LW.

A new release of xRulesis 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)

https://forum.renoise.com/t/aftertouch-cc-tracker/47241

And one for LamptonWorm (visual feedback on launchpad)

https://forum.renoise.com/t/duplex-launchpad-orig-top-row-behaviour/46781

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

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 :smiley: 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!

I am trying to integrate paramter automatization of my Bass Station II in renoise.

Some parameters like Filter Cutoff is implemented as 14 bit MIDI CC. (CC #16 dec. is MSB, CC #48 dec. is LSB).

The BS II sends both CCs of a value pair at the same time (in respect to the MIDI input monitor time stamp), so that renoise doesn’t record both of them.

Unfortunately the LSB is stored, so it’s not useful.

I want to convert a MIDI CC pair somehow, so useful information could be stored.

As far as I understand xRules support 14bit MIDI. How would a rule be defined that reacts on

14bit MIDI CC input whereas

MIDI CC #16 is MSB

MIDI CC#48 is LSB

Is it possible to store the LSB a little bit later in the pattern editor than the MSB while recording live?

Is it possible to store the LSB a little bit later in the pattern editor than the MSB while recording live?

well, “delaying” a value would be tricky … what to do when at a pattern boundary, for instance?

Perhaps better and cleaner would be to use xRules to record your 14-bit parameter as graphical automation (envelope)?

There is sufficient resolution in the envelopes to represent the value as a single point.

The “Automapping” example demonstrates how to write automation from the selected parameter.

So, not 100% what you’re looking for but perhaps close enough?

Automapping my 14bit MIDI parameter would definitely be close enough.

I’ve loaded the “Automapping” example in a ruleset but I am not able to record any MIDI parameter to a device parameter in the “track automation editor pane”.

To keep it simple, I started with the Modwheel as MIDI input as already configured in the xRules example.

I’ve selected the “L Delay” parameter of an instance of the Renoise delay device, but can’t figure out how to record it to the track automation. The Modwheel is recorded in the Pattern Editor as usual.

I could only manage to map (using the Renoise MIDI Mapping functionality) the Modwheel to the “L Delay” parameter and see respective hear that it takes effect.

But again, no recording in the “track automation editor pane” happens.

can’t figure out how to record it to the track automation. The Modwheel is recorded in the Pattern Editor as usual.

Hmm, sounds like you’re still recording using “standard” Renoise mappings.

Have you selected the device in the xRules prefs and disabled the port in Renoise preferences?

Edit: you should see the MIDI input indicators lighting up when it works:

8290 xrules-activity-indicators.gif

Doing some tool maintenance today as xRules has a couple of longstanding bugs I wanted to fix.

Any new rulesets that should be considered for inclusion?

New version of xRules, 0.8. Get it from the tool page

This release closes a number of bugs:

(fixed) tool in subfolder (not default folder) causes error on ruleset creation (#69)
(fixed) instrument index set via UI does not work bug (#81)
(fixed) need 'bit_depth' to be set before NRPN messages work (#82)

The second bug (#81) was simply a typo, and affected not only instrument_index but also track_index.

So now you should finally be able to control the target instrument + track from the xRules UI.

1 Like