com.softsynth.jmsl.jsyn
Class SimpleSamplePlayingInstrumentWithLoops

java.lang.Object
  extended by com.softsynth.jmsl.InstrumentAdapter
      extended by com.softsynth.jmsl.jsyn.SimpleSamplePlayingInstrument
          extended by com.softsynth.jmsl.jsyn.SimpleSamplePlayingInstrumentWithLoops
All Implemented Interfaces:
Editable, Instrument, Namable, OutputProvider, Transposable, AttributeBuildable, DirectorySettable, HandleSpecialXMLTag
Direct Known Subclasses:
TransposingSamplePlayingInstrument, TransposingSampleSustainingInstrument

public class SimpleSamplePlayingInstrumentWithLoops
extends SimpleSamplePlayingInstrument

This class is not used directly. It is a subclass of SimpleSamplePlaying instrument adding a hashtable of sample loop regioners, and provides a common superclass for both TransposingSamplePlayingInstrument and TransposingSampleSustainngInstrument

Author:
Nick Didkovsky, didkovn@mail.rockefeller.edu (C) 2001 Nick Didkovsky, all rights reserved.
See Also:
TransposingSamplePlayingInstrument

Field Summary
 
Fields inherited from class com.softsynth.jmsl.jsyn.SimpleSamplePlayingInstrument
POLYPHONY
 
Constructor Summary
SimpleSamplePlayingInstrumentWithLoops()
           
SimpleSamplePlayingInstrumentWithLoops(java.lang.String sampleDirectory)
          constructor.
 
Method Summary
 void addSamplePitch(com.softsynth.jsyn.SynthSample sample, int noteIndex)
          Assign a dynamically created sample to a note index.
 void clear()
          remove all samples and pitch mappings
 SampleLoopRegioner getSampleLoopRegioner(int pitchIndex)
           
 java.util.Hashtable getSampleLoopRegioners()
           
 void loadSample(java.lang.String filename, int noteIndex)
           
 double play(double playTime, double timeStretch, double[] dar)
          If there is a sample loaded at dar[1], bang it.
 
Methods inherited from class com.softsynth.jmsl.jsyn.SimpleSamplePlayingInstrument
addEditListener, addSamplePitch, addSamplePitch, buildFromAttributes, close, edit, getAlternativeSampleIndex, getDirectory, getEditEnabled, getNumChannels, getNumOutputs, getOutput, getOutput, getPitches, getSampleFilename, getSynthSamples, getTuning, getVoices, handleSpecialTag, main, notifyEditListeners, off, on, open, reload, removeEditListener, setDirectory, setEditEnabled, setNumChannels, setTuning, testSampleDirectory, writeSpecialXMLTags
 
Methods inherited from class com.softsynth.jmsl.InstrumentAdapter
getDimensionNameSpace, getInterpreter, getMixerClassName, getMusicDevice, getName, getTransposition, noteOff, noteOn, noteOnFor, setDimensionNameSpace, setInterpreter, setMixerClassName, setMusicDevice, setName, setTransposition, toString, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleSamplePlayingInstrumentWithLoops

public SimpleSamplePlayingInstrumentWithLoops()

SimpleSamplePlayingInstrumentWithLoops

public SimpleSamplePlayingInstrumentWithLoops(java.lang.String sampleDirectory)
constructor. sample directory string must end in dir delimitter, ex "F:\samples\"

Method Detail

loadSample

public void loadSample(java.lang.String filename,
                       int noteIndex)
                throws java.io.IOException
Throws:
java.io.IOException

addSamplePitch

public void addSamplePitch(com.softsynth.jsyn.SynthSample sample,
                           int noteIndex)
Description copied from class: SimpleSamplePlayingInstrument
Assign a dynamically created sample to a note index. If you do this you will not be able to save/reload. You are committed to runtime building

Overrides:
addSamplePitch in class SimpleSamplePlayingInstrument

clear

public void clear()
Description copied from class: SimpleSamplePlayingInstrument
remove all samples and pitch mappings

Overrides:
clear in class SimpleSamplePlayingInstrument

getSampleLoopRegioners

public java.util.Hashtable getSampleLoopRegioners()
Returns:
Hashtable of SampleLoopRegioner (where key = Integer(pitchIndex), SampleLoopRegioner contains info about loop points in samples associated with pitchIndex)

getSampleLoopRegioner

public SampleLoopRegioner getSampleLoopRegioner(int pitchIndex)
Returns:
SampleLoopRegioner associated with pitchIndex. contains info about loop points in samples

play

public double play(double playTime,
                   double timeStretch,
                   double[] dar)
Description copied from class: SimpleSamplePlayingInstrument
If there is a sample loaded at dar[1], bang it. No sustain, no transposition. Hold time is not used to terminate sample early.

Specified by:
play in interface Instrument
Overrides:
play in class SimpleSamplePlayingInstrument