libcm is a C development framework with an emphasis on audio signal processing applications.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

cmDspPgmKr.c 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #include "cmPrefix.h"
  2. #include "cmGlobal.h"
  3. #include "cmFloatTypes.h"
  4. #include "cmRpt.h"
  5. #include "cmErr.h"
  6. #include "cmCtx.h"
  7. #include "cmMem.h"
  8. #include "cmMallocDebug.h"
  9. #include "cmLinkedHeap.h"
  10. #include "cmText.h"
  11. #include "cmFileSys.h"
  12. #include "cmSymTbl.h"
  13. #include "cmJson.h"
  14. #include "cmPrefs.h"
  15. #include "cmDspValue.h"
  16. #include "cmMsgProtocol.h"
  17. #include "cmThread.h"
  18. #include "cmUdpPort.h"
  19. #include "cmUdpNet.h"
  20. #include "cmAudioSys.h"
  21. #include "cmProcObj.h"
  22. #include "cmDspCtx.h"
  23. #include "cmDspClass.h"
  24. #include "cmDspSys.h"
  25. #include "cmDspPgm.h"
  26. #include "cmAudioFile.h"
  27. #include "cmProcObj.h"
  28. #include "cmProc.h"
  29. #include "cmProc3.h"
  30. #include "cmVectOpsTemplateMain.h"
  31. #include "cmVectOps.h"
  32. cmDspRC_t _cmDspSysPgm_TimeLine(cmDspSysH_t h, void** userPtrPtr )
  33. {
  34. cmDspRC_t rc = kOkDspRC;
  35. const cmChar_t* tlFn = "/home/kevin/src/cmgv/src/gv/data/tl7.js";
  36. const cmChar_t* audPath = "/home/kevin/media/audio/20110723-Kriesberg/Audio Files";
  37. const cmChar_t* scFn = "/home/kevin/src/cmgv/src/gv/data/mod2b.txt";
  38. cmDspInst_t* sci = cmDspSysAllocInst(h,"Scalar", "ScIdx", 5, kNumberDuiId, 0.0, 10000.0, 1.0, 0.0);
  39. cmDspInst_t* tlp = cmDspSysAllocInst(h,"TimeLine", "tl", 2, tlFn, audPath );
  40. cmDspInst_t* php = cmDspSysAllocInst(h,"Phasor", NULL, 0 );
  41. cmDspInst_t* wtp = cmDspSysAllocInst(h,"WaveTable", NULL, 2, cmDspSysSampleRate(h), 0 );
  42. cmDspInst_t* pts = cmDspSysAllocInst(h,"PortToSym", NULL, 1, "start" );
  43. cmDspInst_t* mfp = cmDspSysAllocInst(h,"MidiFilePlay",NULL, 0 );
  44. cmDspInst_t* sfp = cmDspSysAllocInst(h,"ScFol", NULL, 1, scFn );
  45. cmDspInst_t* ao0p = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 0 );
  46. cmDspInst_t* ao1p = cmDspSysAllocInst(h,"AudioOut", NULL, 1, 1 );
  47. cmDspInst_t* prp = cmDspSysAllocInst(h,"Printer", NULL, 1, ">" );
  48. if((rc = cmDspSysLastRC(h)) != kOkDspRC )
  49. return rc;
  50. cmDspSysConnectAudio(h, php, "out", wtp, "phs" ); // phs -> wt
  51. cmDspSysConnectAudio(h, wtp, "out", ao0p, "in" ); // wt -> aout0
  52. cmDspSysConnectAudio(h, wtp, "out", ao1p, "in" ); // wt -> aout1
  53. cmDspSysInstallCb(h, tlp, "afn", prp, "in", NULL );
  54. cmDspSysInstallCb(h, tlp, "mfn", prp, "in", NULL );
  55. cmDspSysInstallCb(h, tlp, "sel", prp, "in", NULL );
  56. cmDspSysInstallCb(h, tlp, "absi", wtp, "beg", NULL );
  57. cmDspSysInstallCb(h, tlp, "aesi", wtp, "end", NULL );
  58. cmDspSysInstallCb(h, tlp, "afn", wtp, "fn", NULL );
  59. cmDspSysInstallCb(h, tlp, "mbsi", mfp, "bsi", NULL );
  60. cmDspSysInstallCb(h, tlp, "mesi", mfp, "esi", NULL );
  61. cmDspSysInstallCb(h, tlp, "mfn", mfp, "fn", NULL );
  62. cmDspSysInstallCb(h, tlp, "mfn", pts, "start", NULL );
  63. cmDspSysInstallCb(h, pts, "out", mfp, "sel", NULL );
  64. cmDspSysInstallCb(h, mfp, "status", sfp, "status", NULL );
  65. cmDspSysInstallCb(h, mfp, "d0", sfp, "d0", NULL );
  66. cmDspSysInstallCb(h, mfp, "d1", sfp, "d1", NULL );
  67. cmDspSysInstallCb(h, sci, "val", sfp, "index", NULL );
  68. cmDspSysInstallCb(h, sfp, "out", prp, "in", NULL );
  69. return rc;
  70. }