Skip to content

File maytrig.h

File List > DaisySP > Source > Utility > maytrig.h

Go to the documentation of this file

Source Code

/*
Copyright (c) 2020 Electrosmith, Corp, Paul Batchelor

Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/

#pragma once
#ifndef DSY_MAYTRIG_H
#define DSY_MAYTRIG_H

#include <stdint.h>
#ifdef __cplusplus

namespace daisysp
{
class Maytrig
{
  public:
    Maytrig() {}
    ~Maytrig() {}
    inline float Process(float prob)
    {
        return ((float)rand() / (float)RAND_MAX) <= prob ? true : false;
    }

  private:
};
} // namespace daisysp
#endif
#endif