### Build and test the M4L Gugelhupf project with pnpm commands Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/README.md Install dependencies trim submodule, run tests, build devices and manual, start browser dev servers for specific devices, and install the compiled devices into the Ableton User Library. The build command produces the .amxd files and a release ZIP, and the manual build requires a local Chromium unless MANUAL_CHROME is set. ```bash pnpm install git submodule update --init # strudel/ - the engine is bundled from here pnpm test # vitest: mini-notation parser + headless engine tests pnpm build # → dist/m4l-gugelhupf/alienmind-gugelhupf.amxd + the seven -.amxd # + dist/m4l-gugelhupf-.zip (release archive incl. installers) pnpm dev:midi # browser dev for the MIDI device, mocked Live beside it pnpm dev:drums-midi # browser dev for the Drums MIDI device pnpm dev:sample-browser # browser dev for the sample browser pnpm dev:fx # browser dev for the Audio FX device pnpm dev:strudel # browser dev for the main Gugelhupf device (and the audio flavour - one page) pnpm dev:synth # browser dev for the Synth device pnpm build:manual # USERSMANUAL.md → dist/manual/USERSMANUAL.{html,pdf} (part of pnpm build) pnpm install:device # automatically copy the compiled devices to your local Ableton User Library) ``` -------------------------------- ### Install on macOS with bash install-mac.sh Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/README.md Run the installer on macOS using bash because the ZIP extraction drops the executable bit. The script copies the .amxd devices and their site folders into the Ableton User Library. ```bash bash install-mac.sh # `bash`, not `./` - Archive Utility drops the executable bit ``` -------------------------------- ### Specify User Library folder for install-mac.sh Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Run the installer with an explicit target folder when the script chooses the wrong User Library. The script prints the library it chose and lists what it installed. ```bash bash install-mac.sh m4l-gugelhupf ./m4l-gugelhupf "/Users/you/Music/Ableton/User Library" ``` -------------------------------- ### Scaffold repo with pnpm dlx @m4l-jweb/build init Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/M4L-JWEB-GUIDE.md Scaffolds a new M4L-JWEB device repo named m4l-gugelhupf and installs dependencies. Produces a working one-device hello-midi build with src/app/midi/, patcher/devices.mjs, and all vite/tsconfig plumbing. ```bash pnpm dlx @m4l-jweb/build init m4l-gugelhupf cd m4l-gugelhupf && pnpm install ``` -------------------------------- ### Install on macOS with bash install-mac.sh Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Run from Terminal in the unzipped folder. Use bash, not ./install-mac.sh, because Archive Utility may not preserve the executable bit, causing a permission denied error. ```bash cd ~/Downloads/m4l-gugelhupf-1.3.2-beta3 # the ZIP carries its version bash install-mac.sh ``` -------------------------------- ### MIDI pattern for Gugelhupf MIDI Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/README.md Quick-start pattern for the Gugelhupf MIDI device. A chord progression of C3 and C#3 played 16 times. This is a valid pattern you can drop directly into the device to get started immediately. ```js >*16 ``` -------------------------------- ### Full pattern for Gugelhupf main device Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/README.md General Strudel pattern for the main Gugelhupf device; anything strudel.cc plays works here. It plays a C minor 7 arpeggio with a sawtooth, low-pass filter at 600 Hz, and reverb. Drop it directly into the main device to start. ```js note("*4").s("sawtooth").lpf(600).room(.3) ``` -------------------------------- ### Clear quarantine with xattr -dr com.apple.quarantine Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Clears the macOS quarantine attribute on the installed folder. Needed if you copy the folder by hand instead of using the installer, otherwise devices may load with an empty page. ```bash xattr -dr com.apple.quarantine "$HOME/Music/Ableton/User Library/Max For Live/m4l-gugelhupf" ``` -------------------------------- ### Run the full build pipeline with pnpm build Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/ARCHITECTURE.md The complete build pipeline invoked by `pnpm build`. It runs three stages: typechecking with `tsc -b`, a single Vite build per device via `scripts/build-ui.mjs`, manual generation via `scripts/build-manual.mjs`, and the `m4l-jweb build` command that compiles the wrapper, generates patchers, and writes `.amxd` containers. All stages are plain Node scripts with no manual Max steps. ```bash tsc -b # typecheck every device's app + the scripts scripts/build-ui.mjs # ONE vite build per device → dist/ui//index.html scripts/build-manual.mjs # USERSMANUAL.md → dist/manual/USERSMANUAL.{html,pdf} m4l-jweb build # @m4l-jweb/build: wrapper compile + patcher generation + amxd writer ``` -------------------------------- ### MIDI devices: write notes with note() or bare mini-notation Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/STRUDEL-SUPPORT.md Correct way to write patterns on MIDI devices: use note() with MIDI numbers or bare mini-notation for drum words that map to Drum Rack pads. ```javascript note("36 38 36 38") // The same thing, as code bd sd bd sd // Bare mini-notation maps drum words to Drum Rack pads ``` -------------------------------- ### Note pattern and drum words for MIDI Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Use note() for pitches or bare mini-notation drum words for Drum Rack pads. These are the correct ways to produce MIDI notes. ```javascript note("36 38 36 38") ``` ```javascript bd sd bd sd // bare mini-notation maps drum words to Drum Rack pads ``` -------------------------------- ### MIDI device trap: s() and sound() produce silence Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/STRUDEL-SUPPORT.md Shows the common mistake of using sample-based patterns on MIDI devices. These produce no notes and no MIDI output, silently failing without errors. ```javascript s("bd sd bd sd") // on a MIDI device: silence. no notes, no error. sound("bd*4") // same. ``` -------------------------------- ### m4l-jweb window spec with resizable option Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/DRAWER_OF_FAILED_IDEAS.md Proposed extension to the m4l-jweb window spec to support a resizable, always-on-top window for the expanded device UI. The resizable flag compiles to the subpatcher's window attributes: keep float in the window flags list, drop nogrow (or send window flags grow), then window exec. ```typescript window({ title: "Strudel Studio", entry: "Expanded", width: 1100, height: 700, // initial size, as today resizable: true, // NEW: user can drag-resize alwaysOnTop: true, }) ``` -------------------------------- ### Using slider() with metadata (name and unit) Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/FEAT-SLIDERS.md Shows the proposed usage of slider() with an extra metadata object containing a name and unit. This pattern already runs in stock Strudel without any patch; the metadata is silently ignored by the current implementation. ```javascript s("sawtooth").lpf(slider(500, 100, 1000, 1, { name: 'cutoff', unit: 'Hz' })) ``` -------------------------------- ### Gugelhupf Drums Sampler: Trigger drum samples with s() Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Use this code in the Gugelhupf Drums Sampler to trigger drum samples. The bank can be overridden with .bank(). Audio effects do not apply; place an FX device after it. ```javascript s("bd sd, hh*8") ``` -------------------------------- ### Silent sample pattern on MIDI device Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Using s() on a MIDI device produces silence because there is no sample engine. This is a common trap. ```javascript s("bd sd bd sd") // on a MIDI device: silence. No notes, no error. ``` -------------------------------- ### Apply Strudel effects in Gugelhupf Audio FX Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Use this line in the Gugelhupf Audio FX device to apply Strudel-style effects to the audio track. Each value becomes a real Live dial that is automatable, MIDI-mappable, and available on Push. The device emulates these effects with Max DSP objects, so the sound may differ from the main instrument. ```javascript .lpf(800).hpf(120).crush(8).room(0.3).gain(1.2) ``` -------------------------------- ### Transpiler plugin: fold options into slider config Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/FEAT-SLIDERS.md Reads a fifth ObjectExpression argument in the slider transpiler plugin and merges its literal properties into the emitted slider configuration. Non-literal properties are skipped to prevent transpilation failures on incomplete code. ```javascript let options = {}; const optsNode = node.arguments[4]; if (optsNode?.type === 'ObjectExpression') { for (const p of optsNode.properties) { const key = p.key?.name ?? p.key?.value; if (key && p.value?.type === 'Literal') options[key] = p.value.value; } } const sliderConfig = { from, to, id, value: node.arguments[0].raw, min: node.arguments[1]?.value ?? 0, max: node.arguments[2]?.value ?? 1, step: node.arguments[3]?.value, type: 'slider', ...options, }; ``` -------------------------------- ### Dispatch cancelable strudel:render event Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/TODO.md Dispatches a cancelable 'strudel:render' event before the default browser download. If no listener calls preventDefault, the download proceeds; otherwise the host can intercept and save the file. ```js const ev = new CustomEvent('strudel:render', { detail: { blob, buffer, seconds, cycles, cps, sampleRate, name }, cancelable: true, }); if (window.dispatchEvent(ev)) downloadBlob(blob, name); // nobody claimed it ``` -------------------------------- ### renderPattern function signature Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/TODO.md Signature for the proposed renderPattern function in superdough. It returns an AudioBuffer and accepts options for cps, cycles, begin offset, and sample rate. ```js renderPattern(pattern, { cps, cycles, begin = 0, sampleRate = 44100 }) -> AudioBuffer ``` -------------------------------- ### Use slider() with lpf() Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/STRUDEL-SUPPORT.md Attaches a slider to the lpf effect of a sawtooth synth. The slider's value is mapped to the filter cutoff frequency, with a default of 500, a minimum of 100, and a maximum of 1000. The slider lands on one of the device's eight native dials (S1..S8) in source order, and turning it changes the sound immediately without re-evaluation. ```javascript s("sawtooth").lpf(slider(500, 100, 1000)) ``` -------------------------------- ### Device diagnostics block Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Diagnostics block logged by every device on load. It shows the device's path, derived folder, UI URL, and a listing of files found beside it. Paste this block into bug reports; on macOS it is currently the only evidence available. ```text m4l-jweb: --- diagnostics (build 1.3.1, mode instrument) --- m4l-jweb: patcher.filepath = '...' m4l-jweb: device folder = '...' m4l-jweb: ui url = file:///... m4l-jweb: folder listing (12): alienmind-gugelhupf.amxd, ... ``` -------------------------------- ### Synth sound for Gugelhupf Synth Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/README.md Sound-only patch for the Gugelhupf Synth device, where the note sequence comes from Ableton Live. Use a single sawtooth with low-pass filter at 800 Hz and reverb. This is not a full pattern, just a sound definition. ```js s("sawtooth").lpf(800).room(.3) ``` -------------------------------- ### Drum pattern for Gugelhupf Drums MIDI Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/README.md Simple drum pattern for the Gugelhupf Drums MIDI device. Uses the standard Strudel sample names bd (kick), hh (hi-hat), sd (snare). Drop it directly into the device to hear a basic four-on-the-floor beat. ```js s("bd hh sd hh") ``` -------------------------------- ### Sonogram (Spectrum Analyzer) Canvas Rendering Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/FEAT-VISUALS.md Draws a filled continuous curve for a spectrum analyzer using frequency bin magnitudes (0-255). The X-axis represents the frequency bin (often converted to a logarithmic scale for better musical representation), and the Y-axis represents the magnitude. ```javascript ctx.beginPath(); ctx.moveTo(0, height); for (let i = 0; i < freqData.length; i++) { const x = (i / freqData.length) * width; const y = height - (freqData[i] / 255.0) * height; ctx.lineTo(x, y); } ctx.lineTo(width, height); ctx.fill(); ``` -------------------------------- ### Gugelhupf Synth: Define a sound with s() Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/USERSMANUAL.md Use this code in the Gugelhupf Synth device to define a sound that will be played for each MIDI note. The sound is a strudel pattern, but only the first event is used. The sustain length is set with .sustain() (default 0.6s) and cannot be cut short. ```javascript s("sawtooth").attack(0.2).lpf(800).room(.3) ``` -------------------------------- ### Oscilloscope (Waveform) Canvas Rendering Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/FEAT-VISUALS.md Draws a waveform on a canvas by mapping time-domain samples (values between -1.0 and 1.0) to X and Y coordinates. The Y-axis is scaled so that -1 maps to the top and 1 to the bottom of the canvas. ```javascript ctx.beginPath(); for (let i = 0; i < timeData.length; i++) { const x = (i / timeData.length) * width; const y = (timeData[i] * 0.5 + 0.5) * height; // Scale -1..1 to canvas height if (i === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y); } ctx.stroke(); ``` -------------------------------- ### Spectrogram (Frequency Waterfall) Canvas Rendering Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/FEAT-VISUALS.md Implements a scrolling spectrogram (frequency waterfall) by shifting previous frames left and drawing a new 1-pixel-wide column on the right edge. Uses the same Uint8Array frequency data but preserves a history over time. ```javascript // Shift previous frames left const imgData = ctx.getImageData(1, 0, width - 1, height); ctx.putImageData(imgData, 0, 0); // Draw new column on the right edge for (let i = 0; i < freqData.length; i++) { const y = height - (i / freqData.length) * height; const intensity = freqData[i]; // Map 0-255 to a color scale (e.g., dark to teal) ctx.fillStyle = `rgb(0, ${intensity}, ${intensity})`; ctx.fillRect(width - 1, y, 1, 1); } ``` -------------------------------- ### Posting a slider value via window message Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/doc/FEAT-SLIDERS.md Shows how to update a slider's value by posting a message to the window. The message type 'cm-slider' is handled by the slider module, updating the internal sliderValues map that the pattern reads on the next query. ```javascript window.postMessage({ type: 'cm-slider', id, value }) ``` -------------------------------- ### FX chain for Gugelhupf Audio FX Source: https://github.com/alienmind/m4l-gugelhupf/blob/main/README.md Effect chain for the Gugelhupf Audio FX device: low-pass filter at 800 Hz and a gain boost of 1.2. The leading dot indicates that this is a chain to append to an existing pattern or signal. ```js .lpf(800).gain(1.2) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.