From static frames to animation – JavaScript, Java & Processing; coding Art ….

As part of my research, I endeavored to build a frame and tile itevenly…as you would a column in a upscale restaurant, or as Billy-Buster tiled his lesser-known below-ground pool in the hilltop paradise above San Simeon. Drawing squares, keeping track of their quantity, position and spacing proved unweildy. So back to the drawing board I turned. The first task was to completely fill a window with squares, evenly spaced, uniformed – no holes. My first breakthrough was a rectangular grid – from the drawing board I found that instead of looping to keep track of the squares (their origins in CGI coordinates space, their quantity, when to drop down a row, when to stop building them…) oy! I located a KISS-simple solution in the following functions and abstract data types:

Click to see it transform.
Some tweaks to a nested-for loop, appropriate “pops” nee popMatrix(); and the careful application of a “random” number generator to produce cool-colored tiles —but not TOO cool — experiment yielded a random range in Green and Blue to give the tiles a watery sheen, sans magenta, indigo, dark purple and the like. For personal intersest and further research I added a mouse event that slows down the animation, eliminates the thin black borders on each tile and zooms in on the whole operation.
At long last “Random dynamic & cool tiles” is up for public consumption:
I could see a pool in Laguna, LA, Vegas or Laughlin with swanky, swarthy, light-up tiles in a pool or on a wall of it’s club …. Bill R. Hearst would be pleased…I like to think so.
Next – I thought about Neil Degrasse Tyson. He says that the “snow” we see on the “TV channels in-between TV channels,” (something our Millennial friends may never fully appreciate…) is ACTUALLY a visual representation of the background radiation that’s permeated the Universe since the Big Bang. UHF & VHF cathode-ray displays pick up this noise and spit out the “ssshhhhhhhh” and the black, white & gray snow we may’ve found on Channel 1 or 3. Mostly, it was annoying and caused us to quickly dial up to CBS, PBS, NBC, FOX or ABC to see what was cookin’….but in the context of nostalgia, the scientific implication of looking back seven trillion years; this “snow” is worth an emulation. Using similar logic I fashioned version 1. The snow doesn’t dance around the screen, but the small circular “flakes” and the way they appear to move based on random gray-scale shadings is a nice start. It looks like they move – kinda.
^^^^I slowed the frame rate down to avoid headaches.
After random “cool” I had to attempt random “warm” –this graphic reminds me of a HollyWood or Vegas marquee. Bright lights seize attention; underscoring the glitz and glamour purported to be found within. The difference is that I think the bulbs this animation emulates are controlled in strict, looping sequences as opposed to my random flashes of “bright” colors controlled by logic.
This animation reminds me of the “Sushi”scene from “Defending Your Life” — Albert Brooks’ barmate proudly states that his life accomplishment was coining the phrase “All Nude. (You know those strip clubs out by LAX? ….“) You needn’t be a fan of his quirky brand of humor to get huge kick out this classic.
That said, I FINALLY got the computer graphic programs to not only display but animate! The “random- (random number generators are not TRULY random, but they are close)-ness” of the algorithms give the displays a kind of innate ability for the computers to create something of THEIR OWN — MY LOGIC & Design—> the computers’ brushstrokes.
All of the “sketches” (as they call them) on my new OpenProcessing Profile are completely original – designed, built, tested, tweaked and deployed by this writer. If you visit my new page & graphics, the source code is easily visible. Feel free to reproduce it yourself, or make changes/improvements to it. You will find that all of them are optimized –nee “code-golfed.” I designed these algorithms to use the fewest lines of code, fewest commands and simplest logic to add a layer of mathematical elegance to the aesthetic of each sketch. Please feel free to download my source code…just plz note that all of them are intellectual property- if you plan to use them in a public/educational or commercial setting…just ask! chris@tapper7.com
More coming soon….plus a litany of fresh podcasts – “I swear it by the old gods & the new.” -t []

Processing animation .js Test ….

Animation *update* unresponsive – posting src and snapshot of fully developed animation as featured image (above).

