Dear all. I am pretty new to SC and have had the fortune of the best teachers <3 and fantastic tutorials out there. But right now I am struggling with something I thought should be the simplest of tasks.
I have a txt file with comma-delimited data (numbers) that I want to use as input for pitches. To simplify the problem I chose freq/Hz. I want SC to read the file and to output these numbers sequentially as tones in a melody.
To simplify the problem, the file contains the following string:
I want this to work equivalent to
`Pbind(\freq, Pseq([382, 440, 440, 220, 880, 176, 576, 576, 1024, 1024, 3111, 440], 2), \dur, 0.5).play;`
When I evaluate the above, I get the desired result - a melody with those numbers in a sequence (played twice, where each note has a duration of 0.5s).
However, when I evaluate this:
Pbind(\freq, Pseq(CSVFileReader.readInterpret("numbers1csv.txt"), 2), \dur, 0.5).play;
for some reason, the tones are played in unison rather than as a sequence. And I don’t understand why. If I write
the post window in SC gives me
-> [ [ 382, 440, 440, 220, 880, 176, 576, 576, 1024, 1024, 3111, 440 ] ]
so here it seems the file is correctly parsed (including adding pretty blanks after the commas), but not when I use the Pbind/PSec.
I have a hunch I am missing something ridiculously simple but I’ve been struggling with this for a whole day now so I thought it’s time to ask. Any idea what I should do to get this work as I intended?
It would be much appreciated.