Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 1 file changed
  • 0 comments
  • 1 contributor
Feb 26, 2012
Werner Almesberger raindance.fnp: green button of channel 8 controls whether to wrap or …
…to smear

While pushed, we wrap, creating kaleidoscopic particle effects.
b7f75b6
Werner Almesberger raindance.fnp: alternate settings for the first four faders
The blue buttons record the current value. The green buttons switch
to the recorded value.
60b0198

Showing 1 changed file with 53 additions and 1 deletion. Show diff stats Hide diff stats

  1. 54  patches/demo/raindance/raindance.fnp
54  patches/demo/raindance/raindance.fnp
@@ -51,6 +51,17 @@ midi "Faderfox LV3" {
51 51
 	enc3_push = switch(30);
52 52
 	enc4_push = switch(31);
53 53
 
  54
+	green1 = button(1, 16);
  55
+	green2 = button(2, 16);
  56
+	green3 = button(3, 16);
  57
+	green4 = button(4, 16);
  58
+	green8 = button(8, 16);
  59
+
  60
+	blue1 = button(1, 17);
  61
+	blue2 = button(2, 17);
  62
+	blue3 = button(3, 17);
  63
+	blue4 = button(4, 17);
  64
+
54 65
 	fx1 = switch(9, 4);
55 66
 	joy1x = fader(9, 1);
56 67
 	joy1y = fader(9, 2);
@@ -80,6 +91,8 @@ green = range(fader6);
80 91
 blue = range(fader7);
81 92
 change = range(fader8);
82 93
 
  94
+wrap = button(green8);
  95
+
83 96
 offcenter = switch(fx1);		// FX1
84 97
 xoff = range(joy1x);
85 98
 yoff = range(joy1y);
@@ -92,29 +105,57 @@ twist_offset = 0;
92 105
 last_reset_sens = 0;
93 106
 sens_offset = 0;
94 107
 
  108
+switch_rot = button(green1);
  109
+set_rot = button(blue1);
  110
+alt_rot = 0;
  111
+alt_theta = 0;
  112
+
  113
+switch_zoom = button(green2);
  114
+set_zoom = button(blue2);
  115
+alt_zoom = 0;
  116
+
  117
+switch_dist = button(green3);
  118
+set_dist = button(blue3);
  119
+alt_dist = 0;
  120
+
  121
+switch_sens = button(green4);
  122
+set_sens = button(blue4);
  123
+alt_sens = 0;
  124
+
95 125
 per_frame:
96 126
 	/* rotation */
97 127
 
98 128
 	rot = whirl*2.2+(twist-twist_offset)/10;
99 129
 	twist_offset = twist if last_reset_twist != reset_twist+1;
100 130
 	last_reset_twist = reset_twist+1; // avoid 0, so first push is change
  131
+	alt_rot = rot if set_rot;
  132
+	rot = alt_rot if switch_rot;
101 133
 
102 134
 	/* growth */
103 135
 
104 136
 	zoom = 0.9+growth/5;
  137
+	alt_zoom = zoom if set_zoom;
  138
+	zoom = alt_zoom if switch_zoom;
105 139
 
106 140
 	/* angle */
107 141
 
108 142
 	dist = radius/5;
109  
-	tmp = theta*6.2832;
  143
+	alt_dist = dist if set_dist;
  144
+	dist = alt_dist if switch_dist;
  145
+
  146
+	tmp = (switch_rot ? alt_theta : theta)*6.2832;
110 147
 	wave_x = cx+cos(tmp)*dist;
111 148
 	wave_y = cy-sin(tmp)*dist;
112 149
 
  150
+	alt_theta = theta if set_rot;
  151
+
113 152
 	/* sensitivity */
114 153
 
115 154
 	wave_scale = sensitivity*10+sens_fine-sens_offset;
116 155
 	sens_offset = sens_fine if last_reset_sens != reset_sens+1;
117 156
 	last_reset_sens = reset_sens+1; // avoid 0, so first push is change
  157
+	alt_sens = wave_scale if set_sens;
  158
+	wave_scale = alt_sens if switch_sens;
118 159
 
119 160
 	/* color */
120 161
 
@@ -127,6 +168,10 @@ per_frame:
127 168
 
128 169
 	wave_thick = thick;
129 170
 
  171
+	/* smear or wrap */
  172
+
  173
+	bTexWrap = wrap;
  174
+
130 175
 	/* special effects */
131 176
 
132 177
 //	cx = offcenter ? 0.5+(xoff-0.5)*0.3 : 0.5;
@@ -137,5 +182,12 @@ per_frame:
137 182
 	dx = shift ? (xshift-0.5)*0.2 : 0;
138 183
 	dy = shift ? (yshift-0.5)*0.2 : 0;
139 184
 
  185
+	/* reset on-only buttons */
  186
+
  187
+	set_rot = 0;
  188
+	set_zoom = 0;
  189
+	set_dist = 0;
  190
+	set_sens = 0;
  191
+
140 192
 per_vertex:
141 193
 	rot = rot + (rad-0.4)*1.7*max(0,min((bass_att-1.1)*1.5,5));

No commit comments for this range

Something went wrong with that request. Please try again.