justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[newer questions][unreplied] | [replied] | [recent comments] | [all]
[older questions]

Question: why is reaWASAPI tagged as "experimental"? do you personnaly use it?
Asked by frenchos (46.218.205.x) on February 6 2013, 5:08pm
Reply on February 7 2013, 2:49am:
    Sometimes, but it can be finicky to get it to work right depending on the hardware, exclusive/shared modes, etc.
Comment...
Question: The tracker seems to have ground to a halt. Elevated FRs seem forgotten as nothing happens with them?
Asked by Tinny (88.207.125.x) on February 6 2013, 9:52am
Reply on February 6 2013, 3:08pm:
    Yeah, the tracker isn't terribly enjoyable to use as a developer. :/
Comment...
Question: Does raping the tertiary operator produce faster machine code than writing legible code (the later version)?
Asked by Will (70.173.150.x) on February 6 2013, 8:35am
Reply on February 6 2013, 2:43pm:
    I don't think so, but part of me wanted the two-line f().
Comment...
Question: There was talk a while back about creating an open source plugin SDK, to get around the VST restrictions, and progress on that?
Asked by Mick (203.149.85.x) on February 6 2013, 2:47am
Reply on February 6 2013, 4:13am:
    Not enough of a point, VST is just lenient enough to make it not worth bothering I think.
Comment...
Question: What's a good algorithm to display a binary tree from the top down one level at a time left to right?
Asked by Will (24.234.85.x) on February 5 2013, 10:34pm
Reply on February 6 2013, 4:11am (edited at February 6 2013, 4:37am):
    The obvious way I'd imagine doing it would be O(N*log(N)), which seems reasonable enough I guess?
    f(h, level) {
        if (level == 0) print(h); // h might be null
        return h && level >= 0 ? level==0 ? 1 : f(h.left,level-1) + f(h.right,level-1) : 0;
    }
    
    l=0;
    while (f(tree,l++)) print("\n");
    
    Edit: updated to print null leaves for levels that are printed...
    Edit: further updated to overuse the tertiary operator. Regretting this, here is the less obfuscated version:
    f(h, level) {
        if (level < 0) return 0;
        if (!h) {
            if (level == 0) print("(null)");
            return 0;
        }
        if (level == 0) {
            print(h);
            return 1;
        }
        return f(h.left,level-1) + f(h.right,level-1);
    }
    
    l=0;
    while (f(tree,l++)) print("\n");
    
Comment...
Question: I want to make function which returns input data shifted by x samples (like plugin latency)
Asked by Franci (46.122.98.x) on February 5 2013, 6:57pm
Reply on February 6 2013, 4:02am (edited at February 6 2013, 4:03am):
    Ah, like a FIFO queue? How about:
    class delay {
        double *m_buf;
        int m_len,m_pos;
    public:
        delay(int len) { m_len=len; m_buf=(double*)calloc(sizeof(double),len); m_pos=0; }
        ~delay() { free(m_buf); }
        double process(double in) {
            double ret=m_buf[m_pos];
            m_buf[m_pos]=in;
            if (++m_pos>=m_len) m_pos=0;
            return ret;
        }
    };
    
Comment...
Question: I am trying to program a function which would create a latency on buffer - any ideas where to get an example code ?
Asked by franci (86.61.125.x) on February 3 2013, 5:52pm
Reply on February 4 2013, 11:31pm:
    You want to create a delay line?
Comment...
Question: Have you ever wanted to own a tractor?
Asked by Pinkaso (208.64.185.x) on February 2 2013, 4:59pm
Reply on February 4 2013, 11:31pm:
    I can't say that I have.
Comment...
Question: Did you coin the phrase "skin" for custom UI graphics? If not, where'd you get it?
Asked by Will (70.173.150.x) on February 2 2013, 5:27am
Reply on February 2 2013, 2:32pm:
    We took the term which was used for Quake characters and applied it to UI graphics.. Not sure if it was the first time that was done, but Quake's use of the term was the inspiration.
Comment...
Question: Re: 6k loc. so what you're saying is that i have to beat you too! LOL. I take the argument back -♥- Any plans for something new?
Asked by gio (94.66.27.x) on January 31 2013, 4:49pm
Reply on February 2 2013, 2:31pm:
    Working on a cool inevitable feature for REAPER at the moment. Trying to keep my function size down... ;)
