|
@@ -723,6 +723,7 @@ cmScRC_t _cmScParseNoteOn( cmSc_t* p, unsigned rowIdx, cmScoreEvt_t* s, unsigned
|
723
|
723
|
unsigned dynVal = kInvalidDynScId;
|
724
|
724
|
const cmChar_t* sciPitch;
|
725
|
725
|
cmMidiByte_t midiPitch;
|
|
726
|
+ cmMidiByte_t midiVel;
|
726
|
727
|
const cmChar_t* attr;
|
727
|
728
|
double secs;
|
728
|
729
|
double durSecs;
|
|
@@ -742,6 +743,9 @@ cmScRC_t _cmScParseNoteOn( cmSc_t* p, unsigned rowIdx, cmScoreEvt_t* s, unsigned
|
742
|
743
|
|
743
|
744
|
if((midiPitch = cmSciPitchToMidi(sciPitch)) == kInvalidMidiPitch)
|
744
|
745
|
return cmErrMsg(&p->err,kSyntaxErrScRC,"Unable to convert the scientific pitch '%s' to a MIDI value. ");
|
|
746
|
+
|
|
747
|
+ if((midiVel = cmCsvCellUInt( p->cH,rowIdx,kD1ColScIdx)) >= kInvalidMidiVelocity )
|
|
748
|
+ return cmErrMsg(&p->err,kSyntaxErrScRC,"An invalid MIDI velocity (%i) was encountered.",midiVel);
|
745
|
749
|
|
746
|
750
|
// get the sec's field - or DBL_MAX if it is not set
|
747
|
751
|
if((secs = cmCsvCellDouble(p->cH, rowIdx, kSecsColScIdx )) == DBL_MAX) // Returns DBL_MAX on error.
|
|
@@ -812,6 +816,7 @@ cmScRC_t _cmScParseNoteOn( cmSc_t* p, unsigned rowIdx, cmScoreEvt_t* s, unsigned
|
812
|
816
|
s->type = kNonEvtScId;
|
813
|
817
|
s->secs = secs;
|
814
|
818
|
s->pitch = midiPitch;
|
|
819
|
+ s->vel = midiVel;
|
815
|
820
|
s->flags = flags;
|
816
|
821
|
s->dynVal = dynVal;
|
817
|
822
|
s->barNumb = barNumb;
|
|
@@ -1513,7 +1518,7 @@ cmScRC_t _cmScInitLocArray( cmSc_t* p )
|
1513
|
1518
|
for(i=1; i<p->cnt; ++i )
|
1514
|
1519
|
{
|
1515
|
1520
|
if( p->array[i].secs < p->array[i-1].secs )
|
1516
|
|
- rc = cmErrMsg(&p->err,kSyntaxErrScRC,"The time associated with the score entry on line %i is less than the previous line.",p->array[i].csvRowNumb);
|
|
1521
|
+ rc = cmErrMsg(&p->err,kSyntaxErrScRC,"The time (%f) associated with the score entry on line %i is less than the previous line (%f).",p->array[i].csvRowNumb,p->array[i].secs,p->array[i-1].secs);
|
1517
|
1522
|
|
1518
|
1523
|
if( (p->array[i].secs - p->array[i-1].secs) > maxDSecs )
|
1519
|
1524
|
++p->locCnt;
|
|
@@ -1673,7 +1678,7 @@ cmScoreEvt_t* cmScoreEvt( cmScH_t h, unsigned idx )
|
1673
|
1678
|
return p->array + idx;
|
1674
|
1679
|
}
|
1675
|
1680
|
|
1676
|
|
-cmScoreEvt_t* cmScoreBarEvt( cmScH_t h, unsigned barNumb )
|
|
1681
|
+const cmScoreEvt_t* cmScoreBarEvt( cmScH_t h, unsigned barNumb )
|
1677
|
1682
|
{
|
1678
|
1683
|
cmSc_t* p = _cmScHandleToPtr(h);
|
1679
|
1684
|
unsigned i = 0;
|
|
@@ -1684,6 +1689,18 @@ cmScoreEvt_t* cmScoreBarEvt( cmScH_t h, unsigned barNumb )
|
1684
|
1689
|
return NULL;
|
1685
|
1690
|
}
|
1686
|
1691
|
|
|
1692
|
+const cmScoreEvt_t* cmScoreIdToEvt( cmScH_t h, unsigned csvEventId )
|
|
1693
|
+{
|
|
1694
|
+ cmSc_t* p = _cmScHandleToPtr(h);
|
|
1695
|
+ unsigned i = 0;
|
|
1696
|
+ for(; i<p->cnt; ++i)
|
|
1697
|
+ if( p->array[i].csvEventId==csvEventId )
|
|
1698
|
+ return p->array + i;
|
|
1699
|
+
|
|
1700
|
+ return NULL;
|
|
1701
|
+}
|
|
1702
|
+
|
|
1703
|
+
|
1687
|
1704
|
unsigned cmScoreSectionCount( cmScH_t h )
|
1688
|
1705
|
{
|
1689
|
1706
|
cmSc_t* p = _cmScHandleToPtr(h);
|