artfwo / pymonome Goto Github PK
View Code? Open in Web Editor NEWpython library for interacting with monome devices
License: MIT License
python library for interacting with monome devices
License: MIT License
Hi,
I try to make the pymonome example working, but each scripts return me the following error :
Traceback (most recent call last):
File "./faders.py", line 39, in <module>
host, port = monome.find_any_monome()
File "~/pymonome/monome.py", line 41, in find_any_monome
browser = MonomeBrowser()
File "~/pymonome/monome.py", line 174, in __init__
self.sdRef = pybonjour.DNSServiceBrowse(regtype=REGTYPE, callBack=self.browse_callback)
File "~/pymonome/pybonjour.py", line 1409, in DNSServiceBrowse
None)
File "~/pymonome/pybonjour.py", line 286, in _errcheck
raise cls(result)
pybonjour.BonjourError: (-65537, 'unknown')
linux distro : Archlinux
Python : 2.7
Thanks
First of all, thanks for this project! Although the async stuff is new to me, the grid studies were a very nice intro, really liking it so far!
Anyway, I wanted to discuss something. The module as it's importable within Python is called monome
, which is the same name as the name of the module for the Python bindings for libmonome, which is kind of unfortunate.
What do you think would be the best fix for this?
Thanks for the awesome asyncio-first library. Works really well.
I was able to get Grid + Arc consistently output at 30fps with ~90fps logic updates without stuttering. To achieve this, I had to switch from using GridBuffer
and ArcBuffer
which allocate the entire map every frame. Instead, I used a numpy array that I simply zeroed between frames, which is measurably faster.
To make this work, I had to make two changes:
Add grid.led_level_map_raw
and arc.ring_map_raw
methods that don't unpack *data
but simply pass data
directly to OSC.
In aiosc
, I added support for numpy arrays in pack_message
without importing numpy by doing this:
elif type(arg).__module__ == 'numpy' and type(arg).__qualname__ == 'ndarray':
result += arg.tobytes()
dt = arg.dtype
if dt == '>i4':
tt = 'i' * arg.size
elif dt == '>f4':
tt = 'f' * arg.size
else:
raise NotImplementedError('Unsupported numpy ndarray dtype: ' + dt)
typetag += tt
With those changes, numpy arrays passed to the new methods allow reusing the same memory buffer and are very efficiently translated to bytes entirely in C land (with arg.tobytes()
above).
Would you be interested in pull requests to upstream my changes?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.