@@ -28,7 +28,7 @@ class Scanner_Effect extends Effect
2828 {
2929 return " Scanner" ;
3030 }
31-
31+
3232 char triggeredByKey () {
3333 return ' 2' ;
3434 }
@@ -39,12 +39,20 @@ class Scanner_Effect extends Effect
3939
4040 Toggle aHueToggle, bwToggle;
4141
42+ int hue, weight;
43+ float speed;
44+
4245 void draw ()
4346 {
4447
45- stg. fill(hueSlider. getValue(), 100 , 100 );
48+ hue = int (hueSlider. getValue());
49+ weight = int (weightSlider. getValue());
50+ speed = speedSlider. getValue();
51+
52+ stg. stroke(hue, 100 , 100 );
53+ stg. strokeWeight(weight);
4654
47- rotation = (rotation+ speedSlider . getValue() / 20 )% (9 * PI );
55+ rotation = (rotation+ speed / 20 )% (9 * PI );
4856
4957 if (rotation< PI )
5058 rotateRight();
@@ -60,73 +68,70 @@ class Scanner_Effect extends Effect
6068 {
6169 rotate (PI / 2 );
6270 LinesDissolve ();
63- }
64- else if (rotation< PI * 7 )
71+ } else if (rotation< PI * 7 )
6572 {
6673 rotate (PI / 2 );
6774 LinesJoin ();
68- }
69- else if (rotation< PI * 8 )
75+ } else if (rotation< PI * 8 )
7076 {
7177 LinesDissolve ();
7278 resetStage();
7379 rotate (PI / 2 );
74- stg. fill((hueSlider . getValue() + 120 )% 360 , 100 , 100 );
80+ stg. fill((hue + 120 )% 360 , 100 , 100 );
7581 LinesDissolve ();
76- }
77- else if (rotation< PI * 9 )
82+ } else if (rotation< PI * 9 )
7883 {
7984 LinesJoin ();
8085 resetStage();
8186 rotate (PI / 2 );
82- stg. fill((hueSlider . getValue() + 120 )% 360 , 100 , 100 );
87+ stg. fill((hue + 120 )% 360 , 100 , 100 );
8388 LinesJoin ();
8489 }
8590
8691 if (aHueToggle. getState() && isKick() && isOnset() && isHat() && isSnare())
87- hueSlider. setValue((hueSlider . getValue() + 120 )% 360 );
92+ hueSlider. setValue((hue + 120 )% 360 );
8893 }
8994
9095 void rotateRight()
9196 {
9297 rotate (rotation);
93- stg. rect(- stg. getMaxRadius()/ 2 , - weightSlider. getValue()/ 2 , stg. getMaxRadius(), weightSlider. getValue());
94- rotate (PI / 2 );
95- stg. fill((hueSlider. getValue()+ 120 )% 360 , 100 , 100 );
96- stg. rect(- stg. getMaxRadius()/ 2 , - weightSlider. getValue()/ 2 , stg. getMaxRadius(), weightSlider. getValue());
98+ stg. line(- stg. getMaxRadius(), 0 , stg. getMaxRadius(), 0 );
99+ stg. stroke((hue+ 120 )% 360 , 100 , 100 );
100+ stg. line(0 , - stg. getMaxRadius(), 0 , stg. getMaxRadius());
97101 }
98102
99103 void rotateLeft()
100104 {
101105 rotate (- rotation);
102- stg. rect (- stg. getMaxRadius()/ 2 , - weightSlider . getValue() / 2 , stg. getMaxRadius(), weightSlider . getValue() );
103- rotate ( - PI / 2 );
104- stg. fill((hueSlider . getValue() + 120 ) % 360 , 100 , 100 );
105- stg. rect( - stg . getMaxRadius() / 2 , - weightSlider . getValue() / 2 , stg . getMaxRadius(), weightSlider . getValue() );
106+ stg. line (- stg. getMaxRadius(), 0 , stg. getMaxRadius(), 0 );
107+ stg . stroke((hue + 120 ) % 360 , 100 , 100 );
108+ stg. line( 0 , - stg . getMaxRadius(), 0 , stg . getMaxRadius() );
109+ stg. stroke(hue, 100 , 100 );
106110 }
107111
108112 void rotateOpposite()
109113 {
110114 rotate (rotation);
111- stg. rect (- stg. getMaxRadius()/ 2 , - weightSlider . getValue() / 2 , stg. getMaxRadius(), weightSlider . getValue() );
112- rotate ( - 2 * rotation );
113- stg. fill((hueSlider . getValue() + 120 ) % 360 , 100 , 100 );
114- stg. rect( - stg . getMaxRadius() / 2 , - weightSlider . getValue() / 2 , stg . getMaxRadius(), weightSlider . getValue() );
115+ stg. line (- stg. getMaxRadius(), 0 , stg. getMaxRadius(), 0 );
116+ stg . stroke((hue + 120 ) % 360 , 100 , 100 );
117+ stg. line( 0 , - stg . getMaxRadius(), 0 , stg . getMaxRadius() );
118+ stg. stroke(hue, 100 , 100 );
115119 }
116120
117121 void LinesDissolve ()
118122 {
119- translate (0 , (stg. height - weightSlider . getValue() )* ((rotation% PI )/ PI )/ 2 );
120- stg. rect (- stg. getMaxRadius()/ 2 , - weightSlider . getValue() / 2 , stg. getMaxRadius(), weightSlider . getValue() );
121- translate (0 , - (stg. height - weightSlider . getValue() )* (rotation% PI / PI ));
122- stg. rect (- stg. getMaxRadius()/ 2 , - weightSlider . getValue() / 2 , stg. getMaxRadius(), weightSlider . getValue() );
123+ translate (0 , (stg. height - weight )* ((rotation% PI )/ PI )/ 2 );
124+ stg. line (- stg. getMaxRadius(), 0 , stg. getMaxRadius(), 0 );
125+ translate (0 , - (stg. height - weight )* (rotation% PI / PI ));
126+ stg. line (- stg. getMaxRadius(), 0 , stg. getMaxRadius(), 0 );
123127 }
124128
125129 void LinesJoin ()
126130 {
127- translate (0 , (stg. height - weightSlider. getValue())* (1 - ((rotation% PI )/ PI ))/ 2 );
128- stg. rect(- stg. getMaxRadius()/ 2 , - weightSlider. getValue()/ 2 , stg. getMaxRadius(), weightSlider. getValue());
129- translate (0 , - (stg. height - weightSlider. getValue())* (1 - ((rotation% PI )/ PI )));
130- stg. rect(- stg. getMaxRadius()/ 2 , - weightSlider. getValue()/ 2 , stg. getMaxRadius(), weightSlider. getValue());
131+ translate (0 , (stg. height - weight)* (1 - ((rotation% PI )/ PI ))/ 2 );
132+ stg. line(- stg. getMaxRadius(), 0 , stg. getMaxRadius(), 0 );
133+ translate (0 , - (stg. height - weight)* (1 - ((rotation% PI )/ PI )));
134+ stg. stroke((hue+ 120 )% 360 , 100 , 100 );
135+ stg. line(- stg. getMaxRadius(), 0 , stg. getMaxRadius(), 0 );
131136 }
132137}
0 commit comments