Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ArticulationSwitcher

File: Rhapsodist/Includes/ArticulationSwitcher.js · Namespace: ArticulationSwitcher.

Overview

ArticulationSwitcher drives articulation switching from incoming MIDI: a keyswitch note, a bank-select CC, or a Program Change.

It has no direct effect on sound; it works entirely by setting the shell’s knbArticulation knob, the same knob any other UI control would set to change articulation.

Usage

Call onNoteOn() and onController() from the Interface script’s corresponding callbacks:

function onNoteOn()
{
    ArticulationSwitcher.onNoteOn();
}

function onController()
{
    ArticulationSwitcher.onController();
}

Events and communication

ArticulationSwitcher only drives knbArticulation’s value; it doesn’t apply any patch/articulation configuration to modules itself.

ConfigurationHandler is what actually applies attribute changes when that knob changes. See Architecture: Patch and Articulation Changes for the full picture of how a patch/articulation change fans out.

Public API

FunctionDescriptionReturns
changeArticulation(index: number)Looks up ArticulationDataManager.getArticulation(index), and if it resolves, sets knbArticulation to index, driving the shell’s articulation knob (and every listener on it).—
onNoteOn()Resolves the incoming note, adjusted for the current transpose amount, against the current keyswitch map, and calls changeArticulation if it matches.—
onController()Resolves CC 32 (bank-select LSB, gated by Manifest.useUacc) or an actual MIDI Program Change, and calls changeArticulation if it matches.—

Internal Reference

Broadcasters

BroadcasterDescription
bcTranposeChangedknbTranspose’s value changes. Updates the stored transposition amount used to adjust incoming notes before matching them against the keyswitch map.