Problems with SceneSwitch

Skip to first unread message

Markku Tavasti

Oct 22, 2020, 3:35:42 PM10/22/20

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 *


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

Am I doing something wrong?


Markku Tavasti

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



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

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

Mar 25, 2021, 6:25:17 AM3/25/21

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?

> --
> 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
> <>.
> To view this discussion on the web visit
> <>.


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 : 
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) //

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

   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

Apr 6, 2021, 3:05:51 PM4/6/21

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) //

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

> <>.


Apr 12, 2021, 6:36:10 PM4/12/21
to mididings
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


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
0 new messages