Add new comment

Permalink

Hello again Rui,

Wow! You rock! I was able to map my transport controls to the transport menu items and things work. It looks like the mods are permanent (not per session), which is what I want. Funny thing: I was going to suggest that MIDI controls be mappable to any UI element as a general purpose idea, but was afraid to suggest it because I thought it would take too much time to put into the existing code AND YOU DID IT ALREADY!

Now for the bad news: Button releases on the Launchkey still cause the mapped action to turn off. I hacked together a mididings script that swallows CC events with an event value of 0, which results in the action I want:

from mididings       import *
from mididings.event import *

buttonState = [0] * 128;

####################################################################################################
# buttonCtrl:  Toggle outgoing CC event value when the incoming value is non-zero
####################################################################################################
#
# Convert the momentary on/off buttons to mode toggle events when the button press occurs
#

def buttonCtrl (event):
  button = event.ctrl;
  value  = event.value;

  if (value != 0):
    state = buttonState [button] = value if (buttonState [button] == 0) else 0;
    event = CtrlEvent (event.port, event.channel, button, state);
    print (" - Ctrl (%d, %d) => Ctrl (%d, %d)" % (button, value, button, state));
    return event;
  else:
    print (" - Ctrl (%d, %d) => *IGNORED*" % (button, value));
    return None;

####################################################################################################
# midiCtrl:  Route the incoming MIDI messages to the event filter
####################################################################################################

def midiCtrl (event):
  button = event.ctrl;
  if   (button >=  51 and button <=  59):  return (buttonCtrl (event));
  elif (button == 104 or  button == 105):  return (buttonCtrl (event));
  elif (button >= 112 and button <= 117):  return (buttonCtrl (event));
  return event;

run (
  Filter (CTRL) % Process (midiCtrl)
)

But what would be nice is if Qtractor could somehow do this natively. I also looked into the hook function, but I don't think it does what I want. Perhaps I'm being daft.

Hope I'm not being a pain about this.

Bruce

The content of this field is kept private and will not be shown publicly.

Markdown

  • Parses markdown and converts it to HTML.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt height width> <strike> <pre> <p> <br>
  • Lines and paragraphs break automatically.

Filtered HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <b> <i> <pre> <img src alt height width> <strike>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
File attachments
Unlimited number of files can be uploaded to this field.
2 MB limit.
Allowed types: jpg jpeg gif png txt doc docx xls xlsx pdf ppt pps odt ods odp zip gz bz2 xz patch diff wav ogg flac ogv mp4 qtz.