8000 chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG) · Issue #58 · ccrma/chugins · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG) #58
Open
@dbadb

Description

@dbadb

chuck 1.4.2 appears to have broken Spectacle and Multicomb (RNG) by undefining RAND_MAX.

Seems like an opportunity to modernize and decouple. Both chugins want a rand2f function.
Here's a simple+modern+portable one.

#include <random>
float rand2f (float min, float max)
{
    static std::mt19937 s_mt;
    static std::uniform_real_distribution<float> s_dist(0.f, 1.f);
    float x = s_dist(s_mt);
    return min + x * (max - min);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0