libcm is a C development framework with an emphasis on audio signal processing applications.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

cmProc4.h 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. /*
  20. typedef struct
  21. {
  22. cmObj obj;
  23. cmReal_t srate;
  24. cmScH_t scH;
  25. unsigned maxWndSmp;
  26. unsigned wndN;
  27. cmScFolWndEle_t* wndV; // wnd[wndN]
  28. int wni; // oldest value in wnd[]
  29. int locN;
  30. cmScFolLoc_t* loc;
  31. unsigned sri; // last reset score index
  32. unsigned sbi; // first (oldest) score index
  33. unsigned sei; // last (newest) score index
  34. unsigned evalWndN; // (dflt:5) count of elements to use for refined match window
  35. unsigned allowedMissCnt; // (dflt:1) count of non-match elements in refined match where a match is still signaled
  36. unsigned* edWndMtx;
  37. } cmScFol1;
  38. */
  39. typedef struct
  40. {
  41. cmObj obj;
  42. cmReal_t srate; //
  43. cmScH_t scH; // score handle
  44. unsigned bufN; // event buffer count
  45. cmScFolBufEle_t* bufV; // event buffer bufV[bufN] - bufV[bufN-1] newest event, bufV[boi] oldest event
  46. int locN; // count of score locations
  47. cmScFolLoc_t* loc; // score loc[locN]
  48. unsigned sbi; // oldest score window index
  49. unsigned sei; // newest score window index
  50. unsigned msln; // minimum score look ahead count
  51. unsigned mswn; // maximum score window length
  52. //unsigned evalWndN; // (dflt:5) count of elements to use for refined match window
  53. //unsigned allowedMissCnt; // (dflt:1) count of non-match elements in refined match where a match is still signaled
  54. unsigned* edWndMtx;
  55. } cmScFol;
  56. // wndN = max count of elements in the score following window.
  57. // wndMs = max length of the score following window in time
  58. cmScFol* cmScFolAlloc( cmCtx* ctx, cmScFol* p, cmReal_t srate, unsigned bufN, cmReal_t wndMs, cmScH_t scH );
  59. cmRC_t cmScFolFree( cmScFol** pp );
  60. cmRC_t cmScFolInit( cmScFol* p, cmReal_t srate, unsigned bufN, cmReal_t wndMs, cmScH_t scH );
  61. cmRC_t cmScFolFinal( cmScFol* p );
  62. cmRC_t cmScFolReset( cmScFol* p, unsigned scoreIndex );
  63. unsigned cmScFolExec( cmScFol* p, unsigned smpIdx, unsigned status, cmMidiByte_t d0, cmMidiByte_t d1 );
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67. #endif