Sources -- https://github.com/fairplay/pixilang
Usage:
Code: Select all
// Include library
include "embe.pixi"
// Create 3 oscillators
// Other oscillators types: osc_sine, osc_saw, osc_noise
// osc_noise takes only one argument -- amplitude (from 0 to 1)
$o1 = osc_sqr(220, 0.2)
$o2 = osc_sqr(293, 0.2)
$o3 = osc_sqr(330, 0.2)
// Create a mixer
$m = mix()
// Join oscillators to the mixer
j($m, $o1)
j($m, $o2)
j($m, $o3)
// Create low pass filter
// with cutoff frequency = 110Hz and resonance = 33%
$f = flt_lp(110, 33)
// Join mixer to the filter
j($f, $m)
// Run audio from our filter (filtered A-minor chord)
out($f)
Everything is dirty, noisy, 8-bitty, without interpolations and antialiasings. And, probably, dsp-code contains some nasty errors.
It was fun to implement OOP in Pixilang.