/usr/include/csound/Random.hpp is in libcsoundac-dev 1:6.10.0~dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | /*
* C S O U N D
*
* L I C E N S E
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef RANDOM_H
#define RANDOM_H
#include "Platform.hpp"
#ifdef SWIG
%module CsoundAC
%{
#include "Node.hpp"
%}
#else
#include "Node.hpp"
#include <random>
#include <cmath>
#include <cstdint>
#endif
namespace csound
{
/**
* A random value will be sampled from the specified distribution,
* translated and scaled as specified,
* and set in the specified row and column of the local coordinates.
* The resulting matrix will be used in place of the local coordinates
* when traversing the music graph.
* If eventCount is greater than zero, a new event will be created
* for each of eventCount samples,
* which will be transformed by the newly sampled local coordinates.
*/
class SILENCE_PUBLIC Random :
public Node
{
protected:
#if !defined(SWIG)
void *generator_;
std::uniform_int_distribution<std::int32_t> uniform_smallint_generator;
std::uniform_int_distribution<std::int64_t> uniform_int_generator;
std::uniform_real_distribution<> uniform_real_generator;
std::bernoulli_distribution bernoulli_distribution_generator;
std::geometric_distribution<> geometric_distribution_generator;
std::exponential_distribution<> exponential_distribution_generator;
std::normal_distribution<> normal_distribution_generator;
std::lognormal_distribution<> lognormal_distribution_generator;
public:
static std::mt19937 mersenneTwister;
#endif
public:
std::string distribution;
int row;
int column;
int eventCount;
bool incrementTime;
double minimum;
double maximum;
double q;
double a;
double b;
double c;
double Lambda;
double mean;
double sigma;
Random();
virtual ~Random();
virtual double sample();
virtual Eigen::MatrixXd getRandomCoordinates();
virtual void createDistribution(std::string distribution);
virtual void produceOrTransform(Score &score, size_t beginAt, size_t endAt,
const Eigen::MatrixXd &compositeCoordinates);
static void seed(int s);
};
}
#endif
|