Sanford.Multimedia.Midi icon indicating copy to clipboard operation
Sanford.Multimedia.Midi copied to clipboard

Error when starting midi file in debug mode

Open gluggi77 opened this issue 6 years ago • 1 comments

When starting the SequencerDemo in debug mode, I get an error as soon as I try to play a loaded midi file: at MidiFileProperties.AssertValid() ... (248)

It's in this code, the last line "Debug.Assert(Division >= PpqnClock.PpqnMinValue);":

    [Conditional("DEBUG")]
    private void AssertValid()
    {
        if(trackCount > 1)
        {
            Debug.Assert(Format == 1 || Format == 2);
        }

        if(IsSmpte(Division))
        {
            Debug.Assert(SequenceType == SequenceType.Smpte);
        }
        else
        {
            Debug.Assert(SequenceType == SequenceType.Ppqn);
            Debug.Assert(Division >= PpqnClock.PpqnMinValue);
        }
    }

Commenting out this line solves the problem for me. I don't really understand what's going on on this part of the code. I just wanted to give some feedback.

Just a side note. I have seen, that the demo code still comes with a target of .Net framework 2. Is there a reason for v2? Could I also go with v4.5?

gluggi77 avatar May 31 '18 21:05 gluggi77

Same

Zhangzijing avatar Apr 27 '19 07:04 Zhangzijing