D-I(1)
π d-i β the manual, but make it make sense
okay bestie, so this is d-i from the BRL-CAD fam (manual section 1, she's official β¨). Think of her as the little converter that takes your fancy double-precision floats and squishes them down into cute lil' 16-bit short integers. It's giving "glow-down but on purpose" π
β¨ NAME β¨
d-i β converts doubles into 16-bit short integers. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
d-i [-n | scale] < doubles > shorts
π¦ DESCRIPTION π¦
So here's the vibe: d-i reads a stream of native, machine-format, double-precision floating point numbers from standard input, multiplies every single value by a scale factor, and writes the results out to standard output as native 16-bit signed short integers. no cap, that's the entire pipeline π«
The optional single argument is what picks your scaling, and you've got choices:
If you pass a numeric scale, every input value gets multiplied by it. If you pass -n, the scale is set to 32767.0, so input data sitting in the range -1.0 to +1.0 maps all the way onto the full short integer range. And if you pass no argument at all, the scale just defaults to 1.0. easy π
Now for the spicy part: values that exceed the representable short range get clipped to 32767 or -32768, and a count of the clipped high and low samples gets reported on standard error. so you'll know if your data got a little too extra π
β οΈ okay important: this command is deprecated and scheduled for removal β she literally prints a deprecation warning on startup. so appreciate her while she's here π«Ά
She's the exact inverse of i-d(1), and she typically shows up in pipelines alongside other BRL-CAD signal-processing tools like dmod(1) and dconv(1). iconic teamwork honestly π
β¨ OPTIONS β¨
-nβ Normalize: use a scale of32767.0so that input in the range-1.0to+1.0fills the full 16-bit signed range. Mutually exclusive with a numeric scale argument, so pick one bestie, not both πscaleβ A floating point multiplier applied to every input sample before conversion. A scale of0.0is rejected as an error. sorry, zero, you're not invited π
π EXAMPLES π
Example 1. Normalize unit-range doubles to full-scale audio samples π§
d-i -n < signal.d > signal.pcm
This treats the values in signal.d as samples in the range -1.0 to +1.0 and rescales them to fill the 16-bit signed integer range, producing raw PCM-style short data in signal.pcm. literally her main character moment π
Example 2. Apply an explicit gain in a processing pipeline π₯
dmod -m 0.5 < input.d | d-i 100 > scaled.shorts
This multiplies the double-precision stream by 0.5 using dmod(1), then scales by 100 and converts to 16-bit shorts. Any samples that exceed the short range get clipped and a clip count is printed to standard error. pipeline queen behavior fr fr π
π SEE ALSO π
brlcad(1), i-d(1), d-a(1), d-u(1), dconv(1), dmod(1)
go read those too, they're all part of the squad π«Ά
π AUTHOR π
BRL-CAD Team π
π COPYRIGHT π
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. yes the government owns this one, slay ποΈβ¨
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. tell them everything, they wanna know ππ
and that's the whole page, bestie β brought to you by BRL-CAD, the D-I(1) manual page, no notes, periodt πΈπ
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms