In ~/extempore/examples/external/granulator.xtm I find 11 occurrences of xtmX.
So I hunted around trying to find what that meant.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In extempore/runtime/llvmti.xtm at line 11895 we have a macro definition
for call-as-xtlang
In the same file at line 11921, 11922
we have:
(define xtmX call-as-xtlang)
(define $ call-as-xtlang)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In extempore/examples/core/audio_101.xtm
at line 81 to 105 we have:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; a simple example of "event" level control
;;
;; or how to to control DSP code from inside
;; a scheme temporal recursion
;; modify one of the examples from above
;; adding freq1 and freq2 into closure environment
(bind-func dsp
(let ((osc1 (osc_c 0.0))
(osc2 (osc_c 0.0))
(freq1 220.0)
(freq2 220.0))
(lambda (in:SAMPLE time:i64 channel:i64 data:SAMPLE*)
(cond ((= channel 1) (osc1 0.3 freq1))
((= channel 0) (osc2 0.3 freq2))
(else 0.0)))))
;; write accessor function for modification
;; of closure slots freq1 and freq2
(bind-func change_freq
(lambda (freq1 freq2)
(dsp.freq1:SAMPLE freq1)
(dsp.freq2:SAMPLE freq2)))
The example goes on to make a loop to change the frequencies randomly.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I notice that you can alter the dsp.freq1 and dsp.freq2 'by hand'
using four different methods:
($ (change_freq 330.0 335.0)) ; using $
(xtmX (change_freq 430.0 230.0)) ; using xtmX
(call-as-xtlang (change_freq 135.0 140.0)) ; using call-as-xtlang
(change_freq 440.0 445.0) ;; Maybe no need for the $ at all. Always?
I have a vague recall that 4th version above was a newer addition to the code
so the older versions are a legacy.
But I realise this is to do with the interaction between xtlang and Scheme.
Will the 4th version above ALWAYS work? Could the $ versions and the xtmX versions be
purged from all extempore code?
Would it be neater to leave out the various call-as-xtlang forms altogether?
Would extempore/runtime/llvmti.xtm compile if lines such as:
line 31 (xtmX (gran1.iot 2000)) ;; inter offset time between grains
be replaced by:
(gran1.iot 2000) ;; inter offset time between grains
I haven't tried it .........
Still plugging away trying to understand something of extempore .....
Regards
George