This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<script src="http://snapsvg.io/assets/js/snap.svg-min.js"></script> | |
<script src="http://snapsvg.io/assets/js/prism.js"></script> | |
</head> | |
<body> | |
<div id="svg" width="400" height="400"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cps 1 | |
-- for `espeak` | |
import System.Cmd | |
-- lazy helpers | |
let wf0 n = within(0, n) | |
sw f = sometimes(wf0 0.5 f) | |
sw' d h f = sometimes(within (d, h) f) | |
nm p = note $ toMIDI p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cps 0.5 | |
solo $ | |
do | |
let runnow d p = do now <- getNow | |
d $ (nextSam now) ~> p | |
adsr = grp [attack_p, decay_p, sustain_p, release_p] | |
hctf = (# hcutoff "100") | |
sctf = (# cutoff (scale 400 1500 (slow 16 $ sine1))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
import csv | |
import re | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
portPath = "/dev/ttyACM0" # Must match value shown on Arduino IDE | |
baud = 115200 # Must match Arduino baud rate | |
timeout = 5 # Seconds | |
filename = "data.csv" |