I hope that this can inspire you. The one-line C code, for example http://www.youtube.com/watch?v=GtQdIYUtAHg http://www.youtube.com/watch?v=qlrs2Vorw2Y is fascinating. We can use csound to easily explore these 8-bit patterns, with the possibility to turn them into sounds of high quality. I have added only anti-alias and dcblock filter. The `kt' variable is increased every k-cycle (8kHz in the example) and replaces the `t' variable used in the original C code. The `av' variable contains the previous value of the pattern and allows us to design recursive patterns. Premise: no problems if you have Csound5.16, otherwise you have to use the old parser with the following example (add the `--old-parser' option). csound --omacro:PAT='kt*((kt>>12|kt>>8)&63&kt>>4)' bytesong.csd # by viznut Here is some example using csound from the shell: # first we create an alias for our csound command function bytesong () { csound --omacro:PAT=$1 bytesong.csd; } # don't forget '...' otherwise the shell interprets '<< >> & *' etc.. bytesong '(kt*(kt>>5|kt>>8))>>(kt>>16)' # by tejeez bytesong 'kt*((kt>>9|kt>>13)&25&kt>>6)' # by visy bytesong 'kt*(kt>>11&kt>>8&123&kt>>3)' # by tejeez bytesong 'kt*(kt>>((kt>>9|kt>>8))&63&kt>>4)' # by visy bytesong '(kt>>6|kt|kt>>(kt>>16))*10+((kt>>11)&7)' # by viznut bytesong '(av>>1)+(av>>4)+kt*(((kt>>16)|(kt>>6))&(69&(kt>>9)))' # by pyryp bytesong 'kt*5&(kt>>7)|kt*3&(kt*4>>10)' # by miiro bytesong '(kt>>7|kt|kt>>6)*10+4*(kt&kt>>13|kt>>6)' # by viznut # by tejeez # (this pattern works only with the new parser in 5.16) bytesong '((-kt&4095)*(255*kt*(kt&kt>>13))>>12)+(127&kt*(234&kt>>8&kt>>3)>>(3&kt>>14))' # game over unset -f bytesong ;; bytesong.csd <CsoundSynthesizer> <CsOptions> ;--old-parser -m0 -odac </CsOptions> <CsInstruments> sr = 48000 ksmps = 6 ; kr = 8kHz nchnls = 1 #define T #0# #define V #0# ;; pattern discovered by viznut ;#define PAT #kt*((kt>>12|kt>>8)&63&kt>>4)# instr 1 kt init $T av init $V av = ($PAT) & 255 asrc = av << 7 aflt butlp asrc, 3500 aout dcblock aflt kt = kt+1 out aout*0.7 endin </CsInstruments> <CsScore> i1 0 36000 </CsScore> </CsoundSynthesizer> tito On Mon, Feb 20, 2012 at 08:34:07PM -0600, Roger Kelly wrote: > What would be a good method to generate an 8 bit type sound in Csound? > Would downsamp be a good approach? I am wanting to make some sounds > similar to older video games and similar to this work: > http://kindofbloop.com/