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: 212cb94
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: dd88600
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Feb 15, 2012

  1. Copy the full SHA
    a8d591d View commit details
  2. Copy the full SHA
    dd88600 View commit details
Showing with 51 additions and 24 deletions.
  1. +31 −11 experimental/T.fnp
  2. +4 −1 src/compiler/doc/Makefile
  3. +0 −1 src/compiler/doc/arch.fig
  4. +16 −11 src/compiler/doc/midi.tex
42 changes: 31 additions & 11 deletions experimental/T.fnp
Original file line number Diff line number Diff line change
@@ -64,8 +64,8 @@ radius = range(fader3);
sensitivity = range(fader4);

twist = unbounded(enc1);
reset_twist = button(enc1_push);
theta = cyclic(enc2); // encoder 1 push
reset_twist = button(enc1_push); // encoder 1 push
theta = cyclic(enc2);

red = range(fader5);
green = range(fader6);
@@ -79,26 +79,46 @@ shift = switch(fx2); // FX2
xshift = range(joy2x);
yshift = range(joy2y);

last_reset_twist = 0;

per_frame:
wave_scale = sensitivity*20;
/* rotation */

rot = whirl*2+twist/10;
twist = last_reset_twist == reset_twist+1 ? twist : 0;
last_reset_twist = reset_twist+1; // avoid 0, so first push is change

/* growth */

zoom = 0.9+growth/5;

/* angle */

dist = radius/5;
tmp = theta*6.2832;
wave_x = cx+cos(tmp)*dist;
wave_y = cy-sin(tmp)*dist;

/* sensitivity */

wave_scale = sensitivity*10;

/* color */

t = time*change*5;
wave_r = red*( 0.60*sin(0.933*t) + 0.40*sin(1.045*t) );
wave_g = green*( 0.60*sin(0.900*t) + 0.40*sin(0.956*t) );
wave_b = blue*( 0.60*sin(0.910*t) + 0.40*sin(0.920*t) );
rot = whirl*2+twist/10;
dist = radius/5;

/* special effects */

// cx = offcenter ? 0.5+(xoff-0.5)*0.3 : 0.5;
// cy = offcenter ? 0.5+(0.5-yoff)*0.3 : 0.5;
sx = offcenter ? 0.2*(xoff-0.5)+1 : 1;
sy = offcenter ? 0.2*(yoff-0.5)+1 : 1;
tmp = theta*6.2832;
wave_x = cx+cos(tmp)*dist;
wave_y = cy-sin(tmp)*dist;

dx = shift ? (xshift-0.5)*0.2 : 0;
dy = shift ? (yshift-0.5)*0.2 : 0;
zoom = 0.9+growth/5;
twist = last_reset_twist == reset_twist+1 ? twist : 0;
last_reset_twist = reset_twist+1; // avoid 0, so first push is change

per_vertex:
rot = rot + (rad-0.4)*1.7*max(0,min((bass_att-1.1)*1.5,5));
5 changes: 4 additions & 1 deletion src/compiler/doc/Makefile
Original file line number Diff line number Diff line change
@@ -14,13 +14,16 @@ PICS = arch msg bind stim \

GEN = nocvars.inc

.PHONY: all xpdf clean
.PHONY: all again xpdf clean

all: midi.pdf

midi.pdf: midi.tex floats.inc $(PICS:%=%.$(PICEXT)) $(GEN)
pdflatex midi

again: midi.tex floats.inc $(PICS:%=%.$(PICEXT)) $(GEN)
pdflatex midi

xpdf: midi.pdf
xpdf $<

1 change: 0 additions & 1 deletion src/compiler/doc/arch.fig
Original file line number Diff line number Diff line change
@@ -98,7 +98,6 @@ Single
2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 4
1 1 2.00 60.00 60.00
7470 3195 7470 2880 4050 2880 4050 3330
4 1 0 45 -1 18 12 0.0000 4 150 525 12330 6570 Patch\001
4 1 0 45 -1 18 12 0.0000 4 150 615 3285 5355 Gizmo\001
4 1 32 45 -1 18 12 0.0000 4 150 435 3285 6480 Frob\001
4 0 0 45 -1 18 12 0.0000 4 150 1380 4185 4725 Characteristics\001
27 changes: 16 additions & 11 deletions src/compiler/doc/midi.tex
Original file line number Diff line number Diff line change
@@ -10,6 +10,9 @@
\newenvironment{expose}{\vskip3mm\qquad\begin{raggedright}}{%
\end{raggedright}\vskip3mm}

\widowpenalty=5000
\clubpenalty=300

\input floats.inc

\begin{document}
@@ -67,15 +70,15 @@ \section{Quick start}
sensitivity = sensitivity*0.99;
\end{listing}

In lines 1 through 6 we describe the controls the MIDI device called
In lines 1 through 7 we describe the controls the MIDI device called
``Gizmo'' provides. In this case, we have one fader, one potentiometer,
two buttons, and one switch. We assign them names that represent their
role: {\tt main}
for the principal fader, {\tt aux} for the potentiometer, and so on.

The numbers are the respective MIDI controller numbers the device uses.
They can be found with the MIDI monitor function of the ``MIDI settings''
dialog in Flickernoise.
The arguments 102, 103, $\ldots$, are the numbers of the MIDI controllers.
They depend on the device and can be found with the MIDI monitor function
of the ``MIDI settings'' dialog in Flickernoise.

In line 9, we bind the {\tt main} control to a variable. This variable
receives the value 0 if the fader is at its minimum and 1 at its maximum.
@@ -206,8 +209,9 @@ \subsection{Device database}
{\em control\_number} is a number from 0 to 127 the MIDI device uses
to identify the control element.

This is the example from the quick start section with channel numbers
added:
Below is the example from the quick start section with channel numbers
added. We will use the {\tt aux} element as the basis for further
examples.

\begin{listing}{1}
midi "Gizmo" {
@@ -312,12 +316,13 @@ \subsection{Event processing}
\subsection{Writing to control variables}

A patch can overwrite the values of control variables. In the case of
per-frame variables, they retain their modified content across
user-defined per-frame variables, they retain their modified content across
frames until a new event arrives. The new event will always overwrite
the previous value of the variable without regard for any changes that
may have been made.

Changes to per-vertex variables are lost at the end of the program.
Changes to per-vertex variables are lost at the end of the program
and so are changes to per-frame variables that are not user-defined.

It is sometimes desirable to make a control change a variable relative
to a value set by the patch. The following example illustrates how
@@ -802,8 +807,8 @@ \subsection{Differential encoders}

Like the rotary encoders emulating potentiometers described in section
\ref{encpot}, the values a device sends for differential encoders may be
increased if turning rapidly. Instead of the very large values used in
the examples, one would see a sequence of smaller values as the encoder
is turned.
increased if turning rapidly. Furthermore, instead of the very large values
used in these examples, one would see a sequence of smaller values as the
encoder is turned.

\end{document}