Browse Source

cmXScore.c : Added 'rptFl' to _cmXScoreFindTiedNote().

master
Kevin Larke 8 years ago
parent
commit
38e9647546
1 changed files with 19 additions and 8 deletions
  1. 19
    8
      app/cmXScore.c

+ 19
- 8
app/cmXScore.c View File

@@ -777,14 +777,15 @@ void _cmXScoreSort( cmXScore_t* p )
777 777
   }
778 778
 }
779 779
 
780
-bool  _cmXScoreFindTiedNote( cmXScore_t* p, cmXsMeas_t* mp, cmXsNote_t* np )
780
+bool  _cmXScoreFindTiedNote( cmXScore_t* p, cmXsMeas_t* mp, cmXsNote_t* np, bool rptFl )
781 781
 {
782 782
   cmXsNote_t* nnp      = np->slink;  // begin w/ note following np
783 783
   unsigned    measNumb = mp->number;
784 784
   unsigned    measNumb0= measNumb;
785 785
   cmChar_t    acc      = np->alter==-1?'b' : (np->alter==1?'#':' ');
786 786
 
787
-  printf("%i %s ",np->meas->number,cmMidiToSciPitch(np->pitch,NULL,0));
787
+  if( rptFl )
788
+    printf("%i %s ",np->meas->number,cmMidiToSciPitch(np->pitch,NULL,0));
788 789
   
789 790
   // for each successive measure
790 791
   for(; mp!=NULL; mp=mp->link)
@@ -800,9 +801,10 @@ bool  _cmXScoreFindTiedNote( cmXScore_t* p, cmXsMeas_t* mp, cmXsNote_t* np )
800 801
         nnp->flags |= kTieProcXsFl;
801 802
         nnp->flags  = cmClrFlag(nnp->flags,kOnsetXsFl);
802 803
 
803
-        printf("---> %i %s ",nnp->meas->number,cmMidiToSciPitch(nnp->pitch,NULL,0));
804
-
804
+        if( rptFl )
805
+          printf("---> %i %s ",nnp->meas->number,cmMidiToSciPitch(nnp->pitch,NULL,0));
805 806
 
807
+        // if this note is not tied to a subsequent note
806 808
         if( cmIsNotFlag(nnp->flags,kTieBegXsFl) )
807 809
         {
808 810
           return true;
@@ -827,7 +829,7 @@ void  _cmXScoreResolveTiesAndLoc( cmXScore_t* p )
827 829
 {
828 830
   unsigned n   = 0;
829 831
   unsigned m   = 0;
830
-  
832
+  bool     rptFl = false;
831 833
   cmXsPart_t* pp = p->partL;
832 834
   
833 835
   // for each part
@@ -850,12 +852,21 @@ void  _cmXScoreResolveTiesAndLoc( cmXScore_t* p )
850 852
         //  may have already been processed by an earlier tied note.)
851 853
         if( cmIsFlag(np->flags,kTieBegXsFl) && cmIsNotFlag(np->flags,kTieProcXsFl))
852 854
         {
853
-          if( _cmXScoreFindTiedNote(p,mp,np) )
855
+          if( _cmXScoreFindTiedNote(p,mp,np,rptFl) )
854 856
             m += 1;
855
-          printf("\n");
857
+          
858
+          if( rptFl )
859
+            printf("\n");
860
+          
856 861
           n += 1;
857 862
         }
858 863
 
864
+        if( cmIsFlag(np->flags,kTieEndXsFl) && cmIsFlag(np->flags,kOnsetXsFl) )
865
+        {
866
+          cmChar_t    acc  = np->alter==-1?'b' : (np->alter==1?'#':' ');
867
+          cmErrWarnMsg(&p->err,kUnterminatedTieXsRC,"The tied %c%c%i in measure %i marked as a tied note but is also marked to sound.",np->step,acc,np->octave,mp->number);
868
+        }
869
+
859 870
         // set the location 
860 871
         if( cmIsFlag(np->flags,kOnsetXsFl) )
861 872
         {
@@ -1648,7 +1659,7 @@ cmXsRC_t cmXScoreTest( cmCtx_t* ctx, const cmChar_t* xmlFn, const cmChar_t* midi
1648 1659
   if((rc = cmXScoreInitialize( ctx, &h, xmlFn, midiFn)) != kOkXsRC )
1649 1660
     return cmErrMsg(&ctx->err,rc,"XScore alloc failed.");
1650 1661
 
1651
-  cmXScoreWriteCsv(h,"/Users/kevin/temp/a0.csv");
1662
+  cmXScoreWriteCsv(h,"/home/kevin/temp/a0.csv");
1652 1663
   cmXScoreReport(h,&ctx->rpt,false);
1653 1664
   
1654 1665
   return cmXScoreFinalize(&h);

Loading…
Cancel
Save