about pools
pools is an instrument for composing & performing music with the crow Eurorack module by monome, which uses A Slope Language (ASL) as a framework to structure musical events in time.
pools is played by changing the content of/relationships between discrete banks of events and "droplets" of musical data.
usage
- TODO: include detailed usage instructions (use copy from spec)
development
setup
prerequisites
Node
- to run pools, you have to first install the newest 'LTS' version of node/npm (10.16.3 as of this writing). get it via command line, as instructed here: https://nodejs.org/en/download/package-manager/
druid
- to reset the Lua environment on crow manually after making changes, you will need to install druid, a REPL for direct serial i/o communication with crow. installation/usage instructions can be found here: https://github.com/monome/druid
get the project
git clone https://github.com/isaacpearl/pools.gitcd poolsnpm run init(this will install all required node modules, build pools, and create application package files inpools/dist/linux-unpacked,pools/dist/win-unpacked, andpools/dist/mac/respectively)- if you don't want to build pools yet, you can run
npm run installinstead ofinit
running pools from source (during development)
-
open the
poolsdirectory in two terminal tabs/windows -
tab 1:
npm startto start the react development server process -
tab 2:
npm run start-electronto start the electron app Node server process (print statements from Node and Lua will display here)- if you see the error:
CONNECTING TO CROW error [Error: Error: No such file or directory, cannot open /dev/ttyACM0]crow is probably not connected.
- If you see:
CONNECTING TO CROW error [Error: Error: Device or resource busy, cannot open /dev/ttyACM0] INITIATING RECONNECTrestart the Node process to try again.
- If you see:
CONNECTING TO CROW error [Error: Error: Permission denied, cannot open /dev/ttyACM0] INITIATING RECONNECTyou don't have permissions to talk to crow's USB port.
-
the pools application window will open alongside chrominum developer tools (print statements from React will display here)
-
if you save changes to the source code while these processes are running, pools will refresh and reflect your changes automatically. If you want to see the results of changes to the Lua scripts, you will have to use druid to send
^^cand^^kmessages to crow (instructions for sending messages with druid), and then restart the Node process manually to reupload them to crow
building/packaging
npm run build-n-packageto rebuild the application package after making changes- it's important note that you can only build pools for macOS from a mac! If you're on Linux or Windows, remove
--macfrom thepackage.jsonfile's packge instructions so that under"scripts":, the entry for thepackagescript reads"package": "electron-builder build --win --linux -c.extraMetadata.main=build/electron/main.js --publish never" - you may need to install Wine to build for Windows from Linux - if you don't have it, you should get an error message with installation instructions
- it's important note that you can only build pools for macOS from a mac! If you're on Linux or Windows, remove
setting serial port rights
open a terminal and run sudo usermod -a -G dialout $USER to authenticate serial communications with crow by default. (TODO: automatically do this configuration in install process)
project information
pools is built with Electron and React, using the Serial Node module for communicating with crow hardware. TODO: add details about IPC and how Node/React/Lua interact
file structure
src/contains a folderreact/with all React components/their css, along with the files that initialize the React virtual DOM (create-react-apprequires that the React component files be inside a parent folder namedsrc)src/reactcontains the source code for all React components. They are organized into folders containing the React source code (.js) and the component's associated styling (.css). ThePoolsAppcomponent contains all top-level state manipulation/logic and communication with the Electron backend - the rest are primarily concerned with rendering UI elements
electron/contains the Electron server (PoolsServer.js), and some standard files for initializing the Electron environmentelectron/srccontains two modules:Crow.js, which handles serial i/o and uploading Lua state/functions to crow, andStateInterface.js, which is an interface for manipulating the Lua program state from JavaScriptelectron/src/Statecontains the Lua representation for the pools program state, and libraries for manipulating that stateelectron/src/State/DropLib.lua- drop manipulationelectron/src/State/EventLib.lua- event manipulationelectron/src/State/GlobalsLib.lua- initalizes global state variableselectron/src/State/PoolLib.lua- pool manipulationelectron/src/State/State.lua- functions for creating/executing the main ASL loop/translating drop values into appropriate function argumentselectron/src/State/State2.lua- init/reset functions, BPM setter,hasPools()status checker (used to determine whether or not to reupload pools scripts), and pretty print utility function
dist/is the destination for all packaged application binariesbuild/contains the source files used to create distributable application packagesnode_modules/contains all Node modules (afternpm run initornpm run installare run) - you shouldn't need to do anything with these filespackage.jsonis a file that represents the project metadata, including configurations for run/build/package/etc commandsREADME.mdis the markdown file you're reading right now!
React components hierarchy
PoolsApp(global program state, interprocess communication with Electron, input handler functions)EventsContainer(container for renderingEventcomponents, user input for creating/removing events)Event(UI representation of events, user input for connecting event function's arguments to different pools)
PoolsContainer(container for renderingPoolcomponents)Pool(UI representation of pools, really just a symbol and array ofDropcomponents)Drop(UI representation of a drop, displays playheads for all event/pool connections, user input for changing drop values)
InfoPanel(container component for rendering all top-level information/control panels)TransportControls(currently just "Start ASL")BpmEditor(user input for editing current BPM)
roadmap
- TODO: write this all out and revise issues accordingly!
