This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_real_time # Preventing latency | |
use_tuning :just, :c # Just Intonation | |
bass = (ring 48, 53, 48, 43, 53, 48, 55, 41) # Alternating between C, F, and G | |
with_fx :compressor, threshold: 0.1 do # Preventing clipping | |
with_fx :reverb do # Everything on the same reverb | |
melody = synth :prophet, note: 0, release: 1000, cutoff_slide: 0.02, amp: 0 | |
live_loop :notes do | |
note_on, velocity = sync "/midi/USB_Midi_Cable/4/1/note_on" # Incoming notes from Yamaha WX-11 wind controller | |
if velocity > 0 # Only use actual note-ons | |
control melody, note: note_on, amp: velocity / 127.0 # Incoming note |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_real_time # Preventing latency | |
use_tuning :just, :c # Just Intonation, chords are diatonic in C major | |
with_fx :compressor, threshold: 0.1 do # Preventing clipping | |
with_fx :reverb do # Everything on the same reverb | |
with_fx :lpf, cutoff_slide: 0.02 do |filtre| # Everything on the same breath-controlled filter | |
baritone = synth :hoover, note: 0, release: 1000, amp: 0 # “Classic early 90’s rave synth” | |
tenor = synth :chipbass, note: 0, release: 1000, amp: 0 # “A 16 step triangle wave modelled after the 2A03 chip found in voice 3 of the NES games console.” | |
alto = synth :beep, note: 0, release: 1000, amp: 0 # Sine wave | |
soprano = synth :chiplead, note: 0, release: 1000, amp: 0 # “A slightly clipped square (pulse) wave with phases of 12.5%, 25% or 50% modelled after the 2A03 chip found in voices 1 and 2 of the NES games console.” |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thirty years ago, Robby Kilgore invented a neat harmonization effect for Michael Brecker: http://robbykilgore.com/?p=19 | |
# The basic idea is that incoming notes are doubled by rotating intervals. So you get diverse chords from the same melodic notes. | |
# This script is an attempt to reproduce the same effect. | |
use_real_time # Prevents latency | |
use_synth :fm # Other interesting synth sounds for this: [:hoover, :prophet, :blade, :fm] | |
middle=[-8, -5, -7, -1].ring # Rotating intervals for the middle note of each chord. | |
low=[-12, -17, 0].ring # Rotating intervals for the “bass” note of each chord. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Passing on OSC data to Sonic Pi | |
import oscP5.*; | |
import netP5.*; | |
OscP5 oscP5; | |
NetAddress myBroadcastLocation; | |
void setup() { | |
background(0); | |
frameRate(60); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Based on Small example OSC client from Python-OSC, and Synth.py from Pimoroni's Skywriter examples. | |
This sends the Skywriter HAT's xyz coordinates as OSC messages to Sonic Pi. | |
""" | |
import argparse | |
import random | |
import time | |
import skywriter | |
import os | |
import signal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set_sched_ahead_time! 0 # Setting that one to a negative value makes Sonic Pi complain, it sounds like. | |
with_fx :bpf do |s| # Setting up the fx to be controlled internally | |
synth :square, note: 32,release: 400 # Long release as the control will affect a single note | |
live_loop :ctl do # The loop is inside the fx as this is where the action will be. | |
ctl=sync "/ctl" # The OSC message which Processing sends, based on mouse coordinates. | |
rz=ctl[:args][0] # Assigning the first argument to resonance. | |
ct=ctl[:args][1] # Assigning the second argument to centre. | |
control s, res: rz, centre: ct # The actual control of the fx. | |
set_sched_ahead_time! -2 # Sounds like setting this again every time actually helps. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Learning Processing | |
// Daniel Shiffman | |
// http://www.learningprocessing.com | |
// Exercise 13-5: Using Example 13-5, draw a spiral path. Start in the center and move | |
// outward. Note that this can be done by changing only one line of code and adding one line | |
// of code! | |
// A Polar coordinate, radius now starts at 0 to spiral outwards | |
float r = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gpiozero import * | |
from time import sleep | |
sensor = DistanceSensor(24, 23) | |
n = 0 | |
bz = PWMOutputDevice(18, initial_value=0.4) | |
bz.pulse(fade_in_time=0.3) | |
while True: | |
print('Distance to nearest object is', sensor.distance, 'm') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO #import the GPIO library | |
import time #import the time library | |
from gpiozero import DistanceSensor | |
class Buzzer(object): | |
def __init__(self): | |
GPIO.setmode(GPIO.BCM) | |
self.buzzer_pin = 22 #set to GPIO pin 22 | |
GPIO.setup(self.buzzer_pin, GPIO.IN) | |
GPIO.setup(self.buzzer_pin, GPIO.OUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#N canvas 431 139 708 570 10; | |
#N canvas 553 258 450 300 soundload 0; | |
#X obj 100 157 openpanel; | |
#X obj 100 100 bng 45 250 50 0 empty empty Load 11 22 0 10 -261682 | |
-33289 -33289; | |
#X msg 100 182 read -resize \$1 soundfile1; | |
#X obj 100 209 soundfiler; | |
#X floatatom 100 233 10 0 0 0 - - -; | |
#X obj 100 256 s filelength; | |
#X obj 254 238 samplerate~; |