Problems with SceneSwitch

26 views
Skip to first unread message

Markku Tavasti

unread,
Oct 22, 2020, 3:35:42 PM10/22/20
to midi...@googlegroups.com
Hi!

I am trying to use mididings 'doubling' my midi controller sliders/pots.
I would use pads for selecting in which scene we are. However, it
doesn't look like working as I intented it. All movements of
controllers, causing controller events, are causing SceneSwitch.

My mididings is installed from git.

My file I am trying to use:
----------------------
from mididings import *

config(
backend='alsa',
client_name='multiplex',
)

run(
scenes = {
1: Scene("controls direct",
KeyFilter(117) % SceneSwitch(2)
),
2: Scene("controls shifted",
KeyFilter(113) % (SceneSwitch(1),
CtrlMap(14,30) >>
CtrlMap(15,31) >>
CtrlMap(16,32)
),
},
pre = ~Filter(PROGRAM),
)
----------------------

Am I doing something wrong?

--Tavasti

Markku Tavasti

unread,
Mar 16, 2021, 3:37:46 PM3/16/21
to midi...@googlegroups.com
Returning to this, still haven't found any solution. Any help?

--Tavasti

STEFETS - https://github.com/stefets/live-config/

unread,
Mar 24, 2021, 5:56:11 PM3/24/21
to mididings
Hi!

I am not sure to understand your script or your need.

You could exclude CTRL in the 'pre' instruction or check for the 'Ctrl Filter' to exclude the undesired control change messages.

Markku Tavasti

unread,
Mar 25, 2021, 6:25:17 AM3/25/21
to midi...@googlegroups.com, STEFETS - https://github.com/stefets/live-config/
Hi!

Thanks for response. I was thinking this list is totally dead :-)

1) my need: I have midi controller, which has 8 sliders and 8 pots. I
want to setup system where I can remap those controllers so that
cotnroller 14 maps to ctrl 30, 15 to 31, etc

2) my script, not familiar with mididings, but what I try to do is that
scene changes are triggered with notes 117 and 113.

In Scene 1, controllers are passed on as they are, no changes

In Scene 2, controllers are remapped


Now my problem is that moving any controller will do scene change. And
because controller values are used in scenes, it is not possible to
filter them out.

Is my script somehow totally wrong?

--Tavasti
> --
> You received this message because you are subscribed to the Google
> Groups "mididings" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mididings+...@googlegroups.com
> <mailto:mididings+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mididings/39d3d5ce-2c8e-42fa-97cc-0be6a349641fn%40googlegroups.com
> <https://groups.google.com/d/msgid/mididings/39d3d5ce-2c8e-42fa-97cc-0be6a349641fn%40googlegroups.com?utm_medium=email&utm_source=footer>.

STEFETS - https://github.com/stefets/live-config/

unread,
Mar 26, 2021, 10:17:07 PM3/26/21
to mididings
Hi! No the list is not dead! But I hope the author Dominic come back to make his software and this list immortal.

I will solve your problem.

Since you have a Midi controller, you have to use and implement the built-in 'control' patch injected in the run section. 
See my repo for example : https://github.com/stefets/live-config 
Read the documentation, read the examples.

For your problem, check my pseudo script, you will have to debug it if it failed somewhere

// Don't use SERIAL connection in that context, user PARALLEL connection
# Simple patch
control_mapping =  
       ( CtrlMap(14,30) //
         CtrlMap(15,31) //
         CtrlMap(16,32)
       )

# Your controller
_control = (
     ( KeyFilter(117) >> SceneSwitch(2) ) //
     (  KeyFilter(113) >> SceneSwitch(1) )
)

# Your Scenes
_scenes = {
    1: Scene("NothingToDo", Pass()),
    2 :Scene("ControlMapping",  control_mapping)
}

In the run() section :

run 
(
   scene = _scenes,
   control = _control
)

Best practice
- Configure the run builtin patches outside, in seperates patches, don't put all your program in the run section;

That's it !
Stéphane Gagnon

Markku Tavasti

unread,
Apr 6, 2021, 3:05:51 PM4/6/21
to midi...@googlegroups.com, STEFETS - https://github.com/stefets/live-config/
Hi!

Thanks for your response, with this help I got forward.

However, in one thing you are not correct:
For re-mapping controllers, need to be serial or have plenty of filters.
If all these CtrlMap are parallel, each controller will output its
original value and re-mapped.

So with parallel, would need to filter for each CtrlMap, and then one
filter that would filter out all those which are originals but send thru
all other controls. And because filter is negated, then pass all the
rest, like this

(CtrlFilter(14) >> CtrlMap(14,30) ) //
(CtrlFilter(15) >> CtrlMap(15,31) ) //
(CtrlFilter(16) >> CtrlMap(16,32) ) //
(CtrlFilter(17) >> CtrlMap(17,33) ) //
~CtrlFilter(14,15,16,17) //
~Filter(CTRL)

Not sure is this better than serial? And this is highly simplified
version, in reality I have 16 controllers.

--Tavasti
> https://groups.google.com/d/msgid/mididings/6ee98d6e-0453-4166-85b1-f29bad724486n%40googlegroups.com
> <https://groups.google.com/d/msgid/mididings/6ee98d6e-0453-4166-85b1-f29bad724486n%40googlegroups.com?utm_medium=email&utm_source=footer>.

STEFETS - https://github.com/stefets/live-config/

unread,
Apr 12, 2021, 6:36:10 PM4/12/21
to mididings
Hi!
That's strange and hard for me to help without having the full script source code.I think that it is normal to filter all the Controls you need to hande... if you have 16 controllers, you have to manage all of them in your script

Anyway,

I see that you add 15 to the control value in you mappings

Another solution is to call a custom python function with Process() and that function will do the job of remap the value

Your patch in your script:
Filter(CTRL) >> CtrlFilter(14,15,16,17) >> Process(Add15)

Custom function in your script
def Add15(event):
    if event.type == 'CTRL':
        event.value = event.value + 15
return event

- Stéphane Gagnon
Reply all
Reply to author
Forward
0 new messages