Skip to content

Instantly share code, notes, and snippets.

View ssfrr's full-sized avatar

Spencer Russell ssfrr

View GitHub Profile
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.
julia> Pkg.build("ZMQ")
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 https://github.com/zeromq/zeromq3-x/releases/download/v3.2.5/zeromq-3.2.5.tar.gz
INFO: Done downloading file https://github.com/zeromq/zeromq3-x/releases/download/v3.2.5/zeromq-3.2.5.tar.gz
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
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

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

~/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:
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)
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
ssfrr / gist:32e40d2e2bec11ecce7aba5fa2128773
Created October 16, 2017 00:13
"invalid age range update" error
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.
-----------STDOUT-----------
init_OSC
----------------------------
-----------STDOUT-----------
compiling class library...
----------------------------
-----------STDOUT-----------
initPassOne started
@ssfrr
ssfrr / gist:92c9f725185b68db76d960a5110caaa6
Created September 21, 2017 03:23
supercolliderjs long output
{"Classes/NamedControl": {"string": "SCDocEntry(\"Classes/NamedControl\", \"NamedControl\", \"Named reference to a control\")","compileString": "SCDocEntry.new","class": "SCDocEntry"},"Classes/Pnaryop": {"string": "SCDocEntry(\"Classes/Pnaryop\", \"Pnaryop\", \"n-ary operator pattern\")","compileString": "SCDocEntry.new","class": "SCDocEntry"},"Classes/PanB2": {"string": "SCDocEntry(\"Classes/PanB2\", \"PanB2\", \"2D Ambisonic B-format panner.\")","compileString": "SCDocEntry.new","class": "SCDocEntry"},"Classes/DegreeToKey": {"string": "SCDocEntry(\"Classes/DegreeToKey\", \"DegreeToKey\", \"Convert signal to modal pitch.\")","compileString": "SCDocEntry.new","class": "SCDocEntry"},"Classes/FFTTrigger": {"string": "SCDocEntry(\"Classes/FFTTrigger\", \"FFTTrigger\", \"Outputs the necessary signal for FFT chains, without doing an FFT on a signal\")","compileString": "SCDocEntry.new","class": "SCDocEntry"},"Classes/Pfindur": {"string": "SCDocEntry(\"Classes/Pfindur\", \"Pfindur\", \"limit total duration of event