event('twinkle',2,time=384, note_on:[chan=2,pitch=72,vol=111]).
event('twinkle',2,time=768, note_off:[chan=2,pitch=72,vol=100]).
After translating the MIDI file into a Prolog format, the other detectors
will be invoked, that is the composer,
lyrics and melody detector,
to extract the information related to these properties.
To extract relevant fragments of the melody we
use the melody detector, of which a partial listing is given below.
melody detector
int melodyDetector(tree *pt, list *tks ){
char buf[1024]; char* _result;
void* q = _query;
int idq = 0;
idq = query_eval(q,"X:melody(X)");
while ((_result = query_result(q,idq)) ) {
putAtom(tks,"note",_result);
}
return SUCCESS;
}
The embedded logic component is given the
query X:melody(X), which results in the notes
that constitute the (relevant fragment of the) melody.
These notes are then added to the tokenstream.
A similar detector is available for the lyrics.
Parsing a given MIDI file, for example twinkle.mid,
results in updating the database.
implementation
The embedded logic component is part of the hush
framework, [OO]. It uses an object extension of Prolog
that allows for the definition of native objects
to interface with the MIDI processing software written in C++.
The logic component allows for
the definition of arbitrary predicates to extract
the musical information, such as the melody and the lyrics.
It also allows for further analysis of these features
to check for, for example, particular patterns in the melody.
[]
readme
preface
1
2
3
4
5
6
7
appendix
checklist
powerpoint
resources
director
eliens@cs.vu.nl

draft version 1 (16/5/2003)