libcm is a C development framework with an emphasis on audio signal processing applications.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cmProc4.h 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. } cmScFolWndEle_t;
  12. typedef struct
  13. {
  14. unsigned pitchCnt; //
  15. unsigned* pitchV; // pitchV[pitchCnt]
  16. unsigned evtIdx; // 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;
  24. unsigned maxWndSmp;
  25. unsigned wndN;
  26. cmScFolWndEle_t* wndV; // wnd[wndN]
  27. int wni; // oldest value in wnd[]
  28. int locN;
  29. cmScFolLoc_t* loc;
  30. unsigned sri; // last reset score index
  31. unsigned sbi; // first (oldest) score index
  32. unsigned sei; // last (newest) score index
  33. unsigned evalWndN; // (dflt:5) count of elements to use for refined match window
  34. unsigned allowedMissCnt; // (dflt:1) count of non-match elements in refined match where a match is still signaled
  35. unsigned* edWndMtx;
  36. } cmScFol;
  37. // wndN = max count of elements in the score following window.
  38. // wndMs = max length of the score following window in time
  39. cmScFol* cmScFolAlloc( cmCtx* ctx, cmScFol* p, cmReal_t srate, unsigned wndN, cmReal_t wndMs, cmScH_t scH );
  40. cmRC_t cmScFolFree( cmScFol** pp );
  41. cmRC_t cmScFolInit( cmScFol* p, cmReal_t srate, unsigned wndN, cmReal_t wndMs, cmScH_t scH );
  42. cmRC_t cmScFolFinal( cmScFol* p );
  43. cmRC_t cmScFolReset( cmScFol* p, unsigned scoreIndex );
  44. unsigned cmScFolExec( cmScFol* p, unsigned smpIdx, unsigned status, cmMidiByte_t d0, cmMidiByte_t d1 );
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif