Yotsuba Games
Back to Node List

Clamp

clamp

Clamps a number between minimum and maximum

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
慄抛
input
Number
Required
範ć›Čć†…ă«ćŽă‚ăŸă„æ•°ć€€ă§ă™

Output Ports

NameTypeDescription
怀
value
Number
範ć›Čć†…ă«ćŽă‚ăŸćŸŒăźæ•°ć€€ă§ă™

Parameters

NameTypeDefaultRangeDescription / Options
範ć›ČプăƒȘă‚»ăƒƒăƒˆ
range_preset
Enum
Normalized—

ă‚ˆăäœżă†çŻ„ć›Čă‚’ă™ă°ă‚„ăèš­ćźšă—ăŸă™

  • æ­ŁèŠćŒ– 0..1Normalized
    ćˆ¶é™çŻ„ć›Čを 0..1 ă«ă—ăŸă™
  • çŹŠć·ä»˜ă -1..1SignedNormalized
    ćˆ¶é™çŻ„ć›Čを -1..1 ă«ă—ăŸă™
  • ç™Ÿćˆ†çŽ‡ 0..100Percent
    ćˆ¶é™çŻ„ć›Čを 0..100 ă«ă—ăŸă™
  • ă‚«ă‚Šăƒłăƒˆ 1..16Count
    ćˆ¶é™çŻ„ć›Čを 1..16 ă«ă—ăŸă™
  • ăƒ”ă‚Żă‚»ăƒ«ă‚Șăƒ•ă‚»ăƒƒăƒˆ -32..32PixelOffset
    ćˆ¶é™çŻ„ć›Čを -32..32 ă«ă—ăŸă™
  • ć€§ăă„ă‚Șăƒ•ă‚»ăƒƒăƒˆ -256..256LargeOffset
    ćˆ¶é™çŻ„ć›Čを -256..256 ă«ă—ăŸă™
  • ă‚«ă‚čタムCustom
    æœ€ć°ć€€ăšæœ€ć€§ć€€ă§ćˆ¶é™çŻ„ć›Čをæ±șă‚ăŸă™
æœ€ć°ć€€
min
Float
0-10000–10000 / step 0.01

ă“ă‚Œă‚ˆă‚Šć°ă•ă„ć€€ăŻă€ă“ăźć€€ă«ăȘă‚ŠăŸă™

æœ€ć€§ć€€
max
Float
1-10000–10000 / step 0.01

ă“ă‚Œă‚ˆă‚Šć€§ăă„ć€€ăŻă€ă“ăźć€€ă«ăȘă‚ŠăŸă™

ç·šé›†ç”šæœ€ć°
soft_min
Float
0-100000–100000 / step 0.01

æœ€ć°ć€€ăšæœ€ć€§ć€€ă‚’ç·šé›†ă™ă‚‹æ™‚ăźă‚čăƒ©ă‚€ăƒ€ăƒŒæœ€ć°ć€€ă§ă™

ç·šé›†ç”šæœ€ć€§
soft_max
Float
1-100000–100000 / step 0.01

æœ€ć°ć€€ăšæœ€ć€§ć€€ă‚’ç·šé›†ă™ă‚‹æ™‚ăźă‚čăƒ©ă‚€ăƒ€ăƒŒæœ€ć€§ć€€ă§ă™

線集甚ă‚čテップ
soft_step
Float
0.010.001–1000 / step 0.001

æœ€ć°ć€€ăšæœ€ć€§ć€€ă‚’ç·šé›†ă™ă‚‹æ™‚ăźă‚čăƒ©ă‚€ăƒ€ăƒŒă‚čテップです

What is it for?

  • Keeping a value within 0–1
  • Preventing positions or strengths from varying too far
  • Producing a safe value that cannot exceed a lower or upper bound

Overview

A safety node that confines a number to a specified range. Values outside the range stick to the nearest endpoint. It is typically placed immediately before a parameter input so that a runaway waveform or calculation cannot break downstream processing.

Usage tips

  • Choose between this node and remap by intent: Remap converts a range while preserving proportions; Clamp clips only the values outside a range. Use Clamp when values already inside the range must pass through unchanged.
  • Placing the Normalized preset before opacity and other 0–1 ratio inputs is the go-to setup.
  • You can also use the flattened out-of-range portions intentionally to cap a waveform and create a trapezoid-like shape.

Related nodes

  • remap — convert a range by compressing or expanding it
  • math_op — Min and Max can limit only one side
  • expression_float — write clamp() directly in an expression

Range presets

  • Normalized
    • The go-to preset for limiting a value to 0..1.
  • SignedNormalized
    • Suited to signed strengths such as -1..1.
  • Percent
    • Suited to percentage values from 0..100.
  • Count
    • Suited to counts or step counts from 1..16.
  • PixelOffset
    • Suited to pixel offsets from -32..32.
  • LargeOffset
    • Suited to larger offsets from -256..256.
  • Custom
    • Use this when you want min / max to define the clamp range.

Notes

  • When min > max, the node automatically swaps them before processing.
  • The output port is Number, but the value currently returned at runtime is Float.
  • For every preset except Custom, range_preset itself determines the evaluated clamp range. The selected preset remains authoritative even if saved data or PPL contains stale min / max values.
  • min / max are evaluated as the actual bounds only in Custom mode.
  • For fine adjustments, switch to Custom and use soft_min / soft_max / soft_step.

Examples

  1. range_preset = Normalized
    • Quickly creates a 0.0–1.0 range.
    • Useful for limiting opacity and ratio values.
  2. Keep the output of Noise Wave within 0.0–1.0
    • Useful when negative values or values above 1 must not pass downstream unchanged.
  3. Pass the result of Math Op(Add) through Clamp
    • Suppresses values that have grown too large through addition.
  4. Limit a value to 0–1 before Opacity
    • Keeps the opacity input within a safe range.
  5. range_preset = PixelOffset
    • Quickly creates a position-correction clamp from -32..32.
  6. Fix ratio inputs for Reveal or Trim to 0–1
    • Helps prevent glitches during animation.
Back to Node List
Clamp — PixPipeline Node Reference