First time here? Check out the FAQ!
x

How do I trigger multiple multisampleclouds independently with modulo arithmetic?

+1 vote
675 views

I'm trying to index 3 different folders of samples with 3 multisampleclouds and gate them individually with !PenDown. On the first !PenDown I only want to work with the first multisamplecloud, on the second !PenDown I only want to work with the second multisamplecloud and so on.

I understand the index parameter field of the multisampleclouds is what I need to work on but I haven't been able to get the expression quite right. How do I trigger only one mulitsamplecloud at a time using modulo arithmetic and !PenDown?

Thanks for any thoughts or suggestions!

http://kyma.symbolicsound.com/qa/?qa=blob&qa_blobid=3263287093531238935

asked May 29, 2017 in Capytalk & Smalltalk by will-klingenmeier (Adept) (1,270 points)
edited Jun 9, 2017 by will-klingenmeier

1 Answer

+2 votes
 
Best answer

How about

SampleCloud1: (!PenDown nextIndexMod: 3) eq: 0

SampleCloud2: (!PenDown nextIndexMod: 3) eq: 1

SampleCloud3: (!PenDown nextIndexMod: 3) eq: 2

The good thing about nextIndexMod: is that it starts at -1 (unlike countTriggersMod:), so the first SampleCloud is only triggered at the first !PenDown.

BTW You can also use a Replicator and:

(!PenDown nextIndexMod: ?NumberVoices) eq: (?VoiceNumber - 1)

 

Best,

Gustav

answered May 29, 2017 by kymaguy (Virtuoso) (10,580 points)
selected May 30, 2017 by will-klingenmeier
Hello Will,
From your description,
"The first two !PenDown I get what I expect but on the third !PenDown I only get one sample that's not even part of the third arithmetic expression."
it sounds like you may have fewer than 47 files listed.  (If you generate an Index outside the range, it will stick on the last file listed, which may be what is happening here).
Have you listed each file individually or are you using a Smalltalk expression to retrieve all the filenames from a folder?  If you're using a Smalltalk expression, select it and use Ctrl+Y to evaluate it so you can check the list of files and count how many are there. It's possible that you are pointing to a file of the same name in a different folder than you expected.
Thanks. I was thinking that it might be something like that and just put it to the test. I'm using this Smalltalk expression to retrieve the filenames:

{'nameofsample1.wav' sampleFileNamesInSameFolder}
{'nameofsample2.wav' sampleFileNamesInSameFolder}
{'nameofsample3.wav' sampleFileNamesInSameFolder}

The evaluation revealed that all 47 files are there.

As a test, I individually listed each filename and that gave me the desired result.

Is there something wrong with my Smalltalk expression or a different one I can try?
Will, could you please upload your Sound?  We need to see more of the structure in order to understand what you are trying to do. Thanks!
Sure. I did a file archive but it's much larger than the 16mb limit, so I just uploaded the sound itself.
For now, you can work around this by concatenating the collections as:
{{'nameofsample1.wav' sampleFileNamesInSameFolder},
{'nameofsample2.wav' sampleFileNamesInSameFolder},
{'nameofsample3.wav' sampleFileNamesInSameFolder}}
This is fixed now, so in the next K7 update you won't have to add the commas for concatenation.
...