NAME

MIDI::Morph - Musical transition tool

VERSION

Version 0.01

SYNOPSIS

use MIDI::Morph;

my $m = MIDI::Morph->new(from => $from_score, to => $to_score);
$new_score = $m->Morph(0.4);

DESCRIPTION

The aim of MIDI::Morph is to provide an easy-to-use composition tool that allows transitions between two gestalten (musical snippets). The data handled by this module is in MIDI::Score format (at this moment, only note events are considered).

This is an alpha release, features and API will be extended and changed iteratively.

CONSTRUCTOR

new

my $m = MIDI::Morph->new(from => $from, to => $to);

Creates a new morpher object.

METHODS

AutoMap

AutoMap is called automatically by MIDI::Morph and provides a mapping from the notes in the from structure to the notes in the to structure. Currently, it is a simple mapping 1st<->1st, 2nd<->2nd, but this will become more sophisticated in future.

Morph

$m->Morph($position);

Morph creates a structure that reflects a transition point between from (0) and to (1). Currently the transition is linear.

FUNCTIONS

event_distance

MIDI::Morph::event_distance($event1, $event2, $weights);

This function calculates the distance between two events. The events passed should be note events as described in MIDI::Score. The weights are passed as a hash reference with the keys start, end, pitch and velocity. This parameter is optional; the default weights are 1, 1, 1 and 0 respectively.

These weights can be used in case you want to measure the distance between two events in different terms.

morph_single_event

my $event = morph_single_event($from_event, $to_event, $position);

This helper function morphs two single events.

AUTHOR

Christian Renz, <crenz @ web42.com>

BUGS

Please report any bugs or feature requests to bug-midi-morph@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MIDI-Morph. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SEE ALSO

MIDI

COPYRIGHT & LICENSE

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.