Writing (or coding) waveshapes

Discussion forum for G-Force users

Moderators: BTT, andy55, b.dwall, juxtiphi

Post Reply
jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Evolution of a Particle...

Post by jerohm »

rebirth of an existing Particle (apologies to Thomas Geier, should he care)...

let's start with something pretty boring...

Code: Select all

// A tipped square

Aspc=1
ConB=1
Num=1

Stps="5"

A0="2 * PI"
A1=".7"

C0="A1 * cos( A0 * s )"		// x Front
C1="A1 * sin( A0 * s )"		// y

X0="C0"
Y0="C1"

LWdt="1.5"
Pen="1"
Meta="reactive=4 detail=3 density=3 morphable=4"

Vers=400
(Meta set to WaveShape for testing convenience!)

Okay... let's put things in the proper orientation:

Code: Select all

// A Square

Aspc=1
ConB=1
Num=1

Stps="5"

A0="2 * PI"
A1=".7"

C0="A1 * cos( A0 * (s-(1/8)) )"		// x Front
C1="A1 * sin( A0 * (s-(1/8)) )"		// y

X0="C0"
Y0="C1"

LWdt="1.5"
Pen="1"
Meta="reactive=4 detail=3 density=3 morphable=4"

Vers=400
Time to see double and rotate to prove we aren't just wasting our time (too much, anyway)

Code: Select all

// Rotating planes

Aspc=1
ConB=1
Num=2

Stps="5"

A0="2 * PI"
A1=".7"
B0="t/4"


C0="A1 * cos( A0 * (s-(1/8)) )"		// x Front
C1="A1 * sin( A0 * (s-(1/8)) )"		// y
B1="A1 * (-1^Id) * cos(A0/8)"		// z [ sqrt(2)/2, hmmm?!? ]

// Rotate around the y axis
C2="C0 * cos( B0 ) + B1 * sin( B0 )"	// x'


X0="C2"
Y0="C1"

LWdt="1.5"
Pen="1"
Meta="reactive=4 detail=3 density=3 morphable=4"

Vers=400
That was fun... why don't we double the fun and shift the new components 90 degrees forward in time...

Code: Select all

// Rotating Cube

Aspc=1
ConB=1
Num=4


Stps="5"

A0="2 * PI"
A1=".7"
B0="t/4 + (Id > 1) * (Pi/2)"

C0="A1 * cos( A0 * (s-(1/8)) )"		// x Front
C1="A1 * sin( A0 * (s-(1/8)) )"		// y
B1="A1 * (-1^Id) * cos(A0/8)"		// z [ sqrt(2)/2 ]

// Rotate around the y axis
C2="C0 * cos( B0 ) + B1 * sin( B0 )"	// x'

X0="C2"
Y0="C1"

LWdt="1.5"
Pen="1"
Meta="reactive=4 detail=3 density=3 morphable=4"

Vers=400
hmmm ... doesn't look all THAT different!?! Let's try rotating it around the x axis too ... maybe ...

Code: Select all

// Spinning Cube - Different Approach

Aspc=1
ConB=1
Num=4

Stps="5"

A0="2 * PI"
A1=".7"
B0="t/4 + (Id > 1) * (Pi/2)"

C0="A1 * cos( A0 * (s-(1/8)) )"		// x Front
C1="A1 * sin( A0 * (s-(1/8)) )"		// y
B1="A1 * (-1^Id) * cos(A0/8)"		// z [ sqrt(2)/2 ]

// Rotate around the y axis
C2="C0 * cos( B0 ) + B1 * sin( B0 )"	// x'
C3="B1 * cos( B0 ) - C0 * sin( B0 )"	// z'

// Rotate around the x axis
C4="C1 * cos( t/4 ) + C3 * sin( t/4 )"	// y'

X0="C2"
Y0="C4"

LWdt="1.5"
Pen="1"
Meta="reactive=4 detail=3 density=3 morphable=4"

Vers=400
Now if this didn't ALREADY exist, we could be pretty proud! Instead, we are nothing more than a johnny come lately... but that is still okay. I encourage you to compare this solution with the existing particle.
Have fun!

My favorite definition If you ask how I stumbled upon it, I plead the fifth :oops:

