Re: Gamelan, microtuning, etc.

[email protected] (Jean-Pierre Vidal) Sat, 14 Feb 2004 22:27:03 +0000
Newsgroups perl.midi
Message-ID <[email protected]>
Le Samedi 14 Février 2004 20:33, Mark Hardy a écrit :
> Hi, All,
>
> Please excuse some impertinent questions from
> this newbie on the MIDI-Perl list.
>
> I would like to use MIDI-Perl to create a CGI program
> that would assist us in tuning instruments to at least three
> different gamelan orchestras, each of which has two tuning
> systems.  Every pitch can be assumed to lie "between the
> cracks" of the familiar Western scale.  I would like to have
> an interface that takes numerical values in units of Hertz
> to generate the tones.  

Because the material from you start is, of course, tempered (MIDI, 
synthesizers, etc. have "equal temperament"), I think it is better to think 
in "cents" rather in Hertz (although I think it is possible to write a module 
which understand 'Hertz commands', I don't know about any implementation).

There are 100 cents in any  tempered half-tone (1200 in an octave, it's a 
logarithmic scale),  and most MIDI instruments, synthesizers or sequencers 
have a pitch-wheel able to alter the current note from -1 tone to +1 tone, 
this is 400 cents. In MIDI, this range -200 to +200 is represented as 
0..8192.
With Sean's MIDI suite, you can do this by creating a MIDI event
	$track->new_event('pitch_wheel_change', 0, $channel, $pitch_wheel)
just before playing the note. (see MIDI::Track and MIDI::Event)

Notice this pitch is relative to a channel, with two consequences:
- you must generate this event before each note on a channel, unless the 
correction doesn't change for the following note.
- you cannot play "chords" (different notes on the same channel), unless they 
have the same correction (from the tempered one).

JPV

> [quoted] I can't tell if MIDI-Perl already has
> something like this.  (Perhaps I can throw something together
> using the pitch wheel...?)  Sean Burke was kind enough to
> mention that someone may already have investigated this.
>
> Since I want it to run as a CGI program, I would need
> the MIDI .pm's to exist on my ISP's server.  I doubt that they
> already exist (but I really should check, shouldn't I?)
> Should I try to convince my ISP to provide MIDI-Perl
> along with the standard modules?  Or, am I better off
> installing everything privately?
>
> FYI, I'm presently using MIDI-Perl-0.8 on a Mac with MacPerl running
> in Classic Mode.  I don't yet have it installed for use with Mac OS X.
>
> Best Regards,
> Mark

-- 
Jean-Pierre Vidal