/*Random lerp circle spirals – cwelke @ SSStudios
last stable build 8/29/2015
Rendered in Java 1.8 using the Processing API which access OpenGL w/in Microsoft Windows 8.1*/
//global vars
float r = 0;
float angle = 0;
float rSteps;
float maxR;
float angleSteps;
float cirSZ;
float centerX;
float centerY;
float r1 = 0;
float angle1 = 0;
float rSteps1;
float maxR1;
float angleSteps1;
float cirSZ1;
float centerX1;
float centerY1;
void setup(){
size (840, 720);
smooth();
setRandomValues();
background(#0E0517); //dk purple-k
}
void draw(){
int i = 0;
int maxBlasts = 0;
//warm & cool spherical sprails ~=40
while(maxBlasts < 21){
displayEllipse2();
moveAngle();
moveAngle1();
checkEdges();
maxBlasts++;
}
while(i < 11){
displayEllipse();
moveAngle();
moveAngle1();
checkEdges();
i++;
}
maxBlasts = 0; //layering
while(maxBlasts < 8){
displayEllipse2();
moveAngle();
moveAngle1();
checkEdges();
maxBlasts++;
}
i = 0;
while(i < 4){
displayEllipse();
moveAngle(); moveAngle1(); checkEdges(); i++;
} //noLoop(); }
void setRandomValues(){
rSteps = random(4, 8); maxR = random(20, 160); angleSteps = random(PI/90, PI/9);
cirSZ = random (12, 44); centerX = random(width); centerY = random(height);
rSteps1 = random(6, 12); maxR1 = random(40, 250); angleSteps1 = random(PI/36, PI/18);
cirSZ1 = random (36, 44); centerX1 = random(width); centerY1 = random(height);
}
void moveAngle(){
angle = angle + angleSteps;
r = r + angleSteps*rSteps; }
void moveAngle1(){angle1 = angle1 + angleSteps1;
r1 = r1 + angleSteps1*rSteps1;
}
void displayEllipse(){
float colorValue = map(r, 0, maxR, 0, 1);
color c = lerpColor(#FF0000, #00FF00, colorValue); fill(c); stroke(#ffffff);
float x = centerX + cos(angle)*r;
float y = centerY + sin(angle)*r;
ellipse(x, y, cirSZ, cirSZ);
}
void displayEllipse2(){stroke(#000000); float colorValue1 = map(r1, 0, maxR1, 0, 1);
color d = lerpColor(#6600FF, #8A2EE6, colorValue1); fill(d);
float x1 = centerX1 + cos(angle1)*r1;
float y1 = centerY1 + sin(angle1)*r1;
ellipse(x1, y1, cirSZ1, cirSZ1);
}
void checkEdges(){
if(r >= maxR || r1 >= maxR1)
r = 0;
r1 = 0;
angle = 0;
angle1 = 0;
setRandomValues();
}
//rest
void mousePressed(){
r = 0;
r1 = 0;
angle = 0;
angle1 = 0;
setRandomValues();
}

//apologies if formatting is bad – ill conjure this up as another convenient XML “fast-loader”
//in fact code will appear as such in future posts for convenience and as jpegs for visualization -c

Music Composition – Building Simplicity part 1 – Drum Corps & I-IV-V-I ….

Let’s go back in time for a moment. We’re 16 again, in the end-zone of some HS football field. Sixty-five of our brothers and sisters surround us for horn-arc. We attentively wait on our Caption Head … maybe it’s Jim Prime, Jim Ott, Rick South, Gail Royer, Jack or John Meehan, Greg Flores, Gordon Henderson, Jim MacFarlane, Gary Kean or Dean Westman. He raises his hands and our horns come up as one. He does two things-

  1. He gives us a “thumbs up”
  2. He smiles

For the uninitiated, the thumbs up signals the “F Tuning” sequence; the smile indicates his joy in conducting this and hearing us perform it , it is also our joy to play it for you. I’m going to bridge the gap between complexity of musical form, aesthetic & structure with our innate ability to enjoy music – no matter if you are a casual listener, a fan, a performer, a student, a pro, or a snobby hack with OCD.

The director brings up his hands and we breathe deep, from the bottom, set our lips and articulate a a unison C in three octaves. Then (perhaps with index and pinky extended to indicate an interval is about to be laid down, he cues the next fermata). The lead barry and sopranos pop up to the perfect fifth: G. Possibly adding another digit to indicate a completing of the major triad, with the next downbeat, seconds arise to the major third – E. –> The I chord is now constructed.

With four digits to signal the IV chord, he cues it and the line moves to an F Major triad – F, A & C. Now with all digits exposed to signal the V chord – he drops the downbeat and we move into G Major – G, B & D. To complete the progression, he gives another big, happy, open downbeat to signal a return home – to the root – I –> C Major again. It rings, it’s in tune, balanced, glorious…it is a moment of sheer joy for all within hearing range.

Why do we “like” F Tuning so much? What makes it happy? Why is the director, performers and audience smiling? That is a question for signal analysts and the neurosciences – what I CAN tell you is what the I-IV-V-I progression expresses artistically, or…at least what is theoretically “saying.” (Hence the study of music theory). I’ve read hundreds of articles and books on this, I’ll be using my own interpretation of the aesthetic. It is open for debate, difficult to define in words – you may have a better or more succinct or poetic way of putting it…for those who wish to learn basic chord progression and the artistic theory associated with F Tuning, I hope to shed some light on what your ears have been telling you all these years.

  1. As the director, I’m going to present the audience with an idea– in this case, the idea is the “color” C. It is plaintive and simple. Though in three octaves it is really just one note. Sixty-six men & women paint it for you.
  2. By cueing the perfect fifth, I’m telling you that “We are going to paint more for you.” The G’s fit just right, like an old baseball mit.
  3. When I layer in the third, I inform you that I’m continuing to “fill in” the picture of a C Major triad. Can you feel the symmetry? Does it appeal to your logical/analytical side? Your creative side? I hope it appeals to both. I’ve given you the WHAT – this piece of art is based on the key of C Major. – What happens next is a bit of a quandary.
  4. I cue the subdominat IV chord –> F Major….In moving to the IV, it signifies a turn inward…it’s as though I’m communicating internally, or perhaps with the performers, but not you…not exactly…not yet. In lyrical music, a IV following a I often contains 1st-person phrases like “Is this a dream?” “How do I feel?” “I’m unsure of myself.” Perhaps (to the 1st-time listener of F Tuning) you are unsure as well…what will I (we) present next? Even though this chord is major (“happy” — sans dissonance), by following the I it evokes uncertainty.
  5. Moving into V –> G Major, I put you back into the picture. In lyrical passages, V’s that follow I & IV often contain verses in the third or second-person. That is; someone, or some group, is being addressed directly. “This is how you make me feel.” “I’ll always remember Dominique’s smile…” “We love our fans.” Subconciously, you should at least get the following message, “NOW you see (hear). NOW you know what I’m (we’re) doing.”
  6. Psychologically (for reasons unknown to me) the V chord following the I & IV send a strong signal that the I chord is coming back — NEXT. If I were to yell “CUT!” before the resolve to I, you are likely to get an uneasy, uncomfortable feeling. To wit, a “buzz-kill.” It’s like in 2nd grade choir when the teacher would play C, D, E, F, G, A, B …… (?????!!!!!) our seven year old brains freaked out a bit…dying to hear the C! You may remember this exercise… some students sang the C out-loud due to frustration. The want or NEED to hear the V resolve to I is even stronger. Scales and one-note-at-a-time patterns have got bupkis on chord progressions.
  7. With a final downbeat – I signal the return home – to I –> C Major. With the V chord, you “saw” … you “knew.” With the resolve…I publicly said, “Now …you understand.” (and tangentially, did you like it? Hopefully, you did).

I reconstructed “Thumbs Up” from memory (not that it’s hard to remember) about a year ago in MuseScore and exported a wave file so you can digitally stand with me in the arc and hear it once more, just don’t be surprised if I add I7 or I9 (“Amen”) to the second refrain & naturally the double high register in the third. It’s the virtual drum corps that lives in my PC. They’re learning.

These feelings, expressions, emotions and forms of communication innate to chord structure and progression can get quite complex, in future installments I’ll add examples to listen to and we’ll delve into far more complex progressions as we learn this together. It’s about time we understood a little bit about our favorite thing in the world, don’t you agree? -t

Looking for latest “posts” dear reader? ….

As we all know, I communicate far more effectively with my voice than my prose.  My last two “posts” were short podcasts showcasing my latest ensemble arrangements, and that of  an associate as well. I’m experimenting with the audio and keeping QC as tight as possible….Broadcasting is what I went school for. That and editing, computer programming and math. My prose always suffers from wordiness. My broadcasts are always clear and concise.
There should be link to my podcasts in Column one of this page and Column two…if not I’ll be adding it.
Best Practice for everyone is to lookup “TapCast” on iTunes. More multimedia content = more gooder.
TapCast is hosted by Tapper7.com and published on Stitcher & iTunes. Get tapped today!

Embed Tapcast via iTunes INTO The Socal Picayune? Technical testing time DING DING!….

So in order to promote my new podcast, so far I can only give search terms on SM….which is way lame, but lots are listening to my prototype level content either organically or because they YOU are reader and have a twisted sense of what qualifies as entertainment (actually you are likely to have a higher education and IQ than 90 % of the public per my analytics analysis aggregation)

SO!force you to search for “Tapcast” on iTunes or 1 mouse click? as software engineer I go with latter. Fast, ez & SIMPLE. No work should be involved to be informed and entertained by the madhouse that is Self-Similarity Studios.
TESTING…..take 1: Apple’s iTunes “Linkmaker”

Below should feature a button so you can “get some” I mean “get it on iTunes” ….

I’ll even allow the Apple branding if it works….
Here are the some of the new transcription arrangements NOT included in the cast….
Testing…”Salvation is Created” adapted from an arrangement by Greg Flores….
Salvation is Created arr. Tapper by Tapper7
*EDIT – Aerith’s theme removed from embedding due to Musescore’s limit of 5 scores, I will repost it on iTunes as “music only” and perhaps a pdf or two here.
*
Relm and Aerith’s Theme were composed by Nobuo Uematsu on behalf of SquareSoft for FF3 on the SNES and FFVII on the PS1, respectively. You can currently order FFVII via Steam if you can’t wait for the remake. As for FF3 (FF6 in Japan), sans a cartridge and console, I recommend snes9x provided you DID purchase the game legitimately when you were a kid. As for Hayes I love that track but f-him na…I thought that guy was cool.

Throw “4chan raids on twitch” into a search if you are bored and in need of laughter. Join up, but after my first, EPIC “Ramoning” of a creepy cosplay guy to entertain the 4channers, 9gaggers, myself and make they annoying anime guy lose his mind…I’m suspended for 24 hours. Next time I’ll record so I can resurrect “Steve from Yellowstone” I wish I’d been recording the livestream. I honestly think Jim and Op wouldve given me an atta boy. Last nights raid on The guest host of Black Ops 3 was beyond epic. Caution; cringe-humor is not for everyone. The running gag was “Bush did 9/11” simply because it made the host lose his mind. Full-blown mental breakdown on camera. Never realized we had FULL CONTROL of his livestream and that none of the donations were real.

Infotainment you won’t hear anywhere else dear reader: The SoCal Picayune.

More Computer Graphics Artwork rendered in Java – Spirals and Variable Crosshatching….

Square Spiral SRC. I will include two ways to view the source code (since WP doesn’t get along with formatted code all that well….)
Below, 4 snapshots posted as jpegs. (it will stay posted it it looks ok)….

At bottom, a far more practical link using my new XML/WP “do it your own way, upload and forget about it” or whatever it is I called that.
Unfortunately, these files can only appear w/in posts as links…any code is subject to all the PHP/CSS/JS hard-wired into most WP themes. I have modified this theme so heavily I could no longer tell you who wrote it. I don’t credit the original author as I only used his code as a template; this not a child-theme…this is The Socal Picayune 2015 WP Theme by Chris Welke.
My Easy/XML to WP system is brand-new …expect improvements!

The featured artwork is a far less complicated algorithm compared with previously-posted recursive “Circle Splatters” and my Recursive “Impressionist” forest I entitled “June Gloom” …still to come on this topic is a 3D fractal terrain map implemented recursively using triangles and a “random” number generator. That’s how they created a whole planet for Captain Kirk to fly over in Star Trek II. (This was the first commercial application of the Diamond-Square Algoritm” which will make sense to anyone with a general knowledge of Euclidean geometry, but put them in the lab and ask them to implement it in Java3D or OpenGL and they MAY go “shit nuts” as I initaillay did 11 years ago when it was a CSC 407 assignment. I had to take an F because I never solved it. My lab partner on the other hand, solved/implemented AND added color-coded elevation for Extra Credit.
spiral code 1spiral code2spiral code3spiral code4

Sometimes, really smart people make me feel really dumb.

Entertainment news, new arrangements + Featured Image by a dear reader….

I’ll let this one speak for itself.

Killing In The Name of RHYTHM arr. Tapper by Tapper7

The featured pic is an enhanced sigpic/Avatar from my self-aggrandizing Facebook page. It is by a treasured reader so I cannot reveal her name, however I await an opportunity to “tap” her back, online in-person or both, so until that time I said I would feature this in The Socal Picayine and so I am. Hence I categorized this under “Plug Love” though I’m unsure what to plug or how at present. The artist took The cropped off #NSFW message at the bottom of this t-shirt was surreptitiously moved it to the top, embedded it carefully and REPOSTED the finished work to my FB Timeline.That took punk-rock historical knowledge, meticulous graphic design and a strange affinity for this writer in order for it to happen. As a massive attention wh— I expressly approve and say thankya.

I hope a few FB friends were offended, but I choose/revise them carefully so I kinda doubt that. “We” appreciate it, “We” love it and “We” think you have a nice blend of intelligence, humor and beauty….she knows who she is.

*Breaking News* Proving my mid-to-late 90s nostalgia is NOT misplaced, SQUARE ENIX (fmrly SquareSoft) announced that it will REMAKE Final Fantasy VII —- a complete reboot! Here is the unveiling (hey cheer up about the death of Jon Snow and be happy about something you negative Nancies….)

Thus, For my next small ensemble arrangement…”Aerith’s Theme” aka “Flowers Blooming in the Church”

I'll reboot the music while SQUARE reboots this EPIC RPG.
I’ll reboot the music while SQUARE reboots this EPIC RPG.
More pics to stir your sense of teenage wonder:
Tifa look to the starry night....
Tifa look to the starry night….
Midgar....2015!
Midgar….2015!
Cloud escapes Mako Reactor, snapped from the original.
Cloud escapes Mako Reactor, snapped from the original.

On top of all that…who the fuck said the movie industry is dead? At long last the greatest story of all time (2nd, behind Cerebus) The Dark Tower, by Stephen KIng, has been optioned for a major motion picture! Woot! It sure is lame that this is all I have to get excited about the future…but ill take it. I’m all good and yes, IT’S all good.

Who “Taps them?” I Tap Them. Who knows? You KNOW!

Post dedication: Doug, Ray, Jen, Glen, Sophia, Arianna, Rich, Dominique, Tony, Michele, MaryJane and whomever I left out: Rest In Peace I remember and love all of you guys – I always will.

Tapper “goes live” on MuseScore.com ….

Tapper's arr. of F Tuning...likely by Jack Meehan originally.

On a whim; we whipped up a quick and dirty transcription of Larry Shane’s epic Soprano lick from Concord’s 1991 program “Conversations in Jazz” —- used MuseScore v1.3 to create it not just for Bb trumpet but for Soprano Bugle in G for historical and nostalgic reasons. We were satisfied enough with the transcript to publish it live on the open-source software project’s official website . The file unexpectedly began trending immediately, despite it being essentially just five or six bars of only two voices IN UNISON, so an executive decision was made to arrange a longer, more fun to listen to track with at least a seven part harmony and an obscure key. “Relm’s Theme” from Final Fantasy III on the Super Nintendo was chosen, again, for nostalgic and historical reasons. We put a great deal of time into that arrangement and it is trending as I write this. Tomorrow people will listen to it in their cars on their way to work, In the park or on the Metro – or maybe with their favorite beverage. More iTunes playlists will include the work of this writer than ever before — so another executive decision was made to release “Lux Aeterna” which is VERY VERY MUCH an experimental WIP AND an innovative from-memory transcription-reboot of “SCV” the Bass Line beat The Santa Clara Vanguard plays as they “troop the line” on the track following a show. It is unknown to me whom actually composed “SCV” so default credit was given Ralph Hardimon and shoutouts to Murray Gussack, Jim Casella, (you can find them @Tapspace — total coincidence about the “Tap” thing — funny how things work out, Thanks again Skare ol’ buddy! Your gifts to my life are truly boundless) Mike “Eppy” Apodaca, Myron, Gail and every SCV Bass Line Veteran in existence.

Due to the unexpected and humbling success of taking these tracks live (listens and downloads are growing geometrically giving them potential to go viral) I dug around for my “Thumbs Up” arrangement which you can easily locate, read and listen to in 33-part harmony here on this site, but the original project file is toast, so I’ll have to rebuild it from scratch — we upgraded to version 2.0.1 today which contains tons of enhanced functionality so my arrangement of Jack Meehan’s famous on-field warm-up “F Tuning” (which is technically C tuning C-C5-Ctriad-FM-GM-CM rpt 3x …crescendo, layer and build from downbeat to cutoff + an “amen” double C’s and at least one triple E …hehheh…you know….)

Anyhoo, srsly check this shit out you guys! I’m really proud of the Relm arrangement and confidant I put enough legwork in to make it legally AND ethically ok to publish (if it were not – I WOULD NOT; per SPJ Ethics Code and applicable US Copyright Laws) In this writers legal opinion, as the track goes through CPI and if it continues to trend, I may be asked to monetize on behalf of SQUARE-ENIX and the original composer – Nobuo Uematsu. I’m happy to do that. I worship their games and his music. I seek no financial gain in this venture. I’m arranging and transcribing music because it is intellectually and artistically fulfilling + I remain an insatiable attention whore…hence “we” are quite optimistic and excited to explore the potential of MuseScore v2.0.1 tomorrow and hopefully upload v2 of “Relm” w/in the next two days. If the html they gave me works – it will embed below. If not, just go to MuseScore.com and look me up – you know what to search for – v2 will also be featured in the next Tapcast (also doing unexpectedly well on iTunes) along with a true story that will either fascinate you or convince you beyond reasonable doubt that I have officially lost my fucking mind. Much love to my regulars and visitors…now put your damn headphones on, listen to the track and get back to work, ok?….and try the veal – don’t forget to tip your waitress. Srsly lolzorz, -t

Relm’s Theme from Final Fantasy III arr. Tapper by Tapper7

Postscript: since the embedding does in fact work – plz forgive the typo A-relative minor, NOT A# –as much qualms as I have about B-flat, A-sharp does not completely exist in my world. #AMIRITE?

Something Self-Similar ….

see src in post

I named my home-studio “Self-Similarity Studios” because I’ve always had an affinity for things in science and nature that affect this quality. “AS ABOVE …. SO BELOW” Think about a rock. Hold it in your hand…what color is it? What shape does it have? Note that the rock you are holding and a mountain (or significantly large hill) MAY look alike….just on different scales. Two inches of a shoreline, viewed from above, with a few hundred bits of sand – MAY look like … two MILES of shoreline from 100 stories above, with a few hundred large rocks. Rocks, mountains, trees, shells, coastlines….they all exhibit a self-similarity. This is where nature and artificiality intersect and dove-tail in strange and striking ways. (More images, experiments and abstraction forthcoming)

I briefly had access to tools that could render graphics quickly (and cost-free) – this was the Silicon Graphics Lab at Cal Poly, donated by SGI, the lab ran about 30 workstations, each running SPARC SOLARIS 7 and all wired into a mainframe capable of doing the massive amounts of calculations needed to draw a frame (or a million, as in a feature-length CGI-animated motion picture) required to not only calculate and store (print; if need be) but depict images that elicit pure aesthetic beauty.

Ahhh….where Logic and Art intersect. On the chipset just beneath my fingers and the never-ending-thought-machine hard-wired to my skull and backbone.

To me; numbers are a simple, spiritual truth. People use numbers to lie all the time; but one can NEVER be deprived of its “one-ness” Carl Sagan said, “The simplest thought like the concept of the number one; is an elaborate logical underpinning. The brain has it’s own language for testing the elegance and consistency of the world.” One is one. QED.
If WWWIII begins at dawn; two will be a prime number. If x is an odd integer, then x + 2 will also be odd. The square root of 2 will be irrational; The sum of The Cantor Set DsubH will be transcendental. Our universe could be obliterated in an instant, but there will still be five and only five regular solids.*
I don’t know about you but I take comfort in that.

Anyway….I had access to this lab for a year; these machines, combined, would still (many years later) dwarf the computing power of yours or my CPU. These machines were used for Raytracing; most famously 1st used in entertainment/(Art!) by John Laseter; the Academy Award winning producer of the short “Luxo Jr.” (and founder of PIXAR).

a frame from luxo jr
How real does this frame look TO YOU?

Luxo is just a lamp, but it took parallel processors days to make him look up, or turn, or jump. Why? – A raytraced image is a 3D scene (Picture the two lamps)….There is ambient and natural light reflected off them, they also project their own artificial light. That’s a lot of photons bouncing around a simple scene – to make it look real; Laseter perfected a technique whereby:
FOR (EVERY PIXEL ON THE SCREEN)
DO (~a million calculations to determine it’s color in RGB Space)
….or a few billion for one frame
….or difficult-to-express numbers for a 3-min short film.

I never got to build or try a ray-tracer…they took about an hour to render just one frame. Till recently a complete developer environment was required to render computer graphics —Visual Studio, a UNIX lab, Something big and expensive from Microsoft, SGI, Sun — all in my interest faded when I didn’t have access to the tools; I never really got the chance to explore it–I STILL have unsolved problems from back then. Only now can an affordable computer be had, open-source IDE’s set up, and LOGIC be used to make art: Fast and CHEAP.

The featured picture was created using the Processing java template library. If you have the JDK (see column two) you can build things like this yourself.

Here is the SRC (Source Code) It uses (to me) the complex compsci-concept of recursion; whereby by a function (in this case a procedure) calls itself. It will render a slightly different image every-time it runs and is easily customize-able; I hope you enjoy it as much as I enjoyed designing the algorithm
/*Algorithm by cwelke @Tapper7.com for Self-Similarity Studios
Last stable build: using Processing API, JDK 1.8, win8.1 5/26/15
Dist under The GNU Public License - compliant with ANSI/ISO std.*/
void setup(){
size(1000, 700);
background(#0F1A0A);
noStroke();
float dec = 0.6;
selfS(width*dec, height*dec, 400);
}//end setup
void selfS(float x, float y, float sz){
float angle, nx, ny;
//last int is transparency--rand switches tint
fill(lerpColor (#002900, #006600, random(1)), 300);
ellipse(x, y, sz, sz);
float rec = 0.6;
if(sz > 1){//recurse to base::do(while px_sz > 1)
angle = random(TWO_PI);
nx = x + sz*rec * sin(angle);
ny = y + sz*rec * cos(angle);
selfS(nx, ny, sz*rec);
angle = random(TWO_PI);
nx = x + sz*rec * sin(angle);
ny = y + sz*rec * cos(angle);
selfS(nx, ny, sz*rec);
angle = random(TWO_PI);
nx = x + sz*rec * sin(angle);
ny = y + sz*rec * cos(angle);
selfS(nx, ny, sz*rec);
}//endIF
}//end selfS

Here is the program run a second time:

only three parameter changes - colors & size
Run again with three parameter changes – colors & size

As long as we are at it check this out:

a recursive forest snap 1
Real…or Artificial?

Same logic – run a second time:

tree snap 2
Algorithmus Eleganten

The source:
/*orig. src by Zack Marlow-McCarthy*/
//modified, formatted, built, debugged and run by Tapper @Tapper7.com
//last stable build at SSStudios 5/27/15
//Processing API builds on JDK 1.8 running win8.1
//rights+compliance: ANSI/ISO std style, Creative Commons & The GNU Public License
float angleRandom1 = .8;
float angleRandom2 = 1/angleRandom1;
float lengthRandom1 = 1.01;
float lengthRandom2 = .08;
void setup(){
size(800,640);
//blue mist mod 5/27
background(#B2B2FF);
smooth();
}
void draw(){
translate(width/2,height);
rotate(PI);
strokeWeight(0);
if(mousePressed == true){
fill(126,20);
rect(-width/2,0,width,height);
strokeWeight(1);
pushMatrix();
translate(random(-width/2,width/2),0);
rotate(random(-PI/9,PI/9));
branch(30,PI/2, 0,0);
popMatrix();
}
}
void branch(float branchLength,float angle,float startX,float startY){
if(branchLength<1){//base case fill(#004A00); noStroke(); ellipse(startX,startY,5,10); stroke(0); }else{ float randomNess = random(0,100); strokeWeight(branchLength/2); float endX = cos(angle)*branchLength; float endY = sin(angle)*branchLength; line(startX,startY,startX+endX,startY+endY); startX += endX; startY += endY; if(randomNess>0 && randomNess<90){ branch(branchLength/(random(lengthRandom1,lengthRandom1+lengthRandom2)), angle*random(angleRandom1, angleRandom2), startX,startY); }else if(randomNess>=90 && randomNess<94){ branch(branchLength/(random(lengthRandom1,lengthRandom1+lengthRandom2)), angle*random(angleRandom1, angleRandom2),startX,startY); branch(branchLength/(random(lengthRandom1,lengthRandom1+lengthRandom2)), angle*random(angleRandom1, angleRandom2),startX,startY); }else if(randomNess>=94 && randomNess<98){
branch(branchLength/(random(lengthRandom1,lengthRandom1+lengthRandom2)), angle*random(angleRandom1, angleRandom2),startX,startY);
branch(branchLength/(random(lengthRandom1,lengthRandom1+lengthRandom2)), angle*random(angleRandom1, angleRandom2),startX,startY);
branch(branchLength/(random(lengthRandom1,lengthRandom1+lengthRandom2)), angle*random(angleRandom1, angleRandom2),startX,startY);
}else{
branch(branchLength,angle,startX,startY);
}//end else
}//end if
}//end recursion

*Proofs to come….[] -t

More fun with Java 1.8 -ASCII “Art” 101 using Arrays….

This is the type of assignment I would hand out to first year programming students. After introducing the idea of lists, I implore them to solve the following:
Use a list to build an ASCII pyramid using the character of your choice and make it: a) appear “pyramidal” that is, no leaning, no right-angles at the base and give it some semblance of aesthetic quality b) your logic should generate EVERY level of the pyramid, that is, no coding “special cases” for the top, middle or bottom rows. The logic must hold sound to construct the entire pyramid as a stand-alone algorithm. c) print your src (source code) and the output of your program to prove to peers that it works.

    This task requires careful dissection of the elements involved:

  • variable number of rows
  • each row knows how many spaces to print and how many characters
  • this involves logical analysis for the left spaces, the chars AND the right spaces
  • The algorithm must know when to “endline”/”newline”/
  • Careful analysis and monitoring (QA/QC) of the variables during runtime may be needed

For the seasoned programmer this is fairly basic, but involves core mathematical concepts, an element of basic aesthetic design and a good grip on list variable storage; how they are both computed and sent to an output stream (System.out in this case) This is the rough equivalent of “cout <<” for you C/C++ guys

    For extra credit:

  • Add a user-interface to ask the user how big to build the pyramid. Include exception-handling for pyramid sizes that are not technically “pyramids” (height = 1 is not a pyramid) heights too large will lose their aesthetic, or their pyramidal structure entirely if built too large or too impractical for the user’s display. (I capped mine at 50 rows) – add warnings depending on the user interface).
  • Decorate the pyramid with one or more random characters in addition to your “foundation” block (I used hashtags for my foundation block).
  • Invert the pyramid.
  • Stack the pyramid atop the inverted one to make a diamond shape…make sure it lines up evenly. No bumps or other strangeness in the middle.

Here is a sample solution; note that I carefully tracked line size, space, building-block-count, row-count & the storage of each…this is crucial to accuracy and QC testing during development time.
This is an acceptable output:

a snap of the pyramid program in-process using the Netbeans IDE
seen w/in the Netbeans Integrated Development Environment. “I design them.”

 

Here is the source code – note brevity in my solution– ~20 lines-ungolfed!:
/*
author: Chris "Tapper" Welke
This program generates an ASCII-art 50 row pyramid using hashtags as a building block.
Solution provided for instructional/informational purposes in the areas of lists,
integers, type-casting, dynamic memory allocation, and open-source programming. If you
are new to Java, this is an excellent trial pgm to get you started.
Dist. under the GNU Public License. Free to distribute: please attribute though, ok?:
Last Stable Build: 5/23/15 at Tapper7.com and Self-Similarity Studios courtesy
The Netbeans (Netbeans.org) IDE, Java 1.8 and the std. javac compiler
OS: Win 8.1, Chipset by Intel. Laptop by Hewlett-Packard. Website provided by Media Temple
*/
package learn;
import java.util.Arrays;
public class HashTagASCIIPyramid{
protected static int charlinelength = 100;
public static void main(String[] arg){
float[] asciiStorage = new float[HashTagASCIIPyramid.charlinelength];
int totalHashtags = 1; //initialize builing block total
int charCount = 0; //count building blocks for QC testing
int[] cclist = new int[100]; //record the char generation as it happens
int leftspaces = (int)asciiStorage.length/2;
int rightspaces = (int)asciiStorage.length/2;
int height = 1;
for(int i = 0; i < asciiStorage.length/2; i++){
for (int l = 0; l < leftspaces; l++){
System.out.print(" "); charCount++;
}
for (int t = 0; t < totalHashtags; t++){
System.out.print("#"); charCount++;
}
for (int r = 0; r < rightspaces; r++){
System.out.print(" "); charCount++;
}
System.out.print('\n');
/*QC Tracking: height++; cclist[i] = charCount;*/
leftspaces--; totalHashtags +=2;rightspaces--;
}//end mn loop
}//end mn
}//end class #asciipyramid

Hints: I used space-fillers for the spaces (” “); – left and right brackets plus lots of variable outputs to see what was going on during run-time, my initial design yielded the following output:
run:
pyramid test1
WHOOPS!
Heh…so clearly there were multiple logic faults, (and I started with tildas, not hashtags….) but it was easy to track the movement of the left and right brackets that debugged the left and right SPACES and not shown are my debugging outputs that checked the length of each row for consistency(it was going over and under 100 – keeping the length of each row equivalent was key to my particular legitimate solution)— also that my iterators and arrays were misplaced and thus not controlling and the output correctly.

    Keys to victory:

  1. increment blocks by TWO; not one
  2. decrement spaces and increment blocks OUTSIDE the main loop rightSpaces--;leftSpaces--totalHashtags+=2;

Coming soon: Bill’s adventures at Los Alamos, More Netbeans experiments, tutorials and anything interesting that happens when I have my camera on me.

Lots of great ideas in the works…and let us not forget: Summer is Coming …. Go Santa Clara and Concord! Support your local drum corps by playing bingo, going to shows, donating your time, tailgating at shows and screaming your lungs out when corps brings you to it on the Field of Honor. All signs point to a another stellar season for Red and Blue Banners both; and I wouldn’t have it any other way (scratch that….I’d resurrect Bridgemen, Suncoast, Big 27, Star, Kingsmen, The Freelancers and The Velvet Knights) THEN it’d be roll-out time.
Under the circumstances, putting all politics aside; Thank God for Rosemont, Rockford, Madison, Garfield, Bloooooo, SCV/BD, Cru, Spirit and all other remamining “Big Time DCI” corps still in the hunt, still rockin’ it…gettin ready for the only kickoff I really care about: Memorial Day Weekend. A trial by fire where those who make it through will be ready for the best summer of their lives. Hang in there kids, you got this!
Music, Tech, Art, Love and Life; find it all right here at The SoCal Picayune. Your LA/OC home for Drum Corps, Culture, tech-security, experiments and solutions, the occasional off-color joke, scam-hunting, YT highlights and the best (and worst) direct from the minds of this writer, Tapper and Bill Feynman.
Maybe a Memorial Day Anecdote will inspire itself as we begin the approach. hmmmmm…..
[] Support my sponsors! All are reviewed regularly for legitimacy by the Senior Ethics Auditor: moi