Skip to content

Instantly share code, notes, and snippets.

@jarmitage
jarmitage / aux-task.cpp
Last active February 28, 2024 09:17
Bela auxiliary task pattern
#include <Bela.h>
AuxiliaryTask myTask;
void myTaskProcess (void*);
bool setup(BelaContext *context, void *userData)
{
myTask = Bela_createAuxiliaryTask(myTaskProcess, 50, "bela-task");
return true;
}
@jarmitage
jarmitage / sinebank.py
Created February 17, 2024 21:56
tolvera signalflow sketch
import numpy as np
from tolvera import Tolvera, run
from tolvera.osc.update import Updater
from tolvera.utils import map_range
from signalflow import *
class Sine(Patch):
def __init__(self, freq=880, gain=1.0, pan=0.0):
super().__init__()
freq = self.add_input("freq", freq)
@jarmitage
jarmitage / bw_osc_api.hs
Last active February 5, 2024 05:16
TidalCycles Bitwig OSC API (WIP)
:{
let bwAddress = "127.0.0.1"
bwPort = 8000
bwLatency = 0.02
bwPreamble = []
bwTimestamp = BundleStamp
:}
-- TEMPO
:{
@jarmitage
jarmitage / tidal-multi-stream.hs
Created October 5, 2019 23:31
Multiple Tidal streams to multiple OSCTargets
-- https://tidalcycles.org/index.php/Custom_OSC
:set -XOverloadedStrings
:set prompt ""
:set prompt-cont ""
import Sound.Tidal.Context
superDirt <- startTidal (superdirtTarget {oLatency = 0.1, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cFrameTimespan = 1/20})
@jarmitage
jarmitage / IntechGrid.svg
Created September 12, 2023 14:22
Intech Studio Grid SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jarmitage
jarmitage / cirklon_json_to_tidal.py
Last active September 5, 2023 15:45
Cirklon JSON MIDI mapping file to Tidal MIDI CC mapping
import json
import argparse
def load_json(name):
with open(name) as f:
data = json.load(f)
return data
def make_tidal_map(cc_dict, prefix):
tidal_map = []
@jarmitage
jarmitage / Compiling-PureData-externals-for-Bela.md
Last active July 5, 2023 08:55
Compiling PureData externals for Bela

Compiling PureData externals for Bela

git clone --recursive https://github.com/pure-data/helloworld.git
  • Follow the instructions in the repository (and perhaps build the test project to familiarise yourself).
@jarmitage
jarmitage / scrivx-to-org.py
Created July 13, 2016 14:20
Convert Scrivener .scrivx file to Emacs org-mode file
import xml.etree.ElementTree as ET
import os
from os.path import join
import io
# 1. Extract Docs and .scrivx from Scrivener using 'Open Package Contents'
# 2. Convert Docs from .rtf to .txt using GNU unrtf and put .txt files in folder called txt
# 3. Run script
dir = 'path/to/scriv'
@jarmitage
jarmitage / tidal-hydra.js
Last active May 26, 2023 07:04
Drawing Tidal sounds in Atom-Hydra
// see tidal example: https://github.com/ojack/hydra-examples
p1.remove()
p1 = new P5()
p1.pixelDensity(1)
msg.setPort(3333)
tidalHistory = 128
tidal = []
sounds = {'s':[], 'c':[]}
@jarmitage
jarmitage / taichi_cv_videocapture.py
Created May 8, 2023 22:08
Taichi OpenCV VideoCapture Webcam GGUI Window
import taichi as ti
import cv2 as cv
cap = cv.VideoCapture(0)
if not cap.isOpened():
print("Cannot open camera")
exit()
ti.init(arch=ti.vulkan)
x,y = 1920,1080