Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

demo/raindance/: Tornado Raindance, with stronger MIDIfication (WIP)

  • Loading branch information...
commit fde4342333121644045418a657fa0fc492d1eebb 1 parent 6e9023d
Werner Almesberger authored February 26, 2012

Showing 1 changed file with 125 additions and 0 deletions. Show diff stats Hide diff stats

  1. 125  patches/demo/raindance/raindance.fnp
125  patches/demo/raindance/raindance.fnp
... ...
@@ -0,0 +1,125 @@
  1
+/*
  2
+ * Highly experimental variant of Tornado (Rain Dance MIDI RMX)
  3
+ */
  4
+
  5
+fDecay=0.9950000
  6
+fVideoEchoZoom=2.000000
  7
+fVideoEchoAlpha=0.000000
  8
+nVideoEchoOrientation=0
  9
+nWaveMode=2
  10
+bAdditiveWaves=0
  11
+bWaveDots=0
  12
+bMaximizeWaveColor=1
  13
+bTexWrap=1
  14
+mv_a=0
  15
+nMotionVectorsX=12
  16
+nMotionVectorsY=9
  17
+fWaveAlpha=3.000000
  18
+fWaveScale=3.020000
  19
+fWarpAnimSpeed=1.000000
  20
+fWarpScale=2.853000
  21
+zoom=1.031000
  22
+rot=0.000000
  23
+cx=0.500000
  24
+cy=0.500000
  25
+dx=0.000000
  26
+dy=0.000000
  27
+warp=0.309000
  28
+sx=1.000000
  29
+sy=1.000000
  30
+wave_r=0.600000
  31
+wave_g=0.600000
  32
+wave_b=0.600000
  33
+wave_x=0.500000
  34
+wave_y=0.500000
  35
+
  36
+midi "Faderfox LV3" {
  37
+	fader1 = fader(1, 7);
  38
+	fader2 = fader(2, 7);
  39
+	fader3 = fader(3, 7);
  40
+	fader4 = fader(4, 7);
  41
+	fader5 = fader(5, 7);
  42
+	fader6 = fader(6, 7);
  43
+	fader7 = fader(7, 7);
  44
+	fader8 = fader(8, 7);
  45
+
  46
+	enc1 = differential(24);
  47
+	enc2 = differential(25);
  48
+
  49
+	enc1_push = button(28);
  50
+
  51
+	fx1 = switch(9, 4);
  52
+	joy1x = fader(9, 1);
  53
+	joy1y = fader(9, 2);
  54
+
  55
+	fx2 = switch(10, 4);
  56
+	joy2x = fader(10, 1);
  57
+	joy2y = fader(10, 2);
  58
+}
  59
+
  60
+/* MIDI settings for Faderfox LV3 */
  61
+
  62
+whirl = range(fader1);
  63
+growth = range(fader2);
  64
+radius = range(fader3);
  65
+sensitivity = range(fader4);
  66
+
  67
+twist = unbounded(enc1);
  68
+reset_twist = button(enc1_push);	// encoder 1 push
  69
+theta = cyclic(enc2);
  70
+
  71
+red = range(fader5);
  72
+green = range(fader6);
  73
+blue = range(fader7);
  74
+change = range(fader8);
  75
+
  76
+offcenter = switch(fx1);		// FX1
  77
+xoff = range(joy1x);
  78
+yoff = range(joy1y);
  79
+shift = switch(fx2);			// FX2
  80
+xshift = range(joy2x);
  81
+yshift = range(joy2y);
  82
+
  83
+last_reset_twist = 0;
  84
+
  85
+per_frame:
  86
+	/* rotation */
  87
+
  88
+	rot = whirl*2+twist/10;
  89
+	twist = last_reset_twist == reset_twist+1 ? twist : 0;
  90
+	last_reset_twist = reset_twist+1; // avoid 0, so first push is change
  91
+
  92
+	/* growth */
  93
+
  94
+	zoom = 0.9+growth/5;
  95
+
  96
+	/* angle */
  97
+
  98
+	dist = radius/5;
  99
+	tmp = theta*6.2832;
  100
+	wave_x = cx+cos(tmp)*dist;
  101
+	wave_y = cy-sin(tmp)*dist;
  102
+
  103
+	/* sensitivity */
  104
+
  105
+	wave_scale = sensitivity*10;
  106
+
  107
+	/* color */
  108
+
  109
+	t = time*change*5;
  110
+	wave_r = red*( 0.60*sin(0.933*t) + 0.40*sin(1.045*t) );
  111
+	wave_g = green*( 0.60*sin(0.900*t) + 0.40*sin(0.956*t) );
  112
+	wave_b = blue*( 0.60*sin(0.910*t) + 0.40*sin(0.920*t) );
  113
+
  114
+	/* special effects */
  115
+
  116
+//	cx = offcenter ? 0.5+(xoff-0.5)*0.3 : 0.5;
  117
+//	cy = offcenter ? 0.5+(0.5-yoff)*0.3 : 0.5;
  118
+	sx = offcenter ? 0.2*(xoff-0.5)+1 : 1;
  119
+	sy = offcenter ? 0.2*(yoff-0.5)+1 : 1;
  120
+
  121
+	dx = shift ? (xshift-0.5)*0.2 : 0;
  122
+	dy = shift ? (yshift-0.5)*0.2 : 0;
  123
+
  124
+per_vertex:
  125
+	rot = rot + (rad-0.4)*1.7*max(0,min((bass_att-1.1)*1.5,5));

0 notes on commit fde4342

Please sign in to comment.
Something went wrong with that request. Please try again.