Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: m-labs/flickernoise
base: 2d66a34
...
head fork: m-labs/flickernoise
compare: 5606d55
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Nov 02, 2011
@wpwrak wpwrak input.c: synchronize with MIDI status and ignore real-time messages
This patch synchronizes the first (status) byte of each message and
it also ignores real-time messages which can appear _inside_ the
data of other messages.

I didn't make provisions for doing anything clever about SysEx,
because we don't handle them anyway.
77634db
@sbourdeauducq sbourdeauducq input: remove MIDI timeout 0d995f0
@sbourdeauducq sbourdeauducq New X2 patch from Werner 5606d55
Showing with 53 additions and 13 deletions.
  1. +41 −0 patches/Interactive/Werner - X2 (MIDI).fnp
  2. +12 −13 src/input.c
View
41 patches/Interactive/Werner - X2 (MIDI).fnp
@@ -0,0 +1,41 @@
+fDecay=0.9950000
+fVideoEchoZoom=2.000000
+fVideoEchoAlpha=0.000000
+nVideoEchoOrientation=0
+nWaveMode=2
+bAdditiveWaves=0
+bWaveDots=0
+bMaximizeWaveColor=1
+bTexWrap=1
+mv_a=0
+nMotionVectorsX=12
+nMotionVectorsY=9
+fWaveAlpha=3.000000
+fWaveScale=3.020000
+fWarpAnimSpeed=1.000000
+fWarpScale=2.853000
+zoom=1.031000
+rot=0.000000
+cx=0.500000
+cy=0.500000
+dx=0.000000
+dy=0.000000
+warp=0.309000
+sx=1.000000
+sy=1.000000
+wave_r=0.600000
+wave_g=0.600000
+wave_b=0.600000
+wave_x=0.500000
+wave_y=0.500000
+per_frame=wave_scale=midi4*20;
+per_frame=t=time*midi8*5;
+per_frame=wave_r = midi5*( 0.60*sin(0.933*t) + 0.40*sin(1.045*t) );
+per_frame=wave_g = midi6*( 0.60*sin(0.900*t) + 0.40*sin(0.956*t) );
+per_frame=wave_b = midi7*( 0.60*sin(0.910*t) + 0.40*sin(0.920*t) );
+per_frame=zoom = zoom + 0.023*( 0.60*sin(0.339*time) + 0.40*sin(0.276*time) );
+per_frame=rot = rot + 0.030*( 0.60*sin(0.381*time) + 0.40*sin(0.579*time) );
+per_frame=rot=midi1*2;
+per_frame=wave_x=0.5+midi3/5;
+per_frame=zoom=0.9+midi2/5;
+per_vertex=rot = rot + (rad-0.4)*1.7*max(0,min((bass_att-1.1)*1.5,5));
View
25 src/input.c
@@ -253,29 +253,28 @@ static int handle_midi_msg(mtk_event *e, unsigned char *msg)
}
}
-#define MIDI_TIMEOUT 20
-
-static int midi_p;
-static rtems_interval midi_last;
+static unsigned char *midi_p = NULL;
static unsigned char midi_msg[3];
static int handle_midi_event(mtk_event *e, unsigned char *msg)
{
- rtems_interval t;
int r;
- t = rtems_clock_get_ticks_since_boot();
- if(t > (midi_last + MIDI_TIMEOUT))
- midi_p = 0;
- midi_last = t;
+ if((*msg & 0xf8) == 0xf8)
+ return 0; /* ignore system real-time */
+
+ if(*msg & 0x80)
+ midi_p = midi_msg; /* status byte */
+
+ if(!midi_p)
+ return 0; /* ignore extra or unsynchronized data */
- midi_msg[midi_p] = msg[0];
- midi_p++;
+ *midi_p++ = *msg;
- if(midi_p == 3) {
+ if(midi_p == midi_msg+3) {
/* received a complete MIDI message */
r = handle_midi_msg(e, midi_msg);
- midi_p = 0;
+ midi_p = NULL;
return r;
}

No commit comments for this range

Something went wrong with that request. Please try again.