com.softsynth.jmsl.jsyn
Class SynthNoteInstrument

java.lang.Object
  extended by com.softsynth.jmsl.InstrumentAdapter
      extended by com.softsynth.jmsl.jsyn.SynthNoteInstrument
All Implemented Interfaces:
Instrument, Namable, NoteOnOff, OutputProvider, Transposable

public class SynthNoteInstrument
extends InstrumentAdapter
implements NoteOnOff

A polyphonic Instrument that plays notes with a JSyn SynthNote. Uses Midi style velocity 0..127
SynthNoteInstrument defines noteOnFor which sustains a note event over time.
update() for SynthNoteInstrument does nothing. The default Interpreter for a SynthNoteInstrument is a NoteInterpreter. You might consider using TunedSynthNoteInstrument or JSynInsFromClassName instead which does not require that you build the allocator, and supports outputs with more than one part (stereo instruments for example), or use the more powerful SynthNoteAllPortsInstrument which gives timbral control over all input ports.

Author:
Phil Burk and Nick Didkovsky
See Also:
NoteInterpreter

Constructor Summary
SynthNoteInstrument()
           
SynthNoteInstrument(com.softsynth.jsyn.util.BussedVoiceAllocator allocator)
          Deprecated. Use no-args contrcutor, then setAllocator()
 
Method Summary
 int getNumOutputs()
           
 java.lang.Object getOutput()
          Implement JSynInstrument interface
 java.lang.Object getOutput(int part)
          same as getOutput(), only 1 part
 Tuning getTuning()
           
static void main(java.lang.String[] args)
          Build an instrument and a MusicShape and play it polyphonically with a JSyn SynthNote.
 double noteOnFor(double playTime, double holdTime, double pitch, double velocity)
          Play a note for a specified duration.
 void print()
           
 void setAllocator(com.softsynth.jsyn.util.BussedVoiceAllocator allocator)
           
 void setTuning(Tuning tuning)
           
 
Methods inherited from class com.softsynth.jmsl.InstrumentAdapter
close, getDimensionNameSpace, getInterpreter, getMixerClassName, getMusicDevice, getName, getTransposition, noteOff, noteOn, off, on, open, play, setDimensionNameSpace, setInterpreter, setMixerClassName, setMusicDevice, setName, setTransposition, toString, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.softsynth.jmsl.NoteOnOff
noteOff, noteOn
 

Constructor Detail

SynthNoteInstrument

public SynthNoteInstrument()

SynthNoteInstrument

public SynthNoteInstrument(com.softsynth.jsyn.util.BussedVoiceAllocator allocator)
Deprecated. Use no-args contrcutor, then setAllocator()

Method Detail

setAllocator

public void setAllocator(com.softsynth.jsyn.util.BussedVoiceAllocator allocator)

setTuning

public void setTuning(Tuning tuning)

getTuning

public Tuning getTuning()

getOutput

public java.lang.Object getOutput()
Implement JSynInstrument interface

Specified by:
getOutput in interface OutputProvider
Overrides:
getOutput in class InstrumentAdapter
Returns:
null

getOutput

public java.lang.Object getOutput(int part)
same as getOutput(), only 1 part

Specified by:
getOutput in interface OutputProvider
Overrides:
getOutput in class InstrumentAdapter
Returns:
null

getNumOutputs

public int getNumOutputs()
Specified by:
getNumOutputs in interface OutputProvider
Overrides:
getNumOutputs in class InstrumentAdapter
Returns:
0

noteOnFor

public double noteOnFor(double playTime,
                        double holdTime,
                        double pitch,
                        double velocity)
Play a note for a specified duration. Use MIDI style pitch and velocity.

Specified by:
noteOnFor in interface NoteOnOff
Overrides:
noteOnFor in class InstrumentAdapter

print

public void print()

main

public static void main(java.lang.String[] args)
Build an instrument and a MusicShape and play it polyphonically with a JSyn SynthNote. Use equal tempered 10 tone tuning. MusicShape's repeat() method halves the timestretch every repeat