Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
module_descriptor.hpp File Reference

The layout manifest: one declarative description of a modular module, from which the panel SVG, the plugin.json entry, and the widget placement are all derived. More...

#include <cmath>
#include <cstdint>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::format::rack::ParamSpec
struct  pulp::format::rack::PortSpec
struct  pulp::format::rack::LightSpec
struct  pulp::format::rack::ModuleDescriptor
 One module: everything needed to emit its panel, its manifest entry, and its widget placement. More...
struct  pulp::format::rack::PluginManifest
 A whole plugin: brand plus its modules. More...

Namespaces

namespace  pulp
namespace  pulp::format
 What the product grants a device: the quota table indexed by capability tier and live thermal state.
namespace  pulp::format::rack
namespace  pulp::format::rack::volts
 Published modular voltage standards. Centralized so no module can drift.

Enumerations

enum class  pulp::format::rack::ControlKind {
  pulp::format::rack::KnobLarge , pulp::format::rack::Knob , pulp::format::rack::KnobSmall , pulp::format::rack::Trimpot ,
  pulp::format::rack::Toggle , pulp::format::rack::Button
}
 Which physical control renders a parameter. More...
enum class  pulp::format::rack::PortRole {
  pulp::format::rack::Audio , pulp::format::rack::Cv , pulp::format::rack::Pitch , pulp::format::rack::Gate ,
  pulp::format::rack::Trigger , pulp::format::rack::Clock
}
 What a jack carries. More...

Functions

constexpr double pulp::format::rack::hp_to_mm (int hp)
constexpr double pulp::format::rack::mm_to_px (double mm)
float pulp::format::rack::volts::voct_to_hz (float volts, float ref_hz=kPitchRefHz)
constexpr double pulp::format::rack::control_radius_mm (ControlKind k)
 Drawn footprint radius in mm for each control kind — the radius of what Rack actually paints, not of the authoring placeholder.
const char * pulp::format::rack::widget_class (ControlKind k)
 The Rack widget class this control maps to.

Variables

constexpr double pulp::format::rack::kHpMm = 5.08
 Eurorack geometry.
constexpr double pulp::format::rack::kPanelHeightMm = 380.0 / 75.0 * 25.4
constexpr double pulp::format::rack::kRackDpi = 75.0
constexpr float pulp::format::rack::volts::kAudioPeak = 5.0f
 audio is ±5 V
constexpr float pulp::format::rack::volts::kCvUnipolar = 10.0f
 unipolar CV is 0..10 V
constexpr float pulp::format::rack::volts::kCvBipolar = 5.0f
 bipolar CV is ±5 V
constexpr float pulp::format::rack::volts::kGateHigh = 10.0f
 gates and triggers are 10 V
constexpr float pulp::format::rack::volts::kSchmittLow = 0.1f
 trigger detection thresholds
constexpr float pulp::format::rack::volts::kSchmittHigh = 1.0f
constexpr float pulp::format::rack::volts::kPitchRefHz = 261.6256f
 1 V/oct: f = f0 · 2^V.
constexpr float pulp::format::rack::volts::kLfoRefHz = 2.0f
constexpr double pulp::format::rack::kJackRadiusMm = 4.11
 Jack footprint (PJ301M is 24.3 px square).
constexpr double pulp::format::rack::kLightRadiusMm = 1.39
 Medium LED (3 mm).

Detailed Description

The layout manifest: one declarative description of a modular module, from which the panel SVG, the plugin.json entry, and the widget placement are all derived.

This header deliberately has NO dependency on the Rack SDK. It is pure data plus pure functions, so the manifest can be authored, validated and unit tested in a build with PULP_HAS_RACK=OFF — which is every build that does not have a developer-supplied SDK. Only the adapter that turns a manifest into a live rack::engine::Module includes <rack.hpp>.

Why a manifest at all: the panel art and the C++ widget placement must agree on coordinates to a fraction of a millimetre, and a label whose baseline lands inside a widget's footprint is invisible in Rack — the widget is drawn on top of the panel and does not exist in the SVG. Deriving both sides from one description is what makes that class of mismatch unrepresentable.