Skip to content

Instantly share code, notes, and snippets.


Spencer Russell ssfrr

View GitHub Profile
View holomorphic.jl
using PlotlyJS
# SVG Path construction
addmove!(io, x, y) = write(io, "M $x $y")
addlineto!(io, x, y) = write(io, " L $x $y")
addclose!(io) = write(io, " Z")
Makes a set of connected lines that go through the points defined by xs and ys
by adding the appropriate SVG commands to the given IO.
View gist:371d2b3b3e484f88d2d148734aae3dc0
INFO: Building ZMQ
INFO: Attempting to create directory /home/sfr/.julia/v0.6/ZMQ/deps/downloads
INFO: Directory /home/sfr/.julia/v0.6/ZMQ/deps/downloads already exists
INFO: Downloading file
INFO: Done downloading file
INFO: Attempting to create directory /home/sfr/.julia/v0.6/ZMQ/deps/src
INFO: Directory /home/sfr/.julia/v0.6/ZMQ/deps/src already exists
INFO: Attempting to create directory /home/sfr/.julia/v0.6/ZMQ/deps
INFO: Directory /home/sfr/.julia/v0.6/ZMQ/deps already exists
View makie_waterfall_grid.jl
using Makie
using PortAudio
Slide the values in the given matrix to the right by 1.
The rightmosts column is discarded and the leftmost column is
left alone.
function shift1!(buf::AbstractMatrix)
for col in size(buf,2):-1:2
View Julia Base.Test reworking

Based on a long-running conversation, mostly on slack with @oxinabox and @c42f, with a little bit @evizero. One issue that led to it is the desire to do XML reports of test runs, which exposes some issues with the extension mechanisms currently in place for Base.Test. I think to figure out how much rearchitecting is necessary we should answer a few questions.

Desired Features

oxinabox says DataStructures.jl has some testing-related hacks, we should investigate what they've had to do to see what might be needed in Base.Test

View gist:25270f5693c98d6093f7d1bc4c03910a
~/j/Makie ❯❯❯ j6 -e 'Pkg.test("Makie")' ⏎ master
INFO: Computing test dependencies for Makie...
WARNING: unknown WAV commit f0ed3cdd, metadata may be ahead of package cache
INFO: Installing VisualRegressionTests v0.1.0
INFO: Building FFTW
INFO: Building SpecialFunctions
INFO: Building ImageMagick
INFO: Testing Makie
WARNING: Gtk not loaded. err: ArgumentError("Module Gtk not found in current path.\nRun `Pkg.add(\"Gtk\")` to install the Gtk package.")
Scene scene:
View waterfall_heatmap.jl
using Makie, GeometryTypes
using PortAudio
N = 1024 # size of audio read
N2 = N÷2+1 # size of rfft output
D = 200 # number of bins to display
M = 200 # amount of history to keep
src = PortAudioStream(1, 2, blocksize=N)
buf = Array{Float32}(N)
fftbuf = Array{Complex{Float32}}(N2)
View waterfall.jl
using Makie, GeometryTypes, Colors
using Reactive
using Juno
using DSP
using LibSndFile, FileIO
using PortAudio, SampledSignals
using BenchmarkTools
N = 1024 # size of audio read
N2 = N÷2+1 # size of rfft output
ssfrr / gist:32e40d2e2bec11ecce7aba5fa2128773
Created Oct 16, 2017
"invalid age range update" error
View gist:32e40d2e2bec11ecce7aba5fa2128773
Main> using SampledSignals, PortAudio, WAV
Main> f = open("/home/sfr/Dropbox/chris_mann.wav")
IOStream(<file /home/sfr/Dropbox/chris_mann.wav>)
Main> wav = WAVSource(f)
WAV.WAVSource{IOStream,FixedPointNumbers.Fixed{Int16,15}}(IOStream(<file /home/sfr/Dropbox/chris_mann.wav>), WAV.WAVFormat(0x0001, 0x0001, 0x0000ac44, 0x00015888, 0x0002, 0x0010, WAV.WAVFormatExtension(0x0000, 0x00000000, UInt8[])), Dict{Symbol,Array{UInt8,1}}(), 5876768, 5876768)
Main> buf = read(wav, 10s)
WARNING: An error occurred during inference. Type inference is now partially disabled.
View gist:8115445c9fb40f36b2f9027a3cb7e640
compiling class library...
initPassOne started
View gist:92c9f725185b68db76d960a5110caaa6
{"Classes/NamedControl": {"string": "SCDocEntry(\"Classes/NamedControl\", \"NamedControl\", \"Named reference to a control\")","compileString": "","class": "SCDocEntry"},"Classes/Pnaryop": {"string": "SCDocEntry(\"Classes/Pnaryop\", \"Pnaryop\", \"n-ary operator pattern\")","compileString": "","class": "SCDocEntry"},"Classes/PanB2": {"string": "SCDocEntry(\"Classes/PanB2\", \"PanB2\", \"2D Ambisonic B-format panner.\")","compileString": "","class": "SCDocEntry"},"Classes/DegreeToKey": {"string": "SCDocEntry(\"Classes/DegreeToKey\", \"DegreeToKey\", \"Convert signal to modal pitch.\")","compileString": "","class": "SCDocEntry"},"Classes/FFTTrigger": {"string": "SCDocEntry(\"Classes/FFTTrigger\", \"FFTTrigger\", \"Outputs the necessary signal for FFT chains, without doing an FFT on a signal\")","compileString": "","class": "SCDocEntry"},"Classes/Pfindur": {"string": "SCDocEntry(\"Classes/Pfindur\", \"Pfindur\", \"limit total duration of event