vitreo12 / omni

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

table #132

Open vitreo12 opened 4 years ago

vitreo12 commented 4 years ago

static compilation of tables

#sine table
table sineTable 1024:
    return sin((i / 1023.0) * twopi)
vitreo12 commented 3 years ago

Internally, const + block is the way to go:

const mytable : array[100, float] = block:
  var t : array[100, float]
  for i in 0..<100:
    t[i] = float(i)
  t