Welcome to %s forums

BrainModular Users Forum

Login Register

Sampler File List Item Count

I need help on a Patch
Post Reply
CleverConQueso
Member
Posts: 190
Contact:

Unread post by CleverConQueso » 21 Jul 2011, 21:08

Folks-
I've got a comma separated text box with a list of paths to sample files feeding the 'List Comma Text' input of a sampler. Rather than use the 'next sample' or 'random sample' commands, I want to be able to use a formula to randomly select the next sample to play and choose its file number. This would be based on the total number of files that are loaded to the sampler and each time the app refreshes, the file count will change. So my question is this -

Does anyone know if there is any way to get an item count from the list text object?
- OR -
Does anyone know if there is a way to get the number of files that are loaded to a sample player?

Thanks,
- CCQ -

23fx23
Member
Posts: 2545
Contact:

Unread post by 23fx23 » 21 Jul 2011, 21:57

it's possible to get the nb of elmts of a commatext via a simple a script .
im away from usine so i ll do it by memory, sorry if doesn't work at first, i can't check.
i ll check when back home. copy and paste to a new empty sript and compile.

Code: Select all

////////////////////////////
Var Commain,NBITEMS : tparameter;
Var SL1: Tstringlist;
//////////////////////////////
Procedure Init;
Begin
commain:= CreateParam('commain',Pttextfield);Setisoutput(commain,false);
NBitems:=CreateParam('NBitems',ptdatafield);SetisInput(NBITEMS,false);
SL1:=Tstringlist.Create;
SL1.commatext:=' ';
END;
///////////////////////////////////////////////////////////
Procedure Callback (n:integer);
BEGIN

SL1.commatext:= getstringvalue(COMMAIN);
setvalue(NBITEMS,SL1.count);

END;
/////////////////////////////////////

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 21 Jul 2011, 22:07

crazy boy !
yes, works fine ;)


CleverConQueso
Member
Posts: 190
Contact:

Unread post by CleverConQueso » 22 Jul 2011, 01:35

Holy crap! That's awesome and works great. Thank you so much.
-CCQ-

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests