Skip to content

Instantly share code, notes, and snippets.

View madskjeldgaard's full-sized avatar

Mads Kjeldgaard madskjeldgaard

View GitHub Profile
@madskjeldgaard
madskjeldgaard / imgplusaudio2video.sh
Created January 31, 2025 11:25
Combine a still image with an audio file into a video file for social media using ffmpeg
#!/bin/bash
# This script combines an image and an audio file into a video using ffmpeg.
# It prompts the user for the paths to the image and audio files, an optional
# fixed length in seconds, and the output file name. The script ensures that
# the paths are properly quoted and constructs the appropriate ffmpeg command.
# Function to add quotes around a path if not already present
add_quotes() {
local path="$1"
@madskjeldgaard
madskjeldgaard / composition-instruments-notam-meetup.scd
Last active May 27, 2024 15:56
Notes for talk about making Composition Instruments at the Notam SuperCollider meetup May 2024

/*

Examples used in talk about composition-instruments at the Notam SuperCollider meetup May 22nd 2024.

*/

/**************************************************

Part 1: Using vanilla SuperCollider classes

@madskjeldgaard
madskjeldgaard / playbuf.scd
Last active May 16, 2023 15:47
My SuperCollider Buffer player synth

/*

This is the buffer player synth to end all buffer player synths

b = Buffer.read(s, "/Users/mads/test-sounds/Ellen-piano-001.wav")

Synth(\playbuf2, [\buffer, b, \dur, 2.5, \loop, 1, \playrate, 2, \pitchEnvAmount, 0.5, \pitchModAmount, 0.0, \modFreq, 0.1, \modEnvAmount, 0.2, \panModAmount, 1.0, \pan, 0.5, \lowPassFreq, 550, \filterModAmount, 0.9, \filterEnvAmount, 1, \filterEnvScale, 1, \lowPassRes, 0.5, \fmAmount, 0.9, \fmEnvAmount, 1])

TODO:

  • Seperate filter envelope?
@madskjeldgaard
madskjeldgaard / supercollider2live.scd
Last active November 28, 2024 09:44
SuperCollider to Ableton Live setup
/*
This small patch is an example of how to nicely send midi to Ableton Live from SuperCollider.
It includes how to set up Ableton Link (don't forget to press the "LINK" button in Live) and play a pattern using Link and midi.
It is assumed that you do this on MacOS and you have created a midi driver called "IAC Driver".
*/
(
@madskjeldgaard
madskjeldgaard / UserConfiguration.txt
Last active January 2, 2023 15:18
Setup auto mapping of the Torso Electronics T-1 in Ableton Live using UserConfiguration.txt
# ======================================================
# Config File for User-defined InstantMappings
# ======================================================
[Globals]
# The primary MIDI channel that the controller uses in
# the range of 0-15.
GlobalChannel: -1
# ======================================================
@madskjeldgaard
madskjeldgaard / .clang-tidy
Created December 22, 2022 19:08
A clang-tidy config file. Place at the root of your project
---
# Enable ALL the things! Except not really
# misc-non-private-member-variables-in-classes: the options don't do anything
# modernize-use-nodiscard: too aggressive, attribute is situationally useful
Checks: "*,\
-google-readability-todo,\
-altera-*,\
-fuchsia-*,\
fuchsia-multiple-inheritance,\
-llvm-header-guard,\
@madskjeldgaard
madskjeldgaard / lsbrew
Created July 15, 2022 16:44
FZF + HomeBrew: Fuzzy find and install packages
#!/bin/zsh
# Made by Niklas Adam <3
brew search // | fzf --preview 'brew info {}' -e -m --reverse --pointer='▓' --prompt='~ ' --marker='<>' --preview-window=right:60% --border=sharp --bind 'ctrl-w:toggle-preview-wrap' --bind 'ctrl-l:clear-query' --bind 'ctrl-d:deselect-all' --bind 'ctrl-space:toggle' --bind 'ctrl-p:toggle-preview' --bind 'shift-right:preview-page-down' --bind 'shift-left:preview-page-up' --header=$'╔════════════════════╗ \n║░ lsbrew ░║\n╚════════════════════╝\n ' | awk '{print $1}' | xargs -ro brew install
@madskjeldgaard
madskjeldgaard / faust2supercolliderx86
Created September 30, 2021 12:12
faust2supercolliderx86: Force macOS x86 compilation on M1
#! /bin/bash -e
#set -x
#####################################################################
# #
# Compiles Faust programs to supercollider #
# (c) Grame, 2010 #
# #
#####################################################################
@madskjeldgaard
madskjeldgaard / extJITLibGuiHotfixes.sc
Last active July 22, 2021 21:03
A number of overwrites to make JITLib gui (especially NdefGui) more readable on HiDPI screens + responsive to local specs
// Some patches to make JitLib gui stuff more easy on the eyes. Mostly: Larger!
// Also: Make it respond to local specs if defined using the NamedControl style
// FIX: Change font size, button heights and color scheme
+ JITGui {
*initClass {
Class.initClassTree(GUI);
GUI.skins.put(\jit, (
fontSpecs: ["Helvetica", 16],
@madskjeldgaard
madskjeldgaard / daisyproject
Last active March 13, 2021 18:24
Project generator script (UNIX) for the Daisy Seed platform
#! /usr/bin/bash
TARGET_DIR=/home/mads/code/mcu
PROJECT_NAME="$1"
PROJECT_NAME_LOWER=$(echo ${PROJECT_NAME} | awk '{ print tolower($0) }')
PROJECT_DIR=$TARGET_DIR/$PROJECT_NAME
function init(){
if [[ -z "$PROJECT_NAME" ]]; then