Assigning tilt to modulation

Posts: 11
Joined: Sat Jun 07, 2014 10:22 am

Assigning tilt to modulation

Postby ajaym » Sun Jun 29, 2014 3:46 am

It looks like there are two playable ways of working with the Qunexus

1. Assign pitch bend to the pitchbend controller, set the range to 12 octaves to resolve the resolution bug in the firmware, and then assign modulation to keyboard tilt.

2. Assign modulation to the pitchbend controller (using either its tilt or pressure sensitive modes) and then assign pitchbend to keyboard tilt.

I have not yet figured out how to also use key pressure at the same time (e.g for filter cutoff) - but I am looking at this.

My focus is not how to do that - obviously that's configurable in the Qunexus editor. Its how to do these things and actually have a playable instrument. With the standard firmware that's not really possible, but as I've already discussed in another thread, it's possible to process the MIDI messages from the Qunexus to work around some of the limitations.

For option 2 the JS plugin I've already posted solves the tilt issue by only sending bend events from after the player tilts the key across the 'neutral' untilted point, and auto-cancelling pitch bend on any subsequent note down.

I have been experimenting this weekend with option 1 and I now have a JS plugin for that scenario. In this case we don't want to manipulate pitchbend events since the dedicated controller is quite manageable in tilt mode once you practice a bit (and, as I said, set the range to 12 semitones to avoid the firmware losing resolution). However, MIDI processing is required to ensure that modulation is musically controllable using tilt. Without that processing, you will find it very difficult to controllably add modulation. This is because, particularly when playing both black and white notes rapidly, controlling the exact spot at which your finger hits a note is difficult and introducing some initial tilt is almost unavoidable.

Fortunately, this is fixable with some MIDI pre-processing. Unlike pitchbend, though, the optimal algorithm appears to be a little different. Record the original tilt position and then if the player tilts the key further away (i.e to increase the tilt), then start outputting modulation values. As with pitchbend, auto-cancel modulation on any subsequent note on event.

This greatly improves playability since now you need to deliberately tilt a key further away to invoke modulation, rather than have it just be based on the current tilted position, which is difficult for the player to control.

I will post the JS plugin for this mode of operation shortly.

I have also figured out now how to get fairly good velocity response from the keys without too much mucking around and will post on my experiences there. So, rapidly turning from a high-tech toy to a musical instrument. Not quite there yet but I'm very impressed so far.
Posts: 11
Joined: Sat Jun 07, 2014 10:22 am

Re: Assigning tilt to modulation

Postby ajaym » Fri Jul 04, 2014 11:04 am

I'll post the code as soon as I can copy it off my other laptop. The optimal algorithm ended up being slightly different.

1. Capture the initial tilt value
2. If the player tilts the key towards them i.e decreases the tilt value, replace the above value with the new value but do not send any MIDI event
3. If the player tilts the key away from them i.e increases the tilt value, commence outputting modulation wheel events.

I have found this allows you to play notes easily without vibrato and then you can either tilt away immediately to add vibrato (at a fairly high amount) or, if you want something more subtle, tilt towards you and then away, which will start adding vibrato at a lower level. This really feels intuitive and musical and works very well.

As someone mentioned in another thread, there's a wrapper VST free from Cockos (the Reaper people) that lets you wrap a JS plugin in a VST, so this code should be useable in any host, not just Reaper.
Posts: 11
Joined: Sat Jun 07, 2014 10:22 am

Re: Assigning tilt to modulation

Postby ajaym » Fri Jul 04, 2014 11:50 am

Follow the instructions in the thread on pitchbend to create a JS plugin from the below code and name it appropriately e.g qunexus_mod or something.

As with the pitchbend plugin, place this first in the effects chain. Enjoy!

EDIT: I found testing on my second device that a small dead-band factor of 5 helped with jittery control messages. Made a couple of other small tweaks and edited this post accordingly, so if you took this before today (Sunday) I suggest you replace with the below code.

// if we sent mod event, reset to neutral on note event
(mod_tilt_neutral != 0 && msg1 == 0x90) ? midisend(ts,0xb0,0x01,0x00);
// reset tilt flags on note event
(msg1 == 0x90) ? (initial_mod_tilt=0; mod_tilt_neutral = 0;);
// capture initial tilt value from first mod event after note on
(msg1 == 0xb0 && msg2 == 0x01 && initial_mod_tilt == 0) ? initial_mod_tilt=msg3;
// after this if the player tilts down, record the new tilt value. They will enable mod if they reverse tilt direction
(msg1 == 0xb0 && msg2 == 0x01 && initial_mod_tilt != 0 && msg3 < initial_mod_tilt) ? initial_mod_tilt=msg3;
// set mod tilt flag when we get a mod event that crosses the pickup point going up. Small amount of hysteresis to allow for jitter
((msg1 == 0xb0 && msg2 == 0x01) && ((msg3 > initial_mod_tilt + 5) && (initial_mod_tilt > 0) && (mod_tilt_neutral == 0))) ? mod_tilt_neutral=1; // set when tilt reaches neutral (pickup point)

// send mod events if we are now allowed to
( msg1 != 0xb0 || (msg1 ==0xb0 && msg2 != 0x01)) ? midisend(ts,msg1,msg2,msg3);
// to scale modulation, change 1.0 below accordingly.
(mod_tilt_neutral != 0 && msg1 == 0xb0 && msg2 == 0x01) ? midisend(ts,msg1,msg2,msg3/1.0);
Posts: 5
Joined: Fri Jul 11, 2014 8:43 pm

Re: Assigning tilt to modulation

Postby richiegusto » Wed Jul 16, 2014 9:28 am

Thanks ajaym.
Posts: 6
Joined: Mon Jun 09, 2014 5:28 pm

Re: Assigning tilt to modulation

Postby Hiosoy » Tue Nov 11, 2014 8:29 pm

That sounds wonderful..
I'm relatively new to this, can you tell me how I was get this (or you're pitchbending post) set up in logic pro 9?

thanks so much for the work

Return to “QuNexus General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests