org.jfugue
Class MusicalEffects

java.lang.Object
  extended by org.jfugue.MusicalEffects

public class MusicalEffects
extends java.lang.Object

EXPERIMENTAL - Contains a variety of static methods that create Patterns that play various musical ornaments

Version:
4.0
Author:
David Koelle

Constructor Summary
MusicalEffects()
           
 
Method Summary
static Pattern hammerOn(Note note1, Note note2, double duration, int numHammers)
          Returns a Pattern that plays two notes in rapid succession (for a total of each note being played numHammers times) over the given duration.
static Pattern slide(Note note1, Note note2, double duration, int numSteps)
          Returns a Pattern that plays a slide between two notes over the given duration.
static Pattern trill(Note note1, Note note2, double duration, int numSteps)
          Right now, this is a pass-through to hammerOn()
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MusicalEffects

public MusicalEffects()
Method Detail

hammerOn

public static Pattern hammerOn(Note note1,
                               Note note2,
                               double duration,
                               int numHammers)
Returns a Pattern that plays two notes in rapid succession (for a total of each note being played numHammers times) over the given duration. The resulting Pattern will have note1 and note2 both represented numHammers times. Example: hammerOn(new Note("C5"), new Note("E5"), 0.5, 4); will produce this Pattern: [60]/0.125 [64]/0.125 [60]/0.125 [64]/0.125 [60]/0.125 [64]/0.125 [60]/0.125 [64]/0.125

Parameters:
note1 - First note to play
note2 - Second note to play
duration - Value representing total duration for the resulting pattern. 1.0=whole note
numHammers - Number of times to repeat each note

slide

public static Pattern slide(Note note1,
                            Note note2,
                            double duration,
                            int numSteps)
Returns a Pattern that plays a slide between two notes over the given duration. TODO: This is currently a naive implementation, which sounds 'numSteps' notes, each with a duration of 'duration/numSteps'. This means that if you're sliding from a F to a G, for example, you could get music that looks like F F F F F F F F G G G G G G, with each note having a very short duration. The problem with this is that the sound of each note stopping and starting again is noticeable. A more intelligent implementation would sound each note for as long as necessary, then sound a different note only when the microtonal math requires it. Otherwise, the pitch wheel messages should cause the note to change while it is playing. This implementation may require one or more new methods in MicrotoneNotation.


trill

public static Pattern trill(Note note1,
                            Note note2,
                            double duration,
                            int numSteps)
Right now, this is a pass-through to hammerOn()

See Also:
hammerOn