Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 44ad1f6
Choose a base ref
...
head repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02b32d0
Choose a head ref
  • 4 commits
  • 11 files changed
  • 1 contributor

Commits on Feb 17, 2012

  1. Copy the full SHA
    e121d60 View commit details
  2. Copy the full SHA
    51203f5 View commit details
  3. Copy the full SHA
    75c4e86 View commit details
  4. Copy the full SHA
    02b32d0 View commit details
36 changes: 36 additions & 0 deletions patches/demo/wheel/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
The "wheel" patch illustrates the use image sequences to create
animations.

To install the patch, run the script "gen" (needs transfig):

./gen

Then upload wheel.fnp and the PNGs with ftp:

ftp milkymist
ftp> prompt
ftp> put wheel.fnp
ftp> mput w*.png

The patch comes with MIDI bindings for the Faderfox LV3:

- the left half of the controller is for image channel 1, the
right half is for image channel 2. They're identical except
that the default positions of the images differ.

- faders 1 and 2 sets the image size and alpha channel

- faders 3 and 4 set the sensitivity to bass and treble

- encoder 1 adjusts the frame rate. The rate can be negative,
resulting in counterclockwise rotation (with the faux motion
blur looking a little odd).

- pushing encoder 1 sets the speed to zero and holds it at zero.
The frame number can be changed by turning the encoder. Pushing
encoder 1 releases the speed.

- blue button 1 sets the speed to one. Blue button 2 reverses the
speed.

- FX1 enables setting the image position with the joystick.
23 changes: 23 additions & 0 deletions patches/demo/wheel/figfilt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/perl
$skip = 0;
$skipping = 0;
while (<STDIN>) {
if (/^#/ && $. != 1) {
$skip = 1;
for $key (@ARGV) {
if ($_ =~ /^# $key$/) {
$skip = 0;
last;
}
}
print unless $skip;
next;
}
if (/^\s/) {
print unless $skipping;
next;
}
print unless $skip;
$skipping = $skip;
$skip = 0;
}
11 changes: 11 additions & 0 deletions patches/demo/wheel/gen
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -x
for n in 01 02 03 04 05 06 07 08 09 \
10 11 12 13 14 15 16 17 18 19 \
20 21 22 23 24; do
./figfilt `echo $n | sed s/^0//` <wheel.fig |
fig2dev -L png -S 4 -m 0.311 -g black >w$n.png
#
# When making changes to the image, adjust the -m parameter such
# that the resulting size of the PNG is 216x216 pixels.
#
done
162 changes: 162 additions & 0 deletions patches/demo/wheel/wheel.fig
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
#FIG 3.2 Produced by xfig version 3.2.5b
Landscape
Center
Metric
A4
100.00
Single
-2
1200 2
# 2
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 5400 2025 407 407 5400 2025 5807 2025
1 3 0 5 31 7 15 -1 -1 0.000 1 0.0000 5400 5175 3150 3150 5400 5175 8550 5175
# 3
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 5400 2025 407 407 5400 2025 5807 2025
# 1
1 3 0 0 0 7 45 -1 20 0.000 1 0.0000 5400 2025 407 407 5400 2025 5807 2025
# 2
1 3 0 0 0 7 45 -1 20 0.000 1 6.0214 6215 2132 407 407 6215 2132 6622 2132
# 3
1 3 0 0 0 7 45 -1 20 0.000 1 5.7596 6975 2447 407 407 6975 2447 7382 2447
# 4
1 3 0 0 0 7 45 -1 20 0.000 1 5.4978 7627 2948 407 407 7627 2948 8034 2948
# 5
1 3 0 0 0 7 45 -1 20 0.000 1 5.2360 8128 3600 407 407 8128 3600 8535 3600
# 6
1 3 0 0 0 7 45 -1 20 0.000 1 4.9742 8443 4360 407 407 8443 4360 8850 4360
# 7
1 3 0 0 0 7 45 -1 20 0.000 1 4.7124 8550 5175 407 407 8550 5175 8957 5175
# 8
1 3 0 0 0 7 45 -1 20 0.000 1 4.4506 8443 5990 407 407 8443 5990 8850 5990
# 9
1 3 0 0 0 7 45 -1 20 0.000 1 4.1888 8128 6750 407 407 8128 6750 8535 6750
# 10
1 3 0 0 0 7 45 -1 20 0.000 1 3.9270 7627 7402 407 407 7627 7402 8034 7402
# 11
1 3 0 0 0 7 45 -1 20 0.000 1 3.6652 6975 7903 407 407 6975 7903 7382 7903
# 12
1 3 0 0 0 7 45 -1 20 0.000 1 3.4034 6215 8218 407 407 6215 8218 6622 8218
# 13
1 3 0 0 0 7 45 -1 20 0.000 1 3.1416 5400 8325 407 407 5400 8325 5807 8325
# 14
1 3 0 0 0 7 45 -1 20 0.000 1 2.8798 4585 8218 407 407 4585 8218 4992 8218
# 15
1 3 0 0 0 7 45 -1 20 0.000 1 2.6180 3825 7903 407 407 3825 7903 4232 7903
# 16
1 3 0 0 0 7 45 -1 20 0.000 1 2.3562 3173 7402 407 407 3173 7402 3580 7402
# 17
1 3 0 0 0 7 45 -1 20 0.000 1 2.0944 2672 6750 407 407 2672 6750 3079 6750
# 18
1 3 0 0 0 7 45 -1 20 0.000 1 1.8326 2357 5990 407 407 2357 5990 2764 5990
# 19
1 3 0 0 0 7 45 -1 20 0.000 1 1.5708 2250 5175 407 407 2250 5175 2657 5175
# 20
1 3 0 0 0 7 45 -1 20 0.000 1 1.3090 2357 4360 407 407 2357 4360 2764 4360
# 21
1 3 0 0 0 7 45 -1 20 0.000 1 1.0472 2672 3600 407 407 2672 3600 3079 3600
# 22
1 3 0 0 0 7 45 -1 20 0.000 1 0.7854 3173 2948 407 407 3173 2948 3580 2948
# 23
1 3 0 0 0 7 45 -1 20 0.000 1 0.5236 3825 2447 407 407 3825 2447 4232 2447
# 24
1 3 0 0 0 7 45 -1 20 0.000 1 0.2618 4585 2132 407 407 4585 2132 4992 2132
# 4
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 6215 2132 407 407 6215 2132 6622 2132
# 5
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 6975 2447 407 407 6975 2447 7382 2447
# 6
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 7627 2948 407 407 7627 2948 8034 2948
# 7
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 8128 3600 407 407 8128 3600 8535 3600
# 8
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 8443 4360 407 407 8443 4360 8850 4360
# 9
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 8550 5175 407 407 8550 5175 8957 5175
# 10
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 8443 5990 407 407 8443 5990 8850 5990
# 11
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 8128 6750 407 407 8128 6750 8535 6750
# 12
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 7627 7402 407 407 7627 7402 8034 7402
# 13
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 6975 7903 407 407 6975 7903 7382 7903
# 14
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 6215 8218 407 407 6215 8218 6622 8218
# 15
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 5400 8325 407 407 5400 8325 5807 8325
# 16
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 4585 8218 407 407 4585 8218 4992 8218
# 17
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 3825 7903 407 407 3825 7903 4232 7903
# 18
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 3173 7402 407 407 3173 7402 3580 7402
# 19
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 2672 6750 407 407 2672 6750 3079 6750
# 20
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 2357 5990 407 407 2357 5990 2764 5990
# 21
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 2250 5175 407 407 2250 5175 2657 5175
# 23
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 2672 3600 407 407 2672 3600 3079 3600
# 22
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 2357 4360 407 407 2357 4360 2764 4360
# 24
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 3173 2948 407 407 3173 2948 3580 2948
# 1
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 3825 2447 407 407 3825 2447 4232 2447
# 2
1 3 0 0 0 7 35 -1 5 0.000 1 0.0000 4585 2132 407 407 4585 2132 4992 2132
# 3
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 6215 2132 407 407 6215 2132 6622 2132
# 4
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 6975 2447 407 407 6975 2447 7382 2447
# 5
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 7627 2948 407 407 7627 2948 8034 2948
# 6
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 8128 3600 407 407 8128 3600 8535 3600
# 7
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 8443 4360 407 407 8443 4360 8850 4360
# 8
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 8550 5175 407 407 8550 5175 8957 5175
# 9
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 8443 5990 407 407 8443 5990 8850 5990
# 10
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 8128 6750 407 407 8128 6750 8535 6750
# 11
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 7627 7402 407 407 7627 7402 8034 7402
# 12
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 6975 7903 407 407 6975 7903 7382 7903
# 13
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 6215 8218 407 407 6215 8218 6622 8218
# 14
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 5400 8325 407 407 5400 8325 5807 8325
# 15
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 4585 8218 407 407 4585 8218 4992 8218
# 16
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 3825 7903 407 407 3825 7903 4232 7903
# 18
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 2672 6750 407 407 2672 6750 3079 6750
# 17
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 3173 7402 407 407 3173 7402 3580 7402
# 19
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 2357 5990 407 407 2357 5990 2764 5990
# 20
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 2250 5175 407 407 2250 5175 2657 5175
# 21
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 2357 4360 407 407 2357 4360 2764 4360
# 22
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 2672 3600 407 407 2672 3600 3079 3600
# 24
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 3825 2447 407 407 3825 2447 4232 2447
# 23
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 3173 2948 407 407 3173 2948 3580 2948
# 1
1 3 0 0 0 7 40 -1 10 0.000 1 0.0000 4585 2132 407 407 4585 2132 4992 2132
2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
450 225 10350 225 10350 10125 450 10125 450 225
2 1 0 5 1 7 20 -1 -1 0.000 0 0 -1 0 0 2
2160 8415 8640 1935
2 1 0 5 1 7 20 -1 -1 0.000 0 0 -1 0 0 2
2160 1935 8640 8415
2 2 0 5 1 7 20 -1 -1 0.000 0 0 -1 0 0 5
2160 1935 8640 1935 8640 8415 2160 8415 2160 1935
118 changes: 118 additions & 0 deletions patches/demo/wheel/wheel.fnp
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* wheel.fnp - Demonstrate moving pictures
*/

imagefiles=w01.png, w02.png, w03.png, w04.png,
w05.png, w06.png, w07.png, w08.png, w09.png,
w10.png, w11.png, w12.png, w13.png, w14.png,
w15.png, w16.png, w17.png, w18.png, w19.png,
w20.png, w21.png, w22.png, w23.png, w24.png;

decay = 0;

midi "Faderfox LV3" {
fad1 = fader(1, 7);
fad2 = fader(2, 7);
fad3 = fader(3, 7);
fad4 = fader(4, 7);
fad5 = fader(5, 7);
fad6 = fader(6, 7);
fad7 = fader(7, 7);
fad8 = fader(8, 7);

enc1 = differential(24);
enc2 = differential(25);
enc3 = differential(26);
enc4 = differential(27);

enc1_push = button(28);
enc2_push = button(29);
enc3_push = button(30);
enc4_push = button(31);

green1 = button(1, 16);
green2 = button(2, 16);
green3 = button(3, 16);
green4 = button(4, 16);
green5 = button(5, 16);
green6 = button(6, 16);
green7 = button(7, 16);
green8 = button(8, 16);

blue1 = button(1, 17);
blue2 = button(2, 17);
blue3 = button(3, 17);
blue4 = button(4, 17);
blue5 = button(5, 17);
blue6 = button(6, 17);
blue7 = button(7, 17);
blue8 = button(8, 17);

fx1 = switch(9, 4);
joy1x = pot(9, 1);
joy1y = pot(9, 2);

fx2 = switch(10, 4);
joy2x = pot(10, 1);
joy2y = pot(10, 2);
};

size1 = range(fad1); /* image size */
alpha1 = range(fad2); /* image alpha */
bass1 = range(fad3); /* sensitivity to bass */
treb1 = range(fad4); /* sensitivity to treble */
size2 = range(fad5);
alpha2 = range(fad6);
bass2 = range(fad7);
treb2 = range(fad8);

speed1 = unbounded(enc1); /* speed of rotation, relative to off1 */
speed2 = unbounded(enc3);

reset1 = unbounded(enc1_push); /* reset speed (and adjust position) */
reset2 = unbounded(enc3_push);

start1 = button(blue1); /* set speed to 1 step/frame = 1 rpm */
rev1 = button(blue2); /* reverse rotation */
start2 = button(blue5);
rev2 = button(blue6);

fx1 = switch(fx1); /* enable joystick */
joy1x = range(joy1x); /* X position of image */
joy1y = range(joy1y); /* Y position */
fx2 = switch(fx2);
joy2x = range(joy2x);
joy2y = range(joy2y);

per_frame:
scale = 4;

image1_zoom = size1*size1*7+0.1+20*sin(5*bass1*bass)+10*sin(treb1*treb);
image2_zoom = size2*size2*7+0.1+20*sin(5*bass2*bass)+10*sin(treb2*treb);
image1_a = alpha1;
image2_a = alpha2;

f1 = f1+(speed1-off1)*scale;
f1 = f1 < 0 ? f1+24 : f1;
f1 = f1 >= 24 ? f1-24 : f1;
off1 = reset1 ? speed1 : start1 ? speed1-1/scale : off1;
off1 = rev1 ? 2*speed1-off1 : off1;

f2 = f2+(speed2-off2)*scale;
f2 = f2 < 0 ? f2+24 : f2;
f2 = f2 >= 24 ? f2-24 : f2;
off2 = reset2 ? speed2 : start2 ? speed2-1/scale : off2;
off2 = rev2 ? 2*speed2-off2 : off2;

image1_index = f1;
image2_index = f2;

image1_x = fx1 ? joy1x : 0.3;
image1_y = fx1 ? 1-joy1y : 0.5;
image2_x = fx2 ? joy2x : 0.7;
image2_y = fx2 ? 1-joy2y : 0.5;

start1 = 0;
start2 = 0;
rev1 = 0;
rev2 = 0;
Loading