FluidLoadFolder error

Hi,

I’m reaaaalllly loving the FluidLoadFolder and FluidProcessSlices pairing! I came across this today:

The .play throws an error if the “~loader.index” has fewer than 4 entries in it (for example if the folder only had 3 files).

It still seems to work though!

T

ERROR: Message 'at' not understood.
RECEIVER:
   nil
ARGS:
   Symbol 'bounds'
PATH: /Users/ted/Documents/_CREATING/_PROJECT FILES/wet ink/supercollider/comparing sax multiphonics with source file 2.scd

PROTECTED CALL STACK:
	Meta_MethodError:new	0x110c26640
		arg this = DoesNotUnderstandError
		arg what = nil
		arg receiver = nil
	Meta_DoesNotUnderstandError:new	0x110c28600
		arg this = DoesNotUnderstandError
		arg receiver = nil
		arg selector = at
		arg args = [ bounds ]
	Object:doesNotUnderstand	0x11d273f40
		arg this = nil
		arg selector = at
		arg args = nil
	a FunctionDef	0x10ee95ac0
		sourceCode = "<an open Function>"
		var numframes = nil
		var onsets = nil
	SynthDef:buildUgenGraph	0x11630bf40
		arg this = SynthDef:temp__83
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = [ ControlName  P 0 i_out scalar 0 ]
	a FunctionDef	0x115041e80
		sourceCode = "<an open Function>"
		arg i_out = an OutputProxy
		var result = nil
		var rate = nil
		var env = nil
	SynthDef:buildUgenGraph	0x11630bf40
		arg this = SynthDef:temp__83
		arg func = a Function
		arg rates = nil
		arg prependArgs = [  ]
		var result = nil
		var saveControlNames = nil
	a FunctionDef	0x11630a580
		sourceCode = "<an open Function>"
	Function:prTry	0x112961940
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = nil
		var wasInProtectedFunc = false
	
CALL STACK:
	DoesNotUnderstandError:reportError
		arg this = <instance of DoesNotUnderstandError>
	Nil:handleError
		arg this = nil
		arg error = <instance of DoesNotUnderstandError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of DoesNotUnderstandError>
	Object:throw
		arg this = <instance of DoesNotUnderstandError>
	Function:protect
		arg this = <instance of Function>
		arg handler = <instance of Function>
		var result = <instance of DoesNotUnderstandError>
	SynthDef:build
		arg this = <instance of SynthDef>
		arg ugenGraphFunc = <instance of Function>
		arg rates = nil
		arg prependArgs = nil
	Function:play
		arg this = <instance of Function>
		arg target = <instance of Group>
		arg outbus = 0
		arg fadeTime = 0.02
		arg addAction = 'addToHead'
		arg args = nil
		var def = nil
		var synth = nil
		var server = <instance of Server>
		var bytes = nil
		var synthMsg = nil
	Integer:do
		arg this = 4
		arg function = <instance of Function>
		var i = 3
	FluidSliceCorpus:play
		arg this = <instance of FluidSliceCorpus>
		arg server = <instance of Server>
		arg sourceBuffer = <instance of Buffer>
		arg bufIdx = <instance of IdentityDictionary>
		arg action = <instance of Function>
		var counter = 4
		var tmpIndices = nil
		var perf = <instance of Function>
		var jobs = <instance of List>
		var total = 3
		var uid = 1571
		var completed = 0
		var pointstotal = 0
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "(
~slicer.play(s,~loader2.bu..."
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ The preceding error dump is for ERROR: Message 'at' not understood.
RECEIVER: nil


FluidSliceCorpus: 1/3
FluidSliceCorpus: 2/3
FluidSliceCorpus: 3/3
done
-> 5080

Thanks @tedmoore. There’s logic in FluidProcessSclies to deal with this, but I seem to have forgotten to apply it to FluidSliceCorpus. You might be able to temporarily fix this by adapting the code from ProcessSlices into SliceCorpus

  1. FluidProcessSlices.play (line 125 FluidCorpusBuilders.sc) has an argument, tasks, which controls how many parallel streams of processing it starts. This defaults to 4 (as a likely guess for the number of CPU cores people have)
  2. Then see lines 160 & 161:
		tasks ?? {tasks  = 4};
		tasks.asInteger.min(jobs.size).do{|jobIDs|perf.value(jobIDs)};

compared with the equivalent in FluidSliceCorpus (line 114)

		4.do{perf.value(Buffer.new)};
  1. Add a tasks argument to FluidSliceCorpus.play
play{ |server,sourceBuffer,bufIdx, action, tasks=4|

and changing line 114 to

tasks ?? {tasks  = 4};
tasks.asInteger.min(jobs.size).do{perf.value(Buffer.new)};

Worked perfectly. Thank you!