All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.nosuch.midi.Alg

java.lang.Object
   |
   +----com.nosuch.midi.Alg

public class Alg
extends Object
MidiAlgorithm collects some algorithmic composition functions.


Constructor Index

 o Alg()

Method Index

 o addRootEvery(MidiPhrase, int)
 o arpeggio(MidiPhrase)
Arpeggiate the input phrase.
 o cutTime(MidiPhrase, long)
Return all notes after a specified time
 o cutTime(MidiPhrase, long, long)
Return a specified time range of a phrase
 o echo(MidiPhrase, int, int, double)
 o everyNth(MidiPhrase, int)
Return a phrase containing every Nth note of a phrase
 o everyRandomNth(MidiPhrase, int)
Return a phrase containing a random selection of notes, choosing approximately 1 of every n notes.
 o findRoot(MidiPhrase)
 o flip(MidiPhrase)
Flip the input phrase.
 o gvolchange(int)
 o highest(MidiPhrase)
Return the highest pitch in the specified phrase.
 o highestnt(MidiPhrase)
Return the highest pitch in the specified phrase.
 o latest(MidiPhrase)
Return the latest ending time of the notes in a phrase.
 o lowest(MidiPhrase)
Return the lowest pitch in the specified phrase.
 o lowestnt(MidiPhrase)
Return the lowest-pitched note in the specified phrase.
 o main(String[])
 o makeRootEvery(MidiPhrase, int)
Figure out a root note every intrvl beats
 o merge(MidiPhrase, MidiPhrase)
 o merge(MidiPhrase, MidiPhrase, MidiPhrase)
 o merge(MidiPhrase, MidiPhrase, MidiPhrase, MidiPhrase)
 o mono(MidiPhrase, int)
Returns a monophonic version of the specified phrase.
 o nextquant(long, long)
This function quantizes the specified number using the specified quantize value, and returns the result.
 o nonNotes(MidiPhrase)
