lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: understanding midi files


From: Johan Vromans
Subject: Re: understanding midi files
Date: Tue, 28 Jan 2014 13:42:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

address@hidden writes:

> Johan Vromas:
>> address@hidden writes:
>> 
>> >> > IOError: [Errno 2] No such file or directory: 'aeiou.mid'
>> >
>> > $ ls -l aeiou.mid 
>> > -rw------- 1 karl users 9760 Jan 27 10:44 aeiou.mid
>> 
>> To eliminate some odds, try passing the file using a complete path, e.g.
>> 
>>   $ lilymidi --pretty `pwd`/aeiou.mid
>
> $ lilymidi --pretty /home/karl/examples/aeiou.mid | head
> Filename:     /home/karl/examples/aeiou.mid
> MIDI format:  1 (one or more simultaneous tracks)
> Divisions:    768 per whole note
> #Tracks:      10
>
> Track 1:
>     Time 0:
>         Track name: A-e-i-o-u
>         Copyright:  T&M: trad. occitan. / Marc H?nsenberger
> Q: Musique Simili: Falbalas. Ins-Anet 1998
> Traceback (most recent call last):
>   File "/usr/local/bin/lilymidi", line 250, in <module>
>     go ()
>   File "/usr/local/bin/lilymidi", line 234, in go
>     dump_midi (midi_data, midi_file, options);
>   File "/usr/local/bin/lilymidi", line 224, in dump_midi
>     dump_event (ev[1], time, "        ");
>   File "/usr/local/bin/lilymidi", line 192, in dump_event
>     print padding + f.format (ev[1], ev[2])
> IOError: [Errno 32] Broken pipe
> $
>
> Ok, full path made it work,

Great. The reason I asked was that I assumed lilymidi to be a script
that internally 'change directory' for some reason.

> but why does it complain so verbosely about broken pipe, pipeing
> things to e.g. head is normal behaviour, it should not complain about
> that.

Sending output to a pipe and then closing the pipe before the program is
finished produces an IO error. It is up to the program to decide whether
to ignore this IO error. Personally, I think it's good to signal the
error.

>   'ticks'  => 192,
>     # Track #0 ...
>         ['set_tempo', 0, 500000],
>         ['time_signature', 0, 1, 3, 24, 8],

Weird time sig. 1/8 ?

> where comes the "96" from (in relation to val2[2]) ?

There are several constants that are used in MIDI. Most of them
originate from the initial, serial protocols used to transmit MIDI
messages between devices. I can't explain them either.

-- Johan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]