Skip to content

01 Getting Started

Gene Boggs edited this page Nov 28, 2020 · 31 revisions
  • First things first

This tutorial assumes that you have Perl installed, you can use it, and know how to install CPAN modules. Also, it assumes that if you want to go further, that you will read the documentation for the modules referred to in this document.

  • Terminology

MIDI is full of domain specific vocabulary. And MIDI-Perl is full of its own! For instance: track, event, note, duration, control change, etc. A "Track" is a thing in MIDI-Perl, but we will use the term generically to refer to a sequence of notes added to the score on a specific channel. An "Event" is a granular aspect of the score, with which we will not concern ourselves. "Note" is a sort of tricky term. It is used both to refer to the pitch and duration. For us, these two things are considered separately. A "control change" is a message you give to the score to set things like reverb or chorus.

We will be concerned with musical creation not analysis. So loading a MIDI file and considering its contents will not be on the agenda.

  • Code essentials

Example 1

  • Handy debugging

Example 2

  • Importing MIDI methods

  • Create a score object

Example 3

  • Add notes and rests to the score

  • Write the score to a MIDI file

Example 4

Clone this wiki locally