Created
December 30, 2019 00:23
-
-
Save vdg0/7d07d8c4b9dc0fedc25c6da834d0ebd3 to your computer and use it in GitHub Desktop.
Second time before a troop server reset. Gift of pablito @bottom
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
i1>>pluck(P[(2, 5), 4, 3, 2, (3, 7), 6, 7, 8, (7, 9), 8, 5, 3].offmul(-2, 0.25) | |
.splice([(0, 2, 5), 6, 7, 4] | |
), | |
dur=PRhythm([1.5,(5,7)]), | |
## dur = PEuclid(5,8), | |
amp=[0.8, 0.45, 0.25], | |
lpf = PTri(200, 8000, 2), | |
pan=[0,[1,-1]], | |
scale=Scale.prometheus | |
).every(6, "palindrome").every(PRand([2, 4, 8]), "reverse").every(5, "trim", 3) | |
i1.stop() | |
print(SynthDefs) | |
print(Scale.names()) | |
## | |
var.bajo = var([0,2],4) | |
x1 >> sawbass(var.bajo, dur=PDur(5,8), oct=5, hpf=linvar([22,2000],[16,8])) + var([0,2],8) | |
x2 >> blip(var.bajo, dur=1,shape=0.3).every(8,'stutter',4,dur=2, pan=[-1,1], oct=6).every(6, 'offadd',4) | |
### I'll leave a gift at the bottom | |
x2.stop() | |
g3 >> ambi(0,amp=0.6,dur=2,oct=4).follow(x1) + (0,2,4) | |
Clock.bpm.set(90) | |
# Beat | |
bd >> play('v vv v v ',dur=1/2,amp=0.65) | |
sd >> play(' u (u[[uuuu] [uuuu] ])',dur=2,amp=0.6,lpf=sinvar([2000,16000],8)) | |
hh >> play('-[--]--(-[---])-(-[---])-',amp=0.5,pshift=sinvar([0,1],8) * 10) | |
blips.stop() | |
hh.stop() | |
blips >> blip(P[0]-2,dur=1/2,amp=0.6,oct=(3,4),sus=[[1,0.1],[0.1,0.1,1,0.1],0.1,[1,0.1]) | |
g2.stop() | |
g1 >> play('$',amp=0.35,sus=0.01,sample='03502111',pshift=-2) | |
g2 >> play('T ',amp=0.1,lpf=4000,pshift=PRand(10)[:16],sample=1) | |
Group([g1,g2]).stop() | |
# Recording <3 | |
# Previous session: https://gist.github.com/vdg0/47a2abbfe18557ff27ed1d3b9c5948d5 | |
morse_dict = { 'A':'.-', 'B':'-...', | |
'C':'-.-.', 'D':'-..', 'E':'.', | |
'F':'..-.', 'G':'--.', 'H':'....', | |
'I':'..', 'J':'.---', 'K':'-.-', | |
'L':'.-..', 'M':'--', 'N':'-.', | |
'O':'---', 'P':'.--.', 'Q':'--.-', | |
'R':'.-.', 'S':'...', 'T':'-', | |
'U':'..-', 'V':'...-', 'W':'.--', | |
'X':'-..-', 'Y':'-.--', 'Z':'--..', | |
'1':'.----', '2':'..---', '3':'...--', | |
'4':'....-', '5':'.....', '6':'-....', | |
'7':'--...', '8':'---..', '9':'----.', | |
'0':'-----'} | |
def string_to_list(string): | |
return [char for char in string] | |
def char_to_morse(char): | |
morse = morse_dict[char] | |
return morse | |
def morse_to_dur(morse_list, dur_dot, dur_dash): | |
dur_list = [] | |
for each in morse_list: | |
listed = string_to_list(each) | |
for each in listed: | |
if each == ".": | |
dur_list.append(dur_dot) | |
elif each == "-": | |
dur_list.append(dur_dash) | |
return dur_list | |
def string_to_durs(stringo, dur_dot=0.25, dur_dash=1): | |
for each in stringo: | |
string_ac = stringo.upper().replace(" ", "") | |
char_list = string_to_list(string_ac) | |
morse_list = [] | |
for char in char_list: | |
morse_list.append(char_to_morse(char)) | |
dur_list = morse_to_dur(morse_list, dur_dot, dur_dash) | |
return dur_list | |
p1 >> blip(0, dur=string_to_durs('LIVECODING') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment