Cabbage Logo
Back to Cabbage Site

Searching for an easy way to implement and sonify datasets

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.

@rorywalsh once again, thank you!
(at least for) now my confusion is gone because i can actually hear something! no idea, what was the problem. perhaps i’m still a noob. :smiley: i am getting an idea of it and will work on finding a fitting sonification of my data.

[quote=“rorywalsh, post:19, topic:258”]
It’s not going to sound anything like an earthquake but should be interesting all the same!
[/quote]aye, that’s what it’s all about. pure data translated ‘somehow but nicely’. earlier, when the sound suddenly befell my room it scared me quite a bit! subconscious apprehension and recognition.

[quote=“rorywalsh, post:21, topic:258”]
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.
[/quote]okay, maybe i’ll come back to this later. not sure yet if i have to adapt my earthquake-data. tempered tuning could get useful at other concepts.