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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
close()
void
dispose()
void
execute(java.lang.String cmd, Environment env)
void
getCommands(Agent.Registry r)
Viewer
getViewer()
void
load(java.io.InputStream s)
int
mapVelocity(double x)
void
open()
void
read(java.io.Reader r)
void
run()
void
save(java.io.OutputStream s)
void
silence()
void
starting()
void
stopping()
void
write(java.io.Writer w)
-
-
-
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()
-
silence
public void silence()
-
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)
-
-