Skip to content

Instantly share code, notes, and snippets.

View hecanjog's full-sized avatar

hecanjog hecanjog

View GitHub Profile
import aubio
import numpy as np
from pippi import dsp, fx, oscs, shapes, tune, rhythm, noise
from pippi.wavesets import Waveset
from pathlib import Path
RN = 56
dsp.seed(RN)
@hecanjog
hecanjog / index.html
Last active April 27, 2020 04:44
phonography.radio.af setup
<!doctype html>
<html>
<head>
<title>Phonography on Aleatoric Forest</title>
<link rel="stylesheet" href="/style.css?v=2019-06-15" />
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, user-scalable=no" />
</head>
<body>
<header>
import io
import numpy
from pippi import dsp, fx
SAMPLERATE = 44100
CHANNELS = 2
# Reading bytes from an image into a soundbuffer
with open('test.jpg', 'rb') as f:
b = io.BytesIO(f.read())
@hecanjog
hecanjog / rainbow.py
Created December 16, 2016 19:46
guitar rainbows
import mido
from pippi import dsp, tune
out = mido.open_output('UltraLite AVB MIDI 1')
channel = 0
def play(freqs, length=44100):
if dsp.rand() > 0.5:
freqs.reverse()
@hecanjog
hecanjog / lunch.py
Last active August 29, 2015 14:22
Lunch break pattern study
from pippi import dsp, tune
from hcj import keys, fx, drums
kick = dsp.read('snds/kick.wav').data
# tempo path
def tempoPath(nsegs):
maxms = dsp.rand(100, 500)
minms = maxms / dsp.rand(2, 20)
wavetypes = ['hann', 'sine', 'vary']
from pippi import dsp, tune
from hcj import keys, fx, drums
kick = dsp.read('snds/kick.wav').data
hat = dsp.read('snds/hat.wav').data
snare = dsp.read('snds/snare.wav').data
bpm = 100
numbars = 8 * 4
barlength = 6
Memorial Day by Schocholautte. Attribution-Noncommercial-Share Alike 3.0 United States
17 by The Valleys. Attribution-Noncommercial-Share Alike 3.0 United States
Scene: We Swim by Krestovsky. Attribution-Noncommercial-Share Alike 3.0 United States
The Wicked Pair Were Dancing by Blevin Blectum. Attribution-Noncommercial-Share Alike 3.0 United States
Winssen beat by Jonas. Attribution-NonCommercial-ShareAlike 3.0 International
Meatje by D'r Sjaak. Attribution-NonCommercial-ShareAlike 3.0 International
Fly by Happy Elf. Attribution-NonCommercial-ShareAlike 3.0 International
Letters When I'm Lonely by Learning Music. Attribution-Noncommercial-Share Alike 3.0 United States
Credo by Les Baudouins Morts. Attribution-NonCommercial-ShareAlike 3.0 International
Planet Take Over by Krowne. Attribution-Noncommercial-Share Alike 3.0 United States
@hecanjog
hecanjog / squee.py
Created January 19, 2015 02:53
Pippi 'squee' instrument
from pippi import dsp
from pippi import tune
def play(ctl):
midi = ctl.get('midi')
midi.setOffset(111)
pw = midi.get(1, low=0.01, high=1)
scale = [1, 2, 3, 6, 9]
scale = tune.fromdegrees(scale, octave = midi.geti(4, low=0, high=4))
@hecanjog
hecanjog / skip2.py
Created December 25, 2014 03:09
skip2.py
from pippi import dsp
class Player:
def __init__(self, snd, position=0, jump_size=dsp.stf(5), skip_length=dsp.mstf(180)):
self.snd = snd
self.position = dsp.randint(position, position + jump_size)
self.jump_size = jump_size # playhead max jump size
self.skip_length = skip_length # buffer length
@hecanjog
hecanjog / skip.py
Created December 24, 2014 21:06
skip.py
from pippi import dsp
skip_length = dsp.mstf(178)
num_alts = 5
num_sections = 20
section_length = dsp.stf(30)
snd = dsp.read('shadows.wav').data