Instruments: PhaseShaper Update and b64 Release

Hi All,

After working the PhaseShaper instrument I announced some days ago I
found some bugs in the coding of the instrument and now have them
fixed up.  I have also packaged together my b64 instrument which was
inspired by the SID sound chip commonly found in Commodore 64’s.  Both
are available for download as a zip with CSD’s and blue projects, and
updated MP3 examples for PhaseShaper and new MP3 examples for b64 are
availble at:

http://www.csounds.com/stevenyi

These instruments are also available directly within blue from blueShare.

Thanks and enjoy!
steven

new opcodes

New opcodes in CVS

ihandle, ktime    pvsbuffer       fsig, ilen
fsig                      pvsbufread   ktime, khandle[, ilo, ihi]

This pair of opcodes make up a circular buffer read/write pair
for streaming PV signals.

The first  sets up and writes to a circular buffer of length ilen (secs),
giving a handle for the buffer and a time pointer, which holds the
current write position (also in seconds).

The second opcode reads from the circular buffer specified by
khandle at a time position determined by ktime (secs). It can
read the whole set of PV bins or a subset defined by the
freq interval  (ilo, iho).

With these opcodes it is possible to, among other things:
1) time-stretch/compress a fsig stream, by reading it at
different rates
2) delay a fsig or portions of it.
3) ‘brassage’ two or more fsigs by switching buffers, since
the reading handles are k-rate. Note that, when using k-rate
handles, it is important to initialise the k-rate variable to a
given handle (so that the fsig initialisation can take place)
and it is only possible to switch handles between compatible
fsig buffers (with the same fftsize and overlap), eg.

fsig1   pvsanal   asig1,1024,256,1024,1
fsig2   pvsanal   asig2,1024,256,1024,1

ibuf1,kt1   pvsbuffer   fsig1, 10  ; 10-sec buf with fsig1
ibuf2,kt2   pvsbuffer  fsig2, 7      ; 7-sec buf with fsig2

khan init ibuf1    ; initialise handle to buf1

if  ktrig  > 0 then   ; switch buffers according to trigger
khan = ibuf2
else
khan = ibuf1
endif

fsb  pvsbufread  kt1, khan   ; read buffer

Now in CVS (should be there in the next release);
man page coming soon.

Victor

new opcodes (diskgrain, pvsdiskin) in CVS

Responding to a request by Jonathan Murphy, I have added a couple
of new opcodes that read directly from disk. Now you can timestretch
your favourite Wagner opera.

DISKGRAIN, a version of syncgrain that reads from disk

asig diskgrain    Sfname, kamp,kfreq,kpitch,kgrsize,kprate,ifn,iolaps[,ioffset,imaxgrsiz]

SFname is the source soundfile name in double-quotes
kamp,kfreq,kpitch,kgrsize,kprate,iolaps  as in syncgrain
ifn is the envelope function table
ioffset is the start offset in secs from the beginning of the file (default 0)
imaxgrsize is the maximum grainsize in secs, used for buffer allocation (default 1.0)

example:
iomax = 2
kol = 2            /* number of overlapped grains */
kgr = 0.05         /* grain size in secs */
kfr = kol/kgr      /* freq or density in gr/sec */
kps = 1/kol        /* pointer rate scaling */

asig diskgrain  “Rheingold.wav”,150/kol, kfr, 1, kgr, kps,3, iomax

   out   asig

PVSDISKIN, a wrap-around pvocex file reader

fsig  pvsdiskin  Sfname,ktimescale, kgain[,ioffset, ichannel]

Sfname is the pvocex file name.
ktimescale controls the readout pointer speed (1 is normal speed, < 1 slower (timestretch),
> 1 faster (timecompress), negative is backwards)
ioffset is the start offset (secs, default 0)
ichannel is the channel number for multi-channel files (default 1)

example:
fsig pvsdiskin “Siegfried.pvx”,1,0.5,0,2
aout pvsynth fsig

    out aout

Now in CVS. Manual page to follow soon (well, hopefully…)

Victor

Victor Lazzarini
Music Technology Laboratory
Music Department
National University of Ireland, Maynooth