EN
JolyMusic Theory Lab

Jazz Enclosures with the JolyMusic Generator: Target, Render, Export

A professional workflow for using the JolyMusic Enclosure Generator: choose harmonic targets, compare chromatic and diatonic approaches, read the generated OSMD score, then export or save useful MIDI lines.

Published May 29, 2026, 4:48 AM

A professional workflow for using the JolyMusic Enclosure Generator: choose harmonic targets, compare chromatic and diatonic approaches, read the generated OSMD score, then export or save useful MIDI lines.

A jazz enclosure is a compact way to make a target note sound earned. Instead of playing the chord tone directly, the line approaches it from above, below, or both sides, then resolves into the note that explains the harmony. Used well, an enclosure is not decoration. It is a target-tone system.

The JolyMusic Enclosure Generator is built around that system. The Symfony page controller prepares tone models, key options, default octave data, export permissions, and the save endpoint; the Stimulus controller turns those inputs into rendered practice lines with note roles, enclosure units, contour chips, OSMD notation, playback, pagination, MIDI download, and optional library saving.

Tool Controller Map
The post follows the actual enclosure tool pipeline
PractitionerTool Workflow
The page route loads tonal data, the Stimulus controller generates enclosure lines, and the save API stores selected MIDI with practice metadata and an optional track container.
Page routeapp_tool_enclosure
Stimulus controllerenclosure
Data sourcesToneRepository and KeyRepository
Save routeapp_tools_enclosure_save_midi
Public URL/en/tools/enclosure
JolyMusic Tool
Open the Enclosure Generator while reading
Open enclosure tool
PracticeTool
Use the same route and workflow described in this article: choose a target degree, select a neighbor source, generate lines, inspect roles, play the OSMD score, then export or save MIDI.
Routeapp_tool_enclosure
WorkflowController data - target degree - pattern - OSMD - MIDI

Start where the controller starts: target data

The page action for app_tool_enclosure does not render a static lesson. It queries the tone table for pitch names, MIDI values, frequency, color, and solfege, then chooses C as the default tone when possible. It also loads key select rows through the key repository and prepares a default key id for the key selector. That matters pedagogically: the generator is not guessing note names. It is working from the same tonal data model used by the rest of JolyMusic.

For practice, this means the first musical decision should be as explicit as the controller state: pick the key, then pick the target degree. The UI exposes root, third, fifth, seventh, ninth, and all-scale targets. Those are not decorative labels; they decide which tones the generated lines are allowed to resolve into.

Target degreeBest useListening check
RootStabilize beginner practice and key-center hearingThe line sounds finished but can become predictable
ThirdDefine major, minor, and dominant qualityThe chord color becomes clear on arrival
FifthBuild neutral vocabulary without too much colorThe line resolves cleanly without strongly naming the chord type
SeventhPractice guide-tone voice leadingThe line points toward the next harmony
NinthAdd melodic color above basic chord tonesThe target sounds lyrical, not accidental
All scaleGenerate broader inside vocabularyEvery target still needs a clear phrase ending

Chromatic and diatonic are different algorithms for pressure

The controller passes the selected neighbor mode to buildEnclosureLines. In chromatic mode, the approach tones are tight half-step neighbors. In diatonic mode, the approach tones are drawn from the selected key-scale context when available. Both modes can produce useful vocabulary, but they answer different musical questions.

A chromatic route into E might use F and Eb before landing on E. A diatonic route in C major might use F and D before landing on E. The target is the same, but the pressure is different: chromatic motion creates bebop bite, while diatonic motion keeps the line inside the key or mode.

TargetChromatic enclosureDiatonic enclosure in CEffect
E over Cmaj7F - Eb - EF - D - EOutside bite versus inside release
B over G7C - Bb - BC - A - BDominant pressure into the third
G over Cmaj7Ab - F# - GA - F - GStrong pull versus scale-based approach
Score jazz-enclosure-target-resolution.musicxml

Use beginner patterns, then expert variants

The beginner pattern select is populated by the Stimulus controller from the enclosure model. It gives clear shapes such as upper-target, lower-target, upper-lower-target, lower-upper-target, double neighbors, turns, and mixed chromatic-diatonic variants. The expert-pattern select is separate because advanced variants can create dense lines quickly. That separation is good practice design: learn the function first, then increase vocabulary.

Presets make this faster. Basic upper-lower and lower-upper presets are for clean target hearing. Chromatic bebop and double chromatic presets are for stronger tension. Diatonic inside keeps the line closer to the key. Turn style is useful when the target should feel embedded inside a melodic ornament rather than announced by a simple two-note approach.

