Skip to content

Instantly share code, notes, and snippets.

@trentgill
trentgill / sequins_arith.lua
Created November 14, 2021 05:01
sequins_arithmetic
-- base sequins
s1 = s{0,4,7}
s1(),s1(),s1() --> 0, 4, 7
-- apply a pattern 'transformer' function to maybe add an octave
s1:fn(function(n) return (n>5) and n or n+12 end)
s1(),s1(),s1() --> 12, 16, 7
+UGen {
fadeChange {
|func, fadeTime=1, fadeClass=(XFade2)|
^[this].fadeChange(func, fadeTime, fadeClass)
}
fadeTrig {
|func, fadeTime=1, fadeClass=(XFade2)|
^[this].fadeTrig(func, fadeTime, fadeClass)
}
fadeSteps {
@andrebrait
andrebrait / keychron_linux.md
Last active April 25, 2024 13:24
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

var harmonics, vols;
harmonics = [1122, 2243, 3369, 4495, 5607, 6677, 7801, 8926, 10146];
vols = [-49, -34, -23, -14, -33, -34, -24, -34, -44, -55].collect({ arg item, i; item.dbamp; });
{Pan2.ar(Mix(SinOsc.ar(harmonics, 0, vols)),MouseX.kr(-1,1))}.scope
@trentgill
trentgill / sequinsdemo.lua
Last active March 21, 2021 01:34
demonstrating usage of the forthcoming 'sequins' lua library for ordering values
--- sequins.
-- a demonstration
engine.name = 'PolyPerc'
local MusicUtil = require "musicutil"
-- TODO operate by reference so the scale can change without recreating the sequin
dim = {3,6,9,15,18,21,-6}
bass = {-6,-12,-15}
lyd = {12,14,16,18,19,9,11,24}
@davidweatherall2
davidweatherall2 / z.scss
Created July 8, 2019 07:05
Z index sass helper function
// Z-index mapping: Correctly place your variable in the correct position based on what it should appear above and behind.
// Example usage: z-index: z(header);
$z-list: (
highest,
lowest
);
@function z($var) {
@JoshCheek
JoshCheek / scrape_sigs
Last active November 23, 2019 04:50
My hydra signature scraping script
#!/usr/bin/env bash
node -e 'console.log(JSON.stringify(require("./src/composable-glsl-functions.js")))' \
| ruby -r json -e '
puts JSON.parse($stdin.read, symbolize_names: true)
.map { |name, defn| {**defn, name: name} }
.group_by { |defn| defn[:type] }
.sort
.each { |cat, defns| defns.sort_by! { |defn| defn[:name] } }
.map { |category, defns|
defns.zip([category]).map.with_index { |(defn,category),i|
@scztt
scztt / debugScope.sc
Last active February 29, 2024 12:26
+ Bus {
debugScope {
| title, names |
var w, ms, listArray, size=380, sliderLoc=0, routine, bus,
min=1000.0, max=(-1000.0), minBox, maxBox, val=0, valBox, synth, m, n, bottom,
playSynthFunction, cmdPeriodFunction, layout;
cmdPeriodFunction = {};
title = title ? "bus %".format( index );
<html>
<script type="module">
import { html, render } from '/lit-html.js';
class MyGreater extends HTMLElement {
static get observedAttributes() { return ['data-name']; }
constructor() {
super();
this.attachShadow({mode: 'open'});
@nerdius
nerdius / vimium-arc-dark.css
Last active September 28, 2023 20:19
Arc Dark theme for styling Vimium link hints
/*
Arc Dark theme for styling Vimium link hints
By Giorgi Gzirishvili (@giogziro95). This code is in the public domain.
To use:
1. Copy the code.
2. Go to the Vimium options.
3. Click Show Advanced Options.