Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: m-labs/flickernoise
base: 2b6b049
head fork: m-labs/flickernoise
compare: 9a098d5
Commits on Jan 30, 2012
Werner Almesberger wpwrak renderer/stimuli.c: unified control input handling
This commit provides data structure and basic functions for the unified
control input handling.
Werner Almesberger wpwrak compiler.h: wrap nasty long lines c26922b
Werner Almesberger wpwrak compiler: include basic elements for unified input events in patch st…
Werner Almesberger wpwrak 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.
Werner Almesberger wpwrak sampler.c: call stim_midi_ctrl upon reception of a MIDI controller event 53f48ec
Werner Almesberger wpwrak 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)
Werner Almesberger wpwrak eval.c: propagate control variables to patch registers 6c4895f
Werner Almesberger wpwrak symtab: added "cvar" index to "struct sym" for binding control variables a6d4cc3
Werner Almesberger wpwrak compiler.c: bind control variables to pfv and pvv registers 2fe2649
Werner Almesberger wpwrak compiler.c: new function patch_add_cvar to allocate a new control var…
Werner Almesberger wpwrak ptest: also link with stimuli.o a9f77a7
Werner Almesberger wpwrak compiler: added "midi" control variable assignment (WIP) e2bebe0
Werner Almesberger wpwrak compiler: update pointers after realloc() in patch_add_cvar 6d81665
Werner Almesberger wpwrak 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]
Werner Almesberger wpwrak experimental/T.fnp: Tornado Rain Dance variant for new MIDI control s…

This is only temporary to better track changes.
Werner Almesberger wpwrak 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.
Werner Almesberger wpwrak 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.
Werner Almesberger wpwrak 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.
Werner Almesberger wpwrak compiler/stimuli: refuse to assign out of range channel/controller nu…
Werner Almesberger wpwrak compiler: move retrieval of stimuli pointer from parser into compiler.c
A bit cleaner this way.
Werner Almesberger wpwrak stimuli: rename stim_add to stim_add_midi_ctrl
It's not generic.
Werner Almesberger wpwrak stimuli: added processor for acceleration with an unbounded range
accel_unbounded is (re)settable, as shown in T.fnp
Werner Almesberger wpwrak 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.
Werner Almesberger wpwrak compiler: fix NULL pointer bug when running patches that don't use di…
…rect MIDI
Werner Almesberger wpwrak stimuli.c: ptrdiff_t is defined in stddef.h, not sys/types.h 41804a4
Werner Almesberger wpwrak compiler: don't include \n in "cannot add stimulus ..." message c1f5d02
Werner Almesberger wpwrak test/stim: regression tests for current stimuli syntax (WIP) 230544d
Commits on Feb 07, 2012
Werner Almesberger wpwrak stimuli: make MIDI channel numbers one-based 2ac7dc9
Commits on Feb 08, 2012
Werner Almesberger wpwrak 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
Werner Almesberger wpwrak test/stim: update for one-based channel numbers 08dbe02
Werner Almesberger wpwrak test/stim: added test for wildcard channel 7dafcae
Werner Almesberger wpwrak gui/midi.c: clean up structure of midi_event() 7133915
Werner Almesberger wpwrak gui/midi.c: show channel number in MIDI monitor and change display fo…

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.
Werner Almesberger wpwrak 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.
Commits on Feb 09, 2012
Werner Almesberger wpwrak stimuli: base for MIDI device database (WIP) 439a665
Werner Almesberger wpwrak compiler: added parsing of MIDI device database (WIP)
Also updated the example code in T.fnp
Werner Almesberger wpwrak 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
Werner Almesberger wpwrak compiler: added binding of inputs (WIP)
Also updated the example code in T.fnp
Commits on Feb 10, 2012
Werner Almesberger wpwrak compiler: make MIDI channel also wildcardable in device database entry eaf6ea0
Werner Almesberger wpwrak test/stim: converted to split database style (DB side only) 3c3d02b
Werner Almesberger wpwrak compiler: removed all-in-one MIDI control syntax f2413ed
Werner Almesberger wpwrak stimuli: stim_add_midi_ctrl and midi_proc_* are now internal
Thus made them "static" and removed them from the header.
Werner Almesberger wpwrak stimuli: renamed midi_proc_accel_* to midi_proc_diff_*
For consistency with differential() and dt_diff.
Werner Almesberger wpwrak compiler: improved structure of sections in parser.y 08af98f
Werner Almesberger wpwrak stimuli: separate set operation from midi_proc_linear
For future sharing.
Werner Almesberger wpwrak stimuli: added button-to-toggle processor (untested) 180f37e
Werner Almesberger wpwrak 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
Werner Almesberger wpwrak stimuli: added differential-to-button processor (untested)
We use it also for differential-to-toggle, like in the range-to-button
Werner Almesberger wpwrak stimuli: add section comments and align code with sections bfbecab
Werner Almesberger wpwrak stimuli: make register update functions not MIDI specific
This just moves the ct->regs lookup across the API.
Werner Almesberger wpwrak test/stim: renamed to stimdb and updated titles accordingly 32fae1f
Werner Almesberger wpwrak stimuli: do_bind didn't check if the processor was NULL
Oops ...
Werner Almesberger wpwrak test/stimin: test cases for device to input binding 44bdea0
Werner Almesberger wpwrak stimuli: stim_db_free to deallocate the device database bdcad90
Werner Almesberger wpwrak compiler: free the input device database after compilation
Since the database is currently per patch, we need to free it once the
patch has been compiled. In the longer run, this is of course now what
we want - the database should be global and long-lived.
Werner Almesberger wpwrak patch editor: replace hard-coded patch buffer size with #define 8318d6f
Werner Almesberger wpwrak patch editor: wrap long lines 650c1de
Werner Almesberger wpwrak patch editor: escape all double quotes before calling ed.set d68317a
Werner Almesberger wpwrak ptest: new options -v and -m to exercise MIDI message processing
-v var  enabled tracing of the specified control variable. This
variable must be a system variable. (This is due to an implementation
detail: we look it up after freeing the symbol table, so only the
system variables survive that long.)

