; [ʞ] physical.orc
;  ~ lexi hale <lexi@hale.su>
;  🄯 CC-NC-BY-SA 3.0
;  ? rippy stampy slappy noises for meatspace shenanigans


#include "base.orc"

; for inserting items into slots
instr snap
	aw crunch p4, p3, 500, 0.3
	aws stix p4, p3, 200, 0.5
	out aw+aws
endin

instr slide
	anois unirand 1
	avol pulse p3, 0.3
	aw poscil p4*avol, anois * 300
	out aw*p4*avol
endin

;gisaw ftgen 0, 0, 16384, 10, 0, .2, 0, .4, 0, .6, 0, .8, 0, 1, 0, .8, 0, .6, 0, .4, 0,.2

instr zip
	kton bpf linseg:k(0,p3,1), 0,300, 0.7, 600, 1, 1000
	ktf unirand 1.0
	kton = kton - ktf * 350
	aw lfo 1.0, kton, 4
	avol fade p3,p4,0.3,0.9
	out aw*avol
endin

gisine ftgen 0, 0, 16384, 10, 1

instr vrrm
	avol pulse p3, 0.3
	kvib vibr 1, 100, gisine
	aw poscil p4*avol, 300 + (200*kvib)
	out aw
endin

instr flutter
	anois unirand 1
	avol pulse p3, 0.3
	aph phasor 20
	out anois*avol*p4*aph
endin

instr shred_b
	avol fade p3,p4, 0.03, 0.97
	ar rand 1.0
	abf poscil 10, 60
	ap poscil 1, abf
	af bpf ap, 0,p5, 0.5, p6, 1,p7
	av bpf ap, 0,.1, 0.2,1, 0.5,0.6, 1,.1
	aw reson ar, af, af/2
	out aw*avol*av * 0.01
endin

instr shred
	al subinstr "shred_b", p4/2, 200, 300, 1500
	ah subinstr "shred_b", p4/2, 600, 800, 1700
	ahh subinstr "shred_b", p4/2, 800, 1200, 1900
	avvh poscil 1, 10
	avvh bpf avvh, 0,0, 0.5,0, 1,1
	avh poscil 1, 10
	avl poscil 1, 5
	out (al*avl) + (ah*avh) 
endin

instr keen
	an unirand 1.0
	al bpf an, 0,1000, .5,p5, 1,2000
	ah bpf an, 0,1000, .5,p6, 1,2000

	ap poscil 1, p7
	at = (al * ap) + (ah * (1-ap))

	ak poscil p4*0.005, at

	out ak
endin
