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: 2b6b049
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: 9a098d5
Choose a head ref

Commits on Jan 30, 2012

  1. renderer/stimuli.c: unified control input handling

    This commit provides data structure and basic functions for the unified
    control input handling.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    3437cec View commit details
  2. Copy the full SHA
    c26922b View commit details
  3. Copy the full SHA
    97e1457 View commit details
  4. sampler.c: disentangle event_callback

    Move pitch and control event handling into separate functions and
    expose the logic of prying apart the event code more clearly.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    30fa417 View commit details
  5. Copy the full SHA
    53f48ec View commit details
  6. stimuli: added crude stim_redirect hack to keep pointers valid across…

    … copies
    
    Maybe we can actually get rid of most of this copying. But for now,
    this should work ... (untested so far, of course)
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    798fa31 View commit details
  7. Copy the full SHA
    6c4895f View commit details
  8. Copy the full SHA
    a6d4cc3 View commit details
  9. Copy the full SHA
    2fe2649 View commit details
  10. Copy the full SHA
    25b08ca View commit details
  11. Copy the full SHA
    a9f77a7 View commit details
  12. Copy the full SHA
    e2bebe0 View commit details
  13. Copy the full SHA
    6d81665 View commit details
  14. midi control: added processors for encoders sending acceleration

    Processor selection is via a 3rd argument to midi():
    
    - linear: normal linear control (default)
    - accel_linear: control sends acceleration data; map to linear
    - accel_cyclic: control sends acceleration data; cycle in interval [0, 1]
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    8553095 View commit details
  15. experimental/T.fnp: Tornado Rain Dance variant for new MIDI control s…

    …election
    
    This is only temporary to better track changes.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    1dd1b1c View commit details
  16. controls: removed indirection via cvar array

    MIDI input now changes the register array directly. Note that this
    means that writing to a control variable changes its value until
    the next time it is updated by MIDI. Not sure if this is more
    feature or bug.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    b4458bc View commit details
  17. renderer: keep patch_lock around and clear current_patch when stopped

    This commit makes renderer_lock_patch, renderer_unlock_patch, and
    renderer_get_patch produce meaningful resuls also when the renderer
    is not running.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    23b34a3 View commit details
  18. sampler.c: only enter patch-specific stimulus processing if we have a…

    … patch
    
    Not checking for this crashed FN when running the sampler without
    rendering, e.g., in the audio dialog.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    f5721eb View commit details
  19. Copy the full SHA
    9b64d06 View commit details
  20. compiler: move retrieval of stimuli pointer from parser into compiler.c

    A bit cleaner this way.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    bcb404d View commit details
  21. stimuli: rename stim_add to stim_add_midi_ctrl

    It's not generic.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    e6fa3f6 View commit details
  22. stimuli: added processor for acceleration with an unbounded range

    accel_unbounded is (re)settable, as shown in T.fnp
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    2f337e1 View commit details
  23. stimuli: remember and update base pointer for stim_redirect

    Running a patch twice broke direct MIDI because pointers were updated
    relative to the previous copy instead of the original patch. The commit
    fixed the problem. The overall ugliness of the process remains, though.
    wpwrak committed Jan 30, 2012
    Copy the full SHA
    c037acc View commit details
  24. Copy the full SHA
    a602258 View commit details
  25. Copy the full SHA
    41804a4 View commit details
  26. Copy the full SHA
    c1f5d02 View commit details
  27. Copy the full SHA
    230544d View commit details

Commits on Feb 7, 2012

  1. Copy the full SHA
    2ac7dc9 View commit details

Commits on Feb 8, 2012

  1. stimuli: added MIDI channel wildcard (WIP)

    The syntax is ugly: midi([chan], controller [, style])
    
    Note that the comma after the channel is required, even if the
    channel number is omitted. This would be difficult to do better
    with the present syntax, but will get easier further down the
    road.
    wpwrak committed Feb 8, 2012
    Copy the full SHA
    d543c6f View commit details
  2. Copy the full SHA
    08dbe02 View commit details
  3. Copy the full SHA
    7dafcae View commit details
  4. Copy the full SHA
    7133915 View commit details
  5. gui/midi.c: show channel number in MIDI monitor and change display fo…

    …rmat
    
    This commit changes the format from  CTRL (VALUE)  to either
    CHAN.CTRL = VALUE  if the channel is the one currently selected, or
    (CHAN.CTRL = VALUE)  if this is on a different channel.
    
    The parentheses indicate that the traditional midiX variables are
    not affected by this controller.
    wpwrak committed Feb 8, 2012
    Copy the full SHA
    39e2529 View commit details
  6. gui/midi.c: make channel numbers presented to user one-based

    For compatibility, the number in the configuration is still zero-based.
    We'll get rid of it eventually.
    wpwrak committed Feb 8, 2012
    Copy the full SHA
    e01883c View commit details