Exercise
Controller-accurate first session
StudentPractice
Use exactly the controls exposed by the tool: key, target degree, pattern, neighbor mode, octave, tempo, note length, and time signature.
Key selectorC, then move through common keys
Target degreeThird first, then seventh
PatternUpper - lower - target
Neighbor modeCompare chromatic and diatonic
PlaybackPlay line one before exporting anything

Harmony targeting makes diatonic practice serious

The advanced harmony-targeting panel is lazy-loaded from app_tool_enclosure_keyscale_selector. It uses the shared key-scale selector component, keeps a small local history, filters toward scales, and sends key-scale change events back to the enclosure controller. When a scale is selected, the controller stores root pitch class, pitch classes, target tones, and interval colors. The next generated line can then distinguish diatonic approach notes from chromatic tension.

That is the difference between a toy generator and a practice tool. If you study D Dorian, G altered, or C major, the generator can reflect the selected scale material instead of treating every target as an isolated pitch. Use this panel when you want the line to answer a harmonic situation, not just a note-name exercise.

Enclosure Controller State
key data - target degree - pattern - neighbor mode - score params - export state
targetDegree: root, third, fifth, seventh, ninth, or all-scaleneighborMode: chromatic or diatonicpattern: beginner select or expert variantscoreParams: key signature, tempo, time signature, note lengthpermissions: authenticated export, paid save

Read the generated card like a professional

Each generated line card contains more information than a note list. The header shows the localized line label, key signature, time signature, note length, and tempo. The body separates generated notes, enclosure units, melodic contour, and a legend for approach notes, diatonic approach notes, chromatic tension, and target resolution. The embedded OSMD score is generated from the same line data, with target note color applied for visual confirmation.

Before playing, read the role colors. Before exporting, inspect the contour chips. If the line sounds awkward, the problem is usually visible: too much chromatic pressure, the wrong target degree, a note length that does not fit the phrase, or an octave setting that pushes the line away from the instrument range you actually practice.

Result areaWhat it verifiesWhat to change if it fails
Generated notesThe target and approach notes are readableTarget degree or neighbor mode
Enclosure unitsThe cell structure is clearPattern or expert variant
Contour chipsThe line moves in a playable shapeOctave or pattern length
OSMD scoreThe notation fits the selected meter and rhythmNote length, tempo, or time signature
Score jazz-enclosure-ii-v-i-guide-tones.musicxml

Export and save are part of the design

The page controller sets canExportGeneratedFiles for fully authenticated users and canSaveGeneratedFiles for users with write access. The UI mirrors that: MIDI download buttons are disabled until export is allowed, and cloud save buttons require the paid write permission. This makes the tool useful for both quick browser practice and a larger media-library workflow.

When saving, the Stimulus controller posts JSON to the enclosure save endpoint. The payload includes the MIDI base64 data, title, audience, visibility, BPM, pattern, neighbor mode, octave, metadata, and a track container when enabled. That track container marks target notes and includes piano-roll-ready timing, so a saved enclosure is not just a file; it can become editable practice material elsewhere in the app.

A complete twenty-minute practice block

  1. Minutes 0-3: Select C, target the third, choose upper-lower-target, and generate chromatic lines at eighth notes.
  2. Minutes 3-6: Play the first four lines. Say the target before pressing play.
  3. Minutes 6-9: Switch neighbor mode to diatonic and compare the role colors and sound.
  4. Minutes 9-12: Change the target to seventh and listen for guide-tone function.
  5. Minutes 12-15: Open harmony targeting and select a scale context for the same key.
  6. Minutes 15-18: Move the key and keep the same pattern. Do not change everything at once.
  7. Minutes 18-20: Export or save only one line you can sing without looking.
JolyMusic Tool
Generate an enclosure line from this workflow
Open enclosure tool
PracticeTool
The tool action opens the exact controller route described here, with controls for key, target degree, pattern, neighbor mode, score settings, playback, MIDI download, and library saving.
Routeapp_tool_enclosure
WorkflowKey - target degree - neighbor mode - line card - MIDI save

Professional mistakes to avoid

MistakeWhat the tool showsCorrection
Choosing all-scale too earlyMany lines, weak target disciplineStart with third or seventh
Exporting before reading the cardMIDI files with unclear role structureCheck note roles, units, contour, and OSMD first
Changing key, target, pattern, and rhythm togetherNo clear cause when the line failsChange one control per pass
Using chromatic mode for every styleEvery phrase has the same outside biteUse diatonic mode with harmony targeting for inside contexts
Ignoring permissionsDisabled export or save controlsLog in for download; use write access for library save

A strong enclosure practice session ends with fewer lines, not more. The generator can create pages of material, but the professional goal is to identify one line whose target is audible, whose role colors make sense, whose notation reads cleanly, and whose MIDI is worth saving.

Recent posts