Return a phrase containing "non" notes (e.g.
 o numquant(long, long)
Quantizes the specified number using a particular quantize value.
 o octaveFence(MidiPhrase, int, int)
Try to put all notes within the limits of pitches p1,p2 This is accomplished by shifting notes in octave increments.
 o onBeat(MidiPhrase, long)
Return a phrase containing notes that are on a particular beat.
 o onlyNotes(MidiPhrase)
Return a phrase containing only "normal" notes in the input phrase.
 o progchange(int, int)
Return a program-change message.
 o quantize(MidiPhrase, int)
Quantize a phrase.
 o repeat(MidiPhrase, int)
Repeat a phrase n times.
 o repeat(MidiPhrase, int, int)
 o scaTimes(MidiPhrase, double)
Scale a phrase by multiplying the time and duration each note by a specified factor.
 o split(MidiPhrase)
 o strnotes(String)
Return a phrase of notes based on the letters in a String
 o stutter(MidiPhrase, int, int)
For each section of phrase ph of width wid, repeat it num times
 o stutterrand(MidiPhrase)
For each section (of random width, within a small range of possible widths) of phrase ph, repeat it
 o sussect(long, int)
Generate a phrase with controller messages that press the sustain pedal on the specified channel (c) and let it up after the specified amount of time (tm).
 o transpose(MidiPhrase, int)
Transpos the pitch of the notes in a phrase by a given amount.
 o transposeSeqInPlace(MidiPhrase, MidiPhrase)

Constructors

 o Alg
 public Alg()

Methods

 o flip
 public static MidiPhrase flip(MidiPhrase p)
Flip the input phrase.

 o arpeggio
 public static MidiPhrase arpeggio(MidiPhrase p)
Arpeggiate the input phrase.

 o repeat
 public static MidiPhrase repeat(MidiPhrase p,
                                 int n)
Repeat a phrase n times.

 o repeat
 public static MidiPhrase repeat(MidiPhrase p,
                                 int n,
                                 int q)
 o echo
 public static MidiPhrase echo(MidiPhrase ph,
                               int num,
                               int rtime,
                               double rfactor)
 o onlyNotes
 public static MidiPhrase onlyNotes(MidiPhrase p)
Return a phrase containing only "normal" notes in the input phrase.

 o nonNotes
 public static MidiPhrase nonNotes(MidiPhrase p)
Return a phrase containing "non" notes (e.g. MidiBytes) in the input phrase.

 o lowest
 public static int lowest(MidiPhrase p)
Return the lowest pitch in the specified phrase.

 o lowestnt
 public static MidiMsg lowestnt(MidiPhrase p)
Return the lowest-pitched note in the specified phrase.

 o highest
 public static int highest(MidiPhrase p)
Return the highest pitch in the specified phrase.

 o highestnt
 public static MidiMsg highestnt(MidiPhrase p)
Return the highest pitch in the specified phrase.

 o findRoot
 public static MidiMsg findRoot(MidiPhrase ph)
 o makeRootEvery
 public static MidiPhrase makeRootEvery(MidiPhrase melody,
                                        int intrvl)
Figure out a root note every intrvl beats

 o addRootEvery
 public static MidiPhrase addRootEvery(MidiPhrase mel,
                                       int intrvl)
 o cutTime
 public static MidiPhrase cutTime(MidiPhrase p,
                                  long tm1,
                                  long tm2)
Return a specified time range of a phrase

 o cutTime
 public static MidiPhrase cutTime(MidiPhrase p,
                                  long tm1)
Return all notes after a specified time

 o stutter
 public static MidiPhrase stutter(MidiPhrase ph,
                                  int wid,
                                  int num)
For each section of phrase ph of width wid, repeat it num times

 o merge
 public static MidiPhrase merge(MidiPhrase p1,
                                MidiPhrase p2)
 o merge
 public static MidiPhrase merge(MidiPhrase p1,
                                MidiPhrase p2,
                                MidiPhrase p3)
 o merge
 public static MidiPhrase merge(MidiPhrase p1,
                                MidiPhrase p2,
                                MidiPhrase p3,
                                MidiPhrase p4)
 o stutterrand
 public static MidiPhrase stutterrand(MidiPhrase ph)
For each section (of random width, within a small range of possible widths) of phrase ph, repeat it

 o transpose
 public static MidiPhrase transpose(MidiPhrase p,
                                    int delta)
Transpos the pitch of the notes in a phrase by a given amount.

 o latest
 public static long latest(MidiPhrase p)
Return the latest ending time of the notes in a phrase.

 o transposeSeqInPlace
 public static MidiPhrase transposeSeqInPlace(MidiPhrase p,
                                              MidiPhrase seq)
 o numquant
 public static long numquant(long v,
                             long q)
Quantizes the specified number using a particular quantize value. If you want to guarantee that the result is not less than the original (which is typical when you are quantizing a time value and want to guarantee that the result is some time in the future), use nextquant().

 o nextquant
 public static long nextquant(long t,
                              long q)
This function quantizes the specified number using the specified quantize value, and returns the result. The result is guaranteed to be greater than the original number; if quantization would produce a smaller number, it is increased by the quantize value. This is typically used when you want to quantize a time value, and want to guarantee that the result will refer to some time in the future, not in the past.

 o quantize
 public static MidiPhrase quantize(MidiPhrase ph,
                                   int qnt)
Quantize a phrase. Each note's starting time will be quantized by the specified quant value. If a limit is specified, notes that would need to be moved by an amount larger than this limit will not be adjusted at all.

 o octaveFence
 public static MidiPhrase octaveFence(MidiPhrase ph,
                                      int p1,
                                      int p2)
Try to put all notes within the limits of pitches p1,p2 This is accomplished by shifting notes in octave increments.

 o scaTimes
 public static MidiPhrase scaTimes(MidiPhrase ph,
                                   double f)
Scale a phrase by multiplying the time and duration each note by a specified factor.

 o split
 public static MidiPhrase[] split(MidiPhrase p)
 o mono
 public static MidiPhrase mono(MidiPhrase ph,
                               int typ)
Returns a monophonic version of the specified phrase. If type==0, high notes are given priority (e.g. if two notes are playing simultaneously, the higher note will be chosen). If type==1, low notes are given priority. If type==2, the priority is randomized.

 o everyNth
 public static MidiPhrase everyNth(MidiPhrase p,
                                   int n)
Return a phrase containing every Nth note of a phrase

 o everyRandomNth
 public static MidiPhrase everyRandomNth(MidiPhrase p,
                                         int n)
Return a phrase containing a random selection of notes, choosing approximately 1 of every n notes.

 o onBeat
 public static MidiPhrase onBeat(MidiPhrase p,
                                 long d)
Return a phrase containing notes that are on a particular beat.

 o progchange
 public static MidiPhrase progchange(int patchnum,
                                     int ch)
Return a program-change message. patchnum is 1-based, ch (channel) is 1-based

 o gvolchange
 public static MidiPhrase gvolchange(int v)
 o sussect
 public static MidiPhrase sussect(long tm,
                                  int c)
Generate a phrase with controller messages that press the sustain pedal on the specified channel (c) and let it up after the specified amount of time (tm).

 o strnotes
 public static MidiPhrase strnotes(String s)
Return a phrase of notes based on the letters in a String

 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index