Commits on Feb 9, 2012

  1. Copy the full SHA
    439a665 View commit details
  2. compiler: added parsing of MIDI device database (WIP)

    Also updated the example code in T.fnp
    wpwrak committed Feb 9, 2012
    Copy the full SHA
    cbf2fb1 View commit details
  3. compiler: added labeling of MIDI devices

    There are three interconnected changes in this commit:
    - added quoted strings (TOK_STRING) to scanner,
    - use them in the grammar, for midi_device,
    - update T.fnp example
    wpwrak committed Feb 9, 2012
    Copy the full SHA
    2902efb View commit details
  4. compiler: added binding of inputs (WIP)

    Also updated the example code in T.fnp
    wpwrak committed Feb 9, 2012
    Copy the full SHA
    d1e597c View commit details

Commits on Feb 10, 2012

  1. Copy the full SHA
    eaf6ea0 View commit details
  2. Copy the full SHA
    3c3d02b View commit details
  3. Copy the full SHA
    f2413ed View commit details
  4. stimuli: stim_add_midi_ctrl and midi_proc_* are now internal

    Thus made them "static" and removed them from the header.
    wpwrak committed Feb 10, 2012
    Copy the full SHA
    2de1183 View commit details
  5. stimuli: renamed midi_proc_accel_* to midi_proc_diff_*

    For consistency with differential() and dt_diff.
    wpwrak committed Feb 10, 2012
    Copy the full SHA
    25bd531 View commit details
  6. Copy the full SHA
    08af98f View commit details
  7. stimuli: separate set operation from midi_proc_linear

    For future sharing.
    wpwrak committed Feb 10, 2012
    Copy the full SHA
    6753ab4 View commit details
  8. Copy the full SHA
    180f37e View commit details
  9. stimuli: added range-to-button processor (untested)

    We use it also for range-to-toggle since this seems to be a better
    approximation than requiring a zero-non-zero transition for each
    toggle.
    wpwrak committed Feb 10, 2012
    Copy the full SHA
    25dc757 View commit details
  10. stimuli: added differential-to-button processor (untested)

    We use it also for differential-to-toggle, like in the range-to-button
    case.
    wpwrak committed Feb 10, 2012
    Copy the full SHA
    50542a4 View commit details
  11. Copy the full SHA
    bfbecab View commit details
  12. stimuli: make register update functions not MIDI specific

    This just moves the ct->regs lookup across the API.
    wpwrak committed Feb 10, 2012
    Copy the full SHA
    ea837ff View commit details
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ ifeq ($(WITH_PDF),1)
endif
OBJS += $(addprefix translations/,french.o german.o)
OBJS += $(addprefix renderer/,framedescriptor.o analyzer.o sampler.o \
eval.o line.o wave.o font.o osd.o raster.o renderer.o \
eval.o line.o wave.o font.o osd.o raster.o renderer.o stimuli.o \
videoinreconf.o)
OBJS += $(addprefix compiler/,compiler.o parser_helper.o scanner.o \
parser.o symtab.o)
29 changes: 26 additions & 3 deletions src/compiler/compiler.c
Original file line number Diff line number Diff line change
@@ -187,13 +187,17 @@ static void all_initials_to_pfv(struct compiler_sc *sc)
static void pfv_bind_callback(void *_sc, struct fpvm_sym *sym, int reg)
{
struct compiler_sc *sc = _sc;
struct sym *s = FPVM2SYM(sym);
struct sym_stim *r;
int pfv;

pfv = pfv_from_sym(FPVM2SYM(sym));
pfv = pfv_from_sym(s);
if(pfv >= 0) {
pfv_update_patch_requires(sc, pfv);
sc->p->pfv_allocation[pfv] = reg;
}
for(r = s->stim; r; r = r->next)
r->regs->pfv = sc->p->perframe_regs+reg;
}

static bool init_pfv(struct compiler_sc *sc)
@@ -265,13 +269,17 @@ static void pvv_update_patch_requires(struct compiler_sc *sc, int pvv)
static void pvv_bind_callback(void *_sc, struct fpvm_sym *sym, int reg)
{
struct compiler_sc *sc = _sc;
struct sym *s = FPVM2SYM(sym);
struct sym_stim *r;
int pvv;

pvv = pvv_from_sym(FPVM2SYM(sym));
pvv = pvv_from_sym(s);
if(pvv >= 0) {
pvv_update_patch_requires(sc, pvv);
sc->p->pvv_allocation[pvv] = reg;
}
for(r = s->stim; r; r = r->next)
r->regs->pvv = sc->p->pervertex_regs+reg;
}

