Waveform expressions?

    Nov 22 2013 | 1:12 pm
    Hello, I am trying to create functions for generating waveforms outside of the signal domain using the expr object. Sine was simple enough to achieve with: expr sin (2 * 3.14159 * $f1 * 0.05)
    I would like to make a square/pulse, triangle, and saw wave with the same method, but am having a difficult time doing so.
    Can anyone help me?

    • Nov 22 2013 | 8:01 pm
      Paging dr. Roman! Paging dr. Roman!
      In the meantime, I think I can improve your code there.
      Here's something to get you started:
    • Nov 22 2013 | 8:04 pm
      That is fantastic! Thank you very much!!!
    • Nov 22 2013 | 9:03 pm
      any time - this was fun! :)
    • Nov 23 2013 | 3:17 am
      (damn, where is the post i just sent?)
      @njosnari: what is your aim? what are the input and output ranges you need?
      @wetterberg:expr 5%12 should work, it is just not officially supported. otherwise use ($f1-int($f1/$f2)*$f2).
    • Nov 23 2013 | 4:55 pm
      I'm doing some modulation, and I'm trying to keep it out of the signal domain to conserve some cpu. The input and output ranges aren't so important, mostly they're being kept between 0 and 1 and then scaled to 0 - 4095 before leaving the patch via a DA convertor.