Skip to main content

New MIDIVal releases: core 0.0.17, node 0.0.2 and react-native!

· 3 min read
Kacper Kula

MIDIVal Cover

In the last couple of weeks MIDIVal got plenty of new updates:

  • @midival/core got 0.0.17 release with fixed onConnected / onDisconnected handlers
  • @midival/node got 0.0.2 release with Virtual Ports, onConnected / onDisconnected listeners and new examples in the repository to get you started
  • @midival/react-native was released!
  • MIDIVal has now brand new website too!

Below I’ll dive deeper into each of those updates and give you quick overview of the changes.

Updates to @midival/core

Update to @midival/core is small, but if you want to listen to newly connected devices, I’ve got something for you! Now you can subscribe for events when MIDI Device was connected or disconnected.

import { MIDIVal } from "@midival/core";
function async connect() {
await MIDIVal.connect();
MIDIVal.onInputDeviceConnected(newInputDevice => {
console.log("Input Connected", newInputDevice.name);
});
MIDIVal.onInputDeviceDisconnected(disconnectedInputDevice => {
console.log("Input Disconnected", disconnectedInputDevice.name);
});
MIDIVal.onOutputDeviceConnected(newOutputDevice => {
console.log("Output Connected", newOutputDevice.name);
});
MIDIVal.onOutputDeviceDisconnected(disconnectedOutputDevice => {
console.log("Output Disconnected", disconnectedOutputDevice.name);
});
}
connect();

You can install new version via yarn or npm:

yarn add @midival/core@0.0.17
### OR
npm install --save @midival/core@0.0.17

Updates to @midival/node

New release of MIDIVal core brings support for on(In|Out)putDevice(Dis)Connected listeners described above. You can listen to new devices the same way, no matter if you are connecting from the browser or from the Node.js environment!

Moreover, new version adds ability to create new Virtual Inputs and Outputs! Those outputs are registered in your system and are accessible by any program like DAWs, Librarians, etc. This opens up many possibilities like:

  • Dedicated Virtual MIDI Out Port that acts as a sequencer sending notes to other programs
  • Dedicated Virtual MIDI Input Port for your Node.js synthesiser which can be played from any MIDI-enabled software on your machine
  • Virtual MIDI Out Port that combines messages from multiple sources

Those are just some of the use-cases for this feature. Let’s see how to use it:

mport { MIDIVal } from "@midival/core";
import {NodeMIDIAccess} from "../src/index";
import * as midi from "midi";
const nodeAccess = new NodeMIDIAccess(midi);
MIDIVal.configureAccessObject(nodeAccess);
MIDIVal.connect()
.then(() => {
// Creating virtual Input Port
const virtualInput = nodeAccess.createVirtualInputPort("Virtual Input");

// Creating virtual Output Port
const virtualOutput = nodeAccess.createVirtualOutputPort("Virtual Output");
});

New release also includes sample example programs to get you started with using MIDIVal in Node.js environment!

You can install new version via yarn or npm:

yarn add @midival/node@0.0.2
### OR
npm install --save @midival/node@0.0.2

Release for @midival/react-native

Beta version of React Native adapter has been released! You can now use exactly same code to write synthesisers for iOS or Android using React Native.

Repository contains sample project to get you started.

You can install it using yarn or npm. Project is using React Native autolink so all required Podfiles for iOS should be linked automatically.

yarn add @midival/react-native
### OR
npm install --save @midival/react-native

New Website

MIDIVal has a new website now to help you get started with the project. I plan to expand it with helpful resources soon but you can use it already to find links to code References and basic code snippets to start hacking!

Website

Have you used MIDIVal already? If so, I am excited hearing from you what do you use it for! As always, contributions and bug reports are welcome.

Happy coding!