{
   "id" : "1-56K",
   "is_private" : null,
   "code" : "// By Dan Stowell\r\n\r\n// Someone asked me if it was possible to turn any MP3 automatically into 8-bit chiptune music. Well, yes and no...\r\n\r\ns.boot;\r\n(\r\nSynthDef(\"help_mp3_01\", { |bufnum = 0|\r\n   var son, pitch, amp, wibble;\r\n   son = DiskIn.ar(2, bufnum).mean;\r\n   pitch = Tartini.kr(son)[0];\r\n   amp = Amplitude.ar(son);\r\n   pitch = Median.kr(5, pitch); // smooth\r\n   pitch = pitch.min(10000).max(10); // limit\r\n   pitch = pitch.cpsmidi.round.midicps; // coerce\r\n   wibble = Pulse.ar(pitch, 0.2, amp * 2); // resynthesise\r\n   wibble = FreeVerb.ar(wibble, 0.3, 0.1, 0.9); // bit of reverb just to taste\r\n   Out.ar(0, wibble.dup);\r\n}).memStore;\r\n)\r\n\r\n// Choose your MP3... some will work well and most will work badly.\r\n// Oh and you'll need the MP3 Quark.\r\nm = MP3(\"../mp3s/Gimme A Pig Foot And A Bottle Of Beer.mp3\");\r\nm.start;\r\nb = Buffer.cueSoundFile(s, m.fifo, 0, 2);\r\n// Off we go:\r\nx = Synth(\"help_mp3_01\", [\\bufnum, b.bufnum], addAction:\\addToTail);\r\n\r\n// Please remember to tidy up after yourself:\r\nx.free;\r\nb.close; b.free;\r\nm.finish;\r\n\r\n\r\n// More waffle plus a recorded example at\r\n// http://www.mcld.co.uk/blog/blog.php?235",
   "labels" : [
      "8bit",
      "chiptune",
      "pitch",
      "analysis"
   ],
   "ancestor_list" : [],
   "description" : "Migration from the old SourceForge wiki.",
   "name" : "Turning real music into 8-bit music",
   "author" : "codepool"
}
