Experimental music from very short C programs
category: code [glöplog]
i call this one magpie sounds
(JS)
(JS)
Code:
typeof q==='undefined'&&(q=1),t%1600==0?q=random()*2:0,(sin(t/4*q)+cos(t/3.95*q))/2*64+128
its sample rate 16000
intersect
Code:
w=t*('1214'[~~(t/2000)%4]/(1+(~~(t/32000)%2)*0.3)),w%72+w%71+w%73
attempt at making speech synthesis
Code:
speech="this is what i speak",
rate=1,
vowel=["0500505055","5005055500","5005","01231231254","050543050050005"],
v=(vindex)=>(vowel[vindex].charCodeAt(~~(t/3)%vowel[vindex].length)-48)*10,
s=speech[~~(t/1000*rate)%speech.length],
s=="a"?v(0):s=="e"?v(1):s=="i"?v(2):s=="o"?v(3):s=="u"?v(4):s==" "|s=="."|s==","|s==";"|s==":"|s=="/"?0:t*27>>4&t*46>>5
Code:
speech="this is what i speak",
rate=1,
vowel=["0500505055","5005055500","5005","01231231254","050543050050005"],
v=(vindex)=>(vowel[vindex].charCodeAt(~~(t/3)%vowel[vindex].length)-48)*10,
s=speech[~~(t/1000*rate)%speech.length],
s=="a"?v(0):s=="e"?v(1):s=="i"|s=="y"?v(2):s=="o"?v(3):s=="u"?v(4):s==" "|s=="."|s==","|s==";"|s==":"|s=="/"?0:t*27>>4&t*46>>5
changed i vowel to also assign to y