Skip to content

Instantly share code, notes, and snippets.

View elihugarret's full-sized avatar
💭
I may be slow to respond.

Elihu Garrett elihugarret

💭
I may be slow to respond.
View GitHub Profile
@elihugarret
elihugarret / circular.jl
Created April 7, 2020 00:53
Circular arrays in Julia. (A very silly implementation just for learning)
mutable struct Circular
arr
currentIndex
function Circular(arr, startIndex=1)
currentIndex = startIndex
new(arr, currentIndex)
end
end
@elihugarret
elihugarret / pycall_midi.jl
Created April 22, 2020 05:04
Receive and visualize MIDI CC input messages in Julia with PyCall.
#pip install mido
using PyCall, GR, Interact
mido = pyimport("mido")
mido.set_backend("mido.backends.portmidi")
mido.get_input_names()
# here goes the name of your midi input
@elihugarret
elihugarret / plot_audio_input.jl
Last active October 9, 2020 16:37
Simple Pluto.jl notebook that plots audio input.
### A Pluto.jl notebook ###
# v0.11.8
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))
@elihugarret
elihugarret / echo_midi.jl
Last active March 23, 2021 05:42
Pluto.jl notebook for echo MIDI input/output
### A Pluto.jl notebook ###
# v0.11.8
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local el = $(esc(element))