Package samer.midi

Class MidiSynth

  • java.lang.Object
    • Viewable
      • samer.midi.MidiSynth
  • All Implemented Interfaces:
    Task
    Direct Known Subclasses:
    MidiWithAftertouch


    public class MidiSynth
    extends Viewable
    implements Task
    A class which generates midi events from the values of an input vector. Each element of the vector corresponds to a certain midi note number. The loudness of a note depends on the value of the corresponding vector element. Parameters: trigger note on events. offset is added to the vector element number to get a midi note number. pedal control whether or not note off events are generated
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected javax.sound.midi.MidiChannel[] cc 
      protected int[] chans 
      protected VDouble factor 
      protected int n 
      protected int[] nnums 
      protected VInteger offset 
      protected VBoolean pedal 
      protected double[] x 
    • Constructor Summary

      Constructors 
      Constructor and Description
      MidiSynth(VVector input) 
    • Field Detail

      • cc

        protected javax.sound.midi.MidiChannel[] cc
      • chans

        protected int[] chans
      • factor

        protected VDouble factor
      • n

        protected int n
      • nnums

        protected int[] nnums
      • offset

        protected VInteger offset
      • pedal

        protected VBoolean pedal
      • x

        protected double[] x
    • Constructor Detail

      • MidiSynth

        public MidiSynth(VVector input)
    • Method Detail

      • getViewer

        public Viewer getViewer()
      • open

        public void open()
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close()
      • dispose

        public void dispose()
        Specified by:
        dispose in interface Task
      • silence

        public void silence()
      • starting

        public void starting()
        Specified by:
        starting in interface Task
      • stopping

        public void stopping()
        Specified by:
        stopping in interface Task
      • run

        public void run()
        Specified by:
        run in interface Task
      • getCommands

        public void getCommands(Agent.Registry r)
      • execute

        public void execute(java.lang.String cmd,
                            Environment env)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • save

        public void save(java.io.OutputStream s)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • load

        public void load(java.io.InputStream s)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • read

        public void read(java.io.Reader r)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • write

        public void write(java.io.Writer w)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • mapVelocity

        public int mapVelocity(double x)