| Crates.io | oscy |
| lib.rs | oscy |
| version | 0.1.1 |
| created_at | 2026-01-09 14:36:00.535667+00 |
| updated_at | 2026-01-10 15:18:49.933284+00 |
| description | Minimalistic Rust library for audio oscillators supporting common waveform shapes. |
| homepage | |
| repository | https://github.com/paramako/oscy |
| max_upload_size | |
| id | 2032192 |
| size | 23,776 |
A Rust library for audio oscillators and waveform generation.
| Oscillator | Description |
|---|---|
NaiveOsc |
Simple oscillator without anti-aliasing. Fast but produces aliasing at higher frequencies. |
PolyBlepOsc |
Band-limited oscillator using polyBLEP for reduced aliasing. |
| More | Additional implementations planned. |
use oscy::{poly_blep::PolyBlepOsc, Oscillator, Waveform};
let mut osc = PolyBlepOsc::new(44100.0, 440.0, Waveform::Saw);
let mut buffer = [0.0f32; 512];
osc.fill(&mut buffer);
use oscy::{poly_blep::PolyBlepOsc, Waveform};
let osc = PolyBlepOsc::new(44100.0, 440.0, Waveform::Square);
let samples: Vec<f32> = osc.take(1024).collect();
Use NaiveOsc when performance is critical and aliasing is acceptable (e.g., low frequencies, or when followed by filtering). Use PolyBlepOsc for cleaner sound at higher frequencies.
use oscy::{naive::NaiveOsc, poly_blep::PolyBlepOsc, Oscillator, Waveform};
// Naive: simple and fast, but aliases
let mut naive = NaiveOsc::new(44100.0, 2000.0, Waveform::Saw);
// PolyBLEP: smooths discontinuities to reduce aliasing
let mut blep = PolyBlepOsc::new(44100.0, 2000.0, Waveform::Saw);
MIT License - see LICENSE for details.