
Music::Gestalt - Compose music using gestalts.

Version 0.06

use Music::Gestalt;
# see below

This module helps to compose music using musical gestalts (forms). A gestalt is similar to a list in MIDI::Score format, but so far it only supports note events, and all parameters are expressed as values between 0 and 1. This allows for more flexible transformations of the musical material.

newmy $g = Music::Gestalt->new(score => $score);
Creates a new Music::Gestalt object. The optional score argument receives a score in MIDI::Score format.

PitchLowestSets (if you pass a value) and returns lowest pitch used in this gestalt.
PitchHighestSets (if you pass a value) and returns highest pitch used in this gestalt.
PitchMiddleSets (if you pass a value) and returns middle pitch of the range used in this gestalt.
PitchRangeReturns the pitch range used in this gestalt, ie. the pitches that occur will be between pitch middle +/- pitch range.
If you pass a value as parameter, the new pitch range will be calculated around the current pitch middle.
VelocityLowestSets (if you pass a value) and returns lowest velocity used in this gestalt.
VelocityHighestSets (if you pass a value) and returns highest velocity used in this gestalt.
VelocityMiddleSets (if you pass a value) and returns middle velocity of the range used in this gestalt.
VelocityRangeReturns the velocity range used in this gestalt, ie. the velocities that occur will be between velocity middle +/- velocity range.
If you pass a value as parameter, the new velocity range will be calculated around the current velocity middle.
DurationReturns the duration of this gestalt.
If you pass a value as a parameter, it will be used as new duration.
NoteLengthReturns the note length property of this gestalt. "1" means that the original note lengths are retained, ".5" means that each note is half as long as it originally was.
If you pass a value as a parameter, it will be used as new note length.
NotesReturns the note list of this gestalt.
DensitySets and returns the density of this gestalt. The initial density is 1, meaning that all notes will be used. At density 0, a score created from this gestalt will have no events. At density 0.5, a score created from this gestalt will have half the original events, selected at random.
It is intentional that the density may not be greater than 1; there are too many possible ways to generate additional events.
PitchesReturns or sets the pitches used in this gestalt. You should pass areference to a list that contains the pitch numbers used. Returns a reference to a list of pitches that will be used. An empty list signifies that all pitches are used. Note that the set of pitches used is also influenced by the "PitchesMode" parameter.
PitchesModeReturns or sets the pitch mode used in this gestalt.

AsScoreReturns a structure representing the gestalt in MIDI::Score format.
AppendAppends other Music::Gestalt objects to this object.
InsertInserts other Music::Gestalt objects into this object.
MirrorTime, MirrorPitch, MirrorVelocityMirrors the start times, pitches and velocites found in the gestalt.

Using automation, you can vary a parameter over time (comparable to parameter automation in sequencers like Logic or Cubase). For each parameter that can be automated, there are three modes available:
In this mode, the currently set parameter values will be replaced with the values that you pass to the function. If you pass (0, 100), the parameter will range from 0 to 100 over the whole gestalt. If you pass (20, 50 20), the parameter will first rise from 20 to 50, then in the second half of the gestalt fall from 50 to 20. The parameter value is interpolated at the event's position.
In this mode, the currently set parameter values will be multiplied with the values that you pass to the function. If you pass (0, 1), the parameter will fade in over the whole gestalt. If you pass (.2, .5 .2), the parameter will first fade in from 20% to 50%, then in the second half of the gestalt fade out from 50% to 20%. The parameter value is interpolated at the event's position.
Automation will not be applied.
Here are some examples how to call the automation functions:
$g->AutomateVelocityOff(); # default $g->AutomateVelocityAbs(20, 50, 20); $g->AutomateVelocityRel(0, 1);
The values passed to the automation methods will be applied evenly-spaced.
The following automation methods are available:
AutomateVelocityOff, AutomateVelocityAbs, AutomateVelocityRel
AutomatePitchMiddleOff, AutomatePitchMiddleAbs, AutomatePitchMiddleRel
Christian Renz, <crenz @ web42.com>

Please report any bugs or feature requests to bug-music-gestalt@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Music-Gestalt. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
Please also consider adding a test case to your bug report (.t script).

Copyright 2005 Christian Renz, <crenz @ web42.com>, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.