The idea with GEN23 is that you can load all your data to a function table directly and then use it any way you wish. The example uses amp/freq data but you may do anything you wish with it. I don’t quite follow what you are trying to do? It’s simple to use the data from your text files as a signal’s waveform:
<Cabbage>
form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginID("def1")
keyboard bounds(8, 158, 381, 95)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr 1
kEnv madsr .1, .2, .6, .4
aOut oscili p5, p4, 1
outs aOut*kEnv, aOut*kEnv
endin
</CsInstruments>
<CsScore>
f1 0 16384 -23 "data.txt"
;causes Csound to run for about 7000 years...
f0 z
</CsScore>
</CsoundSynthesizer>
I’m not sure what way you wish to use the data to sequence the track? You could for example do something as simple as(note, it’s doesn’t sound the best!)
<Cabbage>
form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginID("def1")
keyboard bounds(8, 158, 381, 95)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1
;instrument will be triggered by keyboard widget
instr 1
kCnt init 0
if metro(2)==1 then
kFreq tab kCnt, 1
event "i", 2, 0, 1, kFreq*1000, .5
kCnt = kCnt<ftlen(1) ? kCnt+1 : 0
endif
endin
instr 2
kEnv madsr .1, .2, .6, .4
aOut oscili p5, p4, 1
outs aOut*kEnv, aOut*kEnv
endin
</CsInstruments>
<CsScore>
f1 0 16384 -23 "data.txt"
;causes Csound to run for about 7000 years...
f0 z
</CsScore>
</CsoundSynthesizer>
There is obviously lots of aliasing when you fill a waveform with your data so you may well have to explore other options. For example, if you set your table size to 128 it sound much better. You could also use map the numbers to frequencies from a tempered tuning system rather than directly mapping to hertz values as I’ve done.