[CM] snd-rt <slider> naming problem
border
border at breakz.be
Wed Apr 2 16:14:50 PDT 2008
hi,
I'm working on a model of a tibetan singing bowl with additive synthesis
and I'm trying to write a few functions assisting me with it.
The following function is supposed to take a list of arbitrary length as
argument and is creating a sinus with a few sliders from each element in
the list. The list is as follows:
((frequency amplitude frequency_slider_name amp_slider_name) ...)
so for each list of four elements it should create a sinus with the
given frequency, amplitude and names of the slider.
But the problem is that the <slider> object only accepts strings, not
expressions which evaluate to a string (or so it would seem to me) and
also no variables containing a string.
How am I going to get past that problem?
the error I get is thus:
string-append: wrong-type-arg: Wrong type (expecting "string"): freqname
(freqname)
but if I use string-append like this:
(let ((freq "freq")
(amp "amp"))
(print (string-append freq amp)))
it works?!?! prints --> "freqamp"
My code is the following:
(definstrument (oscillatorbank oscillators)
(define-multi-instrument-rt-dialog)
(define* (oscillator-rec oscillators)
(if (null? oscillators)
#t
(let*
((oscillator1 (car oscillators))
(freq (car oscillator1))
(amp (car (cdr oscillator1)))
(freqname (car (cdr (cdr oscillator1))))
(ampname (car (cdr (cdr (cdr oscillator1))))))
(begin (<rt-out> (* (oscil* (<slider> freqname (- freq 1) freq (+
freq 1)))
(<slider> ampname 0 amp 1 :log #t)))
(oscillator-rec (cdr oscillators))))))
(oscillator-rec oscillators))
(define oscilbank (oscillatorbank '((57.20 0.1 "freq1" "amp1") (175.63
0.1 "freq2" "amp2") (343.89 0.1 "freq3" "amp3"))))
anyone any hints?
thanks
More information about the Cmdist
mailing list