vitreo12 / omni

DSL for low-level audio programming.
https://vitreo12.github.io/omni/
MIT License
188 stars 6 forks source link

min / max values for ins #26

Closed vitreo12 closed 4 years ago

vitreo12 commented 4 years ago

The @min @max will be set inside the in1, in2, etc. templates:

const in1_min = 0.0
const in1_max = 1.0

proc in1_min_max[T : SomeFloat](in1 : T) : T =
    if in1 < in1_min: return T(in1_min)
    elseif in1 > in1_max: return T(in1_max)
    else: return in1

template in1() : untyped =
    in1_min_max(ins_Nim[0][audio_index_loop])
vitreo12 commented 4 years ago

Default value is actually set in wrapper / host. Export a "suggestion" with IO.txt

vitreo12 commented 4 years ago

Proposed interface:

ins 2, {440, 1, 22000}, {0, 1}

ins 2:
    {440, 1, 22000}
    {0, 1}

ins 2:
    "freq"  {440, 1, 22000}
    "phase" {0, 1}

When 3 values, the first is the default, the other two are min/max. When 2 values, they are just min/max

vitreo12 commented 4 years ago

56