> In RG notes have a duration in this case of MIDI file import we use a
> formula noteOffTime - noteOnTime [endTime - startTimer] to compute the
> duration.
>
> yes, we could throw a check in there and that solves the import problem. 
> But it really is just a bandage for the real issue.
>
> RG doesn't verify for 0 length durations of notes.

So what is the real issue here?  I have a sample file now, and there are 
apparently more like it out there in the real world.  What happens is:

  noteOffTime - noteOnTime == 0

What *should* Rosegarden do here?  I think the most technically correct answer 
is that if noteOffTime - noteOnTime == 0 what we have here is a non-note, and 
we should just skip it.  Don't create a Rosegarden note event with a duration 
of zero, because that's invalid (for a *note* event), but since there's 
nothing else to set it to, not creating the event at all seems like the purest 
answer.

As a practical matter, I don't think that would be very satisfactory.  I think 
even though this is a hack to deal with bad data that makes no particular 
sense, what we should probably do when noteOffTime - noteOnTime == 0 is pick a 
reasonable number that is greater than 0 and use that.

Since there's danger in any arbitrary number we substitute being too large, 
let's pick the smallest integer that's greater than 0, and use 1.

I get what you're saying about bandaids and have visions of plugging leaks in 
a dam that's about to burst, but I can't see the repercussions you were 
worrying about as far as changing the length of segments and what have you in 
this case.  I will ONLY fire when we encounter this one very specific and 
arguably stupid and broken situation.

Bad data, but sometimes you get bad data in the real world, and people create 
new de facto standards all the time.  Think IE 6.

I think this is a fairly safe fix, and I imagine Robert would find this a lot 
more satisfactory to use than a filter to use to fix this situation after the 
fact.

Let's try it.  It's easy to reverse if it causes any trouble. It's in revision 
10800.
-- 
D. Michael McIntyre

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to