Skip to content

Instantly share code, notes, and snippets.

@joebowbeer
joebowbeer / puck-js-midi-receiver.js
Created April 29, 2023 03:47
Receive BLE MIDI events on Puck.js and other Espruino devices
/// Receives MIDI events
function recv(evt) {
var data = evt.data;
var cmd = data[2] & 0xF0; // command
var chn = data[2] & 0x0F; // channel
var num = data[3]; // note or controller number
var val = data[4]; // velocity or controller value
switch(cmd) {
case 0x80: // noteOff
case 0x90: // noteOn
@joebowbeer
joebowbeer / importing.module.ts
Created February 8, 2022 01:22 — forked from evolkmann/importing.module.ts
Create Nest.js modules with custom config
import { Module } from '@nestjs/common';
import { MyLibModule } from './my-lib.module';
@Module({
imports: [
MyLibModule.register({ name: 'Enzo' }),
]
})
export class ImportingModule {}