:lol: V-V- * Cute * -V-V :lol: ... jrm :P
Last edited by jerohm on Sat Aug 20, 2011 4:57 pm, edited 2 times in total.

bnh
Posts: 59
Joined: Fri Jan 19, 2007 7:11 pm

Ref Jerhom's Rotating Square Config

Post by bnh »



Rotating waveshape plus particle. Waveshape config shown at right. Waveshape will react to sound and "unfold" into two "house-shapes" while staying inside the particle.
Image

Rotating particle alone. Config shown at right. Particle rotates at a different speed than Waveshape. Particle does not react to sound. Detour FlowField added at end of .mov file.
Image


Another rotating variation on config, but not used in .mov files. Does not "unfold" and is easier to grasp shape. Shows flexibility of Jerhom's design.
Image
All variations based on Jerohm's Rotating Square config

See .mov files here:

Waveshape + Particle:

http://www.bnh.net/gforce/house1.mov

Particle:

http://www.bnh.net/gforce/rotatingsquarevar4.mov
Last edited by bnh on Sat Aug 20, 2011 1:24 pm, edited 4 times in total.

User avatar
BTT
Administrator
Posts: 2162
Joined: Sun Jun 20, 2010 9:34 pm
Location: United Kingdom

Post by BTT »

Hello bnh

Could you please post the code for your Config so that I can download it.


Regards BTT

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

RE: bnh PARTICLE

Post by jerohm »

Ask yourself WHY setting 'Num' to anything greater than 4 would make ANY difference whatsoever?!? Steps... YES!!! Unfortunately I FORGOT the original code (do'h!) so I have to look back before "I" can provide a satisfactory answer, but I don't THINK it is necessary :wink:

'Num's define the number of copies of the task. Anything greater than four has already been accomplished by tasks[0-3]. It won't hurt anything, except it just overwrites & consumes extra resources... That makes sense ... right? ... because we are only dealing with 4 sides anyway. It really makes the MOST sense to only have Num=2, and deal with each '[z] pair' as X0/Y0 and X1/Y1. That is the route I ultimately chose if you caught my YouTube/Extras messing 'round (which also has a X2/Y2 set - the top and bottom planes).

Code: Select all

// bnh Particle

Aspc=1
ConB=1
Num=2		// Better Choice if ALSO dealing w/ top & bottom
     		// ... which of course we AREN'T here, but who knows!
// Stps="49"	// Not necessary for (semi-)circles [just default]

A0="3.4 * 1.25"
A1=".7"
B0="t/4 + (Id) * (Pi/2)"		// 90 degree shift

C0="A1 * cos( A0 * (s-(1/8)) )"		// x Front
C1="A1 * sin( A0 * (s-(1/8)) )"		// y
B1="A1 * cos(A0/8)	"		// z [ sqrt(2)/2 ]

X0="C0 * cos( B0 ) + B1 * sin( B0 )"	// x', +z
Y0="C1"
X1="C0 * cos( B0 ) - B1 * sin( B0 )"	// x', -z
Y1="C1"

LWdt="1.5"
Pen="1"
Meta="reactive=4 detail=3 density=3 morphable=4"
Vers=400
Nice Job and fumble on ... :P

( I hope you took my critique in the manner it was intended ... and that is for you to gain even MORE understanding :D )

VVV Nice Job!, fun to watch! VVV
Last edited by jerohm on Wed Aug 31, 2011 9:24 pm, edited 5 times in total.

bnh
Posts: 59
Joined: Fri Jan 19, 2007 7:11 pm

Re: RE: bnh PARTICLE

Post by bnh »

jerohm wrote:Not that I would ever be critical :roll: , but first fix 'Jehom' dimmit!!! :lol: . THEN ask yourself WHY setting 'Num' to anything greater than 4 would make ANY difference whatsoever?!? Steps... YES!!! Unfortunately I FORGOT the original code (do'h!) so I have to look back before "I" can provide a satisfactory answer, but I don't THINK it is necessary :wink:
Yep, sometimes I'm totally lost. Now that you mention it, I did spend time trying to understand the Num again -- but obviously failed in that task. Since my time is so intermittently spent with this code, when I come back to it I've forgotten most of what I learned and just fumble along.

Thank you for reminding me what Num means. I sort of overkilled that last one.

Here are some variations on Jerohm's Spinning Square config. Except for the two config's used earlier, which came from the rotating square config, all of the waveshapes are from the Spinning Square.

1. Jerohm's configs show a neatness, a symetry assiciated with an organized mind. That symetry demonstrates understanding and control. I prefer to break up that symetry (as proof of my lack of understanding) and go straight for some form of abstract expression.

These are one-minute .mov files, approx 20 MG each. If you don't have a fast connection, and since my server does not have the optomized feed for streaming flash files, you might want to download these first to watch them.

These renderings are run from the same vanilla script for comparison. Since I used Camtasia for the capture, the screen display is much smoother than these .mov files, but you'll get the idea.

Image

The first .mov file has no audio. You can watch the .mov rendering using the link below:

http://www.bnh.net/gforce/spinsquare1.mov


Image

2. I put some Reggy Watts music to the following .mov, using the same waveshapes used above. I think you (jerohm) will recognize your Vortex flowfield in these two renderings.

http://www.bnh.net/gforce/spinsquare3.mov

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Absolutely NO MAGIC here, but ...

Post by jerohm »

...some reasonable techniques you won't find examples of anywhere else. Hopefully it is presented in small enough bite size pieces that those who care, can digest. There is a lot here, don't be deceived. As always it is better to start off with FlowFields: '(Empty)' ... and wade in slowly. This a PROGRAMMING EXAMPLE ... NOT a finished WaveShape... run with the concept and impress your friends :lol: !
have fun!

Updated version...

Code: Select all

// Single 'Task' 'Squared' Audio Orb
//   Musings of a sick mind...
//
// Note 99% of the effort is in setting up the 'AVar's
//  (which are a ONE TIME calculation - minimal runtime penalty)

Num=1
Aspc=1
ConB=1

// This technique can obviously be extended to [N]umber (within reason) of Segments
// ( I use 'dot()' for syntax readability )
//
A0="{ .3, .7 }"                                 // Segment[N] 'weights', 'SHOULD' Sum to 1
A1="{ clamp((s)/col(A0, 0))
    , clamp((s-dot(A0,{1,0}))/col(A0, 1))
    }"                                          // Segment[N] 's' 0 -> 1

A2=".75"                                        // Scale

// [Scaled] Object Defintion (by Segment Components)
//   (Segmented Circle)
//
A3="A2 * (
    1 * {  sin( 2 * Pi * (row(A1, 0) - .25))
        ,  cos( 2 * Pi * (row(A1, 0) - .25)) }
  +
    1 * {  2 * row(A1, 1)
        ,  0 }
    )"

A4="Num_S_Steps * col(A0, 1) / 18"                  // Steps/Div
A5="trunc((row(A1, 1)+ .5/A4) * A4) / A4"           // Stepped 's'
A6="A2 * sin(Pi*A5)"                                // Stepped Sine Mask

X0="row(A3, 0)"
Y0="row(A3, 1) + A6 * mag(A5)"                  // Why do I use 'A6' ?

// 't' in an 'AExpr' is MEANINGLESS (do'h!)
// ( Try reassigning A7 -> B0 ;0)
//
A7="1.3 * select(row(A1, 1), sin(Pi*row(A1, 1)), 2 * abs(sin(t/2 + Pi/4 + 1/(col(A0,0))*Pi*s))) +.2"
LWdt="A7"
Pen=1

Meta="reactive=5 detail=3 density=3"
Vers=400
8-[ Something Else 8-[

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Another Example...

Post by jerohm »

Code: Select all

/* Programming EXAMPLE (Only), Just for fun - jrm
   FF: Left Turn and Flow Out
*/

Aspc=1
ConB=1			// 0 also interesting

Stps="200"

A0="Num_S_Steps/10"
A1="trunc(A0*s)/A0"
A2="1 - (((flip(A0*s) > 0)))"

A3=".9 * cos(s*Pi)"
A4=".9 * sin(s*Pi)"

X0=" A3"
Y0=" A4 * select( A2,  A2, min(abs(mag(A1)*2),1))"

X1=" A3"
Y1="-A4 * select(!A2, !A2, min(abs(mag(A1)*2),1))"

LWdt=".2+ sin(Pi*s)/1.5"
Meta="reactive=2 detail=3 density=3"
Vers=400

Code: Select all

/* Programming EXAMPLE (Only), Just for More fun - jrm
    Interesting variation (with more potential)
    This is probably the most effective when set to the ONLY WS (not red lighted) and let Andy go through the morphing (unto itself)...
*/

Aspc=1
ConB=1

Stps="300"

A0="2"
A1="Num_S_Steps/3"
A2="trunc(A1*s)/A1"
A3="1 - (((flip(A1*s) > 0)))"

B0="sin(t/8)"
B1="cos(t/8)"

B2=".9 * cos(2*s*Pi + t/2)"
B3=".9 * sin(2*s*Pi - t/2)"

C0=" B3 * select( A3,  A3, min(abs(mag(A2)*2),1))"
X0="( C0*B0 + B2*B1)"
Y0="( B2*B0 - C0*B1)"

C1="-B3 * select(!A3, !A3, min(abs(mag(A2)*2),1))"
X1="( C1*B0 + B2*B1)"
Y1="( B2*B0 - C1*B1)"

LWdt=".2+ sin(Pi*s)/1.5"
Meta="reactive=2 detail=3 density=3"
Vers=400

Code: Select all

/* Mobius(-Like) - jrm
    12Nov - Nothing special (but kinda interesting)
    13Nov - Just a touch more special - Particlized unique Personality

    Arguably(?), better as a Particle ... maybe...
*/

Aspc=1
ConB=1

Stps="255*2"

A0="2"
A1="Num_S_Steps/6"
A2="trunc(A1*s)/A1"
A3="1 - (((flip(A1*s+0/(Num_S_Steps+1)) > 0)))"
A4="Pi*s"
A5="A4*2"

B0="sin(A4 + t/8)"
B1="cos(A4 + t/8)"

B2=".9 * cos(A5 + t/16)"
B3=".9 * sin(A5 - t/8)"
B4="(min(abs(mag(A2)*2),1) + B4)/2"

C0="select(((dt!=0) || A3), B3, B3*B4)"

C1="(C0*B0 + B2*B1)"
C2="(B2*B0 - C0*B1)"

X0=" C1"
Y0=" C2"
X1="-C1"
Y1="-C2"

Pen="(128-(dt!=0))/128"
LWdt=1
Meta="reactive=3 detail=3 density=3 morphable=5"
Vers=400
rather than update the above, you can compare it with this version...

Code: Select all

/* Mobius(-Like)
    13Nov2011	jrm	Creation
    18Nov2011	jrm	Alternate WS Presentation
*/

Aspc=1
ConB=1

Stps="255*2"

A0="choice({0,1})"		// Random presentation

A1="Num_S_Steps/4"
A2="trunc(A1*s)/A1"
A3="1 - (((flip(A1*s+0/(Num_S_Steps+1)) > 0)))"
A4="Pi*(2*s -1)"
A5="A4*2"

B0="sin(A4 + t/8)"
B1="cos(A4 + t/8)"

B2=".9 * cos(A5 + (((dt!=0)||A0)*t)/16)"
B3=".9 * sin(A5 - (((dt!=0)||A0)*t)/8)"
B4="(min(abs(mag(A2)*2),1) + B4)/2"

C0="select(((dt!=0) || A3), B3, B3*B4)"

X0="(C0*B0 + B2*B1)"
Y0="(B2*B0 - C0*B1)"

Pen="(128-(dt!=0))/128"
LWdt=".7 + abs(.3 * sin(4*Pi*(s+(1/8))))"
Meta="reactive=3 detail=3 density=3 morphable=5"
Vers=400
Last edited by jerohm on Mon Jan 23, 2012 10:59 pm, edited 1 time in total.

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Squaring up the wave

Post by jerohm »

Code: Select all

// Musings... jrm
    Squaring up the wave

    >> Programming Example Only! <<

    Similar to "Spectrum 55.txt &#40;ACO&#41;", but different strategy that
    deconstructs 's' concepts/implications

    There IS a relationship between Stps and A1 that needs to be maintained
    that I haven't bothered to generalize, but these values work
//
Num=1
Aspc=1
ConB=1

Stps="250"

A0="1/&#40;Num_S_Steps-1&#41;"          // S_Step_Increment
A1="10"                         // S_Steps per division
A2="s+ A0*A1/2"                 // s' &#40;offset by divison/2&#41;

A3="Num_S_Steps/A1"
A4="trunc&#40;A3*A2&#41;/A3"

A5="A2 - A0 * &#40;&#40;&#40;Num_S_Steps*A2&#41; % A1&#41; == 0&#41;" // s"

X0="2* A5 -1"           // See WHY A5&#91;s"&#93; is 'better&#40;?&#41;' than A2&#91;s'&#93; &#40;sometimes??&#41;
Y0="mag&#40;A4&#41;"

LWdt=1
Pen=1

Meta="reactive=4 detail=3 density=3 morphable=4"
Vers=400

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Spinning Dodecahedron

Post by jerohm »

Okay the constant .5555* is obviously correct (or close enough for government work), but I can't grasp exactly why... (Update, See below)... :wink:

[ Radius * cos(Pi/5) is the Apothem; everything you wanted to know about regular polygons ]

Code: Select all

// Spinning Dodecahedron &#40;Particle&#41; - jrm

Aspc=1
ConB=1
Num=5


Stps="6"

A0="2 * PI"
A1=".5"

B0="t/8"
B1="B0 + Id * &#40;A0/Num&#41;"

A2="A1 * cos&#40; A0 * &#40;s-.75&#41; &#41;"		// x Front
A3="A1 * sin&#40; A0 * &#40;s-.75&#41; &#41;"		// y
A4="A3 - A1 * .6518"			// y - Offset&#91; cos&#40;A0/10&#41;^2 &#93;

B2="&#40;1 + &#40;cos&#40;A0/10&#41;+A3/A1&#41;*.5589&#41; * A1 * cos&#40;A0/10&#41;"	// Not .5555!!

// Rotate around the y axis
C0="A2 * cos&#40; B1 &#41; + B2 * sin&#40; B1 &#41;"	// x'
C1="B2 * cos&#40; B1 &#41; - A2 * sin&#40; B1 &#41;"	// z'

C2="A4 * cos&#40; B0 &#41; + C1 * sin&#40; B0 &#41;"	// y'

// Rotate around the x axis
X0=" C0"
Y0=" C2"

X1="-C0"
Y1="-C2"

LWdt="1.5"
Pen="1"
Meta="reactive=1 detail=3 density=3 morphable=4"

Vers=400
* n= 5; Radius= .5
Interior Angle: (n-2) * Pi / n == (5-2)*Pi/5 == 1.8849 rad (108 degrees)
Side: 2 * Radius * sin(Pi/n) == .5877

.5877 * cos(1.8849 - Pi/4) == .5589 (NOT .5555 do'h! )
:-$ New Preview

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Dig out your protractor and HS Geometry Book

Post by jerohm »

I needed to get a pen and pad of paper out to get this done, but I am posting because of the level of [complexity] reduction attained... which just goes to show you, if it appears to be too complicated, you probably AREN'T looking at it from the proper perspective. Never accept a solution to be more complicated than the problem... :wink:

Code: Select all

// Yellow Brick Road &#40;Particle&#41; - jrm
Aspc=1 
ConB=1

Stps=5
Num=20 
PDur=40

A0=""
A1="2.6"                                // Scale

A2="2*Pi * s"
A3="sqrt&#40;.5&#41;"                   // == sqrt&#40;2&#41;/2

B0="select&#40;&#40;&#40;Id==0&#41; && &#40;B0==0&#41;&#41;, 1, B0 - .001 * &#40;&#40;Id==1&#41;&&&#40;B0>.15&#41;&#41;&#41;"

B1="A3 * B2"            // r&#91;0&#93; i.e., Id-1
B2="1 - &#40;Id/Num&#41;"       // r&#91;1&#93; limit function
B3="max&#40;B0, B2&#41;"        // r&#91;1&#93;

B4="&#40;B4 * &#40;Id>0&#41;&#41; + pos&#40;&#40;Pi/4&#41; - acos&#40;B1/B3&#41;&#41;"

B5="A1 * B3"
C0="A2 + &#40;B4 + &#40;t/8&#41;&#41;"

X0="B5 * cos&#40;C0&#41;"
Y0="B5 * sin&#40;C0&#41;"


LWdt=".4" 
Pen="&#40;62/64&#41; - Id/128" 
Meta="reactive=3 detail=3 density=3 morphable=4" 

Vers=400

If you are bored, google 'animusic' :idea:

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Boy, is this place DEAD!!

Post by jerohm »

Coding example for you to ponder...

Code: Select all

// more Musings of a sick mind... jrm
//
Aspc=1
ConB=1
Num=1

A0=".75"

B0="t/4"
B1="&#40;atan&#40;Bass&#41;/&#40;2*Pi&#41; + B1*9&#41;/10"  // &#91;0,.25&#93;
B2="A0 + B1"

C0="B2 * cos&#40;2*Pi*s + B0&#41;"
C1="B2 * sin&#40;2*Pi*s + B0&#41;"

B3="asin&#40;B1&#41;"                   // slept thru geometry? Hint&#58; O/H
B4="&#40;Pi-2*B3&#41;*s + B3 + B0"      // aka "vectorLR&#40;Num_S_Steps, B3, Pi-B3&#41; + B0"

C2="B2*cos&#40;B4&#41;"
C3="B2*sin&#40;B4&#41;"

// X0=" C2", Y0=" C3", X1="-C2", Y1="-C3"

C4="&#40;&#40;C0*B1&#41; + col&#40;C0, 0&#41;&#41;"
C5="&#40;&#40;C1*B1&#41; + col&#40;C1, 0&#41;&#41;"

// X2=" C4", Y2=" C5", X3="-C4", Y3="-C5"

B5="t/8"
// &#40;not as cool, but...&#41; Probably more efficient -jrm 20Apr
//
C6="C2*cos&#40;B5&#41; - C3*sin&#40;B5&#41;"
C7="C4*cos&#40;B5&#41; - C5*sin&#40;B5&#41;"

X0=" C6", Y0=" C3"
X1="-C6", Y1="-C3"
X2=" C7", Y2=" C5"
X3="-C7", Y3="-C5"

// C6="&#123; C2, -C2,  C4, -C4 &#125;"              // WTF, Why?! ;0&#41;
// C7="&#123; C3, -C3,  C5, -C5 &#125;"
//
// C8="C6*cos&#40;B5&#41; - C7*sin&#40;B5&#41;"
// C9="C6*sin&#40;B5&#41; + C7*cos&#40;B5&#41;"         //&#91;UNREF&#93; 
//
// X0="row&#40;C8, 0&#41;", Y0="row&#40;C7, 0&#41;"
// X1="row&#40;C8, 1&#41;", Y1="row&#40;C7, 1&#41;"
// X2="row&#40;C8, 2&#41;", Y2="row&#40;C7, 2&#41;"
// X3="row&#40;C8, 3&#41;", Y3="row&#40;C7, 3&#41;"

Meta="reactive=4 detail=3 density=3 morphable=4"
Vers=400
Now that you had a bit of time, a sexy little modification... You are SUPPOSE to notice how easy it is slipped in (or at least question, why I didn't just do it in the first place ... :? ).

[BC]Vars retain their values until assigned a new value, so can be used to pass info between frame and task(Id) calculations.

:idea: :idea: IT WOULD BE NICE ( from an efficiency and esthetic point of view ) IF YOU COULD SPECIFY THAT A 'BVar' SHOULD ONLY BE EVALUATED ONCE PER FRAME. You can accomplish this using a 'select()', but I fear at the expense of efficency, unless Andy optimizes the idom: BVar="select(Id, BVar, whatever)" at compile time
:idea: :idea:

With the following modification, B1 is evaluated 'Num' times MORE than originally coded ... which might not be noticeable in this example, but believe me, I have wrestled with the implications at other time.

Code: Select all

// more Musings of a sick mind...v2 -jrm
//
Aspc=1
ConB=1
Num="round&#40;1+rnd&#40;5&#41;&#41;"

A0=".75"
A1="Pi/Num"

B0="t/4 + Id*Pi/Num"
B1="&#40;atan&#40;Bass&#41;/&#40;2*Pi&#41; + B1*13&#41;/14"  // &#91;0,.25&#93;
B2="A0 + B1"

C0="B2 * cos&#40;2*Pi*s + B0&#41;"
C1="B2 * sin&#40;2*Pi*s + B0&#41;"

B3="asin&#40;B1&#41;"                   // slept thru geometry?  Hint&#58; 0/H
B4="&#40;A1-2*B3&#41;*s + B3 + B0"      // editting oops! - jrm 20Apr

 &#58;
 &#58;
Somethin' you might find useful

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

... just nod if you can hear me... Is there anyone home?

Post by jerohm »

This is another example for those who may care (about coding)... NOT a WS for general viewing. It is loosely based on Gears.txt, but I think I write better code nowadays. It has NO component of audio interaction, but I set the Meta for it to display as a WS (for YOUR convenience). You can play around modifying the configuration parameters, and see how it effects things. Undocumented features work today, but who knows what Andy intends...

have fun...

Code: Select all

// Gears reVisited - jrm &#40;updated 5/9&#41;
Num=1
Aspc=1
ConB=1

// ==================================================
// Modify as desired!
//
Gear=16                 // teeth
                        //   Undocumented, 1-4 Char Names, Constants Only!
Dpth=.08                // .14 Landing depth
tvsl=.16                // tooth/landing ratio offset
R=.7                    // radius

Stps="Gear*20"          // resolution

// ==================================================

A0="Gear * s"   // " + 1/&#40;Num_S_Steps-1&#41;", sometimes&#40;?!&#41; necessary
//
A1="R * &#40;1-pos&#40;sign&#40;sin&#40;2*Pi*A0&#41; + tvsl&#41;&#41;*Dpth&#41;"        // SMARTER Gear definition
A2="R * &#40;1 - .95*&#40;Dpth/2&#41;&#41;"                             // X offset position

A3="2*Pi*s"
A4="&#40;-1^Gear&#41; * 2*Pi*s" // Phase Compensation for EITHER Even or Odd # of teeth
A5="choice&#40;&#123;-1, 1&#125;&#41;/4"

B0="B0 + &#40;1/33&#41;"        // &#40;Assuming 33 fps&#41; Probably NOT what YOU should do, unless...
B1="A5*t"               // ... then replace 't' with 'B0'  & jack up framerate

C0="A3 + B1"
X0="A1*cos&#40;C0&#41; - A2"
Y0="A1*sin&#40;C0&#41;"

C1="A4 - B1"            // &#91;Even&#93;"A3 - B1"   // &#91;Odd&#93;"-C0"

X1="A1*cos&#40;C1&#41; + A2"
Y1="A1*sin&#40;C1&#41;"


LWdt="1.2"
Pen=1

Meta="reactive=5 detail=3 density=3 morphable=4"
Vers=400

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

It is a good thing there are a lot smater people than me...

Post by jerohm »

Implementation of Nobuo Yamamoto Original work
http://www16.ocn.ne.jp/~akiko-y/index_E.html

(This is NOT meant to be a WS ... But interesting enough for those who are care)

Code: Select all

// Nobuo Yamamoto Work, interpreted for GF by jrm
// Heart Particle 

Aspc=1
ConB=1

a=0
b=.4
c=.8
d=.8
k=.5
p=1
q=1.2

A0="exp&#40;1&#41;"			// Euler 2.71828 ...

C0="Pi * &#40;2*s -1&#41;"		// t, &#91;-Pi, Pi&#93;
C1="exp&#40;-p*&#40;C0^2&#41;&#41;"
C2="&#40;&#40;1-C1&#41;/&#40;1+C1&#41;&#41;"
C3="&#40;C0^3&#41; * exp&#40;-q*&#40;C0^2&#41;&#41;"	// 

X0="a*C2 + c*C3 * cos&#40;k*C0&#41;"
Y0="b*C2 + d*C3 * sin&#40;k*C0&#41;"


Meta="reactive=3 detail=3 density=3 morphable=5"
Vers=400
This may not represent the simplest solution ... just the first one I stumbled upon...

YouTube Video Demo

VVVV - Good Stuff BNH - VVV
Last edited by jerohm on Thu Aug 02, 2012 11:26 pm, edited 2 times in total.

bnh
Posts: 59
Joined: Fri Jan 19, 2007 7:11 pm

Post by bnh »

Image

Jerohm,

I've been playing with your gears WS and knocked one down to a .gif via the FRAPS program, only to find out that looped gifs this large do not stream well. Best to download the file.

Here's the link:
http://www.bnh.net/gforce/wave2viaFRAPS3.gif

The photo above is also a derivative of your gears WS.

jerohm
Senior Member
Posts: 419
Joined: Fri Jan 09, 2009 5:19 pm

Bubbles revisited...

Post by jerohm »

Update of Jul 20, 2011 rant...

:oops: I guess it really DOES work, IF you know what you are doing :oops:

Code: Select all

/* Bubbles - jrm 
     w/ gentle reactivity 
*/ 
Aspc=1 
ConB=1 
Num=8 

// Stps="NUM_S_STEPS"   // NUM_S_STEPS 
// FNUM="Num"           // NUM_FFT_BINS 

A0="vectorLR&#40;Num, 0, Num-1&#41;" 
A1="2*Pi*s" 

/*** Original Code *** 
 *** B0="row&#40;B10, Id&#41;" 
***/ 
B0="col&#40;B9, Id&#41;"     // All Variables for task&#40;Id&#41; 

// radius defined??? 
B1="&#40;row&#40;B0, 0&#41; != 0&#41; && &#40;row&#40;B0, 3&#41; > -&#40;1+row&#40;B0, 0&#41;&#41;&#41;" 

B2="select&#40;B1, row&#40;B0, 0&#41;   , .1+rnd&#40;.5&#41;&#41;"     //  radius 
B3="select&#40;B1, row&#40;B0, 1&#41;   , .005+rnd&#40;.01&#41;&#41;"  //  descent rate 
B4="select&#40;B1, row&#40;B0, 2&#41;   ,  1-rnd&#40;2&#41;&#41;"      //  X 
B5="select&#40;B1, row&#40;B0, 3&#41;-B3,  1+B2&#41;"          //  Y 
B6="select&#40;B1, row&#40;B0, 4&#41;   ,  0&#41;"             //  reactivity 

B7="&#40;&#40;1+atan&#40;&#40;1.5-B2&#41;*fft&#40;Id/Num&#41;&#41;&#41; + B6*15&#41;/16" 
B8="B2 * max&#40;B7, max&#40;B2, B6-.00005&#41;&#41;"          // tame things a bit 

X0="B8*sin&#40;A1&#41; + B4 * &#40;X_EXTENTS/Y_EXTENTS&#41; + .075*sin&#40;t+Id&#41;" 
Y0="B8*cos&#40;A1&#41; + B5" 

/*** Original Code *** 
 *** B9="&#123; select&#40;Id != A0, row&#40;B9, 0&#41;, B2&#41; 
 ***     , select&#40;Id != A0, row&#40;B9, 1&#41;, B3&#41; 
 ***     , select&#40;Id != A0, row&#40;B9, 2&#41;, B4&#41; 
 ***     , select&#40;Id != A0, row&#40;B9, 3&#41;, B5&#41; 
 ***     , select&#40;Id != A0, row&#40;B9, 4&#41;, B7&#41; 
 ***     &#125;" 
 *** B10="transpose&#40;B9&#41;" 
***/ 

B9="select&#40;Id != A0, B9, transpose&#40;&#123;B2,B3,B4,B5,B7&#125;&#41;&#41;"  // Far More Elegant! 

LWdt=".85" 
Pen=1 
Meta="reactive=3 detail=3 density=4 morphable=3" 
Vers=400 


In my defense, I have a quiz for you all (read: Andy) to work on...
Given:

Code: Select all

A1="&#123;&#123;1,1&#125;,&#123;2,2&#125;,&#123;3,3&#125;,&#123;4,4&#125;&#125;"
A2="&#123;&#123;1&#125;,&#123;2&#125;,&#123;3&#125;,&#123;4&#125;&#125;"
Determine:

Code: Select all

&#40;rows&#40;A1&#41;==??&#41;
&#40;cols&#40;A1&#41;==??&#41;
&#40;rows&#40;A2&#41;==??&#41;
&#40;cols&#40;A2&#41;==??&#41;
It (half, anyway) is NOT what you(I?) would have ever suspected... and I ASSUME an implementation error, or maybe just the way things are (Hint: study how I addressed the issues in the above program...

Post Reply