Skip to content

Instantly share code, notes, and snippets.

@drsm79
drsm79 / grandpa.md
Last active December 8, 2023 00:13
Grandpa helpful command lines

Grandpa helpful command lines

Using ffmpeg, ffmpeg-normalize & ffprobe to manage samples for Grandpa per the manual.

Convert an audio file to the right wav format

ffmpeg -i my_audio.wav -acodec pcm_s16le -ac 1 -ar 16000 P1.wav
@drsm79
drsm79 / build.sh
Last active August 5, 2020 00:02
Build python objects from OSCAL schemas
#! /usr/bin/zsh
git submodule add https://github.com/usnistgov/OSCAL.git
git submodule update --init --recursive
for i in `ls OSCAL/json/schema| sed -e 's/oscal_\(.*\)_schema.json/\1/'`
do
echo OSCAL/json/schema/oscal_${i}_schema.json
echo $i:s/-/_/
datamodel-codegen --input-file-type jsonschema --input OSCAL/json/schema/oscal_${i}_schema.json --output $i:s/-/_/
done

"A"SR: "A"SR is an "Analog" Shift Register simulation with a 256-step ring buffer. When selected in one hemisphere, it has two indexed outputs. When selected in both hemispheres, the same buffer is used across all four outputs.

AD-EG: AD EG is an attack/decay envelope generator with forward and reverse trigger inputs, and end-of-cycle trigger output.

ADSR-EG: ADSR EG is a straightforward linear envelope generator. It has a single envelope, but responds independently on two channels.

Annular-Fusion-Euclidean-Drummer: Annular Fusion is a dual Euclidean trigger generator. It can be used to generate Euclidean rhythms of up to 32 steps in length.

Backup-and-Restore: Backup/Restore is a utility that allows you to transfer complete sets of app and/or calibration data to and from your module. Possible uses include

The proposal for using Sims Hill as a site for a new park and ride seems a poor choice.

The land itself is fertile & used to grow food for residents of Bristol. It has high quality, productive soil. The selection of this site seems contrary to both Bristol council strategic policy (p.73, Bristol Development Framework Core Strategy) and WECA guidance (which is to minimise loss of productive land when building housing - why would this not be applied to transport?).

Secondly, the location itself is poor for a park and ride. Traffic backs up on the M4 entering the M32. This would imply a site accessible directly from the M4 is necessary to actually reduce congestion. A site near Emersons Green or the Bristol & Bath cience park seems more suitable, especially given the light industrial use in the area (e.g. distribution warehouse off Jenner Boulevard, Puma energy off Folly Brook). This would enable the park and ride to connect directly to the M4 reducing congestion on both M4 and M32 and connect into the metrobu

@drsm79
drsm79 / WSL Mutable Dev.md
Created June 5, 2018 22:07
Setting up WSL for building Mutable Instrument firmware

Bit of trial and error has resulted in:

  • sudo apt install gcc-avr avr-libc
  • pull in the code & submodules: git clone https://github.com/pichenettes/eurorack.git && git submodule init && git submodule update
  • edit avrlib/makefile.mk to point AVRLIB_TOOL_PATH to /usr/bin and set PROGRAMMER to usbtiny
  • make -f branches/makefile

Seems to build...

@drsm79
drsm79 / fibber.py
Last active May 14, 2018 22:30
Fibonacci to chord sequence
def fib_next(current, previous):
return current + previous, current, int(oct(current + previous).strip('L')[-1])
scale = ['F', 'g', 'a', 'Bb', 'C', 'd', 'em7b5', 'F']
def runme(iterations=False):
pattern = [0, 1]
previous, current = pattern
n = 0
{
"pid": "1234",
"name": "TShirt",
"price": 20
"colors": ["blue","red","white"],
"sizes": ["S","M","L","XL","XXL","XXXL"],
"type": "product-cached"
"modifications": {
"colors": ["blue", "red", "white", "black"],
"sizes": ["S","M","L","XL"],
@drsm79
drsm79 / ConfigAction.py
Created June 24, 2013 20:01
I wanted a way to get my argparser to read args from a config file, so came up with this.
from argparse import Action, FileType, _ensure_value
class ConfigAction(Action):
"""
Given a json file ConfigAction will populate the parser with properties
defined in the json. This won't override settings from other actions or
allow settings not defined in the parser initialisation.
"""
@drsm79
drsm79 / d3-hello.html
Last active September 6, 2016 10:01
d3
<html>
<head>
<script type="text/javascript" src="d3.v3.js" charset="UTF-8"></script>
</head>
<body>
<div id="d3workspace"></div>
<script type="text/javascript">
// Pick the #d3workspace element
d3.select('#d3workspace')
// We're going to work with a p element
/* dashboard-specific css goes here */
#index {
#summary {
span.cost {
display: block;
font-size: 200%;
font-weight: bold;
padding: @buffer 0 @buffer 0;
span.super {
vertical-align: super;