issue with the backend = 'alsa' statement

25 views
Skip to first unread message

Thimo Korffmann

unread,
Mar 31, 2023, 12:45:25 PM3/31/23
to mididings
Hi, when running the python with the following simple coding, I receive an error on an invalid type for the backend parameter. would somebody be able to help me? 

Thanks a lot, Thimo

Coding:
from mididings import *
config(backend = 'alsa'),
run(Transpose(3))

This is the error coming up:
Traceback (most recent call last):
  File "/home/pi/Python scripts/test.py", line 2, in <module>
    config(backend = 'alsa'),
  File "<decorator-gen-1>", line 2, in config
  File "/usr/local/lib/python2.7/dist-packages/mididings/arguments.py", line 88, in wrapper
    a = _try_apply_constraint(self.kwargs_constraints[k], v, f.__name__, k)
  File "/usr/local/lib/python2.7/dist-packages/mididings/arguments.py", line 103, in _try_apply_constraint
    raise type(ex)(message)
TypeError: invalid type for parameter 'backend' of config():
expected one of (), got str

Stéphane Gagnon

unread,
Mar 31, 2023, 5:35:33 PM3/31/23
to mididings
Hi, 

That's strange because the ALSA backend is the default backend in mididings, so you can remove the backend directive from the config section to see what happen.,


Or add a client_name
config(
    backend='alsa',
    client_name='example',
)

Also, you have not defined any input ports ?

Python 2.7 is deprecated. What is your mididings version ? 

Try mididings --version in command line

Stephane

Thimo Korffmann

unread,
Apr 2, 2023, 4:25:35 PM4/2/23
to mididings
Hi Stephane, 

thanks for your reply.
Basically I did already run mididings successfully for some years. But then recently stopped working and giving the error mentioned above. My script did also contain e.g. input port definitions, I did then only cut it down to a very minimum of instructions to get an idea on the root cause.
Based on your reply, I did not try to set up all from scratch- with a 3.9 python in this case, which was part already of a current Raspbian OS.
Unfortuntalely, after hours of trying and reading, I am now failing greatly when trying to install the boost python+thread libraries. The system is just hanging during executing the b2 install. I followed (I think it is even yours) instructions- thanks for all your help her.
Tried now in terminal mode only, with python library only, and tons of other combinations- but the system always hangs after a while.
I will give up...

Best Thimo

Thimo Korffmann

unread,
Apr 2, 2023, 4:28:01 PM4/2/23
to mididings
... typo correction: based on your reply I did now try to setup all from scratch 

Thimo Korffmann

unread,
Apr 3, 2023, 3:54:28 AM4/3/23
to mididings
Hi Stephane,

with my last activity (which then was running overnight), I was able to set it up and running again- I did install boost via
sudo apt-get install libboost-all-dev

I didnt think it was going to work, but my mididings script is now doing its job again :-) very happy.

Thanks for your help,
best Thimo

Stéphane Gagnon

unread,
Apr 3, 2023, 12:38:47 PM4/3/23
to mididings
Hi Thimo, Great that you are up and running again!  

The libboosst-all-dev was my next suggestion. Are you still in python 2.7 ? 
Mididings can be installed with pip from a new maintainer on github for python 3

Tx

Thimo Korffmann

unread,
Apr 6, 2023, 5:08:58 AM4/6/23
to mididings
Hi Stephane,

thanks! yes I am very glad that it worked, since I am not at all experienced in Linux, and do rather type in what I classify as potenially helpful in the available information in the internet to solve my issues.
I did also upgrade to python3 yes, and installed it using the maintainer.

Best Thimo
Reply all
Reply to author
Forward
0 new messages