forked from ewowi/StarBase
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BeatMania.sc: more compact notation and changed from 1D to 2D Bars (so Live effect is still a 2D effect) animwleSL.sc added but not working yet octo and balls, sPC remove first parameter, bug solved UserModLive - add cos8 - beatSin8 bug return uint8_t not float - spCLive: remove first parameter, bug solved
- Loading branch information
1 parent
f719ecf
commit 553b6a8
Showing
5 changed files
with
150 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
// WIP, By Yves but time and triangle is now external | ||
// Unexpected at line:115 | ||
// preScript has 27 lines, so should be 88, or a but around but looks okay there | ||
|
||
define maxIterations 15 | ||
define scale 0.5 | ||
uint32_t __deltamillis[1]; | ||
|
||
uint32_t __baseTime[1]; | ||
|
||
__ASM__ uint32_t millis() | ||
{ | ||
"entry a1,32" | ||
"l32r a5,__baseTime" | ||
"l32i a14,a5,0" | ||
"rsr a13,234" | ||
"l32r a4,__deltamillis" | ||
"s32i a13,a4,0" | ||
"sub a13,a13,a14" | ||
"movi a14,240" | ||
"quou a13,a13,a14" | ||
"movi a14,1000" | ||
"quou a13,a13,a14" | ||
"l32r a4,stackr" | ||
"s32i a13,a4,0" | ||
"retw.n" | ||
} | ||
|
||
float cR; // = -0.94299; | ||
float cI; // = 0.3162; | ||
|
||
|
||
float cX; | ||
float cY; | ||
float fX; | ||
float fY; | ||
|
||
// timers used to animate movement and color | ||
float t1; | ||
float t2; | ||
int iter; | ||
// UI | ||
|
||
|
||
void beforeRender() | ||
{ | ||
// float jj=triangle(time(0.2)); | ||
// dp(2.4*(jj-0.5)); | ||
//§§float g=2.4; | ||
//§ t1 = g*(triangle(time(0.2)) - 0.5) | ||
; | ||
//dp(t1); | ||
t1 = (triangle(time(0.2)) - 0.5)*2.4 ; | ||
//dp(t1); | ||
t2 = time(0.05); | ||
|
||
cX = cR + t1; | ||
cY = cI + (t1 / 2.5); | ||
// dp(cY); | ||
// dp(cX); | ||
// dp(t1); | ||
// display(11111); | ||
// dp(t2); | ||
} | ||
|
||
|
||
void render2D(int x1, int y1) | ||
{ | ||
float x = (x1/width-0.5)/scale; | ||
float y = (y1/height-0.5)/scale; | ||
int iter; | ||
for (iter = 0; iter < maxIterations; iter++) | ||
{ | ||
float x2 = x ^ 2; | ||
float y2 = y ^ 2; | ||
if ((int)(x2 + y2) >= 4) | ||
{ | ||
break; | ||
} | ||
fX = x2 - y2 + cX; | ||
fY = 2 * x * y + cY; | ||
x = fX; | ||
y = fY; | ||
} | ||
|
||
|
||
if (iter < maxIterations) | ||
{ | ||
CRGB gg = hsv((float)((t2 + (iter / maxIterations)) * 255), 255, 255); | ||
sPC(panel_width * y1 + x1, gg); | ||
} | ||
else | ||
{ | ||
CRGB gg = hsv(0,0,0); | ||
sPC(panel_width * y1 + x1, gg); | ||
} | ||
} | ||
|
||
void main() | ||
{ | ||
clear(); | ||
resetStat(); | ||
cR = -0.94299; | ||
cI = 0.3162; | ||
int h = 1 ; | ||
while (h > 0) | ||
{ | ||
beforeRender(); | ||
for (int i = 0; i < width; i++) | ||
{ | ||
for (int j = 0; j < height; j++) | ||
{ | ||
render2D(i, j); | ||
} | ||
} | ||
show(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters