[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Re: Buffer allocation



Sorry, having a bit of trouble with my mail server, below is my original
question and your response.

Cheers,

/S

On Dec 14, 2008, at 2:27 PM, saul@xxxxxxxxxx wrote:

		~bufCh =  ~ exSamples_Buf[temp].bufnum;

		~bufLen = ~ exSamples_Buf[~bufCh].numFrames/44100;

Since temp is the index into the array, you should use temp consistently.

The problem is, maybe ~exSamples_Buf[temp].bufnum == temp, but maybe not.
If it's not equal, then ~bufLen is basically garbage.

hjh


: H. James Harkins
: jamshark70@xxxxxxxxxxxxxxxxx
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman
Hi All,

I have an issue with loading multiple samples into buffers.

Firstly I am loading all the samples from a directory into an array of
buffers:

//create an array containing the filenames in the directory
~exSamples ="sounds/frontpage/exspressoBrkRingDel/*".pathMatch;

// make an array of buffers
~ exSamples_Buf = ~ exSamples.collect({ arg i;Buffer.read(s, i);});

I am then playing them back through a task with the wait time dependent on
the length of each sample:

~t1 = Task({
		inf.do({ | i | var temp;

		temp = i % 29;

		~bufCh =  ~ exSamples_Buf[temp].bufnum;

		~bufLen = ~ exSamples_Buf[~bufCh].numFrames/44100;

		~bR1 = Synth.tail(~inputGroup, "sample", ["bufnum", ~bufCh , "rel",
~bufLen, "rate", [1, 0.5, -1].wchoose([0.90, 0.9, 0.01]), "busOut",
[12, 16].wchoose([0.95, 0.05])]);

		~bufLen.wait;

		});
	});

~t1.start;

This works fine on its own, but as soon has I allocate any other buffers,
the above task partially plays the array of buffers and then give the
error:

ERROR: Message 'numFrames' not understood.

The size of the array seems constant and buffer allocation appears
sequential?

Any help much appreciated,

Cheers,

Saul





> Unfortunately, by now I've lost the original message and I don't
> remember what your code looked like.
>
> hjh
>
> On Dec 21, 2008, at 4:39 PM, saul@xxxxxxxxxx wrote:
>
>>
>> Thanks  James for your quick response.
>>
>> This leads me to questioning some of my basic understanding.
>>
>> temp is the index of the array, but I assumed that .bufnum gave the
>> allocation number of that buffer regardless of the order in which
>> it was
>> loaded. So it should not matter if  ~bufCh == temp or not. ~bufCh
>> should
>> be the bufnum of a buffer at index temp?
>>
>> Obviously this is not correct so were am going wrong?
>>
>> I also assumed that .free would remove the the buffers, but again this
>> does not happen quit has I expected, new buffer still get
>> allocation after
>> the just freed buffers.
>>
>>
>> Thanks again,
>>
>> Saul
>>
>>
>>
>> _______________________________________________
>> sc-users mailing list
>>
>> info (subscription, etc.): http://www.beast.bham.ac.uk/research/
>> sc_mailing_lists.shtml
>> archive: https://listarc.bham.ac.uk/marchives/sc-users/
>> search: https://listarc.bham.ac.uk/lists/sc-users/search/
>
>
> : H. James Harkins
> : jamshark70@xxxxxxxxxxxxxxxxx
> : http://www.dewdrop-world.net
> .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
>
> "Come said the Muse,
> Sing me a song no poet has yet chanted,
> Sing me the universal."  -- Whitman
>
>



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/