denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] MIDI Import (Was Re: Release 2.0.6)


From: Richard Shann
Subject: Re: [Denemo-devel] MIDI Import (Was Re: Release 2.0.6)
Date: Mon, 04 Apr 2016 12:49:39 +0100

On Mon, 2016-03-28 at 23:33 -0500, Jeremiah Benham wrote:
> >  I was thinking this midi import may be better if it was written in
> > scheme instead of c.

I've been poking around and found these:

(d-ImportMidi "guided=true") this call lets the user choose a MIDI file 
and creates a MIDI structure smf_t to represent its contents.

(d-GetImportedMidiTracks) returns the number of MIDI tracks that have been 
loaded or #f if none

(d-GetImportedMidiTrack n) gets the n'th MIDI track loads a MIDI track chosen 
by the user as a Denemo , 
using the Clef, Time signature and key signature of the current staff. 
The track behaves like a Denemo recorded MIDI track - it will play back
with any notated music already present. 
The C routine compute_midi_note_durations() is called to guess at
suitable notated durations for  the MIDI note on event in the track.

• (d-CreateClickStaffForMidi)

I'll put this into the Documentation on the Scheme interface.

The structure containing the notes seems to be a list:
Denemo.project->movement->recording->notes

and Denemo.project->movement->recording->type is set to DENEMO_RECORDING_MIDI

The note durations are filled in with a call to

gboolean compute_midi_note_durations (void)

which is in guidedimportmidi.c

This is the bit that you would need to find a good algorithm for. The
current one does not even try to detect chords. And if the MIDI track
includes clef, time signature etc it would be good to set these before
actually inserting notes. Upbeats are, I suspect, a troublesome area
too. I think with the guided MIDI import you could set all these
manually, but I see I have introduced a regression in the drawing of the
imported MIDI note suggestions. I have a fix for that, but I don't think
we should hold up 2.0.6 for it, I'll commit it once you have moved
master on to 2.0.7

Richard







reply via email to

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