Skip to content

Instantly share code, notes, and snippets.

View schollz's full-sized avatar
🎺

Zack schollz

🎺
View GitHub Profile
(
s.waitForBoot({
SynthDef("jp2",{ | out,amp=0.75,db=0,freq=40, mix=1.0, detune = 0.4,lpf=10,gate=1,timeScale=8 |
var note=freq.cpsmidi;
var detuneCurve = { |x|
(10028.7312891634*x.pow(11)) -
(50818.8652045924*x.pow(10)) +
(111363.4808729368*x.pow(9)) -
(138150.6761080548*x.pow(8)) +
IN;
SP1;
PA3125,2650;
PD;
PA3125,2675;
PU;
PA3150,2650
;PD;
PA3150,2725;
PU;
IN;
SP1;
PA3125,2650;
PD;
PA3125,2675;
PU;
PA3150,2650;
PD;
PA3150,2725;
PU;
// run this!
(
Server.default.options.numInputBusChannels=0;
s.waitForBoot({
SynthDef("voice",{
arg noteFinal=48, db = 0;
var snd;
var envVolume;
var noteInitial;
var note;
#include <malloc.h>
uint32_t getTotalHeap() {
extern char __StackLimit, __bss_end__;
return &__StackLimit - &__bss_end__;
}
uint32_t getFreeHeap() {
struct mallinfo m = mallinfo();
# convert samples from http://leisureland.us/mellotron.htm
# unzip one of the zip files into a folder
# copy this file into that folder
# run
# python3 convert_leisureland.py
# a new folder "mx.samples" will have the converted samples for mx.samples
import os
import re
import mimetypes
import itertools as it
InstrumentSample {
var server;
var syns;
var <allNumbers;
var <allDynamics;
var <allRoundRobins;
*new {
arg argServer;
^super.new.init(argServer);
# Set minimum required version of CMake
cmake_minimum_required(VERSION 3.12)
# Include build functions from Pico SDK
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
# Set name of project (as PROJECT_NAME) and C/C++ standards
project(sd_fat_spi C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
cmake_minimum_required(VERSION 3.0.0)
project (main)
add_executable(main main.cpp)
// https://www.electrosmash.com/pt2399-analysis
(
SynthDef("pt2399",{
var sndDelay;
var snd = MdaPiano.ar(Demand.kr(Impulse.kr(8),0,Drand([60,67,62,65,67,60,72].midicps,inf)),stereo:0.0,
gate: LFPulse.kr(8).poll,
vel: LFNoise0.kr(5).range(50,70), // varying velocity
mul: 1
);