static bool init_pvv(struct compiler_sc *sc)
@@ -483,6 +491,7 @@ struct patch *patch_compile(const char *basedir, const char *patch_code,
sc->p->require = 0;
sc->p->original = NULL;
sc->p->next = NULL;
sc->p->stim = NULL;

sc->basedir = basedir;
sc->rmc = rmc;
@@ -502,7 +511,10 @@ struct patch *patch_compile(const char *basedir, const char *patch_code,
if(!finalize_pvv(sc)) goto fail;
if(!schedule_pvv(sc)) goto fail;

#ifndef STANDALONE
symtab_free();
#endif
stim_db_free(); /* @@@ */

free(sc);
return p;
@@ -534,6 +546,13 @@ struct patch *patch_compile_filename(const char *filename,
return p;
}

struct stimuli *compiler_get_stimulus(struct compiler_sc *sc)
{
if(!sc->p->stim)
sc->p->stim = stim_new(sc->p);
return sc->p->stim;
}

#ifndef STANDALONE

struct patch *patch_copy(struct patch *p)
@@ -553,6 +572,9 @@ struct patch *patch_copy(struct patch *p)
img->filename = strdup(img->filename);
pixbuf_inc_ref(img->pixbuf);
}
new_patch->stim = stim_get(p->stim);
if(p->stim)
stim_redirect(p->stim, new_patch);
return new_patch;
}

@@ -567,6 +589,7 @@ void patch_free(struct patch *p)
pixbuf_dec_ref(img->pixbuf);
free((void *) img->filename);
}
stim_put(p->stim);
free(p);
}

@@ -588,4 +611,4 @@ struct patch *patch_refresh(struct patch *p)
return p;
}

#endif
#endif /* !STANDALONE */
51 changes: 35 additions & 16 deletions src/compiler/compiler.h
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@
#include <fpvm/fpvm.h>

#include "../renderer/framedescriptor.h"
#include "../renderer/stimuli.h"
#include "../pixbuf/pixbuf.h"

