com.softsynth.jmsl.jsyn
Class JSynInsFromClassName
java.lang.Object
com.softsynth.jmsl.InstrumentAdapter
com.softsynth.jmsl.jsyn.FreqSynthNoteInstrument
com.softsynth.jmsl.jsyn.TunedSynthNoteInstrument
com.softsynth.jmsl.jsyn.JSynInsFromClassName
- All Implemented Interfaces:
- Instrument, Namable, OutputProvider, Transposable, AttributeBuildable
- Direct Known Subclasses:
- SynthNoteAllPortsInstrument
public class JSynInsFromClassName
- extends TunedSynthNoteInstrument
- implements AttributeBuildable
Create a JSyn Instrument by passing in the classname of a SynthNote Has
optional SynthContext field to pass to its allocator for making SynthCircuits
under a specified context
- Author:
- Nick Didkovsky 3/8/01 10:09PM
Constructor Summary |
JSynInsFromClassName()
|
JSynInsFromClassName(int maxVoices,
java.lang.String className)
|
JSynInsFromClassName(int maxVoices,
java.lang.String className,
com.softsynth.jsyn.SynthContext synthContext)
Constructor with SynthContext which is passed to BVAClassName in
buildFromAttributes() so allocator can make synthcircuits with the
specified SynthContext |
Method Summary |
void |
buildFromAttributes()
|
com.softsynth.jsyn.SynthContext |
getSynthContext()
|
java.lang.String |
getSynthNoteClassName()
|
static void |
main(java.lang.String[] args)
public static void main(String args[]) {
java.awt.Frame f = new java.awt.Frame();
f.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
JMSL.closeMusicDevices();
System.exit(0);
}
});
f.setSize(300, 200);
f.setVisible(true);
JSynMusicDevice.instance().edit(f);
JSynMusicDevice.instance().open();
JMSL.clock.setAdvance(0.5);
MusicShape s = new MusicShape(4);
s.add(0.25, 60, 0.5, 2.0);
s.add(0.25, 69, 0.4, 1.0);
s.add(0.15, 72, 0.3, 0.5);
s.add(5.15, 69, 0.25, 4.0);
JSynInsFromClassName ins = new JSynInsFromClassName();
ins.setMaxVoices(4);
ins.setSynthNoteClassName(com.softsynth.jsyn.circuits.FilteredSawtoothBL.class.getName());
try {
ins.buildFromAttributes();
JMSLMixerContainer mixer = new JMSLMixerContainer();
mixer.start();
mixer.addInstrument(ins);
f.add(mixer.getPanAmpControlPanel());
f.pack();
s.setInstrument(ins);
s.setRepeats(3);
s.launch(JMSL.now() + 0.5);
} catch (Exception e2) {
e2.printStackTrace();
}
} |
void |
setSynthContext(com.softsynth.jsyn.SynthContext context)
|
void |
setSynthNoteClassName(java.lang.String s)
|
java.lang.String |
toString()
|
Methods inherited from class com.softsynth.jmsl.jsyn.FreqSynthNoteInstrument |
close, getAllocator, getMaxVoices, getName, getNumOutputs, getOutput, getOutput, getPolyphonic, getUpdateDimension, off, off, open, play, setAllocator, setMaxVoices, setName, setSynthNote, setUpdateDimension |
Methods inherited from class com.softsynth.jmsl.InstrumentAdapter |
getDimensionNameSpace, getInterpreter, getMixerClassName, getMusicDevice, getTransposition, noteOff, noteOn, noteOnFor, setDimensionNameSpace, setInterpreter, setMixerClassName, setMusicDevice, setTransposition |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JSynInsFromClassName
public JSynInsFromClassName()
JSynInsFromClassName
public JSynInsFromClassName(int maxVoices,
java.lang.String className)
JSynInsFromClassName
public JSynInsFromClassName(int maxVoices,
java.lang.String className,
com.softsynth.jsyn.SynthContext synthContext)
- Constructor with SynthContext which is passed to BVAClassName in
buildFromAttributes() so allocator can make synthcircuits with the
specified SynthContext
- Parameters:
maxVoices
- className
- synthContext
-
getSynthNoteClassName
public java.lang.String getSynthNoteClassName()
setSynthNoteClassName
public void setSynthNoteClassName(java.lang.String s)
buildFromAttributes
public void buildFromAttributes()
- Specified by:
buildFromAttributes
in interface AttributeBuildable
getSynthContext
public com.softsynth.jsyn.SynthContext getSynthContext()
toString
public java.lang.String toString()
- Overrides:
toString
in class InstrumentAdapter
main
public static void main(java.lang.String[] args)
public static void main(String args[]) {
java.awt.Frame f = new java.awt.Frame();
f.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
JMSL.closeMusicDevices();
System.exit(0);
}
});
f.setSize(300, 200);
f.setVisible(true);
JSynMusicDevice.instance().edit(f);
JSynMusicDevice.instance().open();
JMSL.clock.setAdvance(0.5);
MusicShape s = new MusicShape(4);
s.add(0.25, 60, 0.5, 2.0);
s.add(0.25, 69, 0.4, 1.0);
s.add(0.15, 72, 0.3, 0.5);
s.add(5.15, 69, 0.25, 4.0);
JSynInsFromClassName ins = new JSynInsFromClassName();
ins.setMaxVoices(4);
ins.setSynthNoteClassName(com.softsynth.jsyn.circuits.FilteredSawtoothBL.class.getName());
try {
ins.buildFromAttributes();
JMSLMixerContainer mixer = new JMSLMixerContainer();
mixer.start();
mixer.addInstrument(ins);
f.add(mixer.getPanAmpControlPanel());
f.pack();
s.setInstrument(ins);
s.setRepeats(3);
s.launch(JMSL.now() + 0.5);
} catch (Exception e2) {
e2.printStackTrace();
}
}
setSynthContext
public void setSynthContext(com.softsynth.jsyn.SynthContext context)
- Parameters:
context
-