Skip to content

Instantly share code, notes, and snippets.

View Enkerli's full-sized avatar

Alexandre Enkerli Enkerli

View GitHub Profile
@ed95
ed95 / EmojiJUCE.h
Created March 29, 2018 16:33
A simple JUCE app using emojis
/*******************************************************************************
The block below describes the properties of this PIP. A PIP is a short snippet
of code that can be read by the Projucer and used to generate a JUCE project.
BEGIN_JUCE_PIP_METADATA
name: EmojiJUCE
vendor: JUCE
website: http://juce.com
@ed95
ed95 / juce_EmojiDefines.h
Last active November 29, 2019 19:49
C++/JUCE emoji defines
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 5 End-User License
@xavriley
xavriley / wavetable_stuff.sc
Created November 13, 2017 08:20
SuperCollider wavetable experiments for Sonic Pi
s.boot
// BEGIN code to convert AKWF wavetables from 600 samples in length to 1024
// because VOsc3 needs a buffer which is a power of two to work properly
// this pipes in stdout from ls
(
var p, l;
p = Pipe.new("find ~/Projects/sonic-pi/etc/wavetables/AKWF/AKWF_0001 -iname *.wav", "r"); // list directory contents in long format
l = p.getLine; // get the first line
@scripting
scripting / xmlToJson.js
Last active June 8, 2017 21:09
An 8-line Node.js script to convert the XML version of Scripting News's feed to JSON.
const xml2js = require ("xml2js"), request = require ("request");
request ("http://scripting.com/rss.xml", function (error, response, data) {
if (!error && (response.statusCode == 200)) {
xml2js.parseString (data, function (err, result) {
console.log (JSON.stringify (result, undefined, 4));
});
}
});
@mbutz
mbutz / base-clarinet-and-modulo.rb
Created March 2, 2017 20:14
FM sounding like bass clarinet
# Bass Clarinet
master_vol = (line 0, 1, inclusive: true, steps: 50).ramp
bass_vol = 0.5
bass_rhythm = (ring 0.25, 0.75, 1, 0.75, 0.25, 0.5, 0.5).shuffle # makes 4 quarters or one bar on the whole
bass_depth = (line 0, 12, steps: 6) # (ring 0.0, 2.0, 4.0, 6.0, 8.0, 10.0) for fm depth:
bass_room = (ring 100, 150, 200, 300)
bass_cycle = 32 # the complete bassline
bass_phrase = bass_cycle / 4 # One of the four patterns
@rbnpi
rbnpi / ReadMe.txt
Last active March 14, 2017 16:27
Code for remote controlled SP with processing GUI controller
These files accompany a video at https://youtu.be/K1KQSFiHg6I which explores the use of a GUI to control a Sonic Pi program
running code to drive an external midi player. (I used Logic Pro) It currently works with SP2.12.0-midi-alpha1 on a Mac,
but may probably break on future versions. It is intended to show some concepts, particularly the use of a GUI written
in processing which can control SP by means of OSC messages. The source code of the processing sketch is included.
It also illustrates a technique to allow a Sonic Pi piece to be started at any bar, by calculating the start note for
each of the parts concerned. It can handle a tied note already playing at the start of the selected bar.
The final technique utilised is to use an external script utilising calls to the Sonic Pi cli interface gem to stop
Sonic Pi running and then to restart the program using a run_file command. In this way, Sonic Pi can respond to
a stop singal from the GUI and then restart playing when a subsequent Play cue is received via
@bennuttall
bennuttall / remotegpio.md
Last active July 8, 2021 18:22
Set up a Pi and host PC for remote GPIO access using gpiozero

Remote GPIO

GPIO Zero allows you to create objects representing GPIO devices. As well as running it on a Raspberry Pi, you can also install GPIO Zero on a PC and create objects referencing GPIO pins on a Pi over the network.

To do this, you'll need to do a few things to get set up:

  1. Enable Remote GPIO on the Pi in the Raspberry Pi Configuration Tool.

  2. Run the pigpio daemon on the Pi:

@emlyn
emlyn / soundboard.md
Last active April 30, 2021 21:11
Sonic Pi Soundboard controlled from your phone
  • Install Control on your phone (for Android, but it, or something similar, is probably available for iOS).
  • Run it, tap on "menu", then "Destinations", and then the "+" symbol. For the destination URL enter the IP address of your computer running Sonic Pi, and for the destination port enter 5005, then click "Add".
  • In your terminal, run the soundboard.sh script (or just copy and paste the last line). This listens on a public port and forwards any UDP packets to Sonic Pi (because Sonic Pi only listens on localhost).
  • Copy and paste the soundboard.rb code into a Sonic Pi buffer and run it.
  • In the Control app, tap on "Interfaces" and select "Monome Emulation".
  • Tap the grid, and you should hear sounds.
  • The sliders adjust volume and low-pass cutoff.
@rbnpi
rbnpi / BachSend1.rb
Last active November 17, 2018 18:39
Experimental program to receive notes from a second machine running SP 2.12beta and play them in synchronism. Requires a processing script to run on each machine as well. Video at https://youtu.be/jc45yr-LUNc
#experimental program one to send notes to
#SP running on a second computer, using OSC sync
use_osc "localhost", 8000
sleep 1 #allow OSC time to setup
use_synth :piano
with_fx :reverb,room: 0.6 do
a1=[]
b1=[]
a1[0]=[:r,:C4,:D4,:E4,:F4,:D4,:E4,:C4,:G4,:C5,:B4,:A4,:B4,:C5,:D5,:G4,:A4,:B4,:C5,:A4,:B4,:G4,:D5,:G5,:F5,:E5,:F5,:G5,:E5,:A5,:G5,:F5,:E5,:G5,:F5,:A5,:G5,:F5,:E5,:D5,:C5,:E5,:D5,:F5,:E5,:D5,:C5,:B4,:A4,:C5,:B4,:D5,:C5,:B4,:A4,:G4,:Fs4,:A4,:G4,:B4,:A4,:D4,:C5,:B4,:C5,:D5,:B4,:A4,:G4,:Fs4,:E4,:G4,:Fs4,:A4,:G4,:B4,:A4,:C5,:B4,:D5,:C5,:E5,:D5,:B4,:C5,:D5,:G5,:B4,:C5,:B4,:A4,:G4,:G4,:r,:r,:G4,:A4,:B4,:C5,:A4,:B4,:G4,:Fs4,:G4,:Fs4,:r,:r,:A4,:B4,:C5,:D5,:B4,:C5,:A4,:B4,:r,:r,:D5,:C5,:B4,:A4,:C5,:B4,:D5,:C5,:r,:r,:E5,:D5,:C5,:B4,:D5,:Cs5,:E5,:D5,:Cs5,:D5,:E5,:F5,:A4,:B4,:Cs5,:D5,:Fs4,:Gs4,:A4,:B4,:C5,:D5,:E4,:Fs4,:Gs4,:A4,:Fs4,:Gs4,:E4,:E5,:D5,:C5,:E5,:D5,:C5,:B4,:D5,:C5,:A5,:Gs5,:B5,:A5,:E5,:F5,:D5,:Gs4,:F5,:E5,:D5,:C5,:D5,:C5,:B4,:A4,:A4,:A5,:G5,:F5,:E5,:G5,:F5,:A5,:G5,:G5,:E5,:F5,:G5,:A5,:F5,:G5,:E5,:F
@AlexandreRangel
AlexandreRangel / OSC_C_01.rb
Last active April 8, 2019 10:40
Controling Sonic Pi from Processing OSC
# reading OSC from Processing, Alexandre Enkerli
# full screen, fulltime mouse, Alexandre Rangel
# 24-Nov-2016
# Sonic Pi 2.11
use_bpm 120
set_sched_ahead_time! 0 # Setting that one to a negative value makes Sonic Pi complain, it sounds like.
live_loop :osc do # The loop is inside the fx as this is where the action will be.
osc=sync "/osc" # The OSC message which Processing sends, based on mouse coordinates.