enum {
@@ -227,29 +228,47 @@ struct image {

struct patch {
/* per-frame */
struct image images[IMAGE_COUNT]; /* < images used in this patch */
float pfv_initial[COMP_PFV_COUNT]; /* < patch initial conditions */
int pfv_allocation[COMP_PFV_COUNT]; /* < where per-frame variables are mapped in PFPU regf, -1 if unmapped */
int perframe_prog_length; /* < how many instructions in perframe_prog */
unsigned int perframe_prog[PFPU_PROGSIZE]; /* < PFPU per-frame microcode */
float perframe_regs[PFPU_REG_COUNT]; /* < PFPU initial per-frame regf */
struct image images[IMAGE_COUNT]; /* images used in this patch */
float pfv_initial[COMP_PFV_COUNT]; /* patch initial conditions */
int pfv_allocation[COMP_PFV_COUNT]; /* where per-frame variables
are mapped in PFPU regf,
-1 if unmapped */
int perframe_prog_length; /* how many instructions in
perframe_prog */
unsigned int perframe_prog[PFPU_PROGSIZE];
/* PFPU per-frame microcode */
float perframe_regs[PFPU_REG_COUNT]; /* PFPU initial per-frame
register file */
/* per-vertex */
int pvv_allocation[COMP_PVV_COUNT]; /* < where per-vertex variables are mapped in PFPU regf, -1 if unmapped */
int pervertex_prog_length; /* < how many instructions in pervertex_prog */
unsigned int pervertex_prog[PFPU_PROGSIZE]; /* < PFPU per-vertex microcode */
float pervertex_regs[PFPU_REG_COUNT]; /* < PFPU initial per-vertex regf */
int pvv_allocation[COMP_PVV_COUNT]; /* where per-vertex variables
are mapped in PFPU regf,
-1 if unmapped */
int pervertex_prog_length; /* how many instructions in
pervertex_prog */
unsigned int pervertex_prog[PFPU_PROGSIZE];
/* PFPU per-vertex microcode */
float pervertex_regs[PFPU_REG_COUNT]; /* PFPU initial per-vertex
regf */
/* meta */
unsigned int require; /* < bitmask: dmx, osc, midi, video */
void *original; /* < original patch (with initial register values) */
int ref; /* reference count */
struct patch *next; /* < used when chaining patches in mashups */
unsigned int require; /* bitmask: dmx, osc, midi, video */
void *original; /* original patch (with initial register
values) */
int ref; /* reference count */
struct patch *next; /* used when chaining patches in mashups */

/* unified input events */
struct stimuli *stim; /* control variable hierarchy */
};

typedef void (*report_message)(const char *);
struct compiler_sc;

void init_fpvm(struct fpvm_fragment *fragment, int vector_mode);
struct patch *patch_compile(const char *basedir, const char *patch_code, report_message rmc);
struct patch *patch_compile_filename(const char *filename, const char *patch_code, report_message rmc);
struct patch *patch_compile(const char *basedir, const char *patch_code,
report_message rmc);
struct patch *patch_compile_filename(const char *filename,
const char *patch_code, report_message rmc);
struct stimuli *compiler_get_stimulus(struct compiler_sc *sc);
struct patch *patch_copy(struct patch *p);
void patch_free(struct patch *p);
struct patch *patch_refresh(struct patch *p);
129 changes: 129 additions & 0 deletions src/compiler/doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
fig2pdf = ./figfilt $(1) <$< | \
fig2dev -L pdf -m 0.2 >$@ || { rm -rf $@; exit 1; }

PICEXT = pdf

PICS = arch msg bind stim \
button-up button-down \
switch-off switch-on \
fader-0 fader-40 fader-60 fader-100 \
pot-0 pot-90 pot-180 pot-270 \
enc-0 enc-90 enc-270 enc-450 enc-405 \
dial-0 dial-90 dial-180 dial-360 \
dial-405 dial-405-idle dial-315 dial-45 dial-135 dial-315f

GEN = nocvars.inc

.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 $<

arch.pdf: arch.fig
fig2dev -L pdf -m 0.9 $< $@ || { rm -rf $@; exit 1; }

msg.pdf: msg.fig
fig2dev -L pdf -m 0.9 $< $@ || { rm -rf $@; exit 1; }

bind.pdf: bind.fig
fig2dev -L pdf -m 0.9 $< $@ || { rm -rf $@; exit 1; }

stim.pdf: stim.fig
fig2dev -L pdf -m 0.9 $< $@ || { rm -rf $@; exit 1; }

button-up.$(PICEXT): button.fig
$(call fig2pdf, button)

button-down.$(PICEXT): button.fig
$(call fig2pdf, button finger)

switch-off.$(PICEXT): switch.fig
$(call fig2pdf, switch off)

switch-on.$(PICEXT): switch.fig
$(call fig2pdf, switch on)

fader-0.$(PICEXT): fader.fig
$(call fig2pdf, min)

fader-40.$(PICEXT): fader.fig
$(call fig2pdf, 40)

fader-60.$(PICEXT): fader.fig
$(call fig2pdf, 60)

fader-100.$(PICEXT): fader.fig
$(call fig2pdf, max)

pot-0.$(PICEXT): dial.fig
$(call fig2pdf, 225deg stop)

pot-90.$(PICEXT): dial.fig
$(call fig2pdf, 315deg stop cw)

pot-180.$(PICEXT): dial.fig
$(call fig2pdf, 45deg stop cw)

pot-270.$(PICEXT): dial.fig
$(call fig2pdf, 135deg stop cw)

enc-0.$(PICEXT): dial.fig
$(call fig2pdf, 0deg)

enc-90.$(PICEXT): dial.fig
$(call fig2pdf, 90deg cw)

enc-270.$(PICEXT): dial.fig
$(call fig2pdf, 270deg cw-fast)

enc-450.$(PICEXT): dial.fig
$(call fig2pdf, 90deg cw-fast)

enc-405.$(PICEXT): dial.fig
$(call fig2pdf, 45deg ccw-slow)

dial-0.$(PICEXT): dial.fig
$(call fig2pdf, 0deg)

dial-90.$(PICEXT): dial.fig
$(call fig2pdf, 90deg cw)

dial-180.$(PICEXT): dial.fig
$(call fig2pdf, 180deg cw)

dial-360.$(PICEXT): dial.fig
$(call fig2pdf, 0deg cw-fast)

dial-405.$(PICEXT): dial.fig
$(call fig2pdf, 45deg cw-slow)

dial-405-idle.$(PICEXT): dial.fig
$(call fig2pdf, 45deg)

dial-315.$(PICEXT): dial.fig
$(call fig2pdf, 315deg ccw)

dial-45.$(PICEXT): dial.fig
$(call fig2pdf, 45deg ccw-slow)

dial-135.$(PICEXT): dial.fig
$(call fig2pdf, 135deg ccw-fast)

dial-315f.$(PICEXT): dial.fig
$(call fig2pdf, 315deg ccw-fast)

nocvars.inc: ../fnp.ids
./mknocvars <$< >$@ || { rm -f $@; exit 1; }

clean:
rm -f $(PICS:%=%.$(PICEXT))
rm -f $(GEN)
rm -f midi.aux midi.log
Loading