2019-07-13 20:42:46 +00:00
|
|
|
// Custom plugins
|
|
|
|
const std = @import("std");
|
|
|
|
const lv2 = @import("lv2_helpers.zig");
|
|
|
|
const plugins = @import("plugin.zig");
|
|
|
|
|
|
|
|
const c = lv2.c;
|
|
|
|
|
2019-07-13 20:49:09 +00:00
|
|
|
const RunBuffers = plugins.RunBuffers;
|
2019-07-13 20:42:46 +00:00
|
|
|
|
|
|
|
pub const RandomNoise = struct {
|
|
|
|
allocator: *std.mem.Allocator,
|
2019-07-13 20:49:09 +00:00
|
|
|
r: std.rand.DefaultPrng,
|
2019-07-13 20:42:46 +00:00
|
|
|
|
|
|
|
pub fn init(
|
|
|
|
allocator: *std.mem.Allocator,
|
|
|
|
) RandomNoise {
|
2019-07-13 20:49:09 +00:00
|
|
|
var r = std.rand.DefaultPrng.init(std.time.timestamp());
|
|
|
|
|
2019-07-13 20:42:46 +00:00
|
|
|
return RandomNoise{
|
|
|
|
.allocator = allocator,
|
2019-07-13 20:49:09 +00:00
|
|
|
.r = r,
|
2019-07-13 20:42:46 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-07-13 20:49:09 +00:00
|
|
|
pub fn run(self: *RandomNoise, bufs: *RunBuffers) void {
|
|
|
|
bufs.out[0] = self.r.random.float(f32);
|
2019-07-13 20:42:46 +00:00
|
|
|
}
|
|
|
|
};
|