Tuesday, January 10, 2012

Galbanum Waveforms

About a week ago, I purchased the Galbanum Architecture waveform pack on a really insistent impulse. For forty bucks, I downloaded 25,000 waveforms in wav32 format which are 2048 samples each. Besides offering many variations on classic waveforms like square, saws, and triangle waves, they also have a set of unusual waves. Many hours of experimentation lie ahead of me.

The problem is, how do I test each one? Waveforms are organized into different folders. Originally, I would go into a folder, load up a sample one by one in Renoise, and loop them. This was a time consuming effort.

Today, I figured out a way to do that in Csound.
<CsoundSynthesizer>
<CsOptions>
-odac
-M1
--midi-key-pch=4
</CsOptions>
<CsInstruments>
sr = 96000
ksmps = 10
nchnls = 1
0dbfs = 1
alwayson 2
instr 2

gktbl init 1
imax = 40
kkey sensekey

if kkey == 106 then ;go down if 'j' is pressed
gktbl = gktbl - 1
elseif kkey == 107 then ;go down if 'k' is pressed
gktbl = gktbl +1
endif

;cycle through the waveforms. if it reaches the end function tables, go to the beginning
if gktbl < 1 then
gktbl = imax
elseif gktbl > imax then
gktbl = 1
endif
if kkey == 32 then
printk2 gktbl
endif
endin

instr 1
;de-click the sounds
kpad linsegr 0, .01, 1, .01, 0
a1 oscil3 .3*kpad, cpspch(p4), i(gktbl)
out a1
endin

</CsInstruments>
<CsScore>
#include "tables" ;python generated file which contains 40 function tables with the waveforms
f 0 3600 ;stay open for an hour
</CsScore>
</CsoundSynthesizer>


The first thing I did was automatically generate all the wavetables to load up in Csound. With some google-fu and python, I created a file called "tables" which generated 40 function tables that could be loaded up into Csound. Each function table is a different waveform in the folder. To give you a sense of what these function tables look like, here is an example of one:

f1 0 2048 1 "Cos Saw.wav" 0 0 0

The synth itself is just an oscillator with some volume padding to prevent clicks. Just enough to get an idea of what the waveform sounds like. It takes realtime midi input from my USB keyboard, and I made it so the J and K keys would cycle through the waveforms. Pressing the space bar returns the function table number in the terminal window.

Hopefully this will be a useful tool for browsing through these waveforms!

No comments:

Post a Comment