Skip to content

Instantly share code, notes, and snippets.

View madskjeldgaard's full-sized avatar

Mads Kjeldgaard madskjeldgaard

View GitHub Profile
@madskjeldgaard
madskjeldgaard / of-nvim.md
Last active November 13, 2025 16:53
Notes on getting NeoVim and openFrameworks to play nice (work in progress)

Install clang formatting

On Arch Linux I had to install clang to make this work: sudo pacman -Syu clang

There's some really nice autoformatting plugins from Google. Add these to your init.vim and install:

" Code formatting (for c++)
Plug 'google/vim-maktaba'
Plug 'google/vim-codefmt'
@madskjeldgaard
madskjeldgaard / newnannou
Last active April 9, 2020 14:12
Nannou project generator bash script
#!/usr/bin/env bash
#
# A script for generating nannou projects
#
# Usage: newnannou <projectname>
# If you set the environment variable NANNOU_DIR to the path
# of your nannou projects folder, this will be used, otherwise
# the target folder is your home folder
#
# by Mads Kjeldgaard 2020
@madskjeldgaard
madskjeldgaard / main.rs
Last active December 22, 2022 15:00
Simple buffer playback in Rust using the rodio crate
use rodio::Sink;
use std::fs::File;
use std::io::BufReader;
fn main() {
// Sound output
let device = rodio::default_output_device().unwrap();
let sink = Sink::new(&device);
// Buffer playback
@madskjeldgaard
madskjeldgaard / ndef-setter.scd
Last active April 22, 2020 14:22
Set Ndef using custom event
(
// Create new Ndef setter event type
Event.addEventType(\ndset, {|server|
~type = \set;
~id = Ndef(~key).group;
~args = Ndef(~key).controlKeys(except: ~exceptArgs);
currentEnvironment.play;
})
)
@madskjeldgaard
madskjeldgaard / build-sc3-plugins-pi.sh
Last active February 5, 2025 07:10
Install SuperCollider and SC3-plugins headless on Raspberry Pi
#!/bin/sh
# Taken from: https://github.com/lvm/build-supercollider
###
#
# Variables
#
INSTALL_DIR=/tmp
SUPERCOLLIDER_VER=main
SC3PLUGINS_DIR=$INSTALL_DIR/sc3-plugins
@madskjeldgaard
madskjeldgaard / njstart
Created May 3, 2020 13:56
A startup script that sets up a zita-njbridge source and transmits a sine wave using SuperCollider and Tmux
#!/bin/bash
#
# This script makes it easy to setup a source in a networked audio connection
# It uses the 'zita-j2n' (jack to network) command to send audio to the network
# (to be received using 'zita-n2j' on the other end)
#
# Usage
# njstart <target_ip> <target_port> <scfile (optional)>
# Dependencies: jack, zita-njbridge, SuperCollider, tmux
#
@madskjeldgaard
madskjeldgaard / notam-sc-meetup-may-2020.txt
Last active May 11, 2020 18:56
Notam SuperCollider meetup 11th of May 2020
# 2020-05-11
Gaspar
Hii
18:40
salkin
helloo
will be back in 20
18:41
Gaspar
@madskjeldgaard
madskjeldgaard / notam-spatial-audio-meetup-may-2020-chat.txt
Created May 13, 2020 18:57
Chat log from the spatial audio meetup at Notam May 2020
Hello and welcome to this virtual Notam meetup.
This is a space for sharing ideas, inspiration, workflow, projects, tips and tricks and just hanging out with likeminded people.
It's nice to get to know each other so when/if it's your turn to speak, please tell us your name and a bit about yourself.
Feel free to post a link to your website/soundcloud/bandcamp/github or whichever page we could visit to learn a bit more about you and your work.
Thanks for joining!
@madskjeldgaard
madskjeldgaard / alt-nodeproxygui.scd
Created May 15, 2020 21:07
Alternative, more modern and responsive auto gui for NodeProxy in SuperCollider
// Test Ndef
(
Ndef(\yo, {|freq, amp, pan, what|
var sig = SinOsc.ar(freq) * amp;
what;
Pan2.ar(sig, pan)
}).play
)