Package comp :: Module randMelody :: Class RandMelody
[hide private]
[frames] | no frames]

Class RandMelody

source code


A simple test composition module. Generates melodies with limited random selection of pitch, delta, duration.

Instance Methods [hide private]
 
__init__(self, eventCaller='')
Class contructor.
source code
 
getData(self)
Generate pitch, duration and delta time for the next note in the melody.
source code
 
setParameter(self, parameter, value)
Set a class variable.
source code

Inherited from baseComp.BaseComp: perform, playEvent

Instance Variables [hide private]
  eventCaller
Pointer to the event caller.
  isPlaying
A flag indicating if the melody should continue playing or not.
  pitches
The collection of pitches to select from.
  deltaTimes
The collection of (relative) delta times to select from.
  durations
The collection of (relative) durations to select from.
  pan
The stereo pan value.
  reverb
The reverb send value.
  instrument
The csound instrument for playback of events.
Method Details [hide private]

__init__(self, eventCaller='')
(Constructor)

source code 
Class contructor.
Parameters:
  • self - The object pointer.
Overrides: baseComp.BaseComp.__init__

getData(self)

source code 
Generate pitch, duration and delta time for the next note in the melody.
Parameters:
  • self - The object pointer.
Returns:
Parameters for the note event.
  • instrument: The csound instrument for playback of the note event.
  • amp: The amp of the note, in decibel (dbfs)
  • pitch: The pitch of the note, in note number format.
  • delta: Delta time, the time until the next event after this one. The value is relative to the current tempo so that a value of 1 equals one beat.
  • duration: The duration of the note, relative to the delta time (so that a duration of 1 generates a legato note).
  • pan: The stereo pan position of the note. A value of 0.0 is hard left, 0.5 is center, 1.0 is hard right.
  • reverb: The reverb send amount for the note, in the range 0.0 to 1.0.
Overrides: baseComp.BaseComp.getData

setParameter(self, parameter, value)

source code 
Set a class variable.
Parameters:
  • self - The object pointer.
  • parameter - The variable name.
  • value - The value to set the variable to.