nodejs
wrapper aroundlibpd
andportaudio
Tested on MAC OSX 10 and Raspbian Stretch Lite version 9 (raspberry pi 3) - for other platforms, dynamic libraries for libpd and portaudio should probably be built.
npm install [--save] node-libpd
# cf. test/index.js
$ npm run test
pd.clear()
to stop background processes- find a proper way to organize tests
- allow to discover available devices and configuration for input and output => (maybe this should be done in a separate module)
- more generally expose more audio configuration options
- handle audio in
- implement array API
- refactor messaging struct (cf
pd_msg_t
)- use more specialized structs and
dynamic_pointer_cast
- use
const
and references as in PdReceiver callbacks
- use more specialized structs and
- re-enable
addToSearchPath
andclearSearchPath
- stop the whole pd and portaudio instances
- make
init
asynchronous to fix the race condition between js and worker threads (initialization can be quite long (> 100ms on mac OSX)).init
should return aPromise
=> current workaround is to block theinit
method untilcurrentTime != 0
- move
LockedQueue
implementation in.cpp
file - install babel thing to rewrite the index.js in es6
- would be fancy to have an
index.mjs
and anindex.js
- would be fancy to have an
- add a
verbose
options toinit
- properly handle errors using :
Nan::ThrowError("...");
libpd
usage example (patch + test):
Node/Nan tutorial
- https://nodejs.org/api/addons.html#addons_wrapping_c_objects
- https://nodeaddons.com/book/
- https://medium.com/netscape/tutorial-building-native-c-modules-for-node-js-using-nan-part-1-755b07389c7c
libuv book:
Debug with lldb:
TBD