|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.perisic.sound.Voice
public class Voice
This class represents a voice that consists of a set of three functions [0..1] -> [0..1] that determine the pitch, velocity and instrument at time t where 0 <= t <= 1.
Copyright:(c) Marc Conrad, Tim French 2006; Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
Constructor Summary | |
---|---|
Voice(java.util.Random rG,
int[] myInstruments,
int lowestPitch,
int highestPitch,
java.lang.String name)
These parameters determine fully this voice. |
Method Summary | |
---|---|
NiceFunction[] |
getFunctions()
Gives an array of the three functions { pitch, velocity, instrument }. |
java.awt.image.BufferedImage |
getImage(int width,
int height)
Displays a visualization of the voice. |
int |
getInstrument(double t)
The instrument (klangfarbe) is determined according to the defining function for instruments. |
java.lang.String |
getInstrumentNames()
This returns the names of all instruments that are used by this voice separated by newlines. |
java.lang.String |
getName()
When used in conjunction with the class VoiceAssignment |
int |
getNumberOfInstruments()
|
int |
getPitch(double t)
The pitch is determined according to the defining function for the pitch. |
int |
getVelocity(double t)
The velocity is determined according to the defining function for the velocity. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Voice(java.util.Random rG, int[] myInstruments, int lowestPitch, int highestPitch, java.lang.String name)
rG
- a random number generator that is used for
producing the generating functions.myInstruments
- The array of instruments that is used by
this voice. In Midi context the number refers to the number of the
program in bank zero.
Note that the method Util.getInstrumentName(int) returns a text
description of the instrument.lowestPitch
- The lowest possible pitch of the voice.highestPitch
- The highest possible pitch of the voice.name
- The name of the voice.Method Detail |
---|
public int getNumberOfInstruments()
public java.lang.String getInstrumentNames()
public java.lang.String getName()
public int getPitch(double t)
t
- A value with 0 <= t <= 1
public int getVelocity(double t)
t
- A value with 0 <= t <= 1
public int getInstrument(double t)
t
- A value with 0 <= t <= 1
public NiceFunction[] getFunctions()
public java.awt.image.BufferedImage getImage(int width, int height)
width
- The width of the image.height
- The height of the image.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |