Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 4 commits
  • 1 file changed
  • 0 comments
  • 1 contributor

Showing 1 changed file with 20 additions and 4 deletions. Show diff stats Hide diff stats

  1. 24  patches/demo/raindance/raindance.fnp
24  patches/demo/raindance/raindance.fnp
@@ -45,8 +45,11 @@ midi "Faderfox LV3" {
45 45
 
46 46
 	enc1 = differential(24);
47 47
 	enc2 = differential(25);
  48
+	enc4 = differential(27);
48 49
 
49  
-	enc1_push = button(28);
  50
+	enc1_push = switch(28);
  51
+	enc3_push = switch(30);
  52
+	enc4_push = switch(31);
50 53
 
51 54
 	fx1 = switch(9, 4);
52 55
 	joy1x = fader(9, 1);
@@ -67,6 +70,10 @@ sensitivity = range(fader4);
67 70
 twist = unbounded(enc1);
68 71
 reset_twist = button(enc1_push);	// encoder 1 push
69 72
 theta = cyclic(enc2);
  73
+sens_fine = unbounded(enc4);
  74
+reset_sens = switch(enc4_push);
  75
+
  76
+thick = switch(enc3_push);
70 77
 
71 78
 red = range(fader5);
72 79
 green = range(fader6);
@@ -81,12 +88,15 @@ xshift = range(joy2x);
81 88
 yshift = range(joy2y);
82 89
 
83 90
 last_reset_twist = 0;
  91
+twist_offset = 0;
  92
+last_reset_sens = 0;
  93
+sens_offset = 0;
84 94
 
85 95
 per_frame:
86 96
 	/* rotation */
87 97
 
88  
-	rot = whirl*2+twist/10;
89  
-	twist = last_reset_twist == reset_twist+1 ? twist : 0;
  98
+	rot = whirl*2.2+(twist-twist_offset)/10;
  99
+	twist_offset = twist if last_reset_twist != reset_twist+1;
90 100
 	last_reset_twist = reset_twist+1; // avoid 0, so first push is change
91 101
 
92 102
 	/* growth */
@@ -102,7 +112,9 @@ per_frame:
102 112
 
103 113
 	/* sensitivity */
104 114
 
105  
-	wave_scale = sensitivity*10;
  115
+	wave_scale = sensitivity*10+sens_fine-sens_offset;
  116
+	sens_offset = sens_fine if last_reset_sens != reset_sens+1;
  117
+	last_reset_sens = reset_sens+1; // avoid 0, so first push is change
106 118
 
107 119
 	/* color */
108 120
 
@@ -111,6 +123,10 @@ per_frame:
111 123
 	wave_g = green*( 0.60*sin(0.900*t) + 0.40*sin(0.956*t) );
112 124
 	wave_b = blue*( 0.60*sin(0.910*t) + 0.40*sin(0.920*t) );
113 125
 
  126
+	/* line thickness */
  127
+
  128
+	wave_thick = thick;
  129
+
114 130
 	/* special effects */
115 131
 
116 132
 //	cx = offcenter ? 0.5+(xoff-0.5)*0.3 : 0.5;

No commit comments for this range

Something went wrong with that request. Please try again.