Permalink
Browse files

Initial collection of examples.

  • Loading branch information...
0 parents commit b8a846175f65cc223503b1510c834e148becf852 @jbum committed Sep 22, 2011
Showing with 3,735 additions and 0 deletions.
  1. +40 −0 chuck/whitney.ck
  2. +112 −0 flash_actionscript/whitney.as
  3. BIN flash_actionscript/whitneyChromatic.fla
  4. +318 −0 flash_actionscript/whitneyChromatic.html
  5. BIN flash_actionscript/whitneyChromatic.swf
  6. +3 −0 midi/_READ_ME.txt
  7. BIN midi/blues.mid
  8. BIN midi/blues2.mid
  9. BIN midi/bluesrev88.mid
  10. BIN midi/chromatic88.mid
  11. BIN midi/lydian.mid
  12. BIN midi/major.mid
  13. BIN midi/major72.mid
  14. BIN midi/major72_rev.mid
  15. BIN midi/major88.mid
  16. BIN midi/minor.mid
  17. BIN midi/minor72.mid
  18. BIN midi/minor72_rev.mid
  19. BIN midi/minorh.mid
  20. BIN midi/nonprimemajor.mid
  21. BIN midi/primeblues.mid
  22. BIN midi/primebluesrev.mid
  23. BIN midi/primemajor.mid
  24. BIN midi/primemajorrev.mid
  25. +23 −0 nyquist/whitney.lsp
  26. +205 −0 perl/makeWhitneyMusic.pl
  27. +51 −0 processing/digital_harmony_examples/whitney_arabesque/whitney_arabesque.pde
  28. +39 −0 processing/digital_harmony_examples/whitney_columna/whitney_columna.pde
  29. +44 −0 processing/digital_harmony_examples/whitney_columnbc/whitney_columnbc.pde
  30. BIN processing/plus_midi/whitney_crank/data/FranklinGothic-Book-22.vlw
  31. BIN processing/plus_midi/whitney_crank/data/radial_axis.png
  32. BIN processing/plus_midi/whitney_crank/data/radial_sweep.png
  33. BIN processing/plus_midi/whitney_crank/data/radial_sweep.tif
  34. +258 −0 processing/plus_midi/whitney_crank/whitney_crank.pde
  35. +160 −0 processing/plus_midi/whitney_music/whitney_music.pde
  36. +61 −0 processing/plus_pd/pd_whitney_osc/data/makeorgan.pl
  37. +978 −0 processing/plus_pd/pd_whitney_osc/data/organbell~.pd
  38. +16 −0 processing/plus_pd/pd_whitney_osc/data/organplayer.pd
  39. +108 −0 processing/plus_pd/pd_whitney_osc/data/organplayerbells.pd
  40. +280 −0 processing/plus_pd/pd_whitney_osc/data/organ~.pd
  41. +57 −0 processing/plus_pd/pd_whitney_osc/data/rissetbell~.pd
  42. +35 −0 processing/plus_pd/pd_whitney_osc/data/risset~.pd
  43. +72 −0 processing/plus_pd/pd_whitney_osc/data/utils/c_ead.pd
  44. +439 −0 processing/plus_pd/pd_whitney_osc/data/utils/rev3~.pd
  45. +30 −0 processing/plus_pd/pd_whitney_osc/data/voice~.pd
  46. +221 −0 processing/plus_pd/pd_whitney_osc/pd_whitney_osc.pde
  47. +77 −0 processing/visuals_only/whitney_2/whitney_2.pde
  48. +77 −0 processing/visuals_only/whitney_blur/whitney_blur.pde
  49. +31 −0 syd/Whitney2Stage.syd
