Skip to content

Workspace Navigation + Sampler Mode #11

Description

@christoph-hart

Overview

Implement /workspace as the primary navigation + context command, plus a comprehensive sampler mode with sample map management, selection-based editing, and first-class complex group management support.

/workspace Command

Behavior

/workspace tells HISE to switch its IDE view AND puts the CLI into the corresponding contextual mode:

> /workspace Interface        -> [script:Interface]    HISE -> Scripting Workspace
> /workspace MySampler        -> [sampler:MySampler]   HISE -> Sampler Workspace
> /workspace MyDspNetwork     -> [dsp:MyDspNetwork]    HISE -> Scriptnode Workspace

Module Type -> Mode Mapping

Module type HISE workspace CLI mode
ScriptProcessor Scripting script
StreamingSampler Sampler sampler
HardcodedSynth / ScriptFX with DspNetwork Scriptnode dsp

Tasks (workspace)

  • Implement /workspace command (query HISE for module list, infer mode from type)
  • Send workspace switch command to HISE IDE
  • Implement module type detection and mode routing
  • /workspace with no argument: interactive module picker (TUI) / --list (CLI)
  • Tab completion for module names

Sampler Mode

Entered via /workspace targeting a StreamingSampler. The CLI complements the visible HISE sample map editor — selections sync to the HISE UI so the user sees highlighted samples in the workspace.

Grammar

# ── Sample Map Management ─────────────────────────────
maps                                    # list available sample maps
load <samplemap>                        # load a sample map
save [<name>]                           # save current map
clear                                   # clear current sample map
info                                    # current map stats

# ── Import ────────────────────────────────────────────
import <path|glob>                      # import audio files
automap <path|glob>                     # import + auto-detect mapping from filenames
import sfz <path>                       # import SFZ file

# ── Selection (syncs to HISE UI) ──────────────────────
select all
select "<regex>"                        # by filename regex
select where <property> <op> <value>    # by property filter (=, !=, >, <, >=, <=)
select where <prop> <op> <val> and <prop> <op> <val>  # compound filters
select add "<regex>"                    # add to current selection
select subtract "<regex>"              # remove from current selection

# ── Editing (operates on selection) ───────────────────
set <property> [to] <value>
set <property> [to] <value> for all

# ── Inspection ────────────────────────────────────────
show                                    # show selected samples as table
show all                                # show all samples
count                                   # count selected / total

# ── Sample Operations ────────────────────────────────
duplicate                               # duplicate selected samples
delete                                  # delete selected samples
replace <sample> with <path>            # replace audio file

# ── Batch Processing ─────────────────────────────────
monolith [<samplemap>]                  # convert to HLAC monolith
monolith all                            # convert all sample maps
validate                                # check missing files, overlaps

# ── Mic Positions ────────────────────────────────────
mics                                    # list mic positions + purge state
purge <micname>
unpurge <micname>

Sample Properties

Properties for select where / set / show:

Property Type Description
FileName string Audio file path
Root note/int Root note (C4 or 60)
LoKey / HiKey note/int Key range
LoVel / HiVel int Velocity range
RRGroup int Round robin group (or bitmask for complex groups)
Volume dB Sample volume
Pan int Pan (-100 to 100)
SampleStart / SampleEnd int Playback range in samples
LoopStart / LoopEnd int Loop points
LoopEnabled bool Loop on/off
LowerVelocityXFade / UpperVelocityXFade int Velocity crossfade

