Skip to content

Instantly share code, notes, and snippets.

@avinmathew
avinmathew / find_overlaps.py
Last active December 2, 2021 11:38
Find overlapping MIDI notes
# Checks a MIDI file to see if there are any overlapping notes
# An overlapping note is defined as two MIDI on events in sequence
import math
from mido import MidiFile, tick2second
input_midi = MidiFile(r'my_midi_file.mid')
notes = {} # stores which note is being held when iterating through each event
tempo = 120 # default, tempo will be read from the file
numerator = 4 # default, will be read from the file
@avinmathew
avinmathew / script.js
Created February 6, 2021 10:23
Monophonic filter that only keeps top note in a chord for Mainstage/Logic Pro
/*
Only play highest note in a chord
*/
var notes = [];
function highestPitch() {
var highestPitch = -1;
notes.forEach(function(note) {
if (note.pitch > highestPitch)
@avinmathew
avinmathew / web.config
Created October 7, 2017 09:21
React and Node.js on Azure App Service/IIS
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server/server.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<rule name="Static Assets" stopProcessing="true">
@avinmathew
avinmathew / index.jsx
Created August 8, 2017 11:54
Multiple layouts with React Router v4
import React from "react"
import { Route, Switch } from "react-router-dom"
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => (
<Route {...rest} render={props => (
<Layout>
<Component {...props} />
</Layout>
)} />
)