Comment...
Question: is it possible to explain LICE_GradRect(...) a little bit? thanks
Asked by gio (94.66.27.x) on January 31 2013, 1:17pm
Reply on January 31 2013, 4:15pm:
    Sure. LICE_GradRect lets you draw gradients.
    void LICE_GradRect(LICE_IBitmap *dest, int dstx, int dsty, int dstw, int dsth,
                          float ir, float ig, float ib, float ia,
                          float drdx, float dgdx, float dbdx, float dadx,
                          float drdy, float dgdy, float dbdy, float dady,
                          int mode);
    
    dstx-dsth: position/size of rectangle
    ir-ia: RGBA values [0..1] at top left
    drdx-dadx: RGBA deltas (per pixel) moving towards right.
    drdy-dady: RGBA deltas (per pixel) moving towards bottom.

    So, for example:
          LICE_GradRect(framebuffer,0,0,100,100,
              0,0,0,1.0,
              1.0 * 0.01,0.5 * 0.01,0.0 * 0.01,0.0,
              0.0 * 0.01,0.5 * 0.01,1.0 * 0.01,0.0, LICE_BLIT_MODE_COPY);
     
    This will make a 100px square, which is black at the top left, orange (full red, half green) top right, blueish on the bottom left (full blue, half green), and white in the bottom right. The 0.01 multipliers on the deltas reflects the size of the rectangle (1.0/100.0).
Comment...
Question: how is brennan doing? his site is down, i always thought he is a cool guy. loved winamp3 with all faults, etc. { good times } :)
Asked by gio (94.66.27.x) on January 31 2013, 11:53am
Reply on January 31 2013, 4:16pm:
    Hmm we should let him know this, I think his ISP had to change his static IP and he needs to update his DNS.
Comment...
Question: At the opposite desk I have the guy who wrote a function with around 6000 loc. Should I beat him? :s
Asked by gio (94.66.27.x) on January 31 2013, 7:52am
Reply on January 31 2013, 4:19pm:
    Hm I have plenty of 11,000 line functions for which I despise myself. To be fair they are usually giant switch() statements for commands etc.
Comment...
Question: tinyurl.com/amn36wb ::funny and since you love STL you'll like it (hope so). So, is STL that good overall? o_0
Asked by gio (94.66.88.x) on January 30 2013, 6:41pm
Reply on January 30 2013, 8:22pm:
    I'm no fan of STL, but that clearly seems to be a case of bad use of STL rather than STL being inherently bad. Having said that, STL does seem very easy to use poorly.
Comment...
Question: Who is the most famous person you've met?
Asked by Dave (69.15.110.x) on January 30 2013, 5:47pm
Reply on January 30 2013, 8:24pm:
    Hmm Nick Offerman was a couple of rows behind me on a flight this past summer... The best part was, when we were deplaning, I got to call him ""sir."
Comment...
Question: Ever played with Python or Ruby? Any thoughts?
Asked by Will (70.173.150.x) on January 29 2013, 4:26pm
Reply on January 30 2013, 1:37pm:
    I've done a little bit of Python.. I was mostly turned off by how important whitespace ends up being, but that's mostly just me being crotchety and I am not used to it. Anyway, would need some actual project to do in one of these to really dive in.
Comment...
Question: Maybe WASTE will make a comeback? yro.slashdot.org/story/13/01/28/1645252/how-proxied-torrents-cou...
Asked by Will (24.234.85.x) on January 28 2013, 8:10pm
Reply on January 30 2013, 1:38pm:
    Meh... it could be done in a much broader, better distributed fashion (like email), and could be interesting. I've been sort of designing a system for that, but am feeling quite lazy.
Comment...
Question: Any advice on getting through dense technical books?
Asked by travis (70.178.147.x) on January 28 2013, 10:52am
Reply on January 30 2013, 1:38pm:
    Can't say that I've gotten through many myself.
Comment...
Question: How many lines of codes in NINJAM? Did you use various programming languages?
Asked by French Engineeri (90.38.38.x) on January 27 2013, 9:57pm
Reply on January 30 2013, 1:39pm:
    Not that many. It is GPL, you can read it, the core stuff is probably 8000 lines or so. All C++.
Comment...
Question: Can you elaborate on why Java is proprietary? (I'm not a Java advocate, just noticed you mentioned it negatively more than once)
Asked by Will (70.173.150.x) on January 27 2013, 5:05pm
Reply on January 27 2013, 7:11pm:
Comment...
[newer questions][unreplied] | [replied] | [recent comments] | [all]
[older questions]
Copyright 2025 Justin Frankel. | RSS