Spatial & Atmos objects¶
The spatial object layer¶
iclforge/render/spatial.hpp. Mono sources placed on the ITU-R BS.775 ring, rendered to a 5.1
bed. This is the plain-AC-3 object path: the output is an ordinary 5.1 stream and nothing
survives about where the object was.
iclforge::spatial::BedRenderer renderer;
// add_object allocates, so call it before rendering starts.
const std::size_t object = renderer.add_object({.azimuth_deg = 0.0, .gain = 0.7});
Rendering is clocked at the 256-sample block, because that is the rate automation runs at;
gains ramp linearly within a block, so moving an object does not click. The render path itself
does not allocate. Neither do pan_ring and pan_direction: their working storage is on the
stack, sized to Table E2.5's widest ring, because a part rendering objects calls them once per
object per frame and the minimum-footprint probe counts every allocation.
// One full turn every two seconds.
renderer.set_target(object, {.azimuth_deg = 180.0 * seconds, .gain = 0.7});
// Six writable 256-sample spans into this block of the frame:
// L, C, R, SL, SR, LFE. render_block overwrites them.
std::array<std::span<float>, 6> block_out{};
for (std::size_t ch = 0; ch < 6; ++ch) {
block_out[ch] = std::span<float>{bed[ch]}.subspan(
static_cast<std::size_t>(block * iclforge::spatial::kBlockSamples),
iclforge::spatial::kBlockSamples);
}
const std::array<std::span<const float>, 1> audio{std::span<const float>{source}};
renderer.render_block(audio, block_out);
Full program: examples/spatial_objects.cpp.
pan_azimuth(deg) and pan_room(x, y) expose the panner directly if you want the gains
without the renderer. Both are energy-normalized pairwise (VBAP on the horizontal ring),
Σg² = 1.
There is no z. A 5.1 ring has no height speakers, so a raised source folds onto the ring at
its azimuth, at full level. Objects never reach the LFE by panning — lfe_send is the only
route.
Objects with metadata: iclforge::ac3::oba::AtmosEncoder¶
iclforge/ac3/oba/atmos.hpp. The same objects, but their positions survive: the output is one ordinary
5.1 E-AC-3 stream with OAMD and JOC payloads riding beside it in an EMDF container
(TS 102 366 Annex H, carried in a block skip field). A decoder that knows about neither plays
the bed unchanged, at full level — that is the design target, not a fallback.
constexpr int kObjects = 3;
// Object metadata competes with the mantissas for the same frame, so an
// object stream wants more headroom than a plain 5.1 one.
iclforge::ac3::oba::AtmosEncoder encoder{{.bitrate_kbps = 448}, kObjects};
// Positions are room-anchored per §4.2.1: x 0 at the left wall to 1 at
// the right, y 0 front to 1 back, z -1 at the floor to +1 at the
// ceiling (0 is listener height).
std::array<iclforge::objects::oba::ObjectPlacement, kObjects> placement{};
placement[obj] = {
.position = {.x = 0.5 + 0.45 * std::cos(angle),
.y = 0.5 + 0.45 * std::sin(angle),
.z = 0.25 * static_cast<double>(obj)},
.gain = 1.0,
};
const auto unit = encoder.encode_frame(views, placement);
Extent and rendering constraints¶
An object is not necessarily a point. ObjectPlacement also carries TS 103 420 §5.6.1's
extent and rendering-constraint fields, all of which reach OAMD:
placement[obj] = {
.position = {.x = 0.5, .y = 0.2, .z = 0.4},
.gain = 1.0,
// §5.6.1.2 Table 17, each axis in [0, 1]. Table 17 has three shapes and
// only three: a point source, one value shared by all three axes, and
// three separate ones - build_payload picks the cheapest that fits.
.size = {.width = 0.4, .depth = 0.1, .height = 0.4},
// §5.6.1.5.1 b_object_snap - what ADM calls channelLock: render to the
// nearest speaker instead of panning between speakers.
.snap = false,
// §5.6.1.6 Table 20/21: which horizontal zones the renderer may use,
// and whether the Top-Bottom zone is in play at all.
.zone = iclforge::objects::oba::ZoneConstraint::kScreenOnly,
.enable_elevation = true,
// §5.5.14 / Tables 40-42: the share of the object's energy spread into two
// objects along X (§5.2.7), 0 to 1. Quantized to Table 42's values and sent
// in the extended_object_element, which is written only when an object
// diverges.
.divergence = 0.0,
// §5.6.1.1.18-.20: the position is screen-anchored rather than room-anchored,
// with screen_factor (1/8 to 1) and depth_factor (1/4 to 2) saying how far
// the renderer follows the screen.
.screen_reference = false,
.screen_factor = 1.0,
.depth_factor = 1.0,
};
These are transmitted, not applied by the encoder. §4.3 makes the renderer, not the decoder, responsible for turning an extent into loudspeaker feeds, and the 5.1 downmix this encoder builds is a point-source VBAP pan by construction — a downmix that spread the object would then be spread again by the receiving renderer. So a sized object is transmitted as sized and folded into the bed as a point, which is the split used.
The renderer that plays the objects back — iclforge::render::LayoutRenderer, what Hearth, the
ESP32 player and forge decode's AC-4 object rendering go through — is where they are applied,
from the DisplayObject that describe_objects returns. §5.2 fixes what each property means, and
Table A.7 which zones each speaker is in, so the renderer follows the meaning rather than
inventing one:
| Property | What the renderer does |
|---|---|
Channel lock (snap, §5.2.5) |
The one speaker nearest the object, at unit gain: "constrained to a single speaker", no panning between. It wins over size. |
| Zone constraints (§5.2.6, Tables 20 and 21) | The speakers in an excluded zone are taken out of the set the object is panned over, so the object moves rather than gets quieter. A surround pair is the back zone in a 5.X layout and the side zone in a larger one (Table A.7 note 2); the Top-Bottom zone answers to b_enable_elevation alone. A constraint no speaker of the layout satisfies (a stereo room asked for "surround only") cannot be honoured and the object plays unconstrained. |
| Size (§5.2.2) | The cuboid width/depth/height describe, centred on the position, in room units, rendered as that cuboid sampled at the centre and the two ends of each axis it extends along (27 points at most), each point panned and their powers averaged: more speakers at the same level, never louder. |
An object that says none of this — a point, no lock, no zone, elevation allowed, which is what a bed channel always is — renders exactly as it did before the renderer read any of it. Object divergence (§5.2.7) is carried and reported but not applied: the standard gives the amount and says nothing of where the two objects it makes should sit, so there is nothing to follow.
Keyframe carries the same four fields. size interpolates between keyframes the way position
and gain do (BS.2076-2 §10.3 lists width/height/depth among its interpolatable parameters);
snap, zone and enable_elevation do not — they are discrete decisions with no meaningful
halfway point, so evaluate() holds the earlier keyframe's value until the later one is reached.
Full program: examples/atmos_objects.cpp.
AtmosConfig |
Default | Notes |
|---|---|---|
sample_rate |
k48000 |
Handed straight to the bed's own eac3::FrameConfig; nothing in the object layer reads it. |
bitrate_kbps |
448 | Per substream, as everywhere else. The object metadata competes with the mantissas for the same frame, so an object stream needs headroom a plain 5.1 stream does not. |
dialnorm |
31 | 1–31 (§5.4.2.8), as on the plain encoders. |
num_bands_idx |
4 | Index into oba::joc::kNumBands (Table 50). More bands cost codewords without giving the matrix anything new to say. |
fine_quant |
false |
§6.3.3.7's half-step quantizer, roughly one more bit per coefficient. Worth it when objects are nearly degenerate. |
fast_mdct |
true |
The §7.9.4 fast forward MDCT for the whole object encode: the bed's substream (via eac3::FrameConfig::fast_mdct) and the per-object band_energy transforms feeding the reconstruction-matrix solve. false forces the direct §8.2.3.2 reference form everywhere, for validation — the CLI spells that fast-mdct=off on the atmos* commands. |
joc_domain |
oba::joc::Domain::kQmf |
Where the reconstruction matrix is estimated. kQmf is §7.1's 64-band complex filterbank — what §6.6.6 describes and what a licensed decoder reconstructs in. kMdctBand is the 256-bin MDCT approximation this project used before it had a filterbank: cheaper, about 5 dB worse per object, and only correct against a decoder told the same thing. CLI: joc-domain=mdct. |
At most 16 objects (oba::joc::kMaxObjects, per TS 103 420 §8.3.2.2). encoder.bed() returns the
5.1 bed the last frame encoded — what a legacy decoder hears, and the thing most worth
checking — and encoder.parameters() the pre-quantization reconstruction matrix.
The matrix is the minimum mean-square estimate M = P Dᵀ (D P Dᵀ + εI)⁻¹. Because the encoder
built the downmix it knows D exactly rather than estimating it, which makes the solve
near-exact for well-separated objects. P — each object's per-band power — is read off §7.1's
complex QMF, which is the domain the decoder will apply the result in; see
which domain the matrix lives in.
Two limits are structural, not bugs: objects sharing a direction cannot be separated by any
linear combination of the bed, and Dolby's decoder will not treat these as objects at all. Both
are covered in Atmos & JOC.
Channel-based-immersive (CBI) beds¶
Everything above assumes objects: free-floating placements an application authors. A CBI
programme is the other shape TS 103 420 allows — a bed, a fixed speaker layout (5.1.4, 7.1.4,
9.1.6) coded through OAMD+JOC exactly like objects but anchored to speaker labels rather than
positions, program.dynamic_objects == 0 throughout. It is what Dolby's own DEE encoder produces
from --input-format cbi_wav, and it is what most channel-based-immersive Atmos content actually
is — see Atmos & JOC's "a programme need not be objects" note.
AtmosEncoder has a second constructor for it, taking a BedProgram (the Table 12 bed
assignment) instead of an object count:
using iclforge::objects::oba::bed;
const std::uint16_t layout = bed::kLR | bed::kC | bed::kLfe | bed::kLsRs |
bed::kTflTfr | bed::kTblTbr; // 5.1.4
iclforge::ac3::oba::AtmosEncoder encoder{{.bitrate_kbps = 448}, iclforge::ac3::oba::BedProgram{.bed = layout}};
encode_bed_frame replaces encode_frame: no ObjectPlacement to supply, because a bed
channel's position comes from its label, not an argument (TS 103 420 §5.5.9) — just one span of
audio per channel, in iclforge::objects::oba::bed_labels(layout)'s own order (LFE included, at whichever
position that order puts it):
// channels.size() == iclforge::objects::oba::bed_channel_count(encoder.program()).
const auto unit = encoder.encode_bed_frame(channels);
Every channel but the LFE is folded onto the 5-channel ring at its own fixed, speaker-implied
position and reconstructed by JOC from there — the base ring channels (L, C, R, Ls, Rs) at unity,
since they physically are the downmix, and every other bed channel (Lb/Rb, the height pairs,
Lw/Rw) at a small fixed downmix attenuation, a non-normative encoder policy choice (see
kExtensionDownmixScale in atmos.cpp) that a JOC-aware decoder undoes exactly, the same way it
already undoes an authored object's own gain. The LFE feeds the bed's own LFE channel directly,
unpanned — it is not a JOC object either way (§6.3.2.2 bypasses it for a bed programme exactly as
it does for a dynamic-object one).
The channel order is checked against real DEE-produced streams for all three layouts
(libs/ac3/tests/oba/test_dee_joc_fixture.cpp: dee_joc_514.ec3 by tone, dee_joc_714.ec3 and
dee_joc_916.ec3 one channel at a time). Table 12's order and the order a production tool takes
its input in are different permutations at 9.1.6 — the wides are last in the bed and follow the
rears at the input — and the objects come back as the bed's labels say. forge atmos-cbi is the
CLI surface — see CLI commands.
Getting the objects back: oba::joc::reconstruct¶
Eac3Decoder reconstructs object audio into DecodedSubstream::object_audio whenever a frame
carries JOC, using DecoderConfig::joc_domain — kQmf by default, the same pair the encoder
estimated in. The result lags the bed, and by how much depends on the domain:
// 256 samples of encode+decode, plus the JOC transform pair's own delay.
const int delay = 256 + iclforge::objects::oba::joc::reconstruction_delay(config.joc_domain);
oba::joc::reconstruction_delay() returns 576 for kQmf (the filterbank's 640-tap window less one
64-sample hop) and 256 for kMdctBand. Ask it rather than hard-coding either: code that compares
reconstructed objects against a known source and gets the shift wrong measures the latency
instead of the reconstruction, and still looks plausible.
The filterbank is usable on its own as iclforge::dsp::QmfAnalysis / QmfSynthesis (iclforge/dsp/qmf.hpp)
— 64 complex subbands, one timeslot per 64 samples, perfect reconstruction.
Scripted motion: iclforge::objects::oba::motion¶
iclforge/objects/motion.hpp. AtmosEncoder::encode_frame always took a fresh ObjectPlacement per
call; what this adds is a shared way to say where an object is at a given moment, so a caller
stops reimplementing that per-frame math independently the way atmos_objects.cpp does.
// A closed-form orbit - evaluated exactly rather than decimated into
// keyframes, so it stays an exact circle.
const auto orbit = iclforge::objects::oba::make_orbit_path(/*rate_hz=*/0.5, /*phase_rad=*/0.0,
/*height=*/0.5, /*gain=*/0.6, /*lfe_send=*/0.0);
// Sparse authored points, linearly interpolated between neighbours and held
// at the ends rather than extrapolated.
auto keyframed = iclforge::objects::oba::KeyframePath::create({
{.time_s = 0.0, .position = {.x = 0.0, .y = 0.5, .z = 0.0}, .gain = 0.0},
{.time_s = 0.8, .position = {.x = 0.5, .y = 0.9, .z = 0.0}, .gain = 0.8},
{.time_s = 1.6, .position = {.x = 1.0, .y = 0.5, .z = 0.0}, .gain = 0.0},
});
// One call per frame gets every object's placement at that instant, in
// path order - exactly the span encode_frame() wants.
const auto placement = iclforge::objects::oba::evaluate_placements(paths, seconds);
const auto unit = encoder.encode_frame(views, placement);
Full program: examples/scripted_object_motion.cpp.
ObjectPath is a std::variant of the two kinds behind one evaluate(time_s) interface, so a
caller doesn't need to know which one it holds. It is the per-object layer: one object, one
path, no notion of a scene. forge atmos's built-in orbit and live's atmos mode use it
directly; anything with more than one object and a file to load from wants ObjectScene below.
The scene: iclforge::objects::oba::ObjectScene¶
iclforge/objects/scene.hpp. AtmosEncoder::encode_frame takes one ObjectPlacement per object per
frame and nothing more, so every caller that wanted a scene — objects with names, a bed
assignment, automation, a file it can be saved to and reloaded from — used to build its own.
forge atmos-path grew a keyframe-file grammar; the GUI's timeline grew a parallel one it
exports in that grammar; the station-broadcast example hard-coded a cue table in C++. This is
the one description they share.
It is metadata and authoring, deliberately. A scene says where an object is at a moment in
time; turning that into speaker feeds is the encoder's job, and a room-corrected render is
Cavern's rather than this project's. Orientation below is the
same kind of thing: it rewrites the coordinates that go into OAMD, so what reaches the
bitstream is an ordinary scene that happens to have been turned.
using iclforge::objects::oba::Interpolation;
auto built = iclforge::objects::oba::ObjectScene::create({
{.name = "flyby",
.automation = {{.time_s = 0.0, .position = {.x = 0.0, .y = 0.5, .z = 0.5}, .gain = 0.6,
.interp = Interpolation::kSmooth},
{.time_s = 1.5, .position = {.x = 0.5, .y = 0.1, .z = 0.5}, .gain = 0.6,
.interp = Interpolation::kSmooth},
{.time_s = 3.0, .position = {.x = 1.0, .y = 0.5, .z = 0.5}, .gain = 0.6}}},
});
const auto& scene = *built;
std::vector<iclforge::objects::oba::ObjectPlacement> placement(scene.object_count());
scene.evaluate_into(seconds, placement); // allocation-free, once per frame
const auto unit = encoder.encode_frame(views, placement);
Full program: examples/scripted_object_motion.cpp.
Interpolation and ramp semantics¶
Each automation point states how the segment that starts at it reaches the next one, so one object can hold, then slide, then ease without being split into three:
Interpolation |
Between two points |
|---|---|
kHold |
Step. The value stays this point's until the next point's instant, then jumps. Mostly for gain gating and cue-accurate teleports — a position step is audible as a click in the panning. |
kLinear (default) |
Straight line, component by component. Exactly what KeyframePath has always done, which is why a scene built from a legacy keyframe file evaluates to the same doubles that file always produced. |
kSmooth |
Smoothstep, f*f*(3-2f): the value leaves and arrives with zero slope. For where a linear ramp corners audibly. |
Outside the authored range, both ends hold: an object sits still before its first cue and
stays put after its last, rather than extrapolating into the wall or going silent. An object
with one point never moves. Callers evaluate at the frame's end time — every encode loop in
this repository does — because AtmosEncoder ramps its bed between successive frames'
placements, so the placement handed in is the value that ramp arrives at.
Orientation¶
Orientation rotates the whole scene about the room's centre on the way out of evaluate().
Angles are radians (orientation_from_degrees() converts); rotation runs in a centred cube —
x and y mapped from [0,1] to [-1,+1], z already centred per §4.2.1 — applied yaw, then
pitch, then roll, and mapped back with a clamp to the room. Positive yaw turns the scene
clockwise seen from above, positive pitch raises the front, positive roll raises the right. An
all-zero Orientation is an exact no-op, not a rotation by zero, so an un-turned scene's
positions are bit-identical to the authored doubles.
scene.set_orientation(iclforge::objects::oba::orientation_from_degrees(90, 0, 0)); // front wall → right wall
The live half: SceneCursor¶
SceneCursor is the same timeline with per-object overrides an external source pushes in as
they arrive — the seam a live position source and the GUI's live room plug into. OSC (below) is
the one live source; the positions= token takes nothing else, and no MIDI or game-controller
source exists.
iclforge::objects::oba::SceneCursor cursor{std::move(scene)};
cursor.push({.object = 0, .placement = {.position = {.x = 0.75}, .gain = 0.9}});
cursor.sample_into(seconds, placement); // overridden objects report the pushed value
cursor.release(0); // back to the authored timeline
Latest-value-wins, with nothing interpolated between updates, deliberately: a controller's
update rate is not the frame rate, guessing an intermediate position would invent motion nobody
authored, and AtmosEncoder already ramps its bed between the placements it is handed — which
is the right place for that smoothing, since it is the thing that knows the frame boundary. The
scene's orientation applies to pushed placements too, so a live object and its authored
neighbours never end up in different rooms.
The OSC wire form¶
iclforge/objects/scene_osc.hpp. A third reader of a per-object update, beside the JSON and
keyframe-text forms above. Where those two AUTHOR a timeline up front, this one feeds
SceneCursor while a session is running: parse one UDP datagram from a show-control rig or a
DAW into zero or more updates, merge each onto the object's current placement, push the result.
// Stands in for one UDP datagram addressed to /object/0/xyz, as a show-
// control rig configured to speak this project's convention would send
// it.
const auto datagram = osc_xyz_message("/object/0/xyz", 0.9F, 0.1F, 0.5F);
iclforge::objects::oba::OscParseStats stats;
for (const auto& update : iclforge::objects::oba::parse_osc_packet(datagram, &stats)) {
if (update.release) {
cursor.release(update.object);
continue;
}
// The merge that keeps this object's authored gain (0.7 above)
// rather than resetting it to a default-constructed placement's
// 1.0 - see apply()'s own header comment for why this step exists
// and cannot be skipped in favour of pushing `update` directly.
const auto base = cursor.scene().evaluate(update.object, 0.0);
if (const auto merged = iclforge::objects::oba::apply(update, base)) {
cursor.push({.object = update.object, .placement = *merged});
}
}
Full program: examples/osc_object_control.cpp.
Address patterns match LITERALLY — no OSC glob (?/*/[]/{}) matching — with <n> the
0-based object index:
| Address | Type tag | Meaning |
|---|---|---|
/object/<n>/xyz |
,fff |
Position, the same room-coordinate convention Position/the keyframe grammar use per §4.2.1: x∈[0,1], y∈[0,1], z∈[-1,1]. |
/object/<n>/gain |
,f |
Linear gain — matches ObjectPlacement::gain, not dB. |
/object/<n>/lfe |
,f |
Linear LFE send. |
/object/<n>/release |
, (no args) |
Hand to SceneCursor::release(object) instead of apply()/push() — there is no placement to merge, only a request to stop overriding. |
apply() is the piece worth understanding before wiring this up, because it encodes a real
correctness rule rather than a convenience. SceneCursor::push() replaces a whole
ObjectPlacement, so routing a position-only OSC message straight through a
default-constructed placement would silently reset that object's gain to 1.0 and drop its
lfe_send — destroying whatever gain law the caller already has running for it. apply()
merges the wire update onto a base placement instead — typically
cursor.scene().evaluate(object, time_s), this object's currently-authored value — so every
field the OSC message didn't touch carries through unchanged.
The other half of the rule is about position, and it is easy to get backwards: apply() never
reuses base's position as the merged position, even when the incoming update carries none of
its own. That is deliberate, not an oversight. ObjectScene::evaluate() has already rotated
the position it hands back (the scene's Orientation, applied on the way out of evaluate()),
and SceneCursor::sample_into() rotates a pushed placement's position again on the way to the
encoder. Push a once-already-rotated position back in and a non-identity Orientation rotates
it twice. So a gain- or lfe-only update that arrives before this object has ever had a position
pushed has nothing safe to push yet — apply() returns std::nullopt in that case, meaning
"nothing ready to push." A caller wiring this up for real is responsible for remembering that
update against the object and re-applying it once a position finally arrives.
This header is pure, portable, zero-socket, zero-thread code — no I/O of any kind — and is
fuzzed (libs/objects/fuzz/fuzz_osc_parse.cpp) and unit-tested (libs/objects/tests/test_scene_osc.cpp) accordingly.
The actual UDP listener, iclforge::audio::LivePositionSource, is a separate, app-serving-only piece
and is not part of this installed library, for the same reason the rest of iclforge::audio
isn't (see Using the libraries's note on live audio); forge live mode=atmos
positions=osc:[<bind>:]<port> is where a reader can see it wired up end to end over a real
socket.
The serialised form¶
to_json() / scene_from_json(). JSON, not YAML: {fmt} (linked into this library for text
formatting generally) formats a number, it is not a parser for either document format, so
whichever this is still has to be read and written by code in this repository, and RFC 8259 is a
grammar small enough to implement completely and be sure of where YAML 1.2's is not — a
hand-rolled "YAML subset" would accept and reject files no other YAML tool agrees with, which is
worse than not offering YAML. Both other front ends already have a JSON reader to hand (Qt's,
Python's) if they ever want to read a scene without linking this library.
{
"iclforge_scene": 1,
"orientation": { "yaw_rad": 0, "pitch_rad": 0, "roll_rad": 0 },
"objects": [
{
"name": "flyby",
"bed": [],
"automation": [
{ "t": 0, "x": 0, "y": 0.5, "z": 0.5, "gain": 0.6, "lfe": 0, "interp": "smooth" }
]
}
]
}
Numbers are written short-round-tripped (the shortest decimal that reads back as the same
double), one automation point per line and members in a fixed order, so a scene under version
control shows real edits rather than formatting churn, and a save/load cycle is bit-exact. The
reader is strict about what it does not recognise — an unknown member is an error, because a
hand-authored file's likeliest fault is a misspelled key and silently defaulting "gian" to
1.0 would be wrong in a way nothing reports. Forward compatibility rides on the
iclforge_scene version number instead. orientation accepts yaw_deg/pitch_deg/roll_deg
in place of the radian spellings (but never both for one axis). bed names TS 103 420 Table 12
channel labels — "lr", "c", "lfe", "ls_rs", "lb_rb", "tfl_tfr", "tsl_tsr",
"tbl_tbr", "lw_rw", "lfe2" — and an empty array means a dynamic object.
scene_objects_from_keyframe_text() / to_keyframe_text() read and write the older
whitespace-column grammar forge atmos-path has always taken, unchanged including its
diagnostics — see CLI → Commands. read_scene() and scene_from_text()
take either, told apart by whether the first non-whitespace character is {, so a path argument
keeps working whichever form the file is in.
The keyframe form is indexed and sparse — a file may mention objects 0 and 2 and say nothing
about 1 — and what object 1 should then be is the caller's policy, not the library's:
atmos-path fans it out at room centre under its inverse-root gain law, atmos-encode keeps
that channel's existing static placement. That is why read_scene() returns raw
SceneContents with the gaps still empty; fill them, then ObjectScene::create.
scene_from_text() is the convenience for a caller with no policy of its own.
Not in the C API or the Python bindings¶
Both expose AtmosEncoder, and ObjectScene does not follow it there. Its shape has settled:
SceneCursor is the seam a live position source plugs into (OSC, above, is one), and both of those
surfaces are candidates for the coming API freeze, where an experimental type would be a lasting
commitment. Exposing half of it (say, the serialisation free functions but not the type) would be
worse than exposing none: a C caller would get a scene it could load and not evaluate. Load and
save the JSON form from either language and hand the resulting placements to the existing encoder
bindings.
This layer backs forge atmos-path and atmos-encode's optional scene argument, the GUI's
object-path export, and the station broadcast scene's ten authored
objects.
The same authoring for AC-4 objects¶
The AC-4 object encoder (AC-4 § Encoding objects) takes each object's
PCM and its metadata over time in iclforge::ac4::ObjectProperties, and reads no scene format. The
applications feed it the layers on this page and the ADM and IAB bridges: forge atmos-encode,
atmos-adm and atmos-iab with codec=ac4, and the Forge GUI's encoder page, turn each object's
authored position and gain into one metadata update a frame
(apps/shared/media/src/ac4_objects_core.hpp). ObjectScene, motion.hpp and AtmosEncoder know nothing
of AC-4.
Objects-or-nothing: AtmosConfig::emit_object_metadata¶
Whether to emit the EMDF object container (OAMD + JOC) at all. On by default: an object-aware
decoder gets the objects, and one that ignores the container plays the 5.1 bed underneath it —
the design target. Turning it off is the only way to keep the bed playable on a decoder that
validates emdf_protection (see Object signing): such a
decoder treats the container's sync word as a commitment to object decoding and refuses the
whole stream if the tag doesn't check out, rather than falling back. With no container there is
no sync word to find, so it decodes the bed as ordinary 5.1. The choice is objects-or-nothing,
never both.
iclforge::ac3::oba::AtmosEncoder encoder{{.bitrate_kbps = 448, .emit_object_metadata = false}, kObjects};
Turning it off drops TS 103 420 §8.3.1's addbsi object marker along with the container, so the
stream doesn't advertise an object layer either. That marker (flag_ec3_extension_type_a plus
§8.3.2.2's complexity_index_type_a) is the only thing a reader has to go on: it is what
iclforge::ac3::io::scan reports as ScannedStream::oba_complexity_index, what
iclforge::ac3::io::build_codec_config_box turns into the dec3 box's Dolby Atmos extension, what
forge fmp4 writes as an HLS CHANNELS="<N>/JOC" attribute, and what FFmpeg keys its
"Dolby Digital Plus + Dolby Atmos" profile off. Left in, all four would claim objects that were
never encoded — the same empty-promise this mode exists to avoid.
Full program: examples/atmos_fallback.cpp
— encodes the same objects both ways and confirms both decode as an ordinary 5.1 bed.
The stream size is unaffected either way — this is CBR, so frmsiz follows bitrate_kbps
regardless of what rides in the skip field. What differs is where those bits go: with the
container left out, the frame's rate control gives the freed skip-field bytes back to the
mantissas, so the two configurations' decoded bed is close but not bit-identical.
See also: Encoding E-AC-3 — Atmos objects ride inside an ordinary E-AC-3
stream; Object signing — what makes a validating decoder
accept the container in the first place; A worked scene: the station broadcast
— a complete 115-second authored scene built on this API, from synthesis to .ec3;
ADM → Atmos bridging — mapping a professional ADM BWF master's beds and objects
onto this same ObjectPath/AtmosEncoder surface.