Re: Can I split one input event to three output events?

From: Alexandre Ratchov <alex_at_caoua.org>
Date: Thu Jan 16 2014 - 18:07:52 CET
On Tue, Jan 07, 2014 at 11:52:11PM +0100, edgar wrote:
> Hi all,
> 
> The hexter DSSI plugin (Yamaha DX7 emulator):
> 
> http://dssi.sourceforge.net/hexter.html
> 
> has three frequency settings per operator: Coarse, Fine, and Detune,
> which can be controlled by three NRPNs.
> 
> In order to pitch-bend a single operator (not _all_ operators like the
> default hexter pitch-bend controller setting does), I need to split a
> 14-bit pitch-bend input event into three 14-bit NRPN output events.
> 
> The three Coarse, Fine, and Detune values (as their names say) are
> not adjacent ranges, but subranges of each other:
> 
> {nrpn 81 0..16383} -> Coarse 0..31  # Overtone multiplicator
> {nrpn 82 0..16383} -> Fine   0..99  # Subrange of each Coarse step
> {nrpn 83 0..16383} -> Detune 0..15  # Subrange of each Fine step
> 
> This leads to a controller mapping of:
> 
> # First output event
> coarse = $pitch-bend / 32
> {nrpn 81 $coarse}
> 
> # Second output event
> fine = ($pitch-bend - $coarse * 32) / 100
> {nrpn 82 $fine}
> 
> # Third output event
> detune = ($pitch-bend - $coarse * 32 - $fine * 100) / 16
> {nrpn 83 $detune}
> 
> My first question is: How can I assign the 14-bit value from the
> pitch-bend input event to a midish variable?
> 

no, filters dont use variables of the interpreter. The scripting is
here only as a user interface, allow rules to be loaded into the
filter and/or manipulated.

> My second question is: How can I write a filter rule that sends
> three output events per input event?

yes, if there are three rules matching the same input, all rules
will be applied, so a single event will produce three output
events:

example:

fnew myfilt
fmap {bend 0} {bend 1}
fmap {bend 0} {bend 2}
fmap {bend 0} {bend 3}

will make pitch-bend events coming from device 0 to be forwarded to
devices 1, 2, and 3

> 
> Or is there any other way to split a 14-bit pitch-bent event into
> three NRPN events with midish?
> 

There's no way to do so. But the infrastructure is there, and you
could try to tweak the code to do so.

> Please excuse if the questions sound a bit stupid, but I'm still not
> very experienced with writing midish filter rules, and I still was
> unable to find answers to my questions in the midish manual.
> 

Heh, not an easy question, it took me some time to dig into the
code :)

> Of course I do not expect that you do all the work for me, I'm already
> happy if somebody can point me to the respective manual sections or
> give some small code examples how this could work in general.

I'm afraid midish can't map the events the way you expect. There's
only a small number of rules (predefined building blocks) that can
be be combined and constumized with the shell-like interface.

-- Alexandre
Received on Thu, 16 Jan 2014 18:07:52 +0100

This archive was generated by hypermail 2.1.8 : Wed Nov 08 2017 - 16:32:27 CET