Note values accept names (C4, F#3) or MIDI numbers (60, 54).

Automap

Import + auto-detect mapping from filename tokens:

[sampler:MySampler] > automap ~/Samples/Piano/*.wav
  Detected tokens in: Piano_C4_mf_RR1.wav
    Token 1: "Piano"  -> instrument (constant)
    Token 2: "C4"     -> note       -> Root, LoKey, HiKey
    Token 3: "mf"     -> velocity   -> LoVel, HiVel
    Token 4: "RR1"    -> round robin -> RRGroup

TUI: interactive confirmation. CLI: explicit --pattern flag.


Complex Group Management (First-Class)

The complex group manager replaces the simple RR group axis with a 64-bit bitmask supporting arbitrary organizational layers (RR, crossfade, keyswitch, legato, custom). This is a new, powerful HISE feature that the CLI makes much easier to work with programmatically.

Grammar

# ── Layer Management ──────────────────────────────────
groups                                  # show all layers with types, bits, group counts
groups add <type> <name> [--bits N] [--cached] [--ignore]
groups remove <name>
groups <name>                           # show layer details

  Layer types: rr, xfade, keyswitch, legato, custom

  groups add rr "RoundRobin" --ignore
  groups add xfade "VelocityXF"
  groups add keyswitch "Articulation" --cached
  groups add legato "LegatoInterval" --ignore
  groups add custom "MyLayer" --bits 4

# ── Assigning Samples to Groups ──────────────────────
assign <layer> <group> [to selection]   # assign value to selected samples
assign <layer> ignore [to selection]    # set ignore flag

  select "Sustain*"
  assign Legato ignore                  # sustain samples ignore legato filter

  select "RR1*"
  assign RoundRobin 1

  select "pizz*"
  assign Articulation "pizzicato"

# ── Filtering (controls playback) ────────────────────
filter <layer> <group>                  # set active group for a layer
filter <layer> off                      # disable filter

  filter Articulation "staccato"
  filter RoundRobin 3

# ── Layer Properties ─────────────────────────────────
groups set <layer> <property> <value>

  groups set Articulation cached true
  groups set RoundRobin ignore true

# ── Per-Group Audio Control ──────────────────────────
volume <layer> <group> <dB>
delay <layer> <group> <samples>
fadein <layer> <group> <ms> [<dB>]
fadeout <layer> <group> <ms>

Example Workflow

[sampler:MySampler] > groups add keyswitch "Articulation" --cached
[sampler:MySampler] > groups add rr "RR" --ignore
[sampler:MySampler] > groups add legato "Legato" --ignore

[sampler:MySampler] > groups
  Layer         Type       Bits  Groups  Cached  Ignore
  Articulation  keyswitch  2     3       yes     no
  RR            rr         4     9       no      yes
  Legato        legato     7     128     no      yes
  Total: 13 / 64 bits used

[sampler:MySampler] > select "sustain*"
[sampler:MySampler] > assign Articulation "sustain"
[sampler:MySampler] > assign Legato ignore

[sampler:MySampler] > select "legato*C4*"
[sampler:MySampler] > assign Legato C4
[sampler:MySampler] > assign Articulation "sustain"

Automap + Complex Groups

automap can detect articulation/RR tokens and automatically create layers:

[sampler:MySampler] > automap ~/Samples/Violin/*.wav
  Detected articulations: sustain, staccato, pizzicato
  Detected RR groups: 1-6
  Create complex group layers? (Y/n) y
  Created: Articulation (keyswitch, cached), RR (rr, ignore)

HISE API Mapping

CLI command HISE API
maps Sampler.getSampleMapList()
load X Sampler.loadSampleMap(X)
save X Sampler.saveCurrentSampleMap(X)
clear Sampler.clearSampleMap()
import files Sampler.importSamples(fileList)
import sfz path Sampler.loadSfzFile(path)
select "regex" Sampler.selectSounds(regex) + setGUISelection()
select where ... Sampler.createSelectionWithFilter(fn)
set prop val Sampler.setSoundPropertyForSelection(propIdx, val)
set prop val for all Sampler.setSoundPropertyForAllSamples(propIdx, val)
duplicate Sample.duplicateSample() for selection
delete Sample.deleteSample() for selection
show Sample.get(propIdx) for each in selection
groups (list) Sampler.getComplexGroupManager() + iterate
groups add ... ComplexGroupManager layer creation
assign layer group Encodes into RRGroup bitmask via group manager
assign layer ignore Sets ignore flag bits
filter layer group ComplexGroupManager.setActiveGroup(layerIdx, groupIdx)
volume layer group dB ComplexGroupManager.setGroupVolume(layerIdx, groupIdx, gain)
delay layer group N ComplexGroupManager.addGroupEventStartOffset(...)
fadein/fadeout ... ComplexGroupManager.fadeInGroupEvent/fadeOutGroupEvent(...)
groups set layer prop val ComplexGroupManager.setLayerProperty(...)
mics Sampler.getNumMicPositions() + getMicPositionName()
purge X Sampler.purgeMicPosition(X, true)
monolith HISE monolith conversion endpoint

Tasks

Workspace

  • Implement /workspace command (query HISE for module list, infer mode from type)
  • Send workspace switch command to HISE IDE
  • Implement module type detection and mode routing
  • /workspace with no argument (interactive picker / --list)
  • Tab completion for module names

Sampler Mode Core

  • Implement sample map commands: maps, load, save, clear, info
  • Implement import, automap, import sfz
  • Implement selection commands with HISE UI sync (select, select where, select add/subtract)
  • Implement compound where filters (and)
  • Implement set property for selection / for all
  • Implement show as table output
  • Implement sample operations: duplicate, delete, replace
  • Implement batch processing: monolith, validate
  • Implement mic position commands: mics, purge, unpurge
  • Note name parsing (C4 -> 60, F#3 -> 54)

Complex Group Management

  • Implement groups list/detail
  • Implement groups add (rr, xfade, keyswitch, legato, custom with --bits, --cached, --ignore)
  • Implement groups remove
  • Implement assign (set group value for selection, set ignore flag)
  • Implement filter (set active group, disable filter)
  • Implement groups set (layer property modification)
  • Implement per-group audio: volume, delay, fadein, fadeout
  • Automap integration with complex group layer detection

Dependencies

  • Phase 1 (Command Engine Core)
  • Phase 2 (Mode System + /workspace)
  • Phase 6 (DSP Mode — /workspace routes to it)
  • Phase 7 (Script Mode — /workspace routes to it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions