Menu

Programread syntax problem

Help
14 hours ago
15 minutes ago
  • Roger Jönsson

    Roger Jönsson - 14 hours ago

    Am I doing one line stunts that I shouldn't do with Programread and was just lucky the first time?
    This plays correctly, "voice1_out" address is added twice because it is a byte value selecting words in the DATA block:
    Programread(@ulawDecodeTable+Voice1_out+Voice1_out, SAMPLEOUTword) //=Ok!

    These variants does not work:
    (just adding zero to the address fails)

    • Programread(@ulawDecodeTable+Voice1_out+Voice1_out+0, SAMPLEOUTword) //distortion or nothing
      .
      (Adding brackets fails:)
    • Programread(@ulawDecodeTable+(Voice1_out+Voice1_out), SAMPLEOUTword) //twice the speed or nothing
      . (Indicating that adding brackets makes the value of Voice1_out+Voice1_out doubled)
      .
      (multiplying Voice1_out by two instead of Voice1_out+Voice1_out fails:)
    • Programread(@ulawDecodeTable+Voice1_out*2, SAMPLEOUTword) //twice the speed or nothing
      . (Indicating that Voice1_out * 2 adds twice as much as Voice1_out+Voice1_out)
      .
      Different approach, with a solution (starting reading at+4608, could be zero or what ever) :
      This fails:
    • Programread(@ulawDecodeTable+Voice1_out+Voice1_out+4608, SAMPLEOUTword) //nonsense/distortion
      .
      This works and I guess this is more like the proper way to do it?:
    • voice1outulawaddress=Voice1_out+Voice1_out+4608
    • Programread(@ulawDecodeTable+voice1outulawaddress, SAMPLEOUTword)
     

    Last edit: Roger Jönsson 2 hours ago
  • Anobium

    Anobium - 38 minutes ago

    You have figured this out. Well done.

    Send me the code will the five example. It will be interesting to see what is happening.

     
  • Roger Jönsson

    Roger Jönsson - 15 minutes ago

    Ok, so you don't mean my attempts were violations of sanity, then.
    I will send you my full code, but it may be hard to examine, since things are going on inside an interrupt triggered externally. (When I get some time off I can try to boil it down to something smaller, easier to examine.)

     

Log in to post a comment.

MongoDB Logo MongoDB