This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
| delta=counter=naute=idx=0 | |
| previous=60 | |
| gamme=(scale 50, :minor_pentatonic, num_octaves: 5) | |
| counter_gamme=(scale 38, :minor_pentatonic, num_octaves: 2) | |
| 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| |
This file contains hidden or 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 | |
| with_fx :compressor, threshold: 0.2 do # Preventing clipping | |
| with_fx :reverb, room: 0.8 do # Everything on the same reverb | |
| with_fx :ring_mod, mix_slide: 0.02 do |ringy| # Everything on lip-controlled Ring Mod | |
| with_fx :rlpf, res: 0.7, cutoff_slide: 0.02 do |lipf| # Everything on breath-controlled low-pass filter | |
| tibi = synth :tb303, note: 0, wave: 1, pulse_width_slide: 0.02, res: 0.7, release: 1000, amp: 0 # TB-303-inspired pulse | |
| prof = synth :prophet, note: 0, res: 0.8, release: 1000, amp: 0 # Prophet-like sub | |
| live_loop :notes do | |
| note_on, velocity = sync "/midi/USB_Midi_Cable/4/1/note_on" # Incoming notes from Yamaha WX-11 wind controller |
This file contains hidden or 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 | |
| transpo=-12 # Transposition offset | |
| with_fx :compressor, threshold: 0.2 do # Preventing clipping | |
| with_fx :reverb, room: 0.8 do # Everything on the same reverb | |
| with_fx :rlpf, res: 0.7, cutoff_slide: 0.02 do |lipf| # Everything on breath-controlled low-pass filter | |
| with_fx :whammy, transpose_slide: 0.02, mix_slide: 0.02 do |wham| # Everything on a whammy bar | |
| tibi = synth :tb303, note: 0, wave: 1, pulse_width_slide: 0.02, res: 0.7, release: 1000, amp: 0 # TB-303-inspired pulse | |
| prof = synth :prophet, note: 0, res: 0.8, release: 1000, amp: 0 # Prophet-like sub | |
| live_loop :notes do |