Skip to content

chuck-max 0.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Oct 08:44

Changes since the last Release

Added

  • Added a reply outlet: an additional non-signal outlet, rightmost, which reports data to the patch rather than only to the Max console

    • val <name> <value...> in response to get

    • event <name> while a listen is active

    • shred add <id> / shred remove <id> from a ChucK VM shred watcher

    • global <name> <type> in response to globals

    • Selectors always come from the object's own vocabulary and any ChucK name travels as an argument, so no global variable name can collide with a control message. Route with route val event shred global

    • The name precedes the type in global <name> <type> deliberately. Once a patch strips the selector with route global, the next atom becomes the new selector, and ChucK's int and float type names collide with Max's typed methods there, producing bad arguments for message "int". ChucK variable names cannot be reserved words, so leading with the name avoids the collision

    • Replies are queued from the audio thread and flushed on the main thread; the queue drops rather than blocks when full

  • Added host classes bound into every VM with ChucK::bind(): Host.msg(name, ...) to the reply outlet as msg <name> <args...> (bang, float, string and float[] overloads), HostIn/HostMsg for msg <name> <args...>, HostBuffer/HostBufPlay for buffer~, and HostClock for the Max transport (source/docs/dev/bind.md)

    • The names are host-neutral and shared with numchuck and pd-chuck, so one .ck file can run in each host that binds them

    • Host.sendBang, Host.sendFloat, Host.sendSymbol and Host.sendList send to every [receive <name>], as in pd-chuck, without a patch cord or [route msg]; queued on the audio thread and delivered on the main thread, 256 calls per drain and 32 list elements (examples/max/max_send_receive.ck); receive names are shared by the whole Max process, unlike the reply outlet, and lists hold floats only (patchers/tests/test_max_send_receive.maxpat)

  • Copied the examples/max/max_*.ck bind examples into source/projects/examples/max/, the copy source/scripts/update.sh restores examples from; without it the next update deleted them

  • Added source/scripts/patches/, applied by source/scripts/update.sh after every update; it fixes upstream ConvRev's inverted #include <thread> guard, which breaks the build with the current Apple libc++

  • Added abort message, which aborts a shred currently executing inside the VM

    • Unlike remove, this can break out of a shred looping without advancing time

    • Only has a target while the VM is inside a compute cycle, which is the situation it exists for; on an otherwise healthy patch it reports that there is nothing to abort

  • Added multichannel tapping: tap <outlet> <ugen> <nchannels> assigns a multichannel global UGen across consecutive tap outlets, reading via getGlobalUGenSamplesMulti()

    • Each sub-channel needs its own buffered flag in ChucK, for example 1 => stereo.chan(0).buffered, as the parent flag does not propagate
  • Added CHUCK_PARAM_OTF_PRINT_WARNINGS to the param message tables, the only integer VM parameter that was missing

  • Added source/docs/logging.md, documenting the console and outlet reporting channels, the loglevel conflation, and the selector namespacing rules

  • Added an advanced tab to help/chuck~.maxhelp covering the current message set, alongside the previous help content which is now the main tab

    • Six sections: load and run, read globals, set globals, events, tap global UGens, and VM introspection

    • Demonstrates the data outlet with route val event shred global into four labelled prints, and the tap outlets with three scopes

    • chuck~ 2 @ntap 3 leaves no outlet unconnected: the demo uses exactly one mono tap and one stereo pair

    • Message boxes feed a single [s #0-to-chuck] rather than each carrying its own patch cord to the object

    • Does not demonstrate eval, since ChucK code needs semicolons and a bare ; in a Max message box means "send to a named receive"; the main tab covers this with the ui_code.maxpat bpatcher

  • Note for maintainers: each help tab holds its own chuck~, so their send/receive names must not collide. An unscoped name such as to-chuck is global across all of Max, so every chuck~ fed by a matching [r to-chuck] runs every message intended for any other, and their audio is heard together. The main tab still uses the unscoped name, as do test_add, test_editor, test_global_vars, test_song and test_sync. Note also that #0 alone is not sufficient to separate two tabs: it expands per top-level patcher instance and subpatchers inherit the parent's value, so two tabs both using #0-to-chuck would collide again. Distinct names such as #0-main-to-chuck and #0-adv-to-chuck are needed

  • Added patchers/tests/test_chuck_tilde.maxpat and examples/test/help_features.ck demonstrating the above

    • The demo file wires its globals to audible parameters rather than leaving them as inert values: freq drives the oscillator pitch and levels[0] its gain, so set float freq 660., the freq 550. shorthand and set float[i] levels 0 0.75 all produce an obvious change

    • Uses a saw oscillator for the mono voice and a panning triangle for the stereo pair, so the two are distinguishable by ear and the tap scopes show a readable waveform

  • Added compile-time printf format checking to the logging helpers on GCC and Clang

Changed

  • Updated chuck to 1.5.5.9-dev (chai)

  • make brew and make brew-lite no longer enable FluidSynth.chug. They linked libfluidsynth.a from the Homebrew prefix, which Homebrew's fluid-synth does not ship, so both targets failed at link time. make full2 builds the chugin from source

  • Set CHUCK_PARAM_IS_REALTIME_AUDIO_HINT to 1 at startup; it had been left at its default of 0 even though chuck~ is always driven from the MSP audio callback

  • Registered per-instance chout/cherr callbacks in addition to the process-wide stdout/stderr ones, so ChucK's <<< >>> output and the VM's own printing are both captured

  • abort and removeall now report unconditionally via object_post, rather than through the gated helpers, which at the time could not reach the user at all

  • removeall now reports the shred count and notes that global UGens survive shred removal

  • Logging helpers take const char* fmt, removing the need for a (char*) cast at every call site

  • Separated this object's reporting verbosity from the ChucK VM's log level, via a new @verbose attribute (0 quiet, 1 normal, 2 debug; also settable as a message). loglevel now means only what ChucK::setLogLevel() means

    • Previously x->loglevel did both jobs, and ck_new set it to CK_LOG_SYSTEM (2) against helper thresholds of 4, 5 and 6, so 47 of the 118 reporting calls could never appear. Raising the level to reach them also made the engine verbose

    • @verbose defaults to 0, which is what the old gating amounted to in practice, so this changes no observable behaviour; it makes the output reachable without side effects on the engine

    • ck_warn is no longer gated at all: a warning nobody sees is not a warning

    • Query answers in status, vm, chugins and loglevel now report unconditionally, since a question that returns nothing is indistinguishable from a broken object

    • See source/docs/logging.md

  • Made loglevel honestly process-global. It maps to ChucK::setLogLevel(), which is static, so one level is shared by every chuck~ in the process; the code had kept a stale per-instance copy alongside it. Setting the level on one object left the others' copies stale, and querying it with no argument mutated the queried object's copy as a side effect. The copy is removed: ck_loglevel reads and writes the shared VM state directly, and the package default is now applied once by the first instance rather than re-asserted (and thus clobbered) by every new object. Per-object reporting is what the new @verbose is for

  • Replaced the eleven GitHub workflows with two. build.yml is manual and builds any variant on any current runner, all variants at once if asked. release.yml runs when a version tag is pushed. It builds the arm64, Intel and Windows packages in parallel, assembles the multi package from the first and last, creates the GitHub release with notes from the tag's CHANGELOG section, and attaches the four packages as zips. Signed dmgs are still produced locally. The old set targeted the retired macos-12 and macos-13 runners, ran two different workflows on every release, and did not install every dependency the brew target needs

Fixed

  • Fixed sample rate changes being ignored. ck_dsp64() received the host rate and discarded it, leaving the VM at the rate captured when the object was created, so changing Max's sample rate afterwards caused pitch and timing to drift. The rate is now forwarded to the VM via setParam()

  • Fixed set float[i] and set float[k] silently discarding the fractional part of every value. atom_getfloat() was assigned to a long, truncating before the value reached the VM, so set float[i] a 0 0.5 stored 0.0

  • Fixed 13 format string mismatches, mostly %d applied to 64-bit types, which printed incorrect values and were formally undefined behaviour

  • Fixed ChucK::globalCleanup() being called whenever any chuck~ was freed, rather than once when the last one goes away as its contract requires. It shuts down the HID manager, serial IO and the keyboard-hit manager process-wide, so closing one chuck~ pulled those subsystems out from under every other instance still running. Audio, the VM and the type system are untouched by it, so instances not using HID, serial or keyboard input were unaffected, which is why this went unnoticed

  • Fixed get replies and event notifications not being attributable to a specific chuck~ object. The callback-id overloads are now used, with the id encoding both the instance and the request, so replies reach the object that asked

  • Fixed @tap being documented in the README where the implemented attribute is @ntap. The documented form was silently ignored by Max, producing no tap outlets

  • Fixed a size_t to int truncation in replace_character()

  • Fixed the Windows build of maxin.cpp and maxclock.cpp, where std::min and std::max collided with the min and max macros from windows.h

  • Fixed HostClock.bar(), beatInBar() and unit() answering for the previous beat when asked exactly on a boundary. At 44.1 kHz, toNextBeat() => now lands a few 1e-14 ticks short of the beat and floor rounded down. A position within half a sample of a boundary now counts as on it, the rule toNext() and the jump detector already use. Found by the same test in pd-chuck's port of HostClock