- Hello James,
I am CC:ing the JSyn list because these questions are of general interest.
>I have a few questions about tracking and other things:SynthContext as opposed to calling it on a SynthObject?
> 1) What is the difference between calling enableTracking() on a
The method in SynthObject just calls the shared global synthContext. Here's
public static void enableDeletionByGarbageCollector( boolean ifEnabled )
Synth.getSharedContext().enableDeletionByGarbageCollector( ifEnabled );
So call the SynthObject.enableDeletionByGarbageCollector(f) if you are using
a global SynthContext, in other words if you called "Synth.startEngine()".
If you are using your own specific SynthContext, in other words if you
called "mySynthContext.start()", then use
> When I create this SynthCircuit subclass and manually track, start andstop each unit, is it sufficient to call myUnit.track() or should I call
If you enable tracking globally, then you you don't need to call track()
explicitly on each unit. (Jamie, I had just meant to keep a list of units in
your circuit-like class so you can start/stop them when you start/stop the
> 2) How do you set multiple flags when calling Synth.startEngine(intflags)? Do you have to set up multiple SynthContext()'s?
The flags are all powers of 2:
public final static int FLAG_NON_REAL_TIME = (1<<2);
public final static int FLAG_ENABLE_INPUT = (1<<5);
public final static int FLAG_DISABLE_OUTPUT = (1<<6);
So you can OR them together, and JSyn can still see them individually.
Synth.startEngine( Synth.FLAG_ENABLE_INPUT |
> 3) I am creating a piece that has 3 distinct sections. I want to makesure that upon finishing a section, all previous objects are deleted by the
garbage collector (this includes both SynthObject()'s and JMSL objects, as
well as my own objects). Is there a quick and dirty way to do this?
1) Get rid of all references to your objects, clear out Vectors, etc.
2) If you enabled tracking, then call SynthObject.deleteAll() or
3) Force a garbage collection by calling (several times): System.gc();
JSyn,pForth,DSP,ASIC - http://www.softsynth.com
Portable Audio I/O - http://www.portaudio.com
Interaction Server - http://www.transjam.com