Writing (or coding) waveshapes
Moderators: BTT, andy55, b.dwall, juxtiphi
Rotating SOLID Cube
This is a Particle, I guess. It actually is just another exercise on how to accomplish a specific goal( ...also, I kinda wanted to make sure my brain still worked). I started with the code from a previous post, and went from there. If you want to do me one up, make it spin (like the cube)... or find a more elegant solution.
27Sept
I really WANTED one of you to come up with this solution, before me... Is there anybody out there??
Note, I negated row(A3, Y) because one could argue it was inconsistent in the first place.
(... and I HOPE multiplication by 1 is reduced by the compiler... )
28Sept
okay, this is the logical conclusion to this post, and combines the previous two configs into one... It randomly executes one of the two presentations, depending on A1. This represents pretty much the process I always go through whenever I write a new config. It is evolutionary, and there are a lot of baby steps and revelations along the way (that no one sees except me). I hope somebody finds it useful
- jrm
In any case, enjoy, or ignore
Code: Select all
/* Rotating SOLID Cube (VectorC version - jrm)
The ORIGINAL config was created by Thomas Geier (ziggystar(at)gmx.de), who made the programming
and Aaron Pinsker, who had the idea for this.
*/
Aspc=1 //We want the tetraeder to look like one
ConB=1 //Let G-Force draw the lines (connect the two points)
A0=".8" // This is the size of the cube
A1="1 + rnd( 4 )" //[UNREF] Cube line width
A2="clip( .5 + rnd( 1 ) )" //[UNREF] Cube intensity
/*
X Y Z Cube Coordinates
=========
-1, 1, 1
-1,-1, 1
1,-1, 1
1, 1, 1
-1, 1,-1
-1,-1,-1
1,-1,-1
1, 1,-1
or transposed:
Coor 0 1 2 3 4 5 6 7
=========================================
X { -1, -1, 1, 1, -1, -1, 1, 1 }
Y { 1, -1, -1, 1, 1, -1, -1, 1 }
Z { 1, 1, 1, 1, -1, -1, -1, -1 }
*/
X=0 // Row #s; Yes, this is valid
Y=1
Z=2
Stps=11
// Coordinates:
// 0 1 2 3 4 5 6 7
// ======================================
A3=" { { -1, -1, 1, 1, -1, -1, 1, 1 }
, { 1, -1, -1, 1, 1, -1, -1, 1 }
, { 1, 1, 1, 1, -1, -1, -1, -1 } } *.5" // X, Y, Z; Cube
// Plot Path (order):
A4="A0 * { col(A3,1), col(A3,2), col(A3,3), col(A3,0), col(A3,1)
, col(A3,5), col(A3,4), col(A3,7), col(A3,3), col(A3,0)
, col(A3,4) }" // X, Y, Z
A5="{ { 1, 1,-1,-1 }
, {-1, 1, 1,-1 }
}"
A6="{ row(A4,X)
, row(A4,Y)
}"
B0="t/6"
/*** >>> Replaced, 26Sept <<<
B1="trunc(B0/(Pi/2)) % 4"
B2="A6 * col(A5,B1)"
B3="B2 * cos( B0 )"
B4="B2 * sin( B0 )"
***/
// >>> okay... this IS Better (Understand Why?) <<< :
B1="" //[UNREF]
B2="col( A5
, (B0/(Pi/2)) % 4)"
B3="A6 * (B2 * cos( B0 ))"
B4="A6 * (B2 * sin( B0 ))"
// X'= (X * cos(t0) - Y * sin(t0))
// Y'= (X * sin(t0) + Y * cos(t0))
// Y"= (Y' * sin(t1) + Z * cos(t1)), assumes (t0 == t1)
// OR
// Y"= (X * sin(t0) + Y * cos(t0)) * sin(t1) + Z * cos(t1)
B5=" row(B3,X) - row(B4,Y)" // X'
B6="( row(B4,X) + row(B3,Y) ) * sin( Pi/16 ) + row(A4,Z)" // Y"
X0="B5"
Y0="B6"
// Pen="a2"
LWdt="1.5" //The line width (I made changing. Looks good)
// Meta="reactive=0 detail=3 density=3" // for pre 5.00
Vers=500
I really WANTED one of you to come up with this solution, before me... Is there anybody out there??
Note, I negated row(A3, Y) because one could argue it was inconsistent in the first place.
(... and I HOPE multiplication by 1 is reduced by the compiler... )
Code: Select all
/* Spinning SOLID Cube (VectorC version - jrm)
The ORIGINAL config was created by Thomas Geier (ziggystar(at)gmx.de), who made the programming
and Aaron Pinsker, who had the idea for this.
*/
Aspc=1 //We want the tetraeder to look like one
ConB=1 //Let G-Force draw the lines (connect the two points)
A0=".8" // This is the size of the cube
A1="1 + rnd( 4 )" //[UNREF] Cube line width
A2="clip( .5 + rnd( 1 ) )" //[UNREF] Cube intensity
/*
X Y Z Cube Coordinates
=========
-1, 1, 1
-1,-1, 1
1,-1, 1
1, 1, 1
-1, 1,-1
-1,-1,-1
1,-1,-1
1, 1,-1
or transposed:
Coor 0 1 2 3 4 5 6 7
=========================================
X { -1, -1, 1, 1, -1, -1, 1, 1 }
Y { 1, -1, -1, 1, 1, -1, -1, 1 }
Z { 1, 1, 1, 1, -1, -1, -1, -1 }
*/
X=0 // Row #s; Yes, this is valid
Y=1
Z=2
// Coordinates:
// 0 1 2 3 4 5 6 7
// ======================================
A3=" { { -1, -1, 1, 1, -1, -1, 1, 1 }
,-{ 1, -1, -1, 1, 1, -1, -1, 1 }
, { 1, 1, 1, 1, -1, -1, -1, -1 } } *.5" // X, Y, Z; Cube
// Plot Path (order):
//
Stps=11
A4="A0 * { col(A3,1), col(A3,2), col(A3,3), col(A3,0), col(A3,1)
, col(A3,5), col(A3,4), col(A3,7), col(A3,3), col(A3,0)
, col(A3,4) }" // rows(X, Y, Z)
/**** >>> Replaced, 27Sept <<<
A5="{ { 1, 1, -1, -1 }
, { -1, 1, 1, -1 }
}"
// 28Sep - so how many of you guys realized that col(A5,0-3) == col(A5,4-7) ??
// so it can be reduced to only the first 4 cols - do'h!
//
A5="{ { 1, -1, 1, -1, 1, -1, 1, -1 }
, { 1, 1, 1, 1, 1, 1, 1, 1 }
, { 1, 1, -1, -1, 1, 1, -1, -1 }
}"
****/
A5="{ { 1, -1, 1, -1 }
, { 1, 1, 1, 1 }
, { 1, 1, -1, -1 }
}"
B0="t/6"
B1="" //[UNREF]
B2="col( A5
, (B0/(Pi/2)) % 4)" // 28Sep, 8 -> 4
B3="A4 * (B2 * cos( B0 ))"
B4="A4 * (B2 * sin( B0 ))"
// X'= (X * cos(t0) - Y * sin(t0))
// Y'= (X * sin(t0) + Y * cos(t0))
// Y"= (Y' * sin(t1) + Z * cos(t1)), assumes (t0 == t1)
// OR
// Y"= (X * sin(t0) + Y * cos(t0)) * sin(t1) + Z * cos(t1)
B5="( row(B3,X) - row(B4,Y) )" // X'
B6="( row(B4,X) + row(B3,Y) ) * sin( B0 ) + row(B3,Z)" // Y"
X0="B5"
Y0="B6"
// Pen="a2"
LWdt="1.5" //The line width (I made changing. Looks good)
// Meta="reactive=0 detail=3 density=3" // for pre 5.00
Vers=500
okay, this is the logical conclusion to this post, and combines the previous two configs into one... It randomly executes one of the two presentations, depending on A1. This represents pretty much the process I always go through whenever I write a new config. It is evolutionary, and there are a lot of baby steps and revelations along the way (that no one sees except me). I hope somebody finds it useful
- jrm
Code: Select all
/* Rotating(0)/Spinning(1) SOLID Cube (VectorC version - jrm)
The ORIGINAL config was created by Thomas Geier (ziggystar(at)gmx.de), who made the programming
and Aaron Pinsker, who had the idea for this.
*/
Aspc=1 //We want the tetraeder to look like one
ConB=1 //Let G-Force draw the lines (connect the two points)
A0=".8" // This is the size of the cube
A1="choice({0, 1})" // Rotate(0), Spin(1)
A2="(!A1) * Pi/32" // Rotate Z angle (static)
/*
X Y Z Cube Coordinates
=========
-1, 1, 1
-1,-1, 1
1,-1, 1
1, 1, 1
-1, 1,-1
-1,-1,-1
1,-1,-1
1, 1,-1
or transposed:
Coor 0 1 2 3 4 5 6 7
=========================================
X { -1, -1, 1, 1, -1, -1, 1, 1 }
Y { 1, -1, -1, 1, 1, -1, -1, 1 }
Z { 1, 1, 1, 1, -1, -1, -1, -1 }
*/
X=0 // Row #s; Yes, this is valid
Y=1
Z=2
// Coordinates:
// 0 1 2 3 4 5 6 7
// ======================================
A3=" { { -1, -1, 1, 1, -1, -1, 1, 1 }
, { 1, -1, -1, 1, 1, -1, -1, 1 } * (-1 ^ A1)
, { 1, 1, 1, 1, -1, -1, -1, -1 } } *.5" // X, Y, Z; Cube
// Plot Path (order):
//
Stps=11
A4="A0 * { col(A3,1), col(A3,2), col(A3,3), col(A3,0), col(A3,1)
, col(A3,5), col(A3,4), col(A3,7), col(A3,3), col(A3,0)
, col(A3,4) }" // rows(X, Y, Z)
A5="select(A1, { { 1, -1, 1, -1 }
, { 1, 1, 1, 1 }
, { 1, 1, -1, -1 }
}
, { { 1, 1, -1, -1 }
, { -1, 1, 1, -1 }
, { 1, 1, 1, 1 }
} )"
B0="t/6"
B1="col( A5
, (B0/(Pi/2)) % 4)"
B2="A4 * (B1 * cos( B0 ))"
B3="A4 * (B1 * sin( B0 ))"
// X'= (X * cos(t0) - Y * sin(t0))
// Y'= (X * sin(t0) + Y * cos(t0))
// Y"= (Y' * sin(t1) + Z * cos(t1)), assumes (t0 == t1)
// OR
// Y"= (X * sin(t0) + Y * cos(t0)) * sin(t1) + Z * cos(t1)
B4="( row(B2,X) - row(B3,Y) )" // X'
B5="( row(B3,X) + row(B2,Y) ) * sin((A1*B0) + A2)
+ (A1* row(B2,Z)) + ((!A1)* row(A4,Z))" // Y"
// ALL of these are valid solutions, but runtime efficiency is really a function of
// HOW SMART the compile was done... which I have no idea,
// but relative to flowfield processing time, it may be irrelevant anyway - jrm
//
// + (A1* row(B2,Z)) + ((!A1)* row(A4,Z))" // Y"
// + select(A1, row(B2,Z), row(A4,Z))" // Y"
// + row( select(A1, B2, A4), Z)" // Y"
X0="B4"
Y0="B5"
LWdt="1.5"
// Meta="reactive=0 detail=3 density=3" // for pre 5.00
Vers=500
Okay, we're back on track!
It took some hard work on finishing this waveshape. It was nearly successful after I tested it. If anyone knows this, I'll have it pending for tweaking or approval:
Bouncing Bars.txt
Let me know if it needs tweaking.
It took some hard work on finishing this waveshape. It was nearly successful after I tested it. If anyone knows this, I'll have it pending for tweaking or approval:
Bouncing Bars.txt
Code: Select all
C0="( sin( .3 * t * PI ) )"
C1="pos( .3 * BASS )"
C2="cos( PI * ( s - .5 ) )"
X0=".5 + C1 * C2"
Y0="C0"
X1="-C1 * C2"
Y1="-C0"
X2=".5 + C1 * C2"
Y2="-C0"
Y3="-C1 * C2"
Y3="C0"
ConB=1
LWdt="BASS * C2"
Vers=540
For that matter, C1 should also be a Bvar. I ran your code, and it doesn't blowup, but I have no idea what you were trying to do!?! Why don't you post IN WORDS, exactly what you are attempting to do.
But if you are serious, you need to feel comfortable drawing objects WAY before you play with reactivity, 'Pen', or 'Lwdt'... that comes LATER. Why don't you try drawing a geometric object and making it spin, and/or move around the screen? You need to have a firm grasp of polar and rectangular coordinates FIRST (as well as how 'Num_S_Steps' figures in).
Some good starting points:
Wikipedia Polar coordinate system
Wikipedia Rotation of axes
All the easy problems have already been solved. Be prepared to do MOST of the effort yourself [translated: you better have exhausted all options on your own, BEFORE you ask me]... I already [mostly] know this stuff, and don't do real well holding hands. My willingness to help will be a directly proportional to the effort YOU expend. That is all folks.
Strike 1
Forget you ever heard of 'VectorC' ... It has absolutely no relevance as far as you are concerned. Where is the EXACT DESCRIPTION of what you are attempting to do in WORDS that I requested???? If you can't provide that, how do you expect anybody else to read your mind?? (I also have a problem screwing up this thread with gibberish - Start a new thread... it can be solely YOUR OWN!).
VVVVVVV
But if you are serious, you need to feel comfortable drawing objects WAY before you play with reactivity, 'Pen', or 'Lwdt'... that comes LATER. Why don't you try drawing a geometric object and making it spin, and/or move around the screen? You need to have a firm grasp of polar and rectangular coordinates FIRST (as well as how 'Num_S_Steps' figures in).
Some good starting points:
Wikipedia Polar coordinate system
Wikipedia Rotation of axes
All the easy problems have already been solved. Be prepared to do MOST of the effort yourself [translated: you better have exhausted all options on your own, BEFORE you ask me]... I already [mostly] know this stuff, and don't do real well holding hands. My willingness to help will be a directly proportional to the effort YOU expend. That is all folks.
Strike 1
Forget you ever heard of 'VectorC' ... It has absolutely no relevance as far as you are concerned. Where is the EXACT DESCRIPTION of what you are attempting to do in WORDS that I requested???? If you can't provide that, how do you expect anybody else to read your mind?? (I also have a problem screwing up this thread with gibberish - Start a new thread... it can be solely YOUR OWN!).
VVVVVVV
Last edited by jerohm on Mon Nov 07, 2016 5:03 pm, edited 1 time in total.
C0 is actually B0. Again, I have changed it. In that case, here it is:jerohm wrote:For that matter, C1 should also be a Bvar.
Code: Select all
B0="( sin( .3 * t * PI ) )"
C0="pos( .3 * BASS )"
C1="cos( PI * ( s - .5 ) )"
X0=".5 + C0 * C1"
Y0="B0"
X1="-C0 * C1"
Y1="-B0"
X2=".5 + C0 * C1"
Y2="-B0"
Y3="-C0 * C1"
Y3="C0"
ConB=1
LWdt="BASS * C1"
Vers=540
UPDATE: As far as you're telling me that I don't know what VectorC is, I have corrected the above scentence.
EDITED BY BTT - REASON:- REMOVED LINK.
Hello DanPin
Hello Danpin - As you know links other than SoundSpectrum are not allowed on the forum. I removed a link you posted yesterday, and now another one today. PLEASE do not post links other than SoundSpectrum again. Thank you
Hello Danpin - As you know links other than SoundSpectrum are not allowed on the forum. I removed a link you posted yesterday, and now another one today. PLEASE do not post links other than SoundSpectrum again. Thank you
.
Regards BTT
ColorMap Creator for G-Force and Aeon --- SoundSpectrum Forum Administrator.
Regards BTT
ColorMap Creator for G-Force and Aeon --- SoundSpectrum Forum Administrator.
20th Anniversary of G-Force initial release (right??)
how time flies...
(Particle, Oldie... I write smarter code now, but this should still work)
(Particle, Oldie... I write smarter code now, but this should still work)
Code: Select all
//* Time Pieces (JRM)
2009Nov15 JRM - Creation
Original trajectory code by David Tryse (DT - ZoomPlanet.txt)
*/
Stps="trunc(Num_S_Steps/12)*12"
NUM="1 + round(rnd(4))"
Aspc=1
ConB=1
PDur=40
A0="t"
A1="max( 30, (END_TIME - A0))"
A2="4-pos(-sign(1-rnd(2)))"
A3="(Num-1) * pos(sign(1-rnd(2)))" // random '0' or 'Num-1' (discrete)
A4="((PI/4) * rnd(4))+(PI/8)"
A5="2*PI"
A6="NUM_S_STEPS"
A7="12" // divisions
A8="A6/A7" // Steps/division
A9="A6/4" // 3,12,9,6
A10="-.5 * A5"
A11="(.2-rnd(.4))"
A12="rnd(7)"
A13="4+rnd(1.5)"
C0="(A5 * s) + A10"
C1="round(A6 * s)" // sample id, (1, NUM_SAMPLE_BIN)
C2="((C1 % A8) == 0)"
C3="((C1 % A9) == 0)"
B0="abs(A3-ID)"
B1="srand( (((A5/NUM) + A11)* B0) + (A5/8 * A12)) + (t/8)"
B2="max(t-(A0-(B0*A13)), 0)"
B3="((-1 ^ ID) * cos( B1 ))/A2"
B4="((-1 ^ ID) * sin( B1 ))/A2"
// B6=size, B7=posX, B8=posY (Original Code by David Tryse)
//
B5="dt * (B2/(A1-B0*A13)/(1.2-rnd(.2)))" // time elapsed:0-1
B6="0.3*B5+50*clip(0.02*0.01*(3*B5)^12)" // Size
B7="(-1^B0) * (((3.5+rnd(1)) * sin(B5)/(1.5+rnd(.5)) + (B3/.6) - B6))" // x
B8="(sin(B5*(4+rnd(.5)))/(1.5+rnd(.5)) + B4 - B6)" // y
C4="B6 * (1-(.08 * (C2+C3)))"
X0="B7 + C4 * cos( C0 )"
Y0="B8 + C4 * sin( C0 )"
// Clock Face (Hand Resource Optimized 21Apr2017)
//
A16="2*Pi * 1.5 * 12" // (00-12):00 Start
A14=".7 * clamp(1-(2*s))"
A15=".7 * clamp((2*s)-1) * .7"
A17="transpose({ 1
, 1/12})/1.5"
B9="A17*(t+rnd(A16))"
C5="C4 * ( A14 * { vector( Num_S_Steps, sin(row(B9,0)))
, vector(Num_S_Steps, cos(row(B9,0)))
}
+ A15 * { vector( Num_S_Steps, sin(row(B9,1)))
, vector(Num_S_Steps, cos(row(B9,1)))
} )"
X1="B7 + row(C5, 0)"
Y1="B8 + row(C5, 1)"
B10="(B6 <= 7)*(40*(B5+0.2)^8 + .5)"
LWdt="B10"
Pen="1"
// Meta="reactive=1 detail=4 density=4"
Vers=391
Re: Writing (or coding) waveshapes
The version of Slither that was ultimately distributed, bears little resemblance to my original work. I modified my original and replaced lines(CONB=1), with Dots(CONB=0).
12Jan2022
This is the original submission. It has to exist as a separate 'text file', because ConB can not be set with an expression (why???)
Do with it what you will.
j
Code: Select all
// Slither - jrm
// 10Sept2015 rewrite(um, reorganized - Optimized???)
// 10Dec2021 changed lines(ConB == 1) to dots(ConB == 0)
Aspc=1
ConB=0
Stps=28
Ys=24
Num="Ys*choice({1,2})"
A0="Num-Ys" // 0 or Pos
A1="(end_time < 1e30)" // (Particle == true); [ O'Mearagic ;0) ]
A2="choice({0,1})"
A3="choice({0,(A0>0)})"
A4="vectorLR(Num, 0, Num-1)" // Id Offsets
A5="{ (A4 % Ys)/(Ys/4) -2
, (A1||(A4>=A0))
, select((A1||(A4<A0)), 1.365
, select(A3, 0, 1))
, !(A1||(A4<A0))
, !(A1||(A4<A0))/2
, 1 - (A1||(A4<A0))/4
, (A1||(A2*(A4<A0)))
}" // ASSuming fetch, i.e. row(), is ALWAY(?) more efficient
A6="1.2/2" // time weight, (0 - OFF)
B0="col(A5, Id)"
B1="A6*t + row(B0,4)"
B2="B1 + row(B0,0)"
B3="B2 - B1/2"
A7="(1/(Num_S_Steps-1))"
A8="select( abs(round(s)-s) >= 2*A7, s, round(s))"
A9="((2*A8-1)/1.4)"
A10="{ A9
, A9 ^ choice({1,3,1}) }"
B4="max(row(B0,2) * (X_Extents/Y_Extents), 1)"
B5="B4 * cos(B2)"
B6="row(A10,row(B0,1)) * (B4 * sin(B2) * cos(B3) - B5 * sin(B3))
+ row(B0,0)" // z'
A11="trwv(2 * s)"
A12="choice({7,8,9})"
A13="select(((s<A7)||(s>=(1-A7))), A12, 1.8)"
B7="max( A12*max(fft(1-A11), fft(A11)), A13)"
Pen=" row(B0,5)"
Lwdt="row({ B7
, 1.8}, row(B0,6))"
X0="A9*B5"
Y0="B6 + row(B0,3)"
// Meta="reactive=3 detail=3 density=3 morphable=5"
Vers=500
This is the original submission. It has to exist as a separate 'text file', because ConB can not be set with an expression (why???)
Code: Select all
// Slither - jrm
// 10Sept2015 rewrite(um, reorganized - Optimized???)
Aspc=1
ConB=1
Stps=140
Ys=24
Num="Ys*choice({1, 2})"
A0="Num-Ys" // 0 or Pos
A1="(end_time < 1e30)" // (Particle == true); [ O'Mearagic ;0) ]
A2="choice({0,1})"
A3="choice({0,(A0>0)})"
A4="vectorLR(Num, 0, Num-1)" // Id Offsets
A5="{ (A4 % Ys)/(Ys/4) -2
, (A1||(A4>=A0))
, select((A1||(A4<A0)), 1.365
, select(A3, 0, 1))
, !(A1||(A4<A0))
, !(A1||(A4<A0))/2
, 1 - (A1||(A4<A0))/128
, (A1||(A2*(A4<A0)))
}" // ASSuming fetch, i.e. row(), is ALWAY more efficient
A6="1.2/2" // time weight, (0 - OFF)
B0="col(A5, Id)"
B1="A6*t + row(B0,4)"
B2="B1 + row(B0,0)"
B3="B2 - B1/2"
A7="(1/(Num_S_Steps-1))"
A8="select( abs(round(s)-s) >= 2*A7, s, round(s))"
A9="((2*A8-1)/1.4)"
A10="{ A9
, A9 ^ choice({1,3,1}) }"
A11="clamp(2*sin(s*Pi)-.07)/7"
A12="s*20"
B4="max(row(B0,2) * (X_Extents/Y_Extents), 1)"
B5="B4 * cos(B2)"
B6="row(A10,row(B0,1)) * (B4 * sin(B2) * cos(B3) - B5 * sin(B3))
+ row(B0,0)" // z'
X0="A9*B5"
Y0="B6 + row(B0,3) * A11*mag(A12)" // + (Id/Num)
A13="{ select(((s<A7)||(s>=(1-A7))), choice({7,8,9}), 1)
, vector(Num_S_Steps, .8)
}"
Lwdt="row(A13, row(B0,6))"
Pen=" row(B0,5)"
Meta="reactive=3 detail=3 density=3 morphable=5"
Vers=500
Do with it what you will.
j
Re: Writing (or coding) waveshapes
Code: Select all
// fft w/ single(x/y) - jrm (written @60fps)
//
ConB=0
Aspc=0
Bnds=16
ColW=512
BndW=200
Stps="Bnds*ColW"
A0="(Num_S_Steps -1)"
A1="1/A0"
A2="A0*s" // Needs more thought!
A3="(ColW-BndW)/2"
A4=""
A5="vectorLR(Bnds, 0, 1)"
A6="pos(s-A1)" // A6="vectorLR(A0+1, 0, (1-A1))"
B0="B0+1"
B1="select(B0%2, B1, map1d(fft(A5), A6, 0))"
B2="(1 - log10(1+BASS)/3)"
X0="(2*A6 -1) *.98"
Y0="(2*B1 -B2)"
Lwdt="8"
Vers=530
Enjoy, or ignore.
Re: Writing (or coding) waveshapes
My new waveshape:
Don't mind the poor writing. My config writing skills have been reset because it's been so long since I made another one.
Code: Select all
//Bloom Battle by ShohS
Aspc=1
stps="301"
NUM = "5"
A0="2+round(rnd(4))"
A1="2*round(1+rnd(8))"
A2="( 1 + rnd( .15 ) )"
A3="rnd(2 * pi)"
B0="cos( PI * ( s - .5 ) )"
B1="t * -A2 + A3 + 2 * pi * ID / NUM"
B2="sin( t*.6 )*.75+.25"
B3="sin( t*.6 +3 )*.75+.25"
B4="-t*.4"
B5="-t*.5"
C0=".3 + B2 * ((fft(s)*B0*.25)+ (bass*B0*.1) + (s*min(.2 , bass))) - (B0*.2) - (s*.2)"
C1="(s * pi*2)"
C2="C0 * sin(C1)"
C3="C0 * cos(C1)*.7-.21"
C4=".3 + B3 * ((fft(s)*B0*.25)+ (bass*B0*.1) + (s*min(.2 , bass))) - (B0*.2) - (s*.2)"
C5="C4 * sin(C1)"
C6="C4 * cos(C1)*.7-.21"
C7="mag(s) * .2 * sin(8*pi*s)*B2"
C8="mag(s) * .2 * cos(8*pi*s)*B2"
C9="mag(s) * .2 * sin(8*pi*s)*B3"
C10="mag(s) * .2 * cos(8*pi*s)*B3"
X0="(C2 * cos( B1 ) - C3 * sin( B1 ))+sin(B4)*.3-cos(B5)*.2"
Y0="(C2 * sin( B1 ) + C3 * cos( B1 ))+cos(B4)*.3-sin(B5)*.2"
X1="-(C5 * cos( B1 ) - C6 * sin( B1 ))-sin(B4)*.3+cos(B5)*.2"
Y1="-(C5 * sin( B1 ) + C6 * cos( B1 ))-cos(B4)*.3+sin(B5)*.2"
X2="(C7 * cos( B1 ) - C8 * sin( B1 ))+sin(B4)*.3-cos(B5)*.2"
Y2="(C7 * sin( B1 ) + C8 * cos( B1 ))+cos(B4)*.3-sin(B5)*.2"
X3="-(C9 * cos( B1 ) - C10 * sin( B1 ))-sin(B4)*.3+cos(B5)*.2"
Y3="-(C9 * sin( B1 ) + C10 * cos( B1 ))-cos(B4)*.3+sin(B5)*.2"
ConB=0
LWdt="B0 * 5-(fft(s)*B0*2)-bass*B0*.7"
Vers=540
Nut
Re: Writing (or coding) waveshapes
Step sine was written and submitted as a PARTICLE. It was modified by SS and released as a waveshape .
This is my original work; it represents some of my first attempts to code using the VectorC paradigm.
This is my original work; it represents some of my first attempts to code using the VectorC paradigm.
Code: Select all
/* 'A' Step Sine (PARTICLE)
2010Sep05 JRM Creation
2011Jul30 JRM reWrite (1-3 Invocations)
2011Aug05 JRM (VectorC) Proof of concept edit
*/
Aspc=0
ConB=1
Stps=1024
Num="1 + trunc(rnd(3-.001))"
A0="(2*s-1)"
// Randomness SEEMS to work better THIS way, rather than 'srand()' & 'Bvars'
// (and should be more efficient anyway...)
//
// Wouldn't it be WONDERFUL if this notation could have been SIMPLIFIED!!
// [i.e., if 'choice(vector(Num, {1,2,4}))' worked like 'rnd(vector(Num, 1))' ]
//
A1="map1d({1,2,4}, trunc(rnd(vector(Num, 3-.001)))/2, 0)" // 1/Period
A2="map1d({16,32,64,128}, trunc(rnd(vector(Num, 4-.001)))/3, 0)" // Steps
A3="map1d({-1,1}, round(rnd(vector(Num, 1))), 0)
* (1 - 4*rnd(vector(Num, 1))/A2)" // Direction/Speed
A4="A1 * Num_S_Steps"
A5="1/Num_S_Steps" // Slide[T] - Always
A6="map1D({-1,1}, round(rnd(vector(Num, 1))), 0)
* A4" // Slide[L:R]
A7="(A2/A1) * 1.5" // Slide speed
A8="(A2/A1) * A5 * 2*Pi" // AKA, "(A2/A4) * 2*Pi"
A9="map1D({0,1}, round(rnd(vector(Num, 1))), 0)
* (A2>=64)" // Mag() Overlay - 64/128 Only
A10="(1-(A9/20))"
A11="(127-(vectorLR(Num, 0, (Num-1))))/128"
A12="75*s"
// Equation to be plotted...
B0="A5 * abs(col(A6, Id)-((col(A7, Id)*t + Id) % col(A4, Id)))"
B1="col(A8, Id) * trunc(((s + B0)*Num_S_Steps)/col(A2, Id)) + Id"
X0="A0"
Y0="col(A10, Id) * sin(B1 + (col(A3, Id) * t)) + col(A9, Id) * mag(A12)/8"
LWdt=".8"
Pen="col(A11, Id)" // "(127-(Id*2))/128"
// Meta="reactive=1 detail=3 density=3"
Vers=400
Re: Writing (or coding) waveshapes
Cool Beans!!! You've given some life to the forum!!