libcm is a C development framework with an emphasis on audio signal processing applications.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

cmProc4.h 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef cmProc4_h
  2. #define cmProc4_h
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef struct
  7. {
  8. unsigned smpIdx; // time tag sample index for val
  9. cmMidiByte_t val; //
  10. bool validFl; //
  11. } cmScFolBufEle_t;
  12. typedef struct
  13. {
  14. unsigned pitchCnt; //
  15. unsigned* pitchV; // pitchV[pitchCnt]
  16. unsigned scIdx; // index of the score event (into cmScoreEvt[]) at this location
  17. int barNumb; // bar number of this location
  18. } cmScFolLoc_t;
  19. typedef struct
  20. {
  21. cmObj obj;
  22. cmReal_t srate; //
  23. cmScH_t scH; // score handle
  24. unsigned bufN; // event buffer count
  25. cmScFolBufEle_t* bufV; // event buffer bufV[bufN] - bufV[bufN-1] newest event, bufV[boi] oldest event
  26. int locN; // count of score locations
  27. cmScFolLoc_t* loc; // score loc[locN]
  28. unsigned sbi; // oldest score window index
  29. unsigned sei; // newest score window index
  30. unsigned msln; // minimum score look ahead count
  31. unsigned mswn; // maximum score window length
  32. unsigned minVel; // notes < minVel are ignored
  33. unsigned missCnt; // current consecutive unmatched notes
  34. unsigned matchCnt;// current consecutive matched notes
  35. bool printFl; // true if pitch tracker reporting should be included
  36. unsigned aheadCnt;// count of score loc's to look ahead for a match to the current pitch when the optimal edit-dist alignment does not produce a match for the current pitch
  37. unsigned eventIdx;// events since init
  38. unsigned* edWndMtx;
  39. } cmScFol;
  40. // bufN = max count of elements in the event buffer.
  41. // wndMs = max length of the score following window in time
  42. cmScFol* cmScFolAlloc( cmCtx* ctx, cmScFol* p, cmReal_t srate, unsigned bufN, cmReal_t wndMs, cmScH_t scH );
  43. cmRC_t cmScFolFree( cmScFol** pp );
  44. cmRC_t cmScFolInit( cmScFol* p, cmReal_t srate, unsigned bufN, cmReal_t wndMs, cmScH_t scH );
  45. cmRC_t cmScFolFinal( cmScFol* p );
  46. cmRC_t cmScFolReset( cmScFol* p, unsigned scoreIndex );
  47. unsigned cmScFolExec( cmScFol* p, unsigned smpIdx, unsigned status, cmMidiByte_t d0, cmMidiByte_t d1 );
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif