Giter VIP home page Giter VIP logo

hid-pd-external's Introduction

hid-pd-external

An USB HID external for PureData (PD)

Note the current version only outputs raw values as received from the HID - HID descriptor input item specifics (such as min/max, units, exponentials, etc) are not respected. This is not yet implemented in the underlaying USB-HID-Report-Parser.

Built and tested on macos 10.15.7. Tested RPi 4 (5.10.17-v7l+), in principle works but is suboptimal.

hid-example.pd

Todos

  • Add output report support
  • Feature reports?
  • Use hidraw instead of libusb (see note under linux)

Binaries

See https://github.com/tschiemer/hid-pd-external/releases

Building

macos

Install dependencies:

brew install libusb hidapi

Compile:

git clone --recursive https://github.com/tschiemer/hid-pd-external
cd hid-pd-external/
make -f Makefile.macos && make -f Makefile.macos install

linux (Raspberry Pi)

NOTE as it is, using libusb (in this external) on linux is somewhat invasive on USB devices as kernel drivers might be detached for this to work. Using hidraw (as offered by hidapi) this seems to work without further problem, but this is something that remains to be done.

Make sure to install required libraries:

sudo apt install libusb-1.0-0-dev libhidapi-dev
git clone --recursive https://github.com/tschiemer/hid-pd-external
cd hid-pd-external/
make -f Makefile.linux
sudo make -f Makefile.linux install

NOTE Your user will have to get direct access to HID devices, if you know which device it is, you can do something like

sudo chmod 777 /dev/bus/usb/001/003

In principle you could set up udev to do this for you (but didn't work for me).

hid object interface

  • list [vendorid <vendor-id>] [productid <product-id>] [serial <serial-str>] [usage_page <usage-page>] [usage <usage>]

Output any HID devices matching the given criteria in the form of:

device <usage-page> <usage> <vendor-id> <product-id> <serial-str> <manufacturer-str> <product-str>

If serial-str, manufacturer-str or product-str is not defined by the device will return a dash -.

  • open [vendorid <vendor-id>] [productid <product-id>] [serial <serial-str>] [usage_page <usage-page>] [usage <usage>]

Attempts to open first device matching given criteria for interaction.

Outputs opened message on success.

  • close

Closes previously opened device.

  • bang / poll <msec>

Output/process incoming reports and output changed values in the form of

value <usage-page> <usage> <value>

If polling (<msec> > 0) is enabled banging is not possible, to disable polling set <msec> equal zero.

License

Copyright 2021 ICST Institute for Computer Music and Sound Technology, Zurich University of the Arts All rights reserved.

GNU General Public License v3

Author Philip Tschiemer, https://github.com/tschiemer

Relies on (also see deps):

hid-pd-external's People

Contributors

tschiemer avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

hid-pd-external's Issues

Files aren't downloaded with git clone

git clone https://github.com/tschiemer/hid-pd-external.git
Cloning into 'hid-pd-external'...
remote: Enumerating objects: 149, done.
remote: Counting objects: 100% (149/149), done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 149 (delta 64), reused 137 (delta 52), pack-reused 0
Receiving objects: 100% (149/149), 379.90 KiB | 2.75 MiB/s, done.
Resolving deltas: 100% (64/64), done.

% make -f Makefile.macos
hid-pd-external/deps/pd-lib-builder/Makefile.pdlibbuilder: No such file or directory

The deps/ folders are empty

hid.c:4:10: fatal error: 'usbhid_map.h' file not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.