Nes2Noise wrapper class for the Nes2 UGen
requires my BitOr plugin. available at http://www.fredrikolofsson.com/pages/code-sc.html
simplifies the interface for the [Nes2] ugen a little. provides standard ranges with clipping for all inputs. no need to deal with bitwise register calculations, though note that this class is a bit less cpu efficient than to use the standard Nes2.
see also [Nes2Triangle], [Nes2Square], [Nes2DMC]
*ar(trig, loopenv, envdecay, vol, short, freq, vbl)
trig - control or audio rate trigger
loopenv - loop envelope off or on 0/1
envdecay - envelope decay off or on 0/1
vol - volume 0-15
short - short mode off or on 0/1
freq - frequency 0-15
vbl - length counter 0-31
s.boot
{Nes2Noise.ar(Impulse.kr(2), 1, MouseX.kr(0, 1), MouseY.kr(0, 15))}.play
{Nes2Noise.ar(Impulse.kr(10), 0, 1, 10, MouseX.kr(0, 1), MouseY.kr(0, 15))}.play
{Nes2Noise.ar(Impulse.kr(2), 0, 0, 10, 0, MouseX.kr(0, 15), MouseY.kr(0, 31))}.play
{Nes2Noise.ar(Impulse.kr(4), SinOsc.kr([11, 8], 0, 0.5, 0.5)>SinOsc.kr(0.2, 0, 0.5, 0.5), 0, SinOsc.kr(0.1, pi, 0.5, 0.5)>0.1, 1, SinOsc.kr(0.25, 0, 20, 20).round(5)+1, 31)}.play
{Nes2Noise.ar(Dust.kr(30), 0, 0, LFNoise0.kr(3, 3.5, 3.5), LFNoise0.kr(3, 0.5, 0.5), LFNoise0.kr(3, 3, 4), LFNoise0.kr(0.3, 15.5, 15.5)).dup}.play