From d49f626d0e7df3546a1ce0fdf82baca8cdf21fce Mon Sep 17 00:00:00 2001 From: kevin Date: Wed, 24 Feb 2016 19:08:49 -0500 Subject: [PATCH] cmMidiFile.c : Note on messages now show sci. pitch in _cmMidiFilePrintMsg(). --- cmMidiFile.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/cmMidiFile.c b/cmMidiFile.c index 65fabef..52d75a3 100644 --- a/cmMidiFile.c +++ b/cmMidiFile.c @@ -1380,15 +1380,28 @@ void _cmMidiFilePrintHdr( const _cmMidiFile_t* mfp, cmRpt_t* rpt ) void _cmMidiFilePrintMsg( cmRpt_t* rpt, const cmMidiTrackMsg_t* tmp ) { - cmRptPrintf(rpt,"%8i %8i %8i %8i : ", tmp->dtick, tmp->dmicro, tmp->atick, tmp->amicro ); + cmRptPrintf(rpt,"%8i %8i %8i %8i : ", + tmp->dtick, + tmp->dmicro, + tmp->atick, + tmp->amicro ); if( tmp->status == kMetaStId ) - cmRptPrintf(rpt,"%s ", cmMidiMetaStatusToLabel(tmp->metaId)); + { + cmRptPrintf(rpt,"%s ", cmMidiMetaStatusToLabel(tmp->metaId)); + } else { - cmRptPrintf(rpt,"%4s %3i %3i %3i", cmMidiStatusToLabel(tmp->status),tmp->u.chMsgPtr->ch,tmp->u.chMsgPtr->d0,tmp->u.chMsgPtr->d1); - + cmRptPrintf(rpt,"%4s %3i %3i %3i", + cmMidiStatusToLabel(tmp->status), + tmp->u.chMsgPtr->ch, + tmp->u.chMsgPtr->d0, + tmp->u.chMsgPtr->d1); } + + if( cmMidiIsChStatus(tmp->status) && cmMidiIsNoteOn(tmp->status) && (tmp->u.chMsgPtr->d1>0) ) + cmRptPrintf(rpt," %4s ",cmMidiToSciPitch(tmp->u.chMsgPtr->d0,NULL,0)); + cmRptPrintf(rpt,"\n"); }