@@ -0,0 +1,40 @@
+// Whitney Music Box
+//
+// Jim Bumgardner jbum@jbum.com
+
+48 => int nbrDots;
+55 => float baseFreq;
+180 => float durationOfPiece;
+2.0/nbrDots => float dotGain;
+
+fun void whitneyDot(float baseFreq, float secs, int nDots)
+{
+ StifKarp voc => dac;
+ dotGain => voc.gain;
+ for (0 => int i; i < nDots; ++i)
+ {
+ baseFreq => voc.freq;
+ 1 => voc.noteOn;
+ secs::second => now;
+ 1 => voc.noteOff;
+ }
+}
+
+// Sample Chromatic Pitch Function
+fun float pitchFuncC(float baseFreq, int noteIdx)
+{
+ return baseFreq*Math.pow(2,noteIdx/12.0);
+}
+
+// Sample Reversed Harmonics Pitch Function
+fun float pitchFuncH(float baseFreq, int noteIdx)
+{
+ return baseFreq*(nbrDots-noteIdx);
+}
+
+for (0 => int i; i < nbrDots; ++i)
+{
+ spork ~ whitneyDot(pitchFuncC(baseFreq,i), durationOfPiece/(i+1), i+1);
+}
+
+durationOfPiece::second => now;
@@ -0,0 +1,112 @@
+// Whitney.as - Jim Bumgardner
+//
+// From ideas by John Whitney -- see his book "Digital Harmony"
+//
+// Version 1.1 - modified for flash 8, and to draw dots instead of filled circles
+// corrected floating point rendering error in center dots
+// by restricting rotation to 0-360
+// 7-29-2007
+
+if (!nbrPoints)
+ nbrPoints = 48;
+if (!cycleLength)
+ cycleLength = 3*60; // 3 minute cycle
+
+// Spin speed
+speed360 = 360*nbrPoints / cycleLength; // Revolutions per second of the fastest point
+ // The slowest node goes 1/nbrPoints this speed.
+
+width = Stage.width;
+height = Stage.height;
+cx = width/2;
+cy = height/2;
+cRad = width/2*.95;
+
+// Function to return a spectrum of color from 0-1
+//
+getColor = function(ratio)
+{
+ var a = 2*Math.PI*ratio;
+ // trace(a);
+
+ var r = 128+Math.cos(a)*127;
+ var g = 128+Math.cos(a+2*Math.PI/3)*127;
+ var b = 128+Math.cos(a+4*Math.PI/3)*127;
+ return (r << 16) | (g << 8) | b;
+}
+
+// Set up the points as movieclips which have their
+// origin at the center. Rotating each clip will spin the dots.
+//
+for (var i = 0; i < nbrPoints; ++i)
+{
+ var mc = _root.createEmptyMovieClip("mc"+i, 100+i);
+ var r = i/nbrPoints;
+ var len = (i+1)*cRad/nbrPoints;
+ var rad = Math.max(2, r*8);
+ mc._x = cx;
+ mc._y = cy;
+ mc.len = len;
+
+ mc.createEmptyMovieClip("dot", 1);
+ mc.dot._x = len;
+ mc.dot._y = 0;
+ mc.dot.clear();
+ mc.dot.lineStyle(rad*2,getColor(r), 100);
+ mc.dot.moveTo(-.2,-.2);
+ mc.dot.lineTo(.2,.2);
+
+ mc.createEmptyMovieClip("outline", 2);
+ mc.outline.clear();
+ mc.outline._x = len;
+ mc.outline._y = 0;
+ mc.outline.lineStyle(rad*2+2,getColor(r) | 0xF0F0F0, 100);
+ mc.outline.moveTo(-.2,-.2);
+ mc.outline.lineTo(.2,.2);
+}
+
+// Animate the points
+startTime = getTimer()*.001;
+_root.onEnterFrame = function()
+{
+ var elapsed = (getTimer()*.001 - startTime);
+
+ // this corrects floating point accumulation errors
+ // which show up in the central dots...
+ if (elapsed >= cycleLength)
+ startTime += cycleLength;
+
+ // var t = elapsed*nbrPoints*360/cycleLength;
+ var t = elapsed*speed360; // optimization for cpu
+ var ti = t/nbrPoints;
+
+ // var tl = elapsed*speed*2*Math.PI;
+ // var tli = tl/nbrPoints;
+ for (var i = 0; i < nbrPoints; ++i)
+ {
+ var mc = _root['mc'+i];
+ // var r = 1-i/nbrPoints;
+ // Draw outline if we passed the 0 degree point
+ var ad = t/360;
+ ad -= int(ad);
+ mc._rotation = ad*360;
+ t -= ti;
+ if (ad < .1) {
+ if (mc.outline._visible == false) {
+ mc.outline._visible = true;
+ mc.outline._alpha = 100;
+ }
+ else {
+ mc.outline._alpha *= .95;
+ }
+ }
+ else
+ mc.outline._visible = false;
+ }
+}
+
+// Draw zero-degree line
+_root.clear();
+_root.lineStyle(.5, 0x555555, 100);
+_root.moveTo(cx,cy);
+_root.lineTo(width, cy);
Binary file not shown.
Oops, something went wrong.

0 comments on commit b8a8461

Please sign in to comment.