Harmgen

|harmgen| uses second-order Markov chains to generate new output notes.  The system's output and the user's input are received from a feedback loop at the top of the patch.  This input is sent through a network of objects that determine the value of  the two most recent harmonic intervals between the user's input and the system's output.  Intervals larger than an octave are reduced to their equivalent interval class.

Harmgen  
|harmgen|

Once the intervals have been determined, they are converted from integer form into a text string.  For example, intervals of 6 (tritone) followed by a 2 (major second) are converted to the string "sixtwo".  The suffix "perf" is attached, in effect creating the name of  the probability table that corresponds with the last two harmonic intervals.

From this point, |harmgen| functions identically to |melplayer| The |obj. . .| and |s pd-manager.pd| objects create an instance of an object called |harmgetnextint|, place it at (10, 10) on the screen of |manager|, and give it, as an initialization argument, the table name that has just been assembled.  Three random numbers are then generated and sent into the new |harmgetnextint| object.  |harmgetnextint| queries the probability table specified in it's initialization argument, and returns the values stored at the addresses specified by the random numbers.  These returned values, which are suggestions for the next harmonic interval, are sent to |manager|.  When this is complete, |harmgen| destroys the instance of |harmgetnextint| and waits for the next input.

Harmongetint  
|harmongetint|

The |harmongetint| object, located inside of |harmgen|, calculates the current harmonic interval between two voices.  Furthermore, it calculates this interval only if both voices are actually playing.  The |spigot| object prevents calculations from being output if one of the voices falls silent.  |pd notecount| is a subpatch that keeps track of how many notes are currently being played by the user.  This prevents OSCAR from thinking that the human player has fallen silent when it receives a single  "note off" message.  The |moses| and |overflow| network at the bottom of the patch keep the calculated interval from exceeding the allowed one-octave range.


Email Greg OSCAR Main PageTempo