dinchak / node-easymidi Goto Github PK
View Code? Open in Web Editor NEWSimple event-based MIDI messaging for node.js
License: MIT License
Simple event-based MIDI messaging for node.js
License: MIT License
Hi,
I'm sending noteon noteoff command and the latency is insane when I connect to live 11
Old format - "midi device name #' new format 'midi device name'
My friend upgrade nodejs from 14.x to 16.x and sothig wrong happend ...
System display names with 2-
Somthing like this
'2- BCF2000'
HOW TOO RESOLVE ?
Hey!
I can't find any way to do error handling.
If you create an output. Then lose connection to the midi console. how can I get an error?
I only get a console message error when trying to send a message on the disconnected output. but is not able to catch it anywhere.
Do you have a solution?
Hello,
I'm trying to send mtc messages, but I don't get it working. I can send messages without errors and the receiving program can see something, but right now I'm just guessing what values correspond to which function (second, minutes, hours, etc.). For example, I found out, if I set the "type" to 1 and "value" to something between 10 and 15 it decreases the seconds by 1. I found this Wikipedia article which would explain the "type", but I can't make any sense of the "value".
I am getting the following error message:
MidiOutWinMM::openPort: error creating Windows MM MIDI output port.
Any ideas how to make the virtual midi port work?
I'm trying to trigger a note event by REST api.
In my nodejs project (in OSX), I have a function that successfully sends a note to an output.
Once I'm trying to execute the function from inside an express route, the note is not send. No error, the device just doesn't receive the note.
Am I missing something?
Hey,
Thanks for creating this awesome library!
I am currently encountering an issue where I don't get pitch messages when using my touch.
Any pointers on how to resolve it?
i checked in node-midi and I am getting 231,124,127 for the message but nothing in easy-midi
I see an example for receiving clock messages, but no data appears to be included with these, and clock type messages appear to be ignored in the code?
Fantastic library. Simply amazing. I have the following which raises when calling
easymidi.getInputs();
MidiInCore::initialize: error creating OS-X MIDI client object.
libc++abi.dylib: terminating with uncaught exception of type RtMidiError
Note that getOutputs
does not cause this issue.
Setup: MacOS Mojave
environment:
praisethemoon$ node --version
v10.15.1
praisethemoon$ electron --version
v4.1.3
moonpiano praisethemoon$ npm --version
6.4.1
AFAIK this is obviously related to the native module rtmidi
and this issue is known and reported here: thestk/rtmidi#155
Even though I know the issue is not from this project per se, but just to let you know.
Hi,
I'm using easymidi and usb-detection together to handle connect and disconnect of midi controllers.
I'm using Debian 10 and at every usb change, I clean devices by using close() function on both input and output of each device before rechecking. But as I verify my inputs, I can see that it doesn't close them, virtual "rtMidi" inputs and outputs stacks up within getInputs()/getOutputs() until ALSA throws an error because it cannot allocate memory anymore.
I'm doing it in Typescript, an interface is set with in and out as easymidi.Input and easymidi.Output type, the function close() is recognized and doesn't throw an error when called but it has no effect on the virtual ports created.
If someone has an idea of what is wrong here, I'm all hears
Thanks for reading
I'm trying to send MIDI messages between two apps.
When I listen on an input channel, then send the messages to the output channel, they come back through the input again in an infinite loop.
Why is this?
const easymidi = require('easymidi');
const virtualInput = new easymidi.Input('Midi Input', true);
const virtualOutput = new easymidi.Output('Midi Output', true);
virtualInput.on('noteon', function (msg) {
const {_type: type, channel, note, velocity} = msg;
console.log({type, channel, note, velocity});
virtualOutput.send(type, {channel, note, velocity});
});
virtualInput.on('noteoff', function (msg) {
const {_type: type, channel, note, velocity} = msg;
console.log({type, channel, note, velocity});
virtualOutput.send(type, {channel, note, velocity});
});
I have the bad habit of giving people the credit they merit, unlike many other developers. Mind specifying which license you intent to use for your library?
How can you check if connection is closed is there something like:
input.on('close');
Is there a more precise way to keep on time, other than using one setTimeout with a bunch of seIntervals inside? As is, I am making a seperate setInterval for each element (bass, snare, hihat) and just giving each their own timing, but it loses beat.
Hi,
so I've been working with your repo to manage a project. Now I wanted to expend it a little further by reading something like the "ply aftertouch". I used your example for that but changed the midi-input-device to my own piano. When I press a key with polyphonic aftertouch I don't get any data on my console as output. I've tried that with the 'noteoff' too and there I don't receive any data too. I only receive 'noteon' messages. Do you have an idea why?
Hi, when trying to run this module in Electron in a window I get the error that this module is not context aware and therefore cannot run. I have done some digging and found that this is an issue with the "node-midi" module that easy-midi depends on.
@dinchak, if you have the time and knowledge would you please be able to make a fork of the "node-midi" package and make it context aware? I have tried myself but I am simply not experienced enough and the 2 pull requests on "node-midi" did not work (plus the author of "node-midi" seems to be inactive).
I understand if you are unable to do this but regardless of that I want to thank you in advance.
Best regards,
D3vision
Launchpad is on, plugged into my laptop, I ran the Node.js code, and I get this:
Error: No MIDI output found with name: Launchpad Pro
My code:
let midi = require('easymidi');
let input = new midi.Input('Launchpad Pro');
let output = new midi.Output('Launchpad Pro');
input.on('noteon',msg => {
console.log(msg);
});
While I was testing some very boilerplate code from the readme I noticed that after initializing virtual inputs and outputs the virtual devices appear in the opposite device list as expected. Is this incorrect, or do I have my concept of the ins and outs crossed?
Example code to reproduce:
const easymidi = require('easymidi');
const virtualInput = new easymidi.Input('Virtual input name', true);
const virtualOutput = new easymidi.Output('Virtual output name', true);
const inputs = easymidi.getInputs();
const outputs = easymidi.getOutputs();
console.log('inputs:', inputs);
console.log('outputs:', outputs);
The code doesn't assign numbers to devices if two or more identical ones are connected, making it impossible to refer to them individually.
In previous versions, devices were numbered, but it also caused issues.
It would be nice if each identical device had a number assigned:
midi_dev
midi_dev 1 ...
Forgive me if I'm making some sort of mistake, but I am trying to load easymidi
into my Electron app. Upon requiring the package, I get the following error:
Uncaught Error: Loading non-context-aware native module in renderer: '\\?\C:\Users\my_user\Documents\Midi-App\midi-electron\node_modules\midi\build\Release\midi.node'. See https://github.com/electron/electron/issues/18397.
Upon further research, I see that midi
was in fact updated to be context aware, and your wrapper does use the latest version, so what gives?
To reproduce the error, simply add const easymidi = require('easymidi');
to your main.js
file before running npm start
.
Firstly, thanks for making this! Having fun with an 8x8 neotrellis buttom matrix over midi.
If I disconnect the device (after successfully connecting before), everything works perfectly once I reconnect the device.
I was hoping to send midi events to the device after it reconnects (e.g. to reset device state such as brightness, colour, etc per button). Is there a way to detect if a midi device disconnected & reconnected?
I would imagine to emit an event for this, so an implementation like mine can use that as a trigger to re-sync all device states.
If you select a midi device input you can read the midi messages coming in however if you change the midi input device you have to restart the full program before you can read message from the new port
When using this lib on Windows, I keep getting the following error:
MidiInWinMM::openPort: error creating Windows MM MIDI input port.
Is there something I am missing?
Hello,
We are using your library for one of our project.
All the commands work (faders, buttons, etc ...) But not the sysex commands:
Our commands work well with Bome SendSX.
Here's my order:
output.send ('sysex', [240,00,00,66,14,12,00,20,20,43,48,32,20,20,20,20,43,48,32,20,20,20,20,20,20,20,247]);
and in the SendSX software: f0 00 00 66 14 12 00 20 20 43 48 32 20 20 20 20 43 48 32 20 20 20 20 20 20 20
Do you have an explanation for the problem?
Sorry, I'm french
I play notes on my midi keyboard, console.log(input.on), nothing on the screen.
I am using a novation mininova to a focusrite via usb. How do you configure such hardware?
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.