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: 2d66a34
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: 5606d55
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Nov 2, 2011

  1. 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.
    wpwrak authored and Sebastien Bourdeauducq committed Nov 2, 2011

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    77634db View commit details
  2. input: remove MIDI timeout

    Sebastien Bourdeauducq committed Nov 2, 2011
    Copy the full SHA
    0d995f0 View commit details
  3. New X2 patch from Werner

    Sebastien Bourdeauducq committed Nov 2, 2011
    Copy the full SHA
    5606d55 View commit details
Showing with 53 additions and 13 deletions.
  1. +41 −0 patches/Interactive/Werner - X2 (MIDI).fnp
  2. +12 −13 src/input.c
41 changes: 41 additions & 0 deletions patches/Interactive/Werner - X2 (MIDI).fnp
Original file line number Diff line number Diff line change
@@ -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));
25 changes: 12 additions & 13 deletions src/input.c
Original file line number Diff line number Diff line change
@@ -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;
}