Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    MIDI::Trans 0.15

    Download button

    No screenshots available
    Downloads: 200  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    C. Church | More programs
    Perl Artistic License / FREE
    February 15th, 2011, 06:55 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    MIDI::Trans description

    Perl extension for quick and easy text->midi conversion

    MIDI::Trans is a Perl module that serves as a quick development foundation for text to midi conversion algorithms utilizing MIDI::Simple for output. Using MIDI::Trans, you create callbacks for generating note, volume, duration and tempo values. As your corpus is read, these callbacks are utilized to generate your midi score by MIDI::Trans. MIDI::Trans is modelled after the text conversion aspects of TransMid (http://www.digitalkoma.com/church/projects/transmid/), but designed to be more useful to a wider range of tasks, with less overhead.

    If you're in a big hurry, and haven't any need for great control over the process, simply read the 'Plug and Play Usage' and 'CallBacks' sections below to get a jump, and your converter implemented in a just a few minutes, with just a few statements.

    A corpus can be defined as either a string, or text file. MIDI::Trans will then split that corpus into elements based on an element delimiter, provided via argument, and determine some attributes of the corpus based on other data, which can be supplied by the developer. The corpus is then processed, element by element through the use of CallBacks you specify. The normal flow of development looks like this:

     Define Parameters For Conversion
     Define Functions To Generate Note, Duration, Volume, Tempo
     from parameters and element values.
     Specify and process corpus
     Create score
     Write Output


    ... this section not yet complete...

    SYNOPSIS

     use MIDI::Trans;
     
     my $TranObj = MIDI::Trans->new( {
     'Delimiter' => '\s+',
     'Note' => \¬e,
     'Volume' => sub { return(127); },
     'Duration' => \&somesub,
     'Tempo' => sub { ... }
     } );

     if($TransObj->trans( { 'File' => 'text.txt', 'Outfile' => 'out.mid' })) {
     print("success\n");
     } else {
     my $error = $TransObj->error();
     die("ERR: $error\n");
     }
     

     sub note {
     # do something
     # return a value between 0 and 127
     # or string 'rest' (sans quotes) for
     # a rest event
     }
     
     sub duration {
     # return some number of quarter notes
     }



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    text to midi | midi conversion | Perl module | text | midi | conversion

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM