Midi-Input sample
Using the midi-input sample bundle
The midi-input example bundle in samples/midi-input demonstrates the ability to read data from a midi device.
Prerequisites
- Working NodeCG & nodecg-io installation
- A midi device that can be connected to your computer
Configure the midi-input sample bundle
-
Start nodecg with nodecg-io installed. The Twitch-chat bundle is currently part of it so it should also be loaded.
-
Go to the
nodecg-iotab in the nodecg dashboard. -
Login using your password. If this is your first run, then enter the password with which you want to encrypt your configurations and credentials.
-
Create a new midi-input service instance using the left upper menu.
-
Enter your device information
The created instance should be automatically selected, if not select it in the upper left menu. Enter the name of your device in monaco (the text-editor on the right) in this format:
{ "device": "name" }After entering it, click save. Note: A script is provided to list all inputs and outputs. It can be run from the sample directory
samples/midi-inputusing the commandnpm run list. The devices should be listed with their device names and some other stuff. under linux this looks for example like this:nanoKONTROL2:nanoKONTROL2 MIDI 1 28:0Note: If you don't see monaco on the right, try reloading the page.
-
Set the created midi-input service instance to the service dependency of the midi-input sample bundle.
Select the midi-input bundle and the midi-input service in the left bottom menu and then select the service instance that should be used by the midi-input bundle (in this case the name of the previously created midi-input instance).
-
Check the nodecg logs
You should see an error or a success message and all midi messages that are sent by the device that is configured.