Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 896 Bytes

README.md

File metadata and controls

45 lines (35 loc) · 896 Bytes

mozu

synth

Examples

click to play↓!

#include <mozu>
#include <cmath>
using namespace mozu::prelude;

auto main() -> int {
  hertz(c4()) >> sin >> mul(30000) >> cut(1_s) >> save("sine.wav");
}

click to play↓!

#include <mozu>
#include <cmath>
using namespace mozu::prelude;

auto main() -> int {
  auto lfo = hertz(c4() / 20) >> sin >> mul(100);
  hertz(c4() * 2 + std::move(lfo)) >> sin >> mul(30000) >> cut(3_s) >> save("vibrato.wav");
}

click to play↓!

#include <mozu>
#include <cmath>
using namespace mozu::prelude;

auto main() -> int {
  auto sine = hertz(c4()) >> sin >> mul(30000);
  auto quantize = [](double x) -> double {
    return int(x) / 10000 * 10000;
  };
  std::move(sine) >> quantize >> cut(1_s) >> save("quantize.wav");
}