-m [chan.]ctrl=value  injects a MIDI control message into the stimuli
system and prints the value of the traced variable after processing
the message. The -m option can be repeated.
Werner Almesberger wpwrak test/stimin: added MIDI injection to test cases
Also corrected differential -> range test that was actually
range -> range.
Werner Almesberger wpwrak stimuli: ignore value 0 in midi_proc_diff_button
We should probably never receive a zero here. But if we do, ignoring
it seem to be the best choice.
Werner Almesberger wpwrak test/stimin: added differential -> { unbounded, cyclic, button } and …
…button -> toggle

This completes the set of "interesting" mappings.
Werner Almesberger wpwrak compiler/doc: icons for MIDI controls a788442
Commits on Feb 11, 2012
Werner Almesberger wpwrak stimuli: raise threshold for range -> button from 1 to 64
This means that we switch in the middle of the range, increasing
the zones in which the control can be safely "parked", and also
avoiding issues with devices that have difficulties reaching the
end of the range.

Also updated test/stimin
Werner Almesberger wpwrak stimuli: treat toggle -> button like toggle -> range
Before, this translation was not possible. But it doesn't seem to
stretch analogies more than, say, range -> button does.

Also updated test/stimin
Werner Almesberger wpwrak compiler: device type "range" is now "fader" or "pot"
Both are  synonymous for now. This distinction will allow a future
GUI to use different graphical elements for them.
Werner Almesberger wpwrak stimuli: midi_proc_diff_unbounded now keeps the current value in "last"
This means that changing the control variable will not affect the
value written when the next MIDI message arrives. This is to make
diff -> unbounded behaviour consistent with the rest.
Commits on Feb 12, 2012
Werner Almesberger wpwrak MIDI documentation (WIP) de90c93
Werner Almesberger wpwrak stimuli, compiler: renamed "toggle" to "switch"
Switch is more general, a toggle button merely one possible implementation
of the concept.
Werner Almesberger wpwrak compiler/doc: renamed "toggle" to "switch" 7d5cc8b
Werner Almesberger wpwrak compiler/doc: changed "MIDIC" to "MIDICC" to match MIDI terminology f45f7b5
Werner Almesberger wpwrak compiler: fail if trying to use a "live" variable for control
A variable written to by set_pfv_from_frd can never be used as control
variable because set_pfv_from_frd would run after any updates from the
stimulus system, obliterating its changes.

The situation with transfer_pvv_regs is more difficult. At least in
theory, a variable like "sx" could act a control PFV but then
become a regular PVV. The compiler will bind the control PVV
regardlesss, but it will have no effect.

So we can only detect incorrect use of PFV and PVV that have a
corresponding PFV.
Werner Almesberger wpwrak test/stimerr: test detection of duplicate control element and double …

The latter it is a new error check.
Commits on Feb 13, 2012
Werner Almesberger wpwrak stimuli: remember last MIDI value and reset control to it before star…

It's a little hackish to do this from stim_redirect, but since this is
what we call before launching a new patch and it has all the information
we need, it really is the best place.
Werner Almesberger wpwrak patch editor: generalized double quote protection
This will allow the use of double quote protection also for compiler
Werner Almesberger wpwrak patch editor: protect double quotes also in compiler diagnostics 49a1282
Werner Almesberger wpwrak stimuli: stim_db_free didn't reset the "last" pointer
This allowed only the first compilation of a patch with MIDI devices to work.
Werner Almesberger wpwrak MIDI documentation (WIP, continuing) 3b739f3
Commits on Feb 14, 2012
Werner Almesberger wpwrak MIDI documentation (still WIP, on-going) d64b327
Werner Almesberger wpwrak stimuli: refuse to bind the same control twice
Also added the corresponding test to test/stimerr
Werner Almesberger wpwrak compiler: set SF_ASSIGNED for control variables to prevent -Wundefine…
…d warning

Also added a test case to test/stimin
Werner Almesberger wpwrak compiler: allow multiple stimuli to set the same variable 3d96b27
Werner Almesberger wpwrak ptest: free the symbol table in ptest (and not patch_compile)
This defers removal of the stimuli from the symbol table, which was
introduced when allowing binding control variables multiple times.
Werner Almesberger wpwrak compiler: allow multiple control variables to use the same stimulus 0963d9c
Werner Almesberger wpwrak stimuli: stim_bind searched only the first device 9823551
Werner Almesberger wpwrak test/stimmulti: test that binding a variable twice also works across …
Werner Almesberger wpwrak More work on the MIDI documentation 212cb94
Commits on Feb 15, 2012
Werner Almesberger wpwrak First draft of MIDI documentation a8d591d
Werner Almesberger wpwrak T.fnp: improved structure of patch dd88600
Werner Almesberger wpwrak Merge branch 'direct-midi' b3311cb
Werner Almesberger wpwrak experimental/: removed leftover from development branch
T.fnp will come back in a different form at a later time.