Browse Source

*.h/c : Added 'cdg' markup to virtually all source files in libcm, libcm/app and libcm/dsp.

master
Kevin Larke 8 years ago
parent
commit
176073874f
100 changed files with 2346 additions and 2113 deletions
  1. 4
    0
      app/cmDspPgmJsonToDot.h
  2. 4
    0
      app/cmOnset.h
  3. 4
    2
      app/cmPickup.h
  4. 4
    1
      app/cmScore.h
  5. 4
    0
      app/cmScoreProc.h
  6. 6
    3
      app/cmSdb.h
  7. 4
    1
      app/cmTakeSeqBldr.h
  8. 4
    0
      app/cmTimeLine.h
  9. 145
    145
      cmApBuf.h
  10. 4
    0
      cmArray.h
  11. 3
    2
      cmAudDsp.h
  12. 6
    2
      cmAudDspIF.h
  13. 14
    11
      cmAudDspLocal.h
  14. 4
    0
      cmAudLabelFile.h
  15. 4
    1
      cmAudioAggDev.h
  16. 3
    1
      cmAudioBuf.h
  17. 108
    126
      cmAudioFile.h
  18. 11
    0
      cmAudioFileDev.h
  19. 4
    1
      cmAudioFileMgr.h
  20. 4
    1
      cmAudioNrtDev.h
  21. 85
    85
      cmAudioPort.h
  22. 4
    0
      cmAudioPortFile.h
  23. 6
    7
      cmAudioSys.h
  24. 4
    1
      cmAudioSysMsg.h
  25. 11
    0
      cmComplexTypes.h
  26. 4
    0
      cmCsv.h
  27. 4
    4
      cmCtx.h
  28. 3
    1
      cmDList.h
  29. 4
    0
      cmDListTpl.h
  30. 3
    1
      cmData.h
  31. 5
    1
      cmDevCfg.h
  32. 2
    3
      cmErr.h
  33. 3
    0
      cmExec.h
  34. 1
    1
      cmFeatFile.c
  35. 142
    146
      cmFeatFile.h
  36. 1
    0
      cmFile.c
  37. 7
    8
      cmFile.h
  38. 2
    4
      cmFileSys.h
  39. 37
    36
      cmFloatTypes.h
  40. 3
    3
      cmFrameFile.c
  41. 10
    7
      cmFrameFile.h
  42. 6
    8
      cmGlobal.h
  43. 94
    82
      cmGnuPlot.h
  44. 2
    0
      cmGr.h
  45. 4
    1
      cmGrDevCtx.h
  46. 15
    2
      cmGrPage.h
  47. 3
    0
      cmGrPlot.h
  48. 4
    1
      cmGrPlotAudio.h
  49. 4
    0
      cmHashTbl.h
  50. 2
    3
      cmJson.h
  51. 62
    55
      cmKeyboard.h
  52. 1
    5
      cmLex.h
  53. 3
    1
      cmLib.h
  54. 1
    1
      cmLinkedHeap.c
  55. 11
    2
      cmLinkedHeap.h
  56. 4
    0
      cmMain.c
  57. 10
    14
      cmMallocDebug.h
  58. 127
    115
      cmMath.h
  59. 8
    6
      cmMem.h
  60. 4
    0
      cmMidi.h
  61. 6
    3
      cmMidiFile.h
  62. 41
    37
      cmMidiFilePlay.h
  63. 9
    2
      cmMidiPort.h
  64. 3
    0
      cmMsgProtocol.h
  65. 2
    3
      cmPgmOpts.h
  66. 4
    1
      cmPrefs.h
  67. 112
    134
      cmProc.h
  68. 97
    31
      cmProc2.h
  69. 79
    29
      cmProc3.h
  70. 26
    12
      cmProc4.h
  71. 22
    16
      cmProc5.h
  72. 3
    2
      cmProcObj.h
  73. 3
    0
      cmRbm.h
  74. 1
    4
      cmRpt.h
  75. 4
    1
      cmRtNet.h
  76. 4
    7
      cmRtSys.h
  77. 4
    2
      cmRtSysMsg.h
  78. 2
    9
      cmSerialize.h
  79. 4
    1
      cmStack.h
  80. 4
    0
      cmStrStream.h
  81. 1
    7
      cmSymTbl.h
  82. 4
    0
      cmTagFile.h
  83. 4
    2
      cmTaskMgr.h
  84. 2
    3
      cmText.h
  85. 55
    49
      cmTextTemplate.h
  86. 23
    6
      cmThread.h
  87. 3
    8
      cmTime.h
  88. 3
    1
      cmUdpNet.h
  89. 4
    1
      cmUdpPort.h
  90. 8
    4
      cmUi.h
  91. 3
    0
      cmUiDrvr.h
  92. 4
    0
      cmUiRtSysMstr.h
  93. 3
    0
      cmVirtNet.h
  94. 139
    481
      dsp/cmDspBuiltIn.c
  95. 4
    1
      dsp/cmDspClass.h
  96. 218
    143
      dsp/cmDspFx.c
  97. 234
    208
      dsp/cmDspKr.c
  98. 4
    0
      dsp/cmDspNet.h
  99. 150
    4
      dsp/cmDspPgm.c
  100. 0
    0
      dsp/cmDspPgmKr.c

+ 4
- 0
app/cmDspPgmJsonToDot.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Convert a JSON graph description to a DOT vector graphics file." kw:[file plot]}
9
+  
8 10
   enum
9 11
   {
10 12
     kOkDotRC = cmOkRC,
@@ -18,6 +20,8 @@ extern "C" {
18 20
   typedef unsigned cmDotRC_t;
19 21
 
20 22
   cmDotRC_t cmDspPgmJsonToDot( cmCtx_t* ctx, const cmChar_t* inFn, const cmChar_t* outFn );
23
+
24
+  //)
21 25
   
22 26
 #ifdef __cplusplus
23 27
 }

+ 4
- 0
app/cmOnset.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Musical event onset detector." kw:[audio] }
9
+  
8 10
   enum
9 11
   {
10 12
     kOkOnRC = cmOkRC,
@@ -65,6 +67,8 @@ extern "C" {
65 67
 
66 68
   cmOnRC_t cmOnsetTest( cmCtx_t* c );
67 69
 
70
+  //)
71
+  
68 72
 #ifdef __cplusplus
69 73
 }
70 74
 #endif

+ 4
- 2
app/cmPickup.h View File

@@ -5,7 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-
8
+  //( { file_desc:"'fluxo' channel calibration and gain normalization program." kw:[fluxo]}
9
+  
9 10
   enum
10 11
   {
11 12
     kOkPuRC = cmOkRC,
@@ -88,7 +89,8 @@ extern "C" {
88 89
   void cmPuReport( cmPuH_t h, cmRpt_t* rpt );
89 90
 
90 91
   void cmPuTest(cmCtx_t* ctx);
91
-
92
+  //)
93
+  
92 94
 #ifdef __cplusplus
93 95
 }
94 96
 #endif

+ 4
- 1
app/cmScore.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Object for managing musical score data." kw:[score]}
9
+  
8 10
   enum
9 11
   {
10 12
     kOkScRC = cmOkRC,
@@ -273,7 +275,8 @@ extern "C" {
273 275
 
274 276
   void          cmScoreTest( cmCtx_t* ctx, const cmChar_t* fn );
275 277
 
276
-
278
+  //)
279
+  
277 280
 #ifdef __cplusplus
278 281
 }
279 282
 #endif

+ 4
- 0
app/cmScoreProc.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Programs for processing cmScore and peformane data." kw:[score seq]}
9
+
8 10
   typedef unsigned cmSpRC_t;
9 11
 
10 12
   enum
@@ -21,6 +23,8 @@ extern "C" {
21 23
 
22 24
   cmSpRC_t  cmScoreProc(cmCtx_t* ctx );
23 25
 
26
+  //)
27
+  
24 28
 #ifdef __cplusplus
25 29
 }
26 30
 #endif

+ 6
- 3
app/cmSdb.h View File

@@ -5,7 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  /*
8
+  /*( { file_desc:"Musical instrument sample database manager and synthetic sequence generator." kw:[audio] }
9
+
9 10
     The CSV file used to initialize a SDB object has the  following column syntax.
10 11
     
11 12
     Column Name     Type  Description
@@ -40,7 +41,7 @@ extern "C" {
40 41
         so that their cmSdb value is zero based.  See cmSdbLoad().
41 42
  
42 43
    */
43
-
44
+  
44 45
   enum
45 46
   {
46 47
     kOkSdbRC,
@@ -291,7 +292,9 @@ extern "C" {
291 292
   void                   cmSdbSeqPrint( cmSdbSeqH_t sh, cmRpt_t* rpt );
292 293
 
293 294
   cmSdbRC_t cmSdbTest( cmCtx_t* ctx );
294
-
295
+  
296
+  //)
297
+  
295 298
 #ifdef __cplusplus
296 299
 }
297 300
 #endif

+ 4
- 1
app/cmTakeSeqBldr.h View File

@@ -5,7 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-
8
+  //( { file_desc:"Concatenate multipel overlapping MIDI performances into a single virtual performance based by associating score information with the MIDI events." kw:[seq] }
9
+  
9 10
   enum
10 11
   {
11 12
     kOkTsbRC = cmOkRC,
@@ -123,6 +124,8 @@ extern "C" {
123 124
 
124 125
   cmTsbRC_t cmTakeSeqBldrTest( cmCtx_t* ctx );
125 126
 
127
+  //)
128
+  
126 129
 #ifdef __cplusplus
127 130
 }
128 131
 #endif

+ 4
- 0
app/cmTimeLine.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Manage, save, and restore a time-line containing  MIDI files, Audio files, Audio events, and arbitrary markers ." kw[seq] }
9
+ 
8 10
 
9 11
   typedef cmHandle_t cmTlH_t;
10 12
 
@@ -248,6 +250,8 @@ extern "C" {
248 250
   // callback function.
249 251
   cmTlRC_t cmTimeLineDecode( const void* msg, unsigned msgByteCnt, cmTlUiMsg_t* uiMsg );
250 252
 
253
+  //)
254
+  
251 255
 #ifdef __cplusplus
252 256
 }
253 257
 #endif

+ 145
- 145
cmApBuf.h View File

@@ -1,34 +1,33 @@
1
-/// \file cmApBuf.h
2
-/// \brief  Thread-safe audio buffer class.
3
-///
4
-/// This file defines an audio buffer class which handles
5
-/// buffering incoming (recording) and outgoing (playback)
6
-/// samples in a thread-safe manner. 
7
-///
8
-/// Usage example and testing code:
9
-/// See cmApBufTest() and cmAudioSysTest().
10
-/// \snippet cmApBuf.c cmApBufExample
11
-///
12
-/// Notes on channel flags:
13
-/// Disabled channels:  kChFl is cleared
14
-///   cmApBufGet()     
15
-///      in  - return NULL buffer pointers  
16
-///      out - return NULL buffer points
17
-///
18
-///   cmApBufUpdate()
19
-///      in  - incoming samples are set to 0. 
20
-///      out - outgoing samples are set to 0.
21
-///
22
-/// Muted channels: kMuteFl is set 
23
-///   cmApBufUpdate()
24
-///      in  - incoming samples are set to 0. 
25
-///      out - outgoing samples are set to 0.
26
-///
27
-/// Tone channels: kToneFl is set 
28
-///   cmApBufUpdate()
29
-///      in  - incoming samples are filled with a 1k sine tone
30
-///      out - outgoing samples are filled with a 1k sine tone
31
-///
1
+//( {file_desc: "Thread safe audio buffer class." kw:[rt audio]}
2
+//
3
+// This file defines an audio buffer class which handles
4
+// buffering incoming (recording) and outgoing (playback)
5
+// samples in a thread-safe manner. 
6
+//
7
+// Usage example and testing code:
8
+// See cmApBufTest() and cmAudioSysTest().
9
+// \snippet cmApBuf.c cmApBufExample
10
+//
11
+// Notes on channel flags:
12
+// Disabled channels:  kChFl is cleared
13
+//   cmApBufGet()     
14
+//      in  - return NULL buffer pointers  
15
+//      out - return NULL buffer points
16
+//
17
+//   cmApBufUpdate()
18
+//      in  - incoming samples are set to 0. 
19
+//      out - outgoing samples are set to 0.
20
+//
21
+// Muted channels: kMuteFl is set 
22
+//   cmApBufUpdate()
23
+//      in  - incoming samples are set to 0. 
24
+//      out - outgoing samples are set to 0.
25
+//
26
+// Tone channels: kToneFl is set 
27
+//   cmApBufUpdate()
28
+//      in  - incoming samples are filled with a 1k sine tone
29
+//      out - outgoing samples are filled with a 1k sine tone
30
+//)
32 31
 
33 32
 #ifndef cmApBuf_h
34 33
 #define cmApBuf_h
@@ -36,199 +35,200 @@
36 35
 #ifdef __cplusplus
37 36
 extern "C" {
38 37
 #endif
39
-
40
-  typedef cmRC_t cmAbRC_t;  ///< Result code type
38
+  
39
+  //(
40
+  typedef cmRC_t cmAbRC_t;  //< Result code type
41 41
   
42 42
   enum
43 43
   {
44 44
     kOkAbRC = 0
45 45
   };
46 46
 
47
-  /// Allocate and initialize an audio buffer.
48
-  /// devCnt - count of devices this buffer will handle.
49
-  /// meterMs - length of the meter buffers in milliseconds (automatically limit to the range:10 to 1000)
47
+  // Allocate and initialize an audio buffer.
48
+  // devCnt - count of devices this buffer will handle.
49
+  // meterMs - length of the meter buffers in milliseconds (automatically limit to the range:10 to 1000)
50 50
   cmAbRC_t cmApBufInitialize( unsigned devCnt, unsigned meterMs );
51 51
 
52
-  /// Deallocate and release any resource held by an audio buffer allocated via cmApBufInitialize().
52
+  // Deallocate and release any resource held by an audio buffer allocated via cmApBufInitialize().
53 53
   cmAbRC_t cmApBufFinalize();
54 54
 
55
-  /// Configure a buffer for a given device.  
55
+  // Configure a buffer for a given device.  
56 56
   cmAbRC_t cmApBufSetup( 
57
-    unsigned devIdx,              ///< device to setup
58
-    double   srate,               ///< device sample rate (only required for synthesizing the correct test-tone frequency)
59
-    unsigned dspFrameCnt,         /// dspFrameCnt - count of samples in channel buffers returned via cmApBufGet() 
60
-    unsigned cycleCnt,            ///< number of audio port cycles to store 
61
-    unsigned inChCnt,             ///< input channel count on this device
62
-    unsigned inFramesPerCycle,    ///< maximum number of incoming sample frames on an audio port cycle
63
-    unsigned outChCnt,            ///< output channel count on this device
64
-    unsigned outFramesPerCycle    ///< maximum number of outgoing sample frames in an audio port cycle
57
+    unsigned devIdx,              //< device to setup
58
+    double   srate,               //< device sample rate (only required for synthesizing the correct test-tone frequency)
59
+    unsigned dspFrameCnt,         // dspFrameCnt - count of samples in channel buffers returned via cmApBufGet() 
60
+    unsigned cycleCnt,            //< number of audio port cycles to store 
61
+    unsigned inChCnt,             //< input channel count on this device
62
+    unsigned inFramesPerCycle,    //< maximum number of incoming sample frames on an audio port cycle
63
+    unsigned outChCnt,            //< output channel count on this device
64
+    unsigned outFramesPerCycle    //< maximum number of outgoing sample frames in an audio port cycle
65 65
                          );
66 66
 
67
-  /// Prime the buffer with 'audioCycleCnt' * outFramesPerCycle samples ready to be played
67
+  // Prime the buffer with 'audioCycleCnt' * outFramesPerCycle samples ready to be played
68 68
   cmAbRC_t cmApBufPrimeOutput( unsigned devIdx, unsigned audioCycleCnt );
69 69
 
70
-  /// Notify the audio buffer that a device is being enabled or disabled.
70
+  // Notify the audio buffer that a device is being enabled or disabled.
71 71
   void     cmApBufOnPortEnable( unsigned devIdx, bool enabelFl );
72 72
 
73
-  /// This function is called asynchronously by the audio device driver to transfer incoming samples to the
74
-  /// the buffer and to send outgoing samples to the DAC. This function is 
75
-  /// intended to be called from the audio port callback function (\see cmApCallbackPtr_t).
76
-  /// This function is thread-safe under the condition where the audio device uses
77
-  /// different threads for input and output.
78
-  ///
79
-  /// Enable Flag: 
80
-  /// Input: If an input channel is disabled then the incoming samples are replaced with zeros.
81
-  /// Output: If an output channel is disabled then the packet samples are set to zeros.
82
-  ///
83
-  /// Tone Flag:
84
-  /// Input: If the tone flag is set on an input channel then the incoming samples are set to a sine tone.
85
-  /// Output: If the tone flag is set on an output channel then the packet samples are set to a sine tone.
86
-  ///
87
-  /// The enable flag has higher precedence than the tone flag therefore disabled channels
88
-  /// will be set to zero even if the tone flag is set.
73
+  // This function is called asynchronously by the audio device driver to transfer incoming samples to the
74
+  // the buffer and to send outgoing samples to the DAC. This function is 
75
+  // intended to be called from the audio port callback function (\see cmApCallbackPtr_t).
76
+  // This function is thread-safe under the condition where the audio device uses
77
+  // different threads for input and output.
78
+  //
79
+  // Enable Flag: 
80
+  // Input: If an input channel is disabled then the incoming samples are replaced with zeros.
81
+  // Output: If an output channel is disabled then the packet samples are set to zeros.
82
+  //
83
+  // Tone Flag:
84
+  // Input: If the tone flag is set on an input channel then the incoming samples are set to a sine tone.
85
+  // Output: If the tone flag is set on an output channel then the packet samples are set to a sine tone.
86
+  //
87
+  // The enable flag has higher precedence than the tone flag therefore disabled channels
88
+  // will be set to zero even if the tone flag is set.
89 89
   cmAbRC_t cmApBufUpdate(
90
-    cmApAudioPacket_t* inPktArray,  ///< full audio packets from incoming audio (from ADC)
91
-    unsigned           inPktCnt,    ///< count of incoming audio packets
92
-    cmApAudioPacket_t* outPktArray, ///< empty audio packet for outgoing audio (to DAC)  
93
-    unsigned           outPktCnt    ///< count of outgoing audio packets
90
+    cmApAudioPacket_t* inPktArray,  //< full audio packets from incoming audio (from ADC)
91
+    unsigned           inPktCnt,    //< count of incoming audio packets
92
+    cmApAudioPacket_t* outPktArray, //< empty audio packet for outgoing audio (to DAC)  
93
+    unsigned           outPktCnt    //< count of outgoing audio packets
94 94
                          );
95
-  /// Channel flags
95
+  // Channel flags
96 96
   enum
97 97
   {
98
-    kInApFl     = 0x01,  ///< Identify an input channel
99
-    kOutApFl    = 0x02,  ///< Identify an output channel
100
-    kEnableApFl = 0x04,  ///< Set to enable a channel, Clear to disable. 
101
-
102
-    kChApFl     = 0x08,  ///< Used to enable/disable a channel
103
-    kMuteApFl   = 0x10,  ///< Mute this channel
104
-    kToneApFl   = 0x20,  ///< Generate a tone on this channel
105
-    kMeterApFl  = 0x40,  ///< Turn meter's on/off
106
-    kPassApFl   = 0x80   ///< Pass input channels throught to the output. Must use cmApBufGetIO() to implement this functionality.
98
+    kInApFl     = 0x01,  //< Identify an input channel
99
+    kOutApFl    = 0x02,  //< Identify an output channel
100
+    kEnableApFl = 0x04,  //< Set to enable a channel, Clear to disable. 
101
+
102
+    kChApFl     = 0x08,  //< Used to enable/disable a channel
103
+    kMuteApFl   = 0x10,  //< Mute this channel
104
+    kToneApFl   = 0x20,  //< Generate a tone on this channel
105
+    kMeterApFl  = 0x40,  //< Turn meter's on/off
106
+    kPassApFl   = 0x80   //< Pass input channels throught to the output. Must use cmApBufGetIO() to implement this functionality.
107 107
   
108 108
   };
109 109
 
110
-  /// Return the meter window period as set by cmApBufInitialize()
110
+  // Return the meter window period as set by cmApBufInitialize()
111 111
   unsigned cmApBufMeterMs();
112 112
   
113 113
   // Set the meter update period. THis function limits the value to between 10 and 1000.
114 114
   void     cmApBufSetMeterMs( unsigned meterMs );
115 115
 
116
-  /// Returns the channel count set via cmApBufSetup().
116
+  // Returns the channel count set via cmApBufSetup().
117 117
   unsigned cmApBufChannelCount( unsigned devIdx, unsigned flags );
118 118
 
119
-  /// Set chIdx to -1 to enable all channels on this device.
120
-  /// Set flags to {kInApFl | kOutApFl} | {kChApFl | kToneApFl | kMeterFl} | { kEnableApFl=on | 0=off }  
119
+  // Set chIdx to -1 to enable all channels on this device.
120
+  // Set flags to {kInApFl | kOutApFl} | {kChApFl | kToneApFl | kMeterFl} | { kEnableApFl=on | 0=off }  
121 121
   void cmApBufSetFlag( unsigned devIdx, unsigned chIdx, unsigned flags );
122 122
   
123
-  /// Return true if the the flags is set.
123
+  // Return true if the the flags is set.
124 124
   bool cmApBufIsFlag( unsigned devIdx, unsigned chIdx, unsigned flags );
125 125
 
126
-  /// Set chIdx to -1 to enable all channels on this device.
126
+  // Set chIdx to -1 to enable all channels on this device.
127 127
   void  cmApBufEnableChannel(   unsigned devIdx, unsigned chIdx, unsigned flags );
128 128
 
129
-  /// Returns true if an input/output channel is enabled on the specified device.
129
+  // Returns true if an input/output channel is enabled on the specified device.
130 130
   bool  cmApBufIsChannelEnabled(unsigned devIdx, unsigned chIdx, unsigned flags );
131 131
 
132
-  /// Set the state of the tone generator on the specified channel.
133
-  /// Set chIdx to -1 to apply the change to all channels on this device.
134
-  /// Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
132
+  // Set the state of the tone generator on the specified channel.
133
+  // Set chIdx to -1 to apply the change to all channels on this device.
134
+  // Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
135 135
   void  cmApBufEnableTone(   unsigned devIdx, unsigned chIdx, unsigned flags );
136 136
 
137
-  /// Returns true if an input/output tone is enabled on the specified device.
137
+  // Returns true if an input/output tone is enabled on the specified device.
138 138
   bool  cmApBufIsToneEnabled(unsigned devIdx, unsigned chIdx, unsigned flags );
139 139
 
140
-  /// Mute a specified channel.
141
-  /// Set chIdx to -1 to apply the change to all channels on this device.
142
-  /// Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
140
+  // Mute a specified channel.
141
+  // Set chIdx to -1 to apply the change to all channels on this device.
142
+  // Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
143 143
   void  cmApBufEnableMute(   unsigned devIdx, unsigned chIdx, unsigned flags );
144 144
 
145
-  /// Returns true if an input/output channel is muted on the specified device.
145
+  // Returns true if an input/output channel is muted on the specified device.
146 146
   bool  cmApBufIsMuteEnabled(unsigned devIdx, unsigned chIdx, unsigned flags );
147 147
 
148
-  /// Set the specified channel to pass through.
149
-  /// Set chIdx to -1 to apply the change to all channels on this device.
150
-  /// Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
148
+  // Set the specified channel to pass through.
149
+  // Set chIdx to -1 to apply the change to all channels on this device.
150
+  // Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
151 151
   void  cmApBufEnablePass(   unsigned devIdx, unsigned chIdx, unsigned flags );
152 152
 
153
-  /// Returns true if pass through is enabled on the specified channel.
153
+  // Returns true if pass through is enabled on the specified channel.
154 154
   bool  cmApBufIsPassEnabled(unsigned devIdx, unsigned chIdx, unsigned flags );
155 155
 
156
-  /// Turn meter data collection on and off.
157
-  /// Set chIdx to -1 to apply the change to all channels on this device.
158
-  /// Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
156
+  // Turn meter data collection on and off.
157
+  // Set chIdx to -1 to apply the change to all channels on this device.
158
+  // Set flags to {kInApFl | kOutApFl} | { kEnableApFl=on | 0=off }
159 159
   void  cmApBufEnableMeter(   unsigned devIdx, unsigned chIdx, unsigned flags );
160 160
 
161
-  /// Returns true if an input/output tone is enabled on the specified device.
161
+  // Returns true if an input/output tone is enabled on the specified device.
162 162
   bool  cmApBufIsMeterEnabled(unsigned devIdx, unsigned chIdx, unsigned flags );
163 163
 
164
-  /// Return the meter value for the requested channel.
165
-  /// Set flags to kInApFl | kOutApFl.
164
+  // Return the meter value for the requested channel.
165
+  // Set flags to kInApFl | kOutApFl.
166 166
   cmApSample_t cmApBufMeter(unsigned devIdx, unsigned chIdx, unsigned flags );
167 167
 
168
-  /// Set chIdx to -1 to apply the gain to all channels on the specified device.
168
+  // Set chIdx to -1 to apply the gain to all channels on the specified device.
169 169
   void cmApBufSetGain( unsigned devIdx, unsigned chIdx, unsigned flags, double gain );
170 170
 
171
-  /// Return the current gain seting for the specified channel.
171
+  // Return the current gain seting for the specified channel.
172 172
   double cmApBufGain( unsigned devIdx, unsigned chIdx, unsigned flags ); 
173 173
 
174
-  /// Get the meter and fault status of the channel input or output channel array of a device.
175
-  /// Set 'flags' to { kInApFl | kOutApFl }.
176
-  /// The returns value is the count of channels actually written to meterArray.
177
-  /// If 'faultCntPtr' is non-NULL then it is set to the faultCnt of the associated devices input or output buffer.
174
+  // Get the meter and fault status of the channel input or output channel array of a device.
175
+  // Set 'flags' to { kInApFl | kOutApFl }.
176
+  // The returns value is the count of channels actually written to meterArray.
177
+  // If 'faultCntPtr' is non-NULL then it is set to the faultCnt of the associated devices input or output buffer.
178 178
   unsigned cmApBufGetStatus( unsigned devIdx, unsigned flags, double* meterArray, unsigned meterCnt, unsigned* faultCntPtr );
179 179
 
180
-  /// Do all enabled input/output channels on this device have samples available?
181
-  /// 'flags' can be set to either or both kInApFl and kOutApFl
180
+  // Do all enabled input/output channels on this device have samples available?
181
+  // 'flags' can be set to either or both kInApFl and kOutApFl
182 182
   bool  cmApBufIsDeviceReady( unsigned devIdx, unsigned flags ); 
183 183
 
184
-  /// This function is called by the application to get full incoming sample buffers and
185
-  /// to fill empty outgoing sample buffers.
186
-  /// Upon return each element in bufArray[bufChCnt] holds a pointer to a buffer assoicated 
187
-  /// with an audio channel or to NULL if the channel is disabled.
188
-  /// 'flags' can be set to kInApFl or kOutApFl but not both.
189
-  /// The buffers pointed to by bufArray[] each contain 'dspFrameCnt' samples. Where 
190
-  /// 'dspFrameCnt' was set in the earlier call to cmApBufSetup() for this device.
191
-  /// (see cmApBufInitialize()).
192
-  /// Note that this function just returns audio information it does not
193
-  /// change any cmApBuf() internal states.
184
+  // This function is called by the application to get full incoming sample buffers and
185
+  // to fill empty outgoing sample buffers.
186
+  // Upon return each element in bufArray[bufChCnt] holds a pointer to a buffer assoicated 
187
+  // with an audio channel or to NULL if the channel is disabled.
188
+  // 'flags' can be set to kInApFl or kOutApFl but not both.
189
+  // The buffers pointed to by bufArray[] each contain 'dspFrameCnt' samples. Where 
190
+  // 'dspFrameCnt' was set in the earlier call to cmApBufSetup() for this device.
191
+  // (see cmApBufInitialize()).
192
+  // Note that this function just returns audio information it does not
193
+  // change any cmApBuf() internal states.
194 194
   void cmApBufGet(     unsigned devIdx, unsigned flags, cmApSample_t* bufArray[], unsigned bufChCnt );
195 195
 
196
-  /// This function replaces calls to cmApBufGet() and implements pass-through and output 
197
-  /// buffer zeroing: 
198
-  /// 
199
-  /// 1) cmApBufGet(in);
200
-  /// 2) cmApBufGet(out);
201
-  /// 3) Copy through channels marked for 'pass' and set the associated oBufArray[i] channel to NULL.
202
-  /// 4) Zero all other enabled output channels.
203
-  ///
204
-  /// Notes:
205
-  /// 1) The oBufArray[] channels that are disabled or marked for pass-through will 
206
-  /// be set to NULL.
207
-  /// 2) The client is required to use this function to implement pass-through internally.
208
-  /// 3) This function just returns audio information it does not
209
-  /// change any cmApBuf() internal states.
210
-  /// 4) The timestamp pointers are optional.
196
+  // This function replaces calls to cmApBufGet() and implements pass-through and output 
197
+  // buffer zeroing: 
198
+  // 
199
+  // 1) cmApBufGet(in);
200
+  // 2) cmApBufGet(out);
201
+  // 3) Copy through channels marked for 'pass' and set the associated oBufArray[i] channel to NULL.
202
+  // 4) Zero all other enabled output channels.
203
+  //
204
+  // Notes:
205
+  // 1) The oBufArray[] channels that are disabled or marked for pass-through will 
206
+  // be set to NULL.
207
+  // 2) The client is required to use this function to implement pass-through internally.
208
+  // 3) This function just returns audio information it does not
209
+  // change any cmApBuf() internal states.
210
+  // 4) The timestamp pointers are optional.
211 211
   void cmApBufGetIO(   unsigned iDevIdx, cmApSample_t* iBufArray[], unsigned iBufChCnt, cmTimeSpec_t* iTimeStampPtr, 
212 212
                        unsigned oDevIdx, cmApSample_t* oBufArray[], unsigned oBufChCnt, cmTimeSpec_t* oTimeStampPtr );
213 213
 
214 214
 
215
-  /// The application calls this function each time it completes processing of a bufArray[]
216
-  /// returned from cmApBufGet(). 'flags' can be set to either or both kInApFl and kOutApFl.
217
-  /// This function should only be called from the client thread.
215
+  // The application calls this function each time it completes processing of a bufArray[]
216
+  // returned from cmApBufGet(). 'flags' can be set to either or both kInApFl and kOutApFl.
217
+  // This function should only be called from the client thread.
218 218
   void cmApBufAdvance( unsigned devIdx, unsigned flags );
219 219
 
220
-    /// Copy all available samples incoming samples from an input device to an output device.
221
-  /// The source code for this example is a good example of how an application should use cmApBufGet()
222
-  /// and cmApBufAdvance().
220
+    // Copy all available samples incoming samples from an input device to an output device.
221
+  // The source code for this example is a good example of how an application should use cmApBufGet()
222
+  // and cmApBufAdvance().
223 223
   void cmApBufInputToOutput( unsigned inDevIdx, unsigned outDevIdx );
224 224
 
225
-  /// Print the current buffer state.
225
+  // Print the current buffer state.
226 226
   void cmApBufReport( cmRpt_t* rpt );
227 227
 
228
-  /// Run a buffer usage simulation to test the class. cmAudioPortTest.c calls this function.
228
+  // Run a buffer usage simulation to test the class. cmAudioPortTest.c calls this function.
229 229
   void cmApBufTest( cmRpt_t* rpt );
230 230
 
231
-
231
+  //)
232 232
 
233 233
 
234 234
 #ifdef __cplusplus

+ 4
- 0
cmArray.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc: "Dynamic array container class." kw:[container] }
9
+  
8 10
 enum
9 11
 {
10 12
   kOkArRC = cmOkRC,
@@ -55,6 +57,8 @@ enum
55 57
   // Zero elements i:i+n-1
56 58
 #define cmArrayClrN(t,h,i,n) ((t*)cmArraySet(h,i,NULL,n))
57 59
 
60
+  //)
61
+  
58 62
 #ifdef __cplusplus
59 63
 }
60 64
 #endif

+ 3
- 2
cmAudDsp.h View File

@@ -5,8 +5,7 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  // This API supports a serialized interface to an internal instance of 
9
-  // cmAudioSys and cmDspSys.  
8
+  //( { file_desc: "Supports a serialized interface to an internal instance of  cmAudioSys and cmDspSys." kw:[rt]}
10 9
 
11 10
   enum
12 11
   {
@@ -50,6 +49,8 @@ extern "C" {
50 49
   // client program to the aud_dsp system.
51 50
   cmAdRC_t cmAudDspReceiveClientMsg( cmAdH_t h, unsigned msgBytecnt, const void* msg );
52 51
   
52
+  //)
53
+  
53 54
 
54 55
 #ifdef __cplusplus
55 56
   }

+ 6
- 2
cmAudDspIF.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc: "Virtual interface to the audio DSP system." kw:[rt]}
9
+  //
8 10
   // This class provides a two-way interface to the audio DSP system.
9 11
   // It is designed to work independenty of the physical
10 12
   // method of communication.  For example, when used by
@@ -41,8 +43,9 @@ extern "C" {
41 43
   //    client provided cmAdIfDispatch_t function (ssInitFunc,statusFunc or uiFunc).
42 44
   //    Note that this entire chain of calls occurs in the client thread
43 45
   //    and in the context of the cmAdIfDispatchMsgToHost() procedure.
44
-                         
46
+  //)
45 47
 
48
+  //(
46 49
   enum
47 50
   {
48 51
     kOkAiRC = cmOkRC,
@@ -174,7 +177,8 @@ extern "C" {
174 177
                               
175 178
    */
176 179
 
177
-
180
+  //)
181
+  
178 182
 #ifdef __cplusplus
179 183
 }
180 184
 #endif

+ 14
- 11
cmAudDspLocal.h View File

@@ -5,17 +5,19 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  /*
9
-    This class instantiates an audio-DSP engine (cmAudDsp),
10
-    an interface for communicating with it (cmAudDspIF),
11
-    and message delivery functions for copying messages
12
-    in both directions between cmAuDsp and cmAudDspIF.
13
-
14
-    Note that the actual inteface which allows an application to
15
-    control, and receive message from, cmAudDsp is provided by
16
-    cmAudDspIF - which this class provides a handle to.
17
-    
18
-   */
8
+  //( { file_desc: "Implementation of the audio DSP interface for local, in-memory, communication." kw:[rt]}
9
+  //
10
+  //  This class instantiates an audio-DSP engine (cmAudDsp),
11
+  //  an interface for communicating with it (cmAudDspIF),
12
+  //  and message delivery functions for copying messages
13
+  //  in both directions between cmAuDsp and cmAudDspIF.
14
+  //
15
+  //  Note that the underlying inteface which allows an application to
16
+  //  control, and receive message from, cmAudDsp is provided by
17
+  //  cmAudDspIF - which this class provides a handle to.
18
+  //)  
19
+
20
+  //(
19 21
   
20 22
   enum
21 23
   {
@@ -44,6 +46,7 @@ extern "C" {
44 46
 
45 47
   cmAiH_t   cmAudDspLocalIF_Handle( cmAdlH_t h );
46 48
   
49
+  //)
47 50
 
48 51
 #ifdef __cplusplus
49 52
 }

+ 4
- 0
cmAudLabelFile.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Read and write Audacity label files." kw:[audio file] }
9
+  
8 10
 enum
9 11
 {
10 12
   kOkAlfRC = cmOkRC,
@@ -43,6 +45,8 @@ enum
43 45
   
44 46
   void cmAudLabelFileTest( cmCtx_t* ctx );
45 47
 
48
+  //)
49
+  
46 50
 #ifdef __cplusplus
47 51
 }
48 52
 #endif

+ 4
- 1
cmAudioAggDev.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc: "Audio device driver for cmAudioPort which aggregates multiple hardware devices to appear as a single devices." kw:[rt] }
9
+  
8 10
   enum
9 11
   {
10 12
     kOkAgRC = cmOkRC,
@@ -95,7 +97,8 @@ extern "C" {
95 97
 
96 98
   int cmApAggTest(  bool runFl, cmCtx_t* ctx, int argc, const char* argv[] );
97 99
 
98
-
100
+  //)
101
+  
99 102
 #ifdef __cplusplus
100 103
 }
101 104
 #endif

+ 3
- 1
cmAudioBuf.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( {file_desc: "Obsolete audio buffer class. This class is superceded by cmApBuf."}
9
+  
8 10
   enum
9 11
   {
10 12
     kOkBaRC = cmOkRC
@@ -53,7 +55,7 @@ extern "C" {
53 55
 
54 56
   cmBaRC_t cmAudioBufAdvance( unsigned devIdx, unsigned flags );
55 57
 
56
-
58
+  //)
57 59
 
58 60
 
59 61
 #ifdef __cplusplus

+ 108
- 126
cmAudioFile.h View File

@@ -1,13 +1,9 @@
1
-/// \file cmAudioFile.h
2
-/// \brief Audio file reader/writer class.
3
-///
4
-/// This class supports reading uncompressed AIFF and WAV files and writing uncompressed AIFF files.
5
-///  The reading and writing routines are known to work with 8,16,24, and 32 bit integer sample formats.
6
-///
7
-/// Testing and example usage for this API can be found in cmProcTest.c cmAudioReadWriteTest().
8
-///
9
-/// Usage example:
10
-/// \snippet cmAudioFile.c cmAudioFileExample
1
+//( { file_desc: "Read and write AIFF and WAV audio files." kw:[file audio] }
2
+//
3
+// This class supports reading uncompressed AIFF and WAV files and writing uncompressed AIFF files.
4
+//  The reading and writing routines are known to work with 8,16,24, and 32 bit integer sample formats.
5
+//
6
+//)
11 7
 
12 8
 #ifndef cmAudioFile_h
13 9
 #define cmAudioFile_h
@@ -16,15 +12,17 @@
16 12
 extern "C" {
17 13
 #endif
18 14
 
15
+  //(
16
+  
19 17
 #ifndef cmAudioFile_MAX_FRAME_READ_CNT
20
-/// Maximum number of samples which will be read in one call to fread().
21
-/// This value is only significant in that an internal buffer is created on the stack
22
-/// whose size must be limited to prevent stack overflows.
18
+  // Maximum number of samples which will be read in one call to fread().
19
+  // This value is only significant in that an internal buffer is created on the stack
20
+  // whose size must be limited to prevent stack overflows.
23 21
 #define cmAudioFile_MAX_FRAME_READ_CNT (8192) 
24 22
 #endif
25 23
 
26 24
 
27
-  /// Audio file result codes.
25
+  // Audio file result codes.
28 26
   enum
29 27
   {
30 28
     kOkAfRC = 0,
@@ -41,18 +39,18 @@ extern "C" {
41 39
     kUnknownErrAfRC
42 40
   };
43 41
 
44
-  /// Informational flags used by audioFileInfo
42
+  // Informational flags used by audioFileInfo
45 43
   enum
46 44
   {
47
-    kAiffAfFl        = 0x01,    ///< this is an AIFF file 
48
-    kWavAfFl         = 0x02,    ///< this is a WAV file 
49
-    kSwapAfFl        = 0x04,    ///< file header bytes must be swapped
50
-    kAifcAfFl        = 0x08,    ///< this is an AIFC file
51
-    kSwapSamplesAfFl = 0x10     ///< file sample bytes must be swapped
45
+    kAiffAfFl        = 0x01,    // this is an AIFF file 
46
+    kWavAfFl         = 0x02,    // this is a WAV file 
47
+    kSwapAfFl        = 0x04,    // file header bytes must be swapped
48
+    kAifcAfFl        = 0x08,    // this is an AIFC file
49
+    kSwapSamplesAfFl = 0x10     // file sample bytes must be swapped
52 50
   };
53 51
 
54 52
 
55
-  /// Constants
53
+  // Constants
56 54
   enum
57 55
   {
58 56
     kAudioFileLabelCharCnt = 256,
@@ -64,7 +62,7 @@ extern "C" {
64 62
     kAfBextOriginTimeN = 8
65 63
   };
66 64
 
67
-  /// Aiff marker record
65
+  // Aiff marker record
68 66
   typedef struct
69 67
   {
70 68
     unsigned    id;
@@ -72,9 +70,9 @@ extern "C" {
72 70
     char        label[kAudioFileLabelCharCnt];
73 71
   } cmAudioFileMarker_t;
74 72
 
75
-  /// Broadcast WAV header record As used by ProTools audio files. See http://en.wikipedia.org/wiki/Broadcast_Wave_Format
76
-  /// When generated from Protools the timeRefLow/timeRefHigh values appear to actually refer
77
-  /// to the position on the Protools time-line rather than the wall clock time.
73
+  // Broadcast WAV header record As used by ProTools audio files. See http://en.wikipedia.org/wiki/Broadcast_Wave_Format
74
+  // When generated from Protools the timeRefLow/timeRefHigh values appear to actually refer
75
+  // to the position on the Protools time-line rather than the wall clock time.
78 76
   typedef struct
79 77
   {
80 78
     char     desc[      kAfBextDescN       + 1 ];
@@ -86,102 +84,103 @@ extern "C" {
86 84
     unsigned timeRefHigh;  // sample count since midnight high word
87 85
   } cmAudioFileBext_t;
88 86
 
89
-  /// Audio file information record used by audioFileNew and audioFileOpen
87
+  // Audio file information record used by audioFileNew and audioFileOpen
90 88
   typedef struct 
91 89
   {
92
-    unsigned             bits;        ///< bits per sample
93
-    unsigned             chCnt;       ///< count of audio file channels
94
-    double               srate;       ///< audio file sample rate in samples per second
95
-    unsigned             frameCnt;    ///< total number of sample frames in the audio file
96
-    unsigned             flags;       ///< informational flags 
97
-    unsigned             markerCnt;   ///< count of markers in markerArray
98
-    cmAudioFileMarker_t* markerArray; ///< array of markers 
99
-    cmAudioFileBext_t    bextRecd;    ///< only used with Broadcast WAV files
90
+    unsigned             bits;        // bits per sample
91
+    unsigned             chCnt;       // count of audio file channels
92
+    double               srate;       // audio file sample rate in samples per second
93
+    unsigned             frameCnt;    // total number of sample frames in the audio file
94
+    unsigned             flags;       // informational flags 
95
+    unsigned             markerCnt;   // count of markers in markerArray
96
+    cmAudioFileMarker_t* markerArray; // array of markers 
97
+    cmAudioFileBext_t    bextRecd;    // only used with Broadcast WAV files
100 98
   } cmAudioFileInfo_t;
101 99
 
102 100
 
103 101
   
104
-  typedef cmHandle_t cmAudioFileH_t;    ///< opaque audio file handle   
105
-  extern cmAudioFileH_t cmNullAudioFileH;  ///< NULL audio file handle
106
-
107
-  /// Create an audio file handle and optionally use the handle to open an audio file.
108
-  ///
109
-  /// \param  fn         The audio file name to open or NULL to create the audio file handle without opening the file.
110
-  /// \param  infoPtr    A pointer to an audioFileInfo record to be filled when the file is open or NULL to ignore.
111
-  /// \param  rcPtr      A pointer to a result code to be set in the event of a runtime error or NULL to ignore.
112
-  /// \param  rpt        A pointer to a cmRpt_t object which error messages from this class will be directed to.
113
-  /// \retval cmAudioFileH_t A new audio file handle.
114
-  ///
102
+  typedef cmHandle_t cmAudioFileH_t;    // opaque audio file handle   
103
+  extern cmAudioFileH_t cmNullAudioFileH;  // NULL audio file handle
104
+
105
+  // Create an audio file handle and optionally use the handle to open an audio file.
106
+  //
107
+  //   fn         The audio file name to open or NULL to create the audio file handle without opening the file.
108
+  //   infoPtr    A pointer to an audioFileInfo record to be filled when the file is open or NULL to ignore.
109
+  //   rcPtr      A pointer to a result code to be set in the event of a runtime error or NULL to ignore.
110
+  //   rpt        A pointer to a cmRpt_t object which error messages from this class will be directed to.
111
+  //  Returns  cmAudioFileH_t A new audio file handle.
112
+  //
115 113
   cmAudioFileH_t cmAudioFileNewOpen( const cmChar_t* fn, cmAudioFileInfo_t* infoPtr, cmRC_t* rcPtr, cmRpt_t* rpt ); 
116 114
 
117
-  /// Open an audio file for writing
115
+  // Open an audio file for writing
118 116
   cmAudioFileH_t cmAudioFileNewCreate( const cmChar_t* fn, double srate, unsigned bits, unsigned chCnt, cmRC_t* rcPtr, cmRpt_t* rpt );
119 117
 
120 118
 
121
-  /// Open an audio file for reading using a handle returned from an earlier call to audioFileNewXXX().
122
-  ///
123
-  /// \param  h          A file handle returned from and earlier call to cmAudioFileNewOpen() or cmAudioFileNewCreate().
124
-  /// \param  fn         The audio file name to open or NULL to create the audio file handle without opening the file.
125
-  /// \param  infoPtr    A pointer to an audioFileInfo record to be filled when the file is open or NULL to ignore.
126
-  /// \retval Returns an cmRC_t value indicating the success (kOkAfRC) or failure of the call.
127
-  ///
128
-  /// If the audio file handle 'h' refers to an open file then it is automatically closed prior to being
129
-  /// reopened with the new file.
119
+  // Open an audio file for reading using a handle returned from an earlier call to audioFileNewXXX().
120
+  //
121
+  //   h          A file handle returned from and earlier call to cmAudioFileNewOpen() or cmAudioFileNewCreate().
122
+  //   fn         The audio file name to open or NULL to create the audio file handle without opening the file.
123
+  //   infoPtr    A pointer to an audioFileInfo record to be filled when the file is open or NULL to ignore.
124
+  // Returns an cmRC_t value indicating the success (kOkAfRC) or failure of the call.
125
+  //
126
+  // If the audio file handle 'h' refers to an open file then it is automatically closed prior to being
127
+  // reopened with the new file.
130 128
   cmRC_t     cmAudioFileOpen(       cmAudioFileH_t h, const cmChar_t* fn, cmAudioFileInfo_t* infoPtr );
131 129
 
132
-  /// Open an audio file for writing.  The type of the audio file, AIF or WAV
133
-  /// is determined by the file name extension.
130
+  // Open an audio file for writing.  The type of the audio file, AIF or WAV
131
+  // is determined by the file name extension.
134 132
   cmRC_t     cmAudioFileCreate(     
135
-    cmAudioFileH_t h,    ///< Handle returned from an earlier call to cmAudioFileNewCreate() or cmAudioFileNewOpen().
136
-    const cmChar_t* fn,  ///< File name of the new file.
137
-    double srate,        ///< Sample rate of the new file.
138
-    unsigned bits,       ///< Sample word width for the new file in bits (must be 8,16,24 or 32).
139
-    unsigned chCnt       ///< Audio channel count for the new file.
133
+    cmAudioFileH_t h,    // Handle returned from an earlier call to cmAudioFileNewCreate() or cmAudioFileNewOpen().
134
+    const cmChar_t* fn,  // File name of the new file.
135
+    double srate,        // Sample rate of the new file.
136
+    unsigned bits,       // Sample word width for the new file in bits (must be 8,16,24 or 32).
137
+    unsigned chCnt       // Audio channel count for the new file.
140 138
                                     );
141 139
 
142
-  /// Close a the file associated with handle 'h' but do not release the handle.
143
-  /// If the file was opened for writing (cmAudioFileCreate()) then this function will
144
-  /// write the file header prior to closing the file.
140
+  // Close a the file associated with handle 'h' but do not release the handle.
141
+  // If the file was opened for writing (cmAudioFileCreate()) then this function will
142
+  // write the file header prior to closing the file.
145 143
   cmRC_t     cmAudioFileClose(      cmAudioFileH_t* h );
146 144
 
147
-  /// Close the file associated with handle 'h' (via an internal call to 
148
-  /// cmAudioFileClose()) and release the handle and any resources
149
-  /// associated with it.  This is the complement to cmAudioFileOpen/Create().
145
+  // Close the file associated with handle 'h' (via an internal call to 
146
+  // cmAudioFileClose()) and release the handle and any resources
147
+  // associated with it.  This is the complement to cmAudioFileOpen/Create().
150 148
   cmRC_t     cmAudioFileDelete(     cmAudioFileH_t* h );
151 149
 
152
-  /// Return true if the handle is not closed or deleted.
150
+  // Return true if the handle is not closed or deleted.
153 151
   bool       cmAudioFileIsValid(    cmAudioFileH_t h );
154 152
 
155
-  /// Return true if the handle is open.
153
+  // Return true if the handle is open.
156 154
   bool       cmAudioFileIsOpen(     cmAudioFileH_t h );
157 155
 
158
-  /// Return true if the current file position is at the end of the file.
156
+  // Return true if the current file position is at the end of the file.
159 157
   bool       cmAudioFileIsEOF(      cmAudioFileH_t h );
160 158
 
161
-  /// Return the current file position as a frame index.
159
+  // Return the current file position as a frame index.
162 160
   unsigned   cmAudioFileTell(       cmAudioFileH_t h );
163 161
 
164
-  /// Set the current file position as an offset from the first frame.
162
+  // Set the current file position as an offset from the first frame.
165 163
   cmRC_t     cmAudioFileSeek(       cmAudioFileH_t h, unsigned frmIdx );
166 164
 
167
-  /// \name Sample Reading Functions.
168
-  ///@{
169
-  /// Fill a user suppled buffer with up to frmCnt samples.
170
-  /// If less than frmCnt samples are available at the specified audio file location then the unused
171
-  /// buffer space is set to zero. Check *actualFrmCntPtr for the count of samples actually available
172
-  /// in the return buffer.  Functions which do not include a begFrmIdx argument begin reading from
173
-  /// the current file location (see cmAudioFileSeek()). The buf argument is always a pointer to an
174
-  /// array of pointers of length chCnt.  Each channel buffer specified in buf[] must contain at least
175
-  /// frmCnt samples.
176
-  ///
177
-  /// \param h               An audio file handle returned from an earlier call to audioFileNew()
178
-  /// \param fn              The name of the audio file to read.
179
-  /// \param begFrmIdx       The frame index of the first sample to read. Functions that do not use this parameter begin reading at the current file location (See cmAudioFileTell()).
180
-  /// \param frmCnt          The number of samples allocated in buf.
181
-  /// \param chIdx           The index of the first channel to read.
182
-  /// \param chCnt           The count of channels to read.
183
-  /// \param buf             An array containing chCnt pointers to arrays of frmCnt samples.
184
-  /// \param actualFrmCntPtr The number of frames actually written to the return buffer (ignored if NULL)
165
+  // Sample Reading Functions.
166
+  //
167
+  // Fill a user suppled buffer with up to frmCnt samples.
168
+  // If less than frmCnt samples are available at the specified audio file location then the unused
169
+  // buffer space is set to zero. Check *actualFrmCntPtr for the count of samples actually available
170
+  // in the return buffer.  Functions which do not include a begFrmIdx argument begin reading from
171
+  // the current file location (see cmAudioFileSeek()). The buf argument is always a pointer to an
172
+  // array of pointers of length chCnt.  Each channel buffer specified in buf[] must contain at least
173
+  // frmCnt samples.
174
+  //
175
+  // 
176
+  //  h               An audio file handle returned from an earlier call to audioFileNew()
177
+  //  fn              The name of the audio file to read.
178
+  //  begFrmIdx       The frame index of the first sample to read. Functions that do not use this parameter begin reading at the current file location (See cmAudioFileTell()).
179
+  //  frmCnt          The number of samples allocated in buf.
180
+  //  chIdx           The index of the first channel to read.
181
+  //  chCnt           The count of channels to read.
182
+  //  buf             An array containing chCnt pointers to arrays of frmCnt samples.
183
+  //  actualFrmCntPtr The number of frames actually written to the return buffer (ignored if NULL)
185 184
 
186 185
   cmRC_t     cmAudioFileReadInt(    cmAudioFileH_t h, unsigned frmCnt, unsigned chIdx, unsigned chCnt, int**    buf, unsigned* actualFrmCntPtr );
187 186
   cmRC_t     cmAudioFileReadFloat(  cmAudioFileH_t h, unsigned frmCnt, unsigned chIdx, unsigned chCnt, float**  buf, unsigned* actualFrmCntPtr );
@@ -191,10 +190,7 @@ extern "C" {
191 190
   cmRC_t     cmAudioFileGetFloat(  const char* fn, unsigned begFrmIdx, unsigned frmCnt, unsigned chIdx, unsigned chCnt, float**  buf, unsigned* actualFrmCntPtr, cmAudioFileInfo_t* afInfoPtr, cmRpt_t* rpt );
192 191
   cmRC_t     cmAudioFileGetDouble( const char* fn, unsigned begFrmIdx, unsigned frmCnt, unsigned chIdx, unsigned chCnt, double** buf, unsigned* actualFrmCntPtr, cmAudioFileInfo_t* afInfoPtr, cmRpt_t* rpt );
193 192
 
194
-  ///@}
195
-
196
-  /// \name Sum the returned samples into the output buffer.
197
-  ///@{
193
+  // Sum the returned samples into the output buffer.
198 194
   cmRC_t     cmAudioFileReadSumInt(    cmAudioFileH_t h, unsigned frmCnt, unsigned chIdx, unsigned chCnt, int**    buf, unsigned* actualFrmCntPtr );
199 195
   cmRC_t     cmAudioFileReadSumFloat(  cmAudioFileH_t h, unsigned frmCnt, unsigned chIdx, unsigned chCnt, float**  buf, unsigned* actualFrmCntPtr );
200 196
   cmRC_t     cmAudioFileReadSumDouble( cmAudioFileH_t h, unsigned frmCnt, unsigned chIdx, unsigned chCnt, double** buf, unsigned* actualFrmCntPtr );
@@ -202,12 +198,8 @@ extern "C" {
202 198
   cmRC_t     cmAudioFileGetSumInt(    const char* fn, unsigned begFrmIdx, unsigned frmCnt, unsigned chIdx, unsigned chCnt, int**    buf, unsigned* actualFrmCntPtr, cmAudioFileInfo_t* afInfoPtr, cmRpt_t* rpt );
203 199
   cmRC_t     cmAudioFileGetSumFloat(  const char* fn, unsigned begFrmIdx, unsigned frmCnt, unsigned chIdx, unsigned chCnt, float**  buf, unsigned* actualFrmCntPtr, cmAudioFileInfo_t* afInfoPtr, cmRpt_t* rpt );
204 200
   cmRC_t     cmAudioFileGetSumDouble( const char* fn, unsigned begFrmIdx, unsigned frmCnt, unsigned chIdx, unsigned chCnt, double** buf, unsigned* actualFrmCntPtr, cmAudioFileInfo_t* afInfoPtr, cmRpt_t* rpt );
205
-  ///@}
206
-
207
-  ///@}
208 201
 
209
-  /// \name Sample Writing Functions
210
-  ///@{
202
+  // Sample Writing Functions
211 203
   cmRC_t    cmAudioFileWriteInt(    cmAudioFileH_t h, unsigned frmCnt, unsigned chCnt, int**    bufPtrPtr );
212 204
   cmRC_t    cmAudioFileWriteFloat(  cmAudioFileH_t h, unsigned frmCnt, unsigned chCnt, float**  bufPtrPtr );
213 205
   cmRC_t    cmAudioFileWriteDouble( cmAudioFileH_t h, unsigned frmCnt, unsigned chCnt, double** bufPtrPtr );
@@ -215,14 +207,11 @@ extern "C" {
215 207
   cmRC_t    cmAudioFileWriteFileInt(    const char* fn, double srate, unsigned bit, unsigned frmCnt, unsigned chCnt, int**    bufPtrPtr, cmRpt_t* rpt );
216 208
   cmRC_t    cmAudioFileWriteFileFloat(  const char* fn, double srate, unsigned bit, unsigned frmCnt, unsigned chCnt, float**  bufPtrPtr, cmRpt_t* rpt );
217 209
   cmRC_t    cmAudioFileWriteFileDouble( const char* fn, double srate, unsigned bit, unsigned frmCnt, unsigned chCnt, double** bufPtrPtr, cmRpt_t* rpt );
218
-  ///@}
219 210
 
220 211
 
221 212
 
222
-  /// \name cmSample_t and cmReal_t Alias Macros
223
-  ///@{
224
-  /// Alias the cmSample_t and cmReal_t sample reading and writing functions to the appropriate
225
-  /// type based on #CM_FLOAT_SMP and #CM_FLOAT_REAL.
213
+  // Alias the cmSample_t and cmReal_t sample reading and writing functions to the appropriate
214
+  // type based on #CM_FLOAT_SMP and #CM_FLOAT_REAL.
226 215
 
227 216
 #if CM_FLOAT_SMP == 1
228 217
 
@@ -263,51 +252,44 @@ extern "C" {
263 252
 #define cmAudioFileWriteFileReal cmAudioFileWriteFileDouble
264 253
 
265 254
 #endif
266
-  ///@}
267 255
 
268 256
 
269
-  /// \name Minimum, Maximum, Mean
270
-  ///@{
271
-  /// Scan an entire audio file and return the minimum, maximum and mean sample value.
272
-  /// On error *minPtr, *maxPtr, and *meanPtr are set to -acSample_MAX, cmSample_MAX, and 0 respectively
257
+  // Scan an entire audio file and return the minimum, maximum and mean sample value.
258
+  // On error *minPtr, *maxPtr, and *meanPtr are set to -acSample_MAX, cmSample_MAX, and 0 respectively
273 259
   cmRC_t     cmAudioFileMinMaxMean( cmAudioFileH_t h, unsigned chIdx, cmSample_t* minPtr, cmSample_t* maxPtr, cmSample_t* meanPtr );
274 260
   cmRC_t     cmAudioFileMinMaxMeanFn( const cmChar_t* fn, unsigned chIdx, cmSample_t* minPtr, cmSample_t* maxPtr, cmSample_t* meanPtr, cmRpt_t* rpt );
275
-  ///@}
276 261
 
277
-  /// Return the file name associated with a audio file handle.
262
+  // Return the file name associated with a audio file handle.
278 263
   const cmChar_t* cmAudioFileName( cmAudioFileH_t h );
279 264
 
280
-  /// Given an error code return the associated message.
265
+  // Given an error code return the associated message.
281 266
   const char* cmAudioFileErrorMsg( unsigned rc );
282 267
 
283
-  /// \name Get information about an audio file
284
-  ///@{
285
-
286
-  /// Return the cmAudioFileInfo_t record associated with a file.
268
+  // Return the cmAudioFileInfo_t record associated with a file.
287 269
   cmRC_t     cmAudioFileGetInfo(   const cmChar_t* fn, cmAudioFileInfo_t* infoPtr, cmRpt_t* rpt );
288 270
   
289
-  /// Print the cmAudioFileInfo_t to a file.
271
+  // Print the cmAudioFileInfo_t to a file.
290 272
   void       cmAudioFilePrintInfo( const cmAudioFileInfo_t* infoPtr, cmRpt_t* );
291 273
 
292
-  /// Print the file header information and frmCnt sample values beginning at frame index frmIdx.
274
+  // Print the file header information and frmCnt sample values beginning at frame index frmIdx.
293 275
   cmRC_t     cmAudioFileReport(   cmAudioFileH_t h,  cmRpt_t* rpt, unsigned frmIdx, unsigned frmCnt );
294 276
 
295
-    /// Print the file header information and  frmCnt sample values beginning at frame index frmIdx.
277
+  // Print the file header information and  frmCnt sample values beginning at frame index frmIdx.
296 278
   cmRC_t     cmAudioFileReportFn( const cmChar_t* fn, unsigned frmIdx, unsigned frmCnt, cmRpt_t* rpt );
297
-  ///@}
298 279
 
299
-  /// Change the sample rate value in the header.  Note that this function does not resample the audio
300
-  /// signal it simply changes the value of the sample rate in the header.
280
+  // Change the sample rate value in the header.  Note that this function does not resample the audio
281
+  // signal it simply changes the value of the sample rate in the header.
301 282
   cmRC_t     cmAudioFileSetSrate( const cmChar_t* audioFn, unsigned srate );
302 283
 
303 284
   // Generate a sine tone and write it to a file.
304 285
   cmRC_t     cmAudioFileSine( cmCtx_t* ctx, const cmChar_t* fn, double srate, unsigned bits, double hz, double gain, double secs );
305 286
 
306 287
 
307
-  /// Testing and example routine for functions in cmAudioFile.h.
308
-  /// Also see cmProcTest.c cmAudioFileReadWriteTest()
288
+  // Testing and example routine for functions in cmAudioFile.h.
289
+  // Also see cmProcTest.c cmAudioFileReadWriteTest()
309 290
   void       cmAudioFileTest( cmCtx_t* ctx, int argc, const char* argv[] );
310
-
291
+  
292
+  //)
311 293
   
312 294
 #ifdef __cplusplus
313 295
 }

+ 11
- 0
cmAudioFileDev.h View File

@@ -1,6 +1,11 @@
1 1
 #ifndef cmAudioFileDev_h
2 2
 #define cmAudioFileDev_h
3 3
 
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
8
+//( { file_desc:"Implements cmAudioFileDev for reading and writing audio files under control of cmAudioPort.", kw:[audio file rt]}
4 9
 enum
5 10
 {
6 11
   kOkAfdRC = cmOkRC,
@@ -72,4 +77,10 @@ void      cmAudioFileDevReport( cmAfdH_t h, cmRpt_t* rpt );
72 77
 
73 78
 void      cmAudioFileDevTest( cmRpt_t* rpt );
74 79
 
80
+//)
81
+
82
+#ifdef __cplusplus
83
+}
84
+#endif
85
+
75 86
 #endif

+ 4
- 1
cmAudioFileMgr.h View File

@@ -4,6 +4,9 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
+
8
+  //( { file_desc:"Manages a collection of audio files and maintains downsampled copies of their signals." kw:[audio file] }
9
+  
7 10
   enum
8 11
   {
9 12
     kOkAfmRC = cmOkRC,
@@ -56,7 +59,7 @@ extern "C" {
56 59
   bool         cmAfmIsValid( cmAfmH_t h );
57 60
   cmAfmFileH_t cmAfmIdToHandle( cmAfmH_t h, unsigned fileId );
58 61
 
59
-    
62
+  //)  
60 63
 
61 64
 
62 65
 #ifdef __cplusplus

+ 4
- 1
cmAudioNrtDev.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Audio device driver which generates the callbacks to run cmAudioPort in a non-real time mode." kw:[audio rt]}
9
+  
8 10
   cmApRC_t cmApNrtAllocate( cmRpt_t* rpt );
9 11
 
10 12
   cmApRC_t cmApNrtFree();
@@ -57,7 +59,8 @@ extern "C" {
57 59
   /// Return true if the device is currently started.
58 60
   bool          cmApNrtDeviceIsStarted( unsigned devIdx );
59 61
 
60
-
62
+  //)
63
+  
61 64
 #ifdef __cplusplus
62 65
 }
63 66
 #endif

+ 85
- 85
cmAudioPort.h View File

@@ -1,27 +1,24 @@
1
-/// \file cmAudioPort.h
2
-/// \brief Cross platform audio I/O interface.
3
-///
4
-/// This interface provides data declarations for platform dependent 
5
-/// audio I/O functions. The implementation for the functions are
6
-/// in platform specific modules. See cmAudioPortOsx.c and cmAudioPortAlsa.c.
7
-///
8
-/// ALSA Notes:  
9
-/// Assign capture device to line or mic input:
10
-/// amixer -c 0 cset iface=MIXER,name='Input Source',index=0 Mic
11
-/// amixer -c 0 cset iface=MIXER,name='Input Source',index=0 Line
12
-///
13
-/// -c 0                            select the first card
14
-/// -iface=MIXER                    the cset is targetting the MIXER component
15
-/// -name='Input Source',index=0    the control to set is the first 'Input Source'
16
-/// Note that the 'Capture' control sets the input gain.
17
-///
18
-/// See alsamixer for a GUI to accomplish the same thing.
19
-///
20
-///
21
-/// Usage example and testing code:
22
-/// See cmApPortTest() and cmAudioSysTest().
23
-/// \snippet cmAudioPort.c cmAudioPortExample
24
-///
1
+//( { file_desc: "Cross platform audio device interface." kw:[audio rt] }
2
+//
3
+// This interface provides data declarations for platform dependent 
4
+// audio I/O functions. The implementation for the functions are
5
+// in platform specific modules. See cmAudioPortOsx.c and cmAudioPortAlsa.c.
6
+//
7
+// ALSA Notes:  
8
+// Assign capture device to line or mic input:
9
+// amixer -c 0 cset iface=MIXER,name='Input Source',index=0 Mic
10
+// amixer -c 0 cset iface=MIXER,name='Input Source',index=0 Line
11
+//
12
+// -c 0                            select the first card
13
+// -iface=MIXER                    the cset is targetting the MIXER component
14
+// -name='Input Source',index=0    the control to set is the first 'Input Source'
15
+// Note that the 'Capture' control sets the input gain.
16
+//
17
+// See alsamixer for a GUI to accomplish the same thing.
18
+//
19
+//
20
+//)
21
+
25 22
 #ifndef cmAudioPort_h
26 23
 #define cmAudioPort_h
27 24
 
@@ -29,8 +26,10 @@
29 26
 extern "C" {
30 27
 #endif
31 28
 
32
-  typedef unsigned cmApRC_t;      ///< Audio port interface result code.
33
-  typedef float    cmApSample_t;  ///< Audio sample type.
29
+  //(
30
+  
31
+  typedef unsigned cmApRC_t;      // Audio port interface result code.
32
+  typedef float    cmApSample_t;  // Audio sample type.
34 33
 
35 34
   enum 
36 35
   { 
@@ -45,81 +44,81 @@ extern "C" {
45 44
   // cmApAudioPacket_t flags
46 45
   enum
47 46
   {
48
-    kInterleavedApFl = 0x01,  ///< The audio samples are interleaved.
49
-    kFloatApFl       = 0x02   ///< The audio samples are single precision floating point values.
47
+    kInterleavedApFl = 0x01,  // The audio samples are interleaved.
48
+    kFloatApFl       = 0x02   // The audio samples are single precision floating point values.
50 49
   };
51 50
 
52
-  /// Audio packet record used by the cmApAudioPacket_t callback.
53
-  /// Audio ports send and receive audio using this data structure. 
51
+  // Audio packet record used by the cmApAudioPacket_t callback.
52
+  // Audio ports send and receive audio using this data structure. 
54 53
   typedef struct
55 54
   {
56
-    unsigned devIdx;         ///< device associated with packet
57
-    unsigned begChIdx;       ///< first device channel 
58
-    unsigned chCnt;          ///< count of channels
59
-    unsigned audioFramesCnt; ///< samples per channel (see note below)
60
-    unsigned bitsPerSample;  ///< bits per sample word
61
-    unsigned flags;          ///< kInterleavedApFl | kFloatApFl
62
-    void*    audioBytesPtr;  ///< pointer to sample data
63
-    void*    userCbPtr;      ///< user defined value passed in cmApDeviceSetup()
64
-    cmTimeSpec_t timeStamp;  ///< Packet time stamp.
55
+    unsigned devIdx;         // device associated with packet
56
+    unsigned begChIdx;       // first device channel 
57
+    unsigned chCnt;          // count of channels
58
+    unsigned audioFramesCnt; // samples per channel (see note below)
59
+    unsigned bitsPerSample;  // bits per sample word
60
+    unsigned flags;          // kInterleavedApFl | kFloatApFl
61
+    void*    audioBytesPtr;  // pointer to sample data
62
+    void*    userCbPtr;      // user defined value passed in cmApDeviceSetup()
63
+    cmTimeSpec_t timeStamp;  // Packet time stamp.
65 64
   }  cmApAudioPacket_t; 
66 65
 
67 66
 
68
-  /// Audio port callback signature. 
69
-  /// inPktArray[inPktCnt] are full packets of audio coming from the ADC to the application.
70
-  /// outPktArray[outPktCnt] are empty packets of audio which will be filled by the application 
71
-  /// and then sent to the DAC.
72
-  ///
73
-  /// The value of audioFrameCnt  gives the number of samples per channel which are available
74
-  /// in the packet data buffer 'audioBytesPtr'.  The callback function may decrease this number in
75
-  /// output packets if the number of samples available is less than the size of the buffer.
76
-  /// It is the responsibility of the calling audio port to notice this change and pass the new,
77
-  /// decreased number of samples to the hardware.
78
-  ///
79
-  /// In general it should be assmed that this call is made from a system thread which is not 
80
-  /// the same as the application thread.
81
-  /// The usual thread safety precautions should therefore be taken if this function implementation
82
-  /// interacts with data structures also handled by the application. The audio buffer class (\see cmApBuf.h) 
83
-  /// is designed to provide a safe and efficient way to communicate between
84
-  /// the audio thread and the application.
67
+  // Audio port callback signature. 
68
+  // inPktArray[inPktCnt] are full packets of audio coming from the ADC to the application.
69
+  // outPktArray[outPktCnt] are empty packets of audio which will be filled by the application 
70
+  // and then sent to the DAC.
71
+  //
72
+  // The value of audioFrameCnt  gives the number of samples per channel which are available
73
+  // in the packet data buffer 'audioBytesPtr'.  The callback function may decrease this number in
74
+  // output packets if the number of samples available is less than the size of the buffer.
75
+  // It is the responsibility of the calling audio port to notice this change and pass the new,
76
+  // decreased number of samples to the hardware.
77
+  //
78
+  // In general it should be assmed that this call is made from a system thread which is not 
79
+  // the same as the application thread.
80
+  // The usual thread safety precautions should therefore be taken if this function implementation
81
+  // interacts with data structures also handled by the application. The audio buffer class (\see cmApBuf.h) 
82
+  // is designed to provide a safe and efficient way to communicate between
83
+  // the audio thread and the application.
85 84
   typedef void (*cmApCallbackPtr_t)( cmApAudioPacket_t* inPktArray, unsigned inPktCnt, cmApAudioPacket_t* outPktArray, unsigned outPktCnt );
86 85
 
87
-  /// Setup the audio port management object for this machine.
86
+  // Setup the audio port management object for this machine.
88 87
   cmApRC_t      cmApInitialize( cmRpt_t* rpt );
89 88
 
90
-  /// Stop all audio devices and release any resources held 
91
-  /// by the audio port management object.
89
+  // Stop all audio devices and release any resources held 
90
+  // by the audio port management object.
92 91
   cmApRC_t      cmApFinalize();
93 92
 
94
-  /// Return the count of audio devices attached to this machine.
93
+  // Return the count of audio devices attached to this machine.
95 94
   unsigned      cmApDeviceCount();
96 95
 
97
-  /// Get a textual description of the device at index 'devIdx'.
96
+  // Get a textual description of the device at index 'devIdx'.
98 97
   const char*   cmApDeviceLabel(          unsigned devIdx );
99 98
 
100
-  /// Given an audio device label return the associated device index.
99
+  // Given an audio device label return the associated device index.
101 100
   unsigned      cmApDeviceLabelToIndex( const cmChar_t* label );
102 101
 
103
-  /// Get the count of audio input or output channesl on device at index 'devIdx'.
102
+  // Get the count of audio input or output channesl on device at index 'devIdx'.
104 103
   unsigned      cmApDeviceChannelCount(   unsigned devIdx, bool inputFl );
105 104
 
106
-  /// Get the current sample rate of a device.  Note that if the device has both
107
-  /// input and output capability then the sample rate is the same for both.
105
+  // Get the current sample rate of a device.  Note that if the device has both
106
+  // input and output capability then the sample rate is the same for both.
108 107
   double        cmApDeviceSampleRate(     unsigned devIdx );
109 108
 
110
-  /// Get the count of samples per callback for the input or output for this device.
109
+  // Get the count of samples per callback for the input or output for this device.
111 110
   unsigned      cmApDeviceFramesPerCycle( unsigned devIdx, bool inputFl );
112 111
 
113
-  /// Configure a device.  
114
-  /// All devices must be setup before they are started.
115
-  /// framesPerCycle is the requested number of samples per audio callback. The
116
-  /// actual number of samples made from a callback may be smaller. See the note
117
-  /// regarding this in cmApAudioPacket_t.
118
-  /// If the device cannot support the requested configuration then the function
119
-  /// will return an error code.
120
-  /// If the device is started when this function is called then it will be 
121
-  /// automatically stopped and then restarted following the reconfiguration.
122
-  /// If the reconfiguration fails then the device may not be restared.
112
+  // Configure a device.  
113
+  // All devices must be setup before they are started.
114
+  // framesPerCycle is the requested number of samples per audio callback. The
115
+  // actual number of samples made from a callback may be smaller. See the note
116
+  // regarding this in cmApAudioPacket_t.
117
+  // If the device cannot support the requested configuration then the function
118
+  // will return an error code.
119
+  // If the device is started when this function is called then it will be 
120
+  // automatically stopped and then restarted following the reconfiguration.
121
+  // If the reconfiguration fails then the device may not be restared.
123 122
   cmApRC_t      cmApDeviceSetup(          
124 123
     unsigned          devIdx, 
125 124
     double            srate, 
@@ -127,25 +126,26 @@ extern "C" {
127 126
     cmApCallbackPtr_t callbackPtr,
128 127
     void*             userCbPtr );
129 128
 
130
-  /// Start a device. Note that the callback may be made prior to this function returning.
129
+  // Start a device. Note that the callback may be made prior to this function returning.
131 130
   cmApRC_t      cmApDeviceStart( unsigned devIdx );
132 131
 
133
-  /// Stop a device.
132
+  // Stop a device.
134 133
   cmApRC_t      cmApDeviceStop(  unsigned devIdx );
135 134
 
136
-  /// Return true if the device is currently started.
135
+  // Return true if the device is currently started.
137 136
   bool          cmApDeviceIsStarted( unsigned devIdx );
138 137
 
139
-  /// Print a report of all the current audio device configurations.
138
+  // Print a report of all the current audio device configurations.
140 139
   void          cmApReport( cmRpt_t* rpt );
141 140
 
142
-  /// Test the audio port by synthesizing a sine signal or passing audio through
143
-  /// from the input to the output.  This is also a good example of how to 
144
-  /// use all of the functions in the interface.
145
-  /// Set runFl to false to print a report without starting any audio devices.
146
-  /// See cmAudiotPortTest.c for usage example for this function.
141
+  // Test the audio port by synthesizing a sine signal or passing audio through
142
+  // from the input to the output.  This is also a good example of how to 
143
+  // use all of the functions in the interface.
144
+  // Set runFl to false to print a report without starting any audio devices.
145
+  // See cmAudiotPortTest.c for usage example for this function.
147 146
   int           cmApPortTest(bool runFl, cmRpt_t* rpt, int argc, const char* argv[] );
148 147
 
148
+  //)
149 149
 #ifdef __cplusplus
150 150
 }
151 151
 #endif

+ 4
- 0
cmAudioPortFile.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"This is an audio device driver for cmAudioPort which supports reading and writing audio files as though they are real-time devices." kw[audio file rt] } 
9
+  
8 10
   cmApRC_t      cmApFileAllocate( cmRpt_t* rpt );
9 11
   cmApRC_t      cmApFileFree();
10 12
 
@@ -41,6 +43,8 @@ extern "C" {
41 43
   void          cmApFileReport( cmRpt_t* rpt );
42 44
   void          cmApFileTest( cmRpt_t* rpt );
43 45
 
46
+  //)
47
+  
44 48
 #ifdef __cplusplus
45 49
 }
46 50
 #endif

+ 6
- 7
cmAudioSys.h View File

@@ -1,5 +1,4 @@
1
-// cmAudioSys.h
2
-// Implements a real-time audio processing engine.
1
+//( { file_desc: "This is the kernel of a real-time audio processing engine." kw:[audio rt] }
3 2
 //
4 3
 // The audio system is composed a collection of independent sub-systems.
5 4
 // Each sub-system maintains a thread which runs asynchrounsly
@@ -49,9 +48,7 @@
49 48
 // delivered to the DSP procedure at the end of the DSP execution
50 49
 // procedure.
51 50
 //
52
-// Usage example and testing code:
53
-// See  cmAudioSysTest().
54
-// \snippet cmAudioSys.c cmAudioSysTest
51
+//)
55 52
 
56 53
 #ifndef cmAudioSys_h
57 54
 #define cmAudioSys_h
@@ -59,7 +56,8 @@
59 56
 #ifdef __cplusplus
60 57
 extern "C" {
61 58
 #endif
62
-
59
+  
60
+  //(
63 61
   // Audio system result codes
64 62
   enum
65 63
   {
@@ -296,7 +294,8 @@ extern "C" {
296 294
   // Audio system test and example function.
297 295
   void      cmAudioSysTest( cmRpt_t* rpt, int argc, const char* argv[] );
298 296
 
299
-
297
+  //)
298
+  
300 299
 
301 300
 #ifdef __cplusplus
302 301
 }

+ 4
- 1
cmAudioSysMsg.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Constrants and data structures used to communicate messages to and from cmAudioSys" kw:[audio real_time]}
9
+  
8 10
   /// Reserved DSP message selector id's (second field of all host<->audio system messages)
9 11
   enum
10 12
   {
@@ -112,7 +114,8 @@ extern "C" {
112 114
     
113 115
   } cmAudioSysStatus_t;
114 116
 
115
-
117
+  //)
118
+  
116 119
 #ifdef __cplusplus
117 120
 }
118 121
 #endif

+ 11
- 0
cmComplexTypes.h View File

@@ -1,9 +1,15 @@
1 1
 #ifndef cmComplexTypes_h
2 2
 #define cmComplexTypes_h
3 3
 
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
4 8
 #include <complex.h>
5 9
 #include <fftw3.h>
6 10
 
11
+//( { file_desc: "Constants and functions used for working with complex values." kw:[base math] }
12
+
7 13
 #if CM_FLOAT_SMP == 1
8 14
 
9 15
 #define cmCabsS  cabsf
@@ -95,5 +101,10 @@ void cmVOCR_Abs(     cmSample_t*   y, const cmComplexR_t* x, unsigned n );
95 101
 void cmVOCR_MultVS(  cmComplexR_t* y, cmReal_t v, unsigned n );
96 102
 void cmVOCR_DivVS(   cmComplexR_t* y, cmReal_t v, unsigned n );
97 103
 
104
+//)
105
+
106
+#ifdef __cplusplus
107
+}
108
+#endif
98 109
 
99 110
 #endif

+ 4
- 0
cmCsv.h View File

@@ -6,6 +6,8 @@
6 6
 extern "C" {
7 7
 #endif
8 8
 
9
+  //( { file_desc:"Comma seperated value file reader and writer." kw[file] }
10
+  
9 11
   enum
10 12
   {
11 13
     kOkCsvRC = 0,
@@ -146,6 +148,8 @@ extern "C" {
146 148
 
147 149
   cmCsvRC_t  cmCsvPrint( cmCsvH_t h, unsigned rowCnt );
148 150
 
151
+  //)
152
+  
149 153
 #ifdef __cplusplus
150 154
 }
151 155
 #endif

+ 4
- 4
cmCtx.h View File

@@ -1,5 +1,6 @@
1
-//{ 
2
-//(
1
+ 
2
+//( { file_desc:"Global application context record." kw[base] }
3
+//
3 4
 // cmCtx_t is used to hold application supplied cmRpt_t, cmErr_t and
4 5
 // other global values for easy distribution throughtout a cm based application.
5 6
 //
@@ -44,8 +45,7 @@ extern "C" {
44 45
     unsigned         mmFlags      //  Initialization flags used to configure \ref cmMallocDebug.h
45 46
                    );
46 47
   //)
47
-  //}
48
-
48
+ 
49 49
 #ifdef __cplusplus
50 50
 }
51 51
 #endif

+ 3
- 1
cmDList.h View File

@@ -6,6 +6,8 @@
6 6
 extern "C" {
7 7
 #endif
8 8
 
9
+  //( { file_desc:"Dynamic generic array with user programmable indexing and sorting capablity." kw:[container] }
10
+  
9 11
   enum
10 12
   {
11 13
     kOkDlRC = cmOkRC,
@@ -86,7 +88,7 @@ extern "C" {
86 88
   // which this iterator is attached to.
87 89
   const void* cmDListIterFind(      cmDListIterH_t  iH, const void* key, unsigned keyN, unsigned* recdByteNRef);
88 90
 
89
-
91
+  //) 
90 92
 #ifdef __cplusplus
91 93
 }
92 94
 #endif

+ 4
- 0
cmDListTpl.h View File

@@ -1,4 +1,6 @@
1 1
 
2
+//( { file_desc:"Template 'include' code for using cmDList as a template." kw:[container] }
3
+
2 4
 // The following two macros must be defined prior to including this code:
3 5
 // #define cmSFX(a) a##_MySuffix
4 6
 // #define cmTYPE   My_Type 
@@ -117,6 +119,8 @@ const cmTYPE* cmSFX(cmDListIterFind)(      cmDListIterH_t  iH, const cmTYPE* key
117 119
 
118 120
 #endif // cmGEN_CODE
119 121
 
122
+//)
120 123
 
121 124
 #undef cmSFX
122 125
 #undef cmTYPE
126
+

+ 3
- 1
cmData.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Generic, introspective, data structure." }
9
+  
8 10
   /*
9 11
     TODO:
10 12
     0) Figure out an error handling scheme that does not rely on
@@ -688,7 +690,7 @@ extern "C" {
688 690
   void     cmDataPrint( const cmData_t* p, cmRpt_t* rpt );
689 691
   
690 692
   void     cmDataTest( cmCtx_t* ctx );
691
-
693
+  //)
692 694
 
693 695
 #ifdef __cplusplus
694 696
 }

+ 5
- 1
cmDevCfg.h View File

@@ -4,6 +4,9 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
+
8
+  //( { file_desc:"A class for managing persistent device configuration information." kw:[audio hardware] }
9
+  
7 10
   /*
8 11
     IMPLEMENTATION:
9 12
     1) A 'cfg' record is a device reference with a 'cfg label'.
@@ -210,7 +213,8 @@ extern "C" {
210 213
   // Set 'fn' to NULL to use filename from cmDevCfgAlloc()
211 214
   cmDcRC_t cmDevCfgWrite( cmDevCfgH_t h, const cmChar_t* fn );
212 215
   
213
-
216
+  //)
217
+  
214 218
 #ifdef __cplusplus
215 219
 }
216 220
 #endif

+ 2
- 3
cmErr.h View File

@@ -1,5 +1,5 @@
1
-//{ 
2
-//(
1
+//( { file_desc:"Format error messages and track the last error generated." kw:[base]}
2
+//
3 3
 // This class is used to format error messages and track the last error generated.
4 4
 //
5 5
 // Most of the cmHandle_t based classes use cmErr_t to format error messages with a 
@@ -75,7 +75,6 @@ extern "C" {
75 75
   cmRC_t cmErrClearRC( cmErr_t* err );
76 76
    
77 77
   //)
78
-  //}
79 78
 
80 79
 #ifdef __cplusplus
81 80
 }

+ 3
- 0
cmExec.h View File

@@ -6,6 +6,7 @@
6 6
 extern "C" {
7 7
 #endif
8 8
 
9
+  //( file_desc:"Run a child process via 'execvp()'" kw[system]
9 10
   enum
10 11
   {
11 12
     kOkExRC,
@@ -22,6 +23,8 @@ extern "C" {
22 23
   cmExRC_t cmExecV( cmErr_t* err, int* returnValRef, const cmChar_t* pgmFn, va_list vl );
23 24
   cmExRC_t cmExec(  cmErr_t* err, int* returnValRef, const cmChar_t* pgmFn, ... );  
24 25
 
26
+  //)
27
+  
25 28
 #ifdef __cplusplus
26 29
 }
27 30
 #endif

+ 1
- 1
cmFeatFile.c View File

@@ -2106,7 +2106,7 @@ cmFtRC_t        cmFtReaderAdvance( cmFtFileH_t h, cmFtFrameDesc_t* fdp )
2106 2106
   {
2107 2107
     if( rc == kOkFtRC )
2108 2108
     {
2109
-      fdp->smpIdx = frameDescPtr->time.sampleIdx;
2109
+      fdp->smpIdx = frameDescPtr->tm.sampleIdx;
2110 2110
       fdp->frmIdx = cmFrameFileFrameLoadedIndex(fp->ffH);
2111 2111
     }
2112 2112
     else

+ 142
- 146
cmFeatFile.h View File

@@ -1,7 +1,6 @@
1
-/// \file cmFeatFile.h
2
-/// \brief Audio file acoustic feature analyzer and accompanying file reader.
3
-///
4
-///
1
+//( { file_desc:" Audio file acoustic feature analyzer and accompanying file reader." kw:[audio analysis file]}
2
+//
3
+//
5 4
 
6 5
 #ifndef cmFeatFile_h
7 6
 #define cmFeatFile_h
@@ -12,7 +11,7 @@ extern "C" {
12 11
 
13 12
 
14 13
 
15
-  /// Result codes for all functions in cmFeatFile.h
14
+  // Result codes for all functions in cmFeatFile.h
16 15
   enum
17 16
   {
18 17
     kOkFtRC = cmOkRC,
@@ -36,241 +35,238 @@ extern "C" {
36 35
     kInvalidFrmIdxFtRC
37 36
   };
38 37
 
39
-  /// Feature Id's
38
+  // Feature Id's
40 39
   enum
41 40
   {
42
-    kInvalidFtId,     ///< 0  
43
-    kAmplFtId,        ///< 1 Fourier transform amplitude 
44
-    kDbAmplFtId,      ///< 2 Fourier transform decibel
45
-    kPowFtId,         ///< 3 Fourier transform power
46
-    kDbPowFtId,       ///< 4 Fourier transform power decibel
47
-    kPhaseFtId,       ///< 5 Fourier transform phase (not unwrapped)
48
-    kBfccFtId,        ///< 6 Bark Frequency Cepstral Coeffcients
49
-    kMfccFtId,        ///< 7 Mel Frequency Cepstral Coefficients
50
-    kCepsFtId,        ///< 8 Cepstral Coefficients
51
-    kConstQFtId,      ///< 9 Constant-Q transform
52
-    kLogConstQFtId,   ///< 10 Log Constant-Q transform
53
-    kRmsFtId,         ///< 11 Root means square of the audio signal
54
-    kDbRmsFtId,       ///< 12 RMS in decibels                         
55
-
56
-    kD1AmplFtId,      ///< 13 1st order difference over time of the Fourier transform amplitude              
57
-    kD1DbAmplFtId,    ///< 14 1st order difference over time of the Fourier transform decibel                
58
-    kD1PowFtId,       ///< 15 1st order difference over time of the Fourier transform power                  
59
-    kD1DbPowFtId,     ///< 16 1st order difference over time of the Fourier transform power decibel          
60
-    kD1PhaseFtId,     ///< 17 1st order difference over time of the Fourier transform phase (not unwrapped)  
61
-    kD1BfccFtId,      ///< 18 1st order difference over time of the Bark Frequency Cepstral Coeffcients      
62
-    kD1MfccFtId,      ///< 19 1st order difference over time of the Mel Frequency Cepstral Coefficients      
63
-    kD1CepsFtId,      ///< 20 1st order difference over time of the Cepstral Coefficients                    
64
-    kD1ConstQFtId,    ///< 21 1st order difference over time of the Constant-Q transform                     
65
-    kD1LogConstQFtId, ///< 22 1st order difference over time of the Log Constant-Q transform                
66
-    kD1RmsFtId,       ///< 23 1st order difference over time of the Root means square of the audio signal   
67
-    kD1DbRmsFtId,     ///< 24 1st order difference over time of the RMS in decibels                         
41
+    kInvalidFtId,     // 0  
42
+    kAmplFtId,        // 1 Fourier transform amplitude 
43
+    kDbAmplFtId,      // 2 Fourier transform decibel
44
+    kPowFtId,         // 3 Fourier transform power
45
+    kDbPowFtId,       // 4 Fourier transform power decibel
46
+    kPhaseFtId,       // 5 Fourier transform phase (not unwrapped)
47
+    kBfccFtId,        // 6 Bark Frequency Cepstral Coeffcients
48
+    kMfccFtId,        // 7 Mel Frequency Cepstral Coefficients
49
+    kCepsFtId,        // 8 Cepstral Coefficients
50
+    kConstQFtId,      // 9 Constant-Q transform
51
+    kLogConstQFtId,   // 10 Log Constant-Q transform
52
+    kRmsFtId,         // 11 Root means square of the audio signal
53
+    kDbRmsFtId,       // 12 RMS in decibels                         
54
+
55
+    kD1AmplFtId,      // 13 1st order difference over time of the Fourier transform amplitude              
56
+    kD1DbAmplFtId,    // 14 1st order difference over time of the Fourier transform decibel                
57
+    kD1PowFtId,       // 15 1st order difference over time of the Fourier transform power                  
58
+    kD1DbPowFtId,     // 16 1st order difference over time of the Fourier transform power decibel          
59
+    kD1PhaseFtId,     // 17 1st order difference over time of the Fourier transform phase (not unwrapped)  
60
+    kD1BfccFtId,      // 18 1st order difference over time of the Bark Frequency Cepstral Coeffcients      
61
+    kD1MfccFtId,      // 19 1st order difference over time of the Mel Frequency Cepstral Coefficients      
62
+    kD1CepsFtId,      // 20 1st order difference over time of the Cepstral Coefficients                    
63
+    kD1ConstQFtId,    // 21 1st order difference over time of the Constant-Q transform                     
64
+    kD1LogConstQFtId, // 22 1st order difference over time of the Log Constant-Q transform                
65
+    kD1RmsFtId,       // 23 1st order difference over time of the Root means square of the audio signal   
66
+    kD1DbRmsFtId,     // 24 1st order difference over time of the RMS in decibels                         
68 67
 
69 68
   };
70 69
 
71
-  /// User defined feature parameters
70
+  // User defined feature parameters
72 71
   typedef struct
73 72
   {
74
-    unsigned id;         ///< feature id
75
-    unsigned cnt;        ///< length of feature vector
76
-    bool     normFl;     ///< normalize this feature 
77
-    bool     enableFl;   ///< true if this feature is enabled
73
+    unsigned id;         // feature id
74
+    unsigned cnt;        // length of feature vector
75
+    bool     normFl;     // normalize this feature 
76
+    bool     enableFl;   // true if this feature is enabled
78 77
   } cmFtAttr_t;
79 78
 
80 79
 
81
-  /// Skip input audio range record
80
+  // Skip input audio range record
82 81
   typedef struct
83 82
   {
84
-    unsigned smpIdx;  ///< Index of first sample to skip
85
-    unsigned smpCnt;  ///< Count of successive samples to skip.
83
+    unsigned smpIdx;  // Index of first sample to skip
84
+    unsigned smpCnt;  // Count of successive samples to skip.
86 85
   } cmFtSkip_t;
87 86
 
88 87
 
89
-  /// Analysis parameters
88
+  // Analysis parameters
90 89
   typedef struct
91 90
   {
92
-    const char*        audioFn;               ///< Audio file name.
93
-    const char*        featFn;                ///< Feature file name.
94
-    unsigned           chIdx;                 ///< Audio file channel index
95
-    cmReal_t           wndMs;                 ///< Length of the analysis window in milliseconds.
96
-    unsigned           hopFact;               ///< Analysis window overlap factor 1 = 1:1 2=2:1 ...
97
-    bool               normAudioFl;           ///< Normalize the audio over the length of the audio file
98
-    cmMidiByte_t       constQMinPitch;        ///< Used to determine the base const-q octave.
99
-    cmMidiByte_t       constQMaxPitch;        ///< Used to determine the maximum const-q frequency of interest.
100
-    unsigned           constQBinsPerOctave;   ///< Bands per const-q octave.
101
-    unsigned           onsetMedFiltWndSmpCnt; ///< Complex onset median filter 
102
-    cmReal_t           onsetThreshold;        ///< Complex onset threshold
103
-    cmReal_t           minDb;                 ///< Fourier Transform magnitude values below minDb are set to minDb.
104
-    cmReal_t           floorThreshDb;         ///< Frames with an RMS below this value will be skipped
105
-    cmFtSkip_t*        skipArray;             ///< skipArray[skipCnt] user defined sample skip ranges
106
-    unsigned           skipCnt;               ///< Count of records in skipArray[].
107
-    cmFtAttr_t*        attrArray;             ///< attrArray[attrCnt] user defined parameter array
108
-    unsigned           attrCnt;               ///< Count of records in attrArray[].
91
+    const char*        audioFn;               // Audio file name.
92
+    const char*        featFn;                // Feature file name.
93
+    unsigned           chIdx;                 // Audio file channel index
94
+    cmReal_t           wndMs;                 // Length of the analysis window in milliseconds.
95
+    unsigned           hopFact;               // Analysis window overlap factor 1 = 1:1 2=2:1 ...
96
+    bool               normAudioFl;           // Normalize the audio over the length of the audio file
97
+    cmMidiByte_t       constQMinPitch;        // Used to determine the base const-q octave.
98
+    cmMidiByte_t       constQMaxPitch;        // Used to determine the maximum const-q frequency of interest.
99
+    unsigned           constQBinsPerOctave;   // Bands per const-q octave.
100
+    unsigned           onsetMedFiltWndSmpCnt; // Complex onset median filter 
101
+    cmReal_t           onsetThreshold;        // Complex onset threshold
102
+    cmReal_t           minDb;                 // Fourier Transform magnitude values below minDb are set to minDb.
103
+    cmReal_t           floorThreshDb;         // Frames with an RMS below this value will be skipped
104
+    cmFtSkip_t*        skipArray;             // skipArray[skipCnt] user defined sample skip ranges
105
+    unsigned           skipCnt;               // Count of records in skipArray[].
106
+    cmFtAttr_t*        attrArray;             // attrArray[attrCnt] user defined parameter array
107
+    unsigned           attrCnt;               // Count of records in attrArray[].
109 108
   } cmFtParam_t;
110 109
 
111 110
 
112
-  /// Feature summary information
111
+  // Feature summary information
113 112
   typedef struct 
114 113
   {
115
-    unsigned    id;   ///< feature id (same as associated cmFtAttr.id)
116
-    unsigned    cnt;  ///< length of each feature vector (same as associated cmFtAttr.cnt)
117
-
118
-    /// The raw feature summary values are calculated prior to normalization.
119
-    cmReal_t* rawMinV;  ///< Vector of min value over time for each feature element.
120
-    cmReal_t* rawMaxV;  ///< Vector of max value over time for each feature element.
121
-    cmReal_t* rawAvgV;  ///< Vector of avg value over time for each feature element.
122
-    cmReal_t* rawSdvV;  ///< Vector of standard deviation values over time for each feature element.
123
-    cmReal_t  rawMin;   ///< Min value of all values for this feature. Equivalent to min(rawMinV).
124
-    cmReal_t  rawMax;   ///< Max value of all values for this feature. Equivalent to max(rawMaxV).
125
-
126
-    /// normalized feature summary values
127
-    cmReal_t* normMinV; ///< Vector of min value over time for each feature element.
128
-    cmReal_t* normMaxV; ///< Vector of max value over time for each feature element.
129
-    cmReal_t* normAvgV; ///< Vector of avg value over time for each feature element.
130
-    cmReal_t* normSdvV; ///< Vector of standard deviation values over time for each feature element.
131
-    cmReal_t  normMin;  ///< Min value of all values for this feature. Equivalent to min(normMinV).
132
-    cmReal_t  normMax;  ///< Max value of all values for this feature. Equivalent to max(rawMaxV).
114
+    unsigned    id;   // feature id (same as associated cmFtAttr.id)
115
+    unsigned    cnt;  // length of each feature vector (same as associated cmFtAttr.cnt)
116
+
117
+    // The raw feature summary values are calculated prior to normalization.
118
+    cmReal_t* rawMinV;  // Vector of min value over time for each feature element.
119
+    cmReal_t* rawMaxV;  // Vector of max value over time for each feature element.
120
+    cmReal_t* rawAvgV;  // Vector of avg value over time for each feature element.
121
+    cmReal_t* rawSdvV;  // Vector of standard deviation values over time for each feature element.
122
+    cmReal_t  rawMin;   // Min value of all values for this feature. Equivalent to min(rawMinV).
123
+    cmReal_t  rawMax;   // Max value of all values for this feature. Equivalent to max(rawMaxV).
124
+
125
+    // normalized feature summary values
126
+    cmReal_t* normMinV; // Vector of min value over time for each feature element.
127
+    cmReal_t* normMaxV; // Vector of max value over time for each feature element.
128
+    cmReal_t* normAvgV; // Vector of avg value over time for each feature element.
129
+    cmReal_t* normSdvV; // Vector of standard deviation values over time for each feature element.
130
+    cmReal_t  normMin;  // Min value of all values for this feature. Equivalent to min(normMinV).
131
+    cmReal_t  normMax;  // Max value of all values for this feature. Equivalent to max(rawMaxV).
133 132
 
134 133
   } cmFtSumm_t;
135 134
 
136
-  /// Feature file info record
135
+  // Feature file info record
137 136
   typedef struct
138 137
   {
139
-    unsigned    frmCnt;         ///< count of frames in the file
140
-    cmReal_t    srate;          ///< audio sample rate
141
-    unsigned    smpCnt;         ///< audio sample count
142
-    unsigned    fftSmpCnt;      ///< FFT window length (always power of 2)
143
-    unsigned    hopSmpCnt;      ///< audio sample hop count
144
-    unsigned    binCnt;         ///< FFT bin count (always fftSmpCnt/2 + 1)
145
-    unsigned    skipFrmCnt;     ///< count of frames skipped based on user skip array 
146
-    unsigned    floorFrmCnt;    ///< count of frames skipped because below floorThreshDb
147
-    cmFtParam_t param;          ///< analysis parameter record used to form this feature file
148
-    cmFtSumm_t* summArray;      ///< summArray[ param.attrCnt ] feature summary information
138
+    unsigned    frmCnt;         // count of frames in the file
139
+    cmReal_t    srate;          // audio sample rate
140
+    unsigned    smpCnt;         // audio sample count
141
+    unsigned    fftSmpCnt;      // FFT window length (always power of 2)
142
+    unsigned    hopSmpCnt;      // audio sample hop count
143
+    unsigned    binCnt;         // FFT bin count (always fftSmpCnt/2 + 1)
144
+    unsigned    skipFrmCnt;     // count of frames skipped based on user skip array 
145
+    unsigned    floorFrmCnt;    // count of frames skipped because below floorThreshDb
146
+    cmFtParam_t param;          // analysis parameter record used to form this feature file
147
+    cmFtSumm_t* summArray;      // summArray[ param.attrCnt ] feature summary information
149 148
   } cmFtInfo_t;
150 149
 
151
-  /// Data structure returned by cmFtReaderAdvance(). 
150
+  // Data structure returned by cmFtReaderAdvance(). 
152 151
   typedef struct
153 152
   {
154
-    unsigned smpIdx;  ///< The audio signal sample index this frames information is based on.
155
-    unsigned frmIdx;  ///< The frame index relative to other frames in this feature file.
153
+    unsigned smpIdx;  // The audio signal sample index this frames information is based on.
154
+    unsigned frmIdx;  // The frame index relative to other frames in this feature file.
156 155
   } cmFtFrameDesc_t;
157 156
 
158
-  typedef cmHandle_t cmFtH_t;      ///< Analyzer handle
159
-  typedef cmHandle_t cmFtFileH_t;  ///< Feature file handle.
160
-  typedef unsigned   cmFtRC_t;     ///< Result code type used by all functions in cmFeatFile.h.
157
+  typedef cmHandle_t cmFtH_t;      // Analyzer handle
158
+  typedef cmHandle_t cmFtFileH_t;  // Feature file handle.
159
+  typedef unsigned   cmFtRC_t;     // Result code type used by all functions in cmFeatFile.h.
161 160
 
162
-  extern cmFtH_t     cmFtNullHandle;      ///< A NULL handle useful for indicating an uninitialized analyzer.
163
-  extern cmFtFileH_t cmFtFileNullHandle;  ///< A NULL handle useful for indicating an uninitialized feature file.
161
+  extern cmFtH_t     cmFtNullHandle;      // A NULL handle useful for indicating an uninitialized analyzer.
162
+  extern cmFtFileH_t cmFtFileNullHandle;  // A NULL handle useful for indicating an uninitialized feature file.
164 163
 
165 164
 
166
-  /// Given a feature type id return the associated label.
165
+  // Given a feature type id return the associated label.
167 166
   const char*     cmFtFeatIdToLabel( unsigned featId );
168 167
 
169
-  /// Given a feature type label return the associated id.
168
+  // Given a feature type label return the associated id.
170 169
   unsigned        cmFtFeatLabelToId( const char* label );
171 170
 
172
-  /// \name Feature Analyzer Related functions
173
-  ///@{ 
171
+  // Feature Analyzer Related functions
174 172
 
175
-  /// Initialize the feature analyzer. The memory manager and file system must
176
-  /// be initialized (cmMdInitialize(), cmFsInitialize()) prior to calling this function.
173
+  // Initialize the feature analyzer. The memory manager and file system must
174
+  // be initialized (cmMdInitialize(), cmFsInitialize()) prior to calling this function.
177 175
   cmFtRC_t        cmFtInitialize( cmFtH_t* hp, cmCtx_t* ctx );
178 176
 
179
-  /// Finalize a feature analyzer.
177
+  // Finalize a feature analyzer.
180 178
   cmFtRC_t        cmFtFinalize( cmFtH_t* h );
181 179
 
182
-  /// Return true if the handle represents an initialized feature analyzer.
180
+  // Return true if the handle represents an initialized feature analyzer.
183 181
   bool            cmFtIsValid( cmFtH_t  h );
184 182
 
185
-  /// Parse a JSON file containing a set of analysis parameters. 
183
+  // Parse a JSON file containing a set of analysis parameters. 
186 184
   cmFtRC_t        cmFtParse( cmFtH_t  h, const char* cfgFn );
187 185
 
188
-  /// Run the analyzer.
186
+  // Run the analyzer.
189 187
   cmFtRC_t        cmFtAnalyze( cmFtH_t h );
190 188
 
191
-  /// If cmFtAnalyze() is being run in a seperate thread this function
192
-  /// can be used to access the analyzers progress.
189
+  // If cmFtAnalyze() is being run in a seperate thread this function
190
+  // can be used to access the analyzers progress.
193 191
   const char*     cmFtAnalyzeProgress( cmFtH_t h, unsigned* passPtr, cmReal_t* percentPtr );  
194 192
 
195
-  ///@}
196 193
   
197
-  /// \name Feature File Related Functions
198
-  ///@{
194
+  // Feature File Related Functions
199 195
 
200
-  /// Open a feature file.
201
-  /// Note that inforPtrPtr is optional and will be ignored if it is set to NULL.
196
+  // Open a feature file.
197
+  // Note that inforPtrPtr is optional and will be ignored if it is set to NULL.
202 198
   cmFtRC_t        cmFtReaderOpen(    cmFtH_t h, cmFtFileH_t* hp, const char* featFn, const cmFtInfo_t** infoPtrPtr );
203 199
 
204
-  /// Close a feature file.
200
+  // Close a feature file.
205 201
   cmFtRC_t        cmFtReaderClose(   cmFtFileH_t* hp );
206 202
 
207
-  /// Return true if the handle reprents an open feature file.
203
+  // Return true if the handle reprents an open feature file.
208 204
   bool            cmFtReaderIsValid( cmFtFileH_t h );
209 205
 
210
-  /// Return the count of features types this file contains.
206
+  // Return the count of features types this file contains.
211 207
   unsigned        cmFtReaderFeatCount( cmFtFileH_t h );
212 208
 
213
-  /// Return the feature type id associated with the specified index.
209
+  // Return the feature type id associated with the specified index.
214 210
   unsigned        cmFtReaderFeatId( cmFtFileH_t h, unsigned index );
215 211
 
216
-  /// Reset the current file location to the first frame but do not load it.
217
-  /// The next call to cmFtReadAdvance() will load the next frame.
212
+  // Reset the current file location to the first frame but do not load it.
213
+  // The next call to cmFtReadAdvance() will load the next frame.
218 214
   cmFtRC_t        cmFtReaderRewind(  cmFtFileH_t h );
219 215
 
220
-  /// Make frmIdx the current file location.
216
+  // Make frmIdx the current file location.
221 217
   cmFtRC_t        cmFtReaderSeek(    cmFtFileH_t h, unsigned frmIdx );
222 218
 
223
-  /// Load the current frame, advance the current file position, and return
224
-  /// a pointer to a cmFtFrameDesc_t record for the loaded frame.
225
-  /// Returns kEofFtRC upon reaching end of file. 
226
-  /// The frameDescPtr is optional.
219
+  // Load the current frame, advance the current file position, and return
220
+  // a pointer to a cmFtFrameDesc_t record for the loaded frame.
221
+  // Returns kEofFtRC upon reaching end of file. 
222
+  // The frameDescPtr is optional.
227 223
   cmFtRC_t        cmFtReaderAdvance( cmFtFileH_t h, cmFtFrameDesc_t* frameDescPtr );
228 224
 
229
-  /// Returns a pointer to a data matrix in the feature identified by featId in the current feature frame. 
225
+  // Returns a pointer to a data matrix in the feature identified by featId in the current feature frame. 
230 226
   cmReal_t*       cmFtReaderData(    cmFtFileH_t h, unsigned featId, unsigned* cntPtr );
231 227
 
232
-  /// Copy the contents of a given set of frames into buf[frmCnt*elePerFrmCnt].
228
+  // Copy the contents of a given set of frames into buf[frmCnt*elePerFrmCnt].
233 229
   cmFtRC_t        cmFtReaderCopy(    cmFtFileH_t h, unsigned featId, unsigned frmIdx, cmReal_t* buf, unsigned frmCnt, unsigned elePerFrmCnt, unsigned* outEleCntPtr );  
234 230
 
235
-  /// Data structure used to specify multiple features for use by cmFtReaderMultiSetup().
231
+  // Data structure used to specify multiple features for use by cmFtReaderMultiSetup().
236 232
   typedef struct
237 233
   {
238
-    unsigned featId; ///< Feature id of feature to include in the feature vector
239
-    unsigned cnt;    ///< Set to count of feat ele's for this feat. Error if greater than avail. Set to -1 to use all avail ele's.
240
-                     ///  returned with actual count used
234
+    unsigned featId; // Feature id of feature to include in the feature vector
235
+    unsigned cnt;    // Set to count of feat ele's for this feat. Error if greater than avail. Set to -1 to use all avail ele's.
236
+                     //  returned with actual count used
241 237
 
242
-    unsigned id0;    ///< Ignored on input. Used internally by cmFtReaderXXX() 
243
-    unsigned id1;    ///< Ignored on input. Used internally by cmFtReaderXXX() 
238
+    unsigned id0;    // Ignored on input. Used internally by cmFtReaderXXX() 
239
+    unsigned id1;    // Ignored on input. Used internally by cmFtReaderXXX() 
244 240
   } cmFtMulti_t;
245 241
   
246
-  /// Setup an array of cmFtMulti_t records.  The cmFtMulti_t array
247
-  /// used by cmFtReaderMulitData() must be initialized by this function.
242
+  // Setup an array of cmFtMulti_t records.  The cmFtMulti_t array
243
+  // used by cmFtReaderMulitData() must be initialized by this function.
248 244
   cmFtRC_t        cmFtReaderMultiSetup(  cmFtFileH_t h, cmFtMulti_t* multiArray, unsigned multiCnt, unsigned* featVectEleCntPtr ); 
249 245
 
250
-  /// Fill outV[outN] with a consecutive data from the features specified in the cmFtMulti_t array.
251
-  /// Use cmFtReaderMultiSetup() to configure the cmFtMulti_t array prior to calling this function.
246
+  // Fill outV[outN] with a consecutive data from the features specified in the cmFtMulti_t array.
247
+  // Use cmFtReaderMultiSetup() to configure the cmFtMulti_t array prior to calling this function.
252 248
   cmFtRC_t        cmFtReaderMultiData(   cmFtFileH_t h, const cmFtMulti_t* multiArray, unsigned multiCnt, cmReal_t* outV, unsigned outN ); 
253 249
 
254
-  /// Report summary information for the specified feature.
250
+  // Report summary information for the specified feature.
255 251
   cmFtRC_t        cmFtReaderReport(  cmFtFileH_t h, unsigned featId );
256 252
 
257
-  /// Identical to cmFtReaderReport() except the feature file is identified from a file name rather than an open cmFtFileH_t.
253
+  // Identical to cmFtReaderReport() except the feature file is identified from a file name rather than an open cmFtFileH_t.
258 254
   cmFtRC_t        cmFtReaderReportFn(  cmFtH_t h, const cmChar_t* fn, unsigned featId );
259 255
 
260
-  /// Report feature data for the specified set of feature frames.
256
+  // Report feature data for the specified set of feature frames.
261 257
   cmFtRC_t        cmFtReaderReportFeature( cmFtFileH_t h, unsigned featId, unsigned frmIdx, unsigned frmCnt );
262 258
 
263
-  /// Write a feature into a binary file.  
264
-  /// Set 'frmCnt' to the cmInvalidCnt to include all frames past frmIdx.
265
-  /// The first three unsigned values in the output file
266
-  /// contain the row count, maximum column count, and the count of bytes in each data element (4=float,8=double). 
267
-  /// Each row of the file begins with the count of elements in the row and is followed by a data array.
259
+  // Write a feature into a binary file.  
260
+  // Set 'frmCnt' to the cmInvalidCnt to include all frames past frmIdx.
261
+  // The first three unsigned values in the output file
262
+  // contain the row count, maximum column count, and the count of bytes in each data element (4=float,8=double). 
263
+  // Each row of the file begins with the count of elements in the row and is followed by a data array.
268 264
   cmFtRC_t        cmFtReaderToBinary( cmFtFileH_t h, unsigned featId, unsigned frmIdx, unsigned frmCnt, const cmChar_t* outFn ); 
269 265
 
270
-  /// Identical to cmFtReaderToBinary() except it takes a feature file name instead of a file handle.
266
+  // Identical to cmFtReaderToBinary() except it takes a feature file name instead of a file handle.
271 267
   cmFtRC_t        cmFtReaderToBinaryFn( cmFtH_t h, const cmChar_t* fn, unsigned featId, unsigned frmIdx, unsigned frmCnt, const cmChar_t* outFn ); 
272 268
 
273
-  ///@}
269
+  //)
274 270
   
275 271
 #ifdef __cplusplus
276 272
 }

+ 1
- 0
cmFile.c View File

@@ -1,3 +1,4 @@
1
+
1 2
 #include "cmPrefix.h"
2 3
 #include "cmGlobal.h"
3 4
 #include "cmRpt.h"

+ 7
- 8
cmFile.h View File

@@ -1,9 +1,3 @@
1
-//{
2
-//( 
3
-// File abstraction class which slightly extends the C standard file handling routines
4
-// to cm style error handling.
5
-//)
6
-//
7 1
 #ifndef cmFile_h
8 2
 #define cmFile_h
9 3
 
@@ -11,7 +5,13 @@
11 5
 extern "C" {
12 6
 #endif
13 7
 
14
-  //(
8
+  //( { file_desc: "File abstraction class." kw:[file system base]}
9
+  // 
10
+  // The cmFile API extends the C standard file handling routines
11
+  // with cm style error handling. All cm file input and output occurs
12
+  // through this interface."
13
+  //
14
+  
15 15
   enum
16 16
   {
17 17
     kOkFileRC = cmOkRC,
@@ -244,7 +244,6 @@ extern "C" {
244 244
   cmFileRC_t cmFileSetRC( cmFileH_t h, cmFileRC_t rc );
245 245
   
246 246
   //)
247
-  //}
248 247
 
249 248
 #ifdef __cplusplus
250 249
 }

+ 2
- 4
cmFileSys.h View File

@@ -1,6 +1,5 @@
1
-//{
2
-//(
3
-// A collection of file system utility functions.
1
+
2
+//( { file_desc:"A collection of file system utility functions." kw:[system file]}
4 3
 //
5 4
 // Note that cmFileSysInitialize() creates an internal cmLHeapH_t based
6 5
 // heap manager from which it allocates memory for some returned objects.
@@ -242,7 +241,6 @@ extern "C" {
242 241
   cmFsRC_t    cmFileSysTest( cmCtx_t* ctx );  
243 242
 
244 243
   //)
245
-  //}
246 244
 
247 245
 #ifdef __cplusplus
248 246
 }

+ 37
- 36
cmFloatTypes.h View File

@@ -1,16 +1,3 @@
1
-/// \file cmFloatTypes.h
2
-/// \brief Declare the types cmReal_t and cmSample_t and define some useful limits.
3
-///
4
-/// For signal processing functions the cm library uses the types cmSample_t to indicate an audio
5
-/// sample value and cmReal_t to specify a general purpose floating point value. The library
6
-/// is designed in such a way that the actual type, float or double, for these two types may
7
-/// be set at compilation time. Set the preprocessor variable CM_FLOAT_SMP to 1 to indicate 
8
-/// that cmSample_t will be of type 'float' otherwise it will be of type 'double'. 
9
-/// Set the preprocessor variable CM_FLOAT_REAL to 1 to indicate 
10
-/// that cmSample_t will be of type 'float' otherwise it will be of type 'double'. 
11
-/// By default cmSample_t is float nad cmReal_t is double.
12
-///
13
-
14 1
 #ifndef cmFloatTypes_h
15 2
 #define cmFloatTypes_h
16 3
 
@@ -19,6 +6,18 @@
19 6
 extern "C" {
20 7
 #endif
21 8
 
9
+  //( { file_desc:"Declare the types cmReal_t and cmSample_t and define some useful limits." kw:[base]}
10
+  //
11
+  // For signal processing functions the cm library uses the types cmSample_t to indicate an audio
12
+  // sample value and cmReal_t to specify a general purpose floating point value. The library
13
+  // is designed in such a way that the actual type, float or double, for these two types may
14
+  // be set at compilation time. Set the preprocessor variable CM_FLOAT_SMP to 1 to indicate 
15
+  // that cmSample_t will be of type 'float' otherwise it will be of type 'double'. 
16
+  // Set the preprocessor variable CM_FLOAT_REAL to 1 to indicate 
17
+  // that cmSample_t will be of type 'float' otherwise it will be of type 'double'. 
18
+  // By default cmSample_t is float nad cmReal_t is double.
19
+  //
20
+
22 21
   //-----------------------------------------------------------------
23 22
 #ifndef CM_FLOAT_SMP
24 23
 #define CM_FLOAT_SMP 1
@@ -26,27 +25,27 @@ extern "C" {
26 25
 
27 26
 #if CM_FLOAT_SMP == 1
28 27
 
29
-  typedef float          cmSample_t;  ///< cmSample_t is a float
30
-  typedef float _Complex cmComplexS_t;///< cmComplexS_t is single precision.
28
+  typedef float          cmSample_t;  // cmSample_t is a float
29
+  typedef float _Complex cmComplexS_t;// cmComplexS_t is single precision.
31 30
 
32
-#define cmSample_EPSILON FLT_EPSILON  ///< Minimum increment between 1.0 and the next greaterv value. (1E-5)
33
-#define cmSample_MAX     FLT_MAX      ///< Maximum representable number (1E+37).
34
-#define cmSample_MIN     FLT_MIN      ///< Minimum representable number (1E-37).
31
+#define cmSample_EPSILON FLT_EPSILON  // Minimum increment between 1.0 and the next greaterv value. (1E-5)
32
+#define cmSample_MAX     FLT_MAX      // Maximum representable number (1E+37).
33
+#define cmSample_MIN     FLT_MIN      // Minimum representable number (1E-37).
35 34
 
36 35
 #else
37 36
 
38
-  typedef  double          cmSample_t;   ///< cmSample_t is a double
39
-  typedef  double _Complex cmComplexS_t; ///< cmComplexS_t is doulbe precision.
37
+  typedef  double          cmSample_t;   // cmSample_t is a double
38
+  typedef  double _Complex cmComplexS_t; // cmComplexS_t is doulbe precision.
40 39
 
41
-#define cmSample_EPSILON DBL_EPSILON    ///< Minimum increment between 1.0 and the next greaterv value. (1E-9)
42
-#define cmSample_MAX     DBL_MAX        ///< Maximum representable number (1E+37).
43
-#define cmSample_MIN     DBL_MIN        ///< Minimum representable number (1E-37).
40
+#define cmSample_EPSILON DBL_EPSILON    // Minimum increment between 1.0 and the next greaterv value. (1E-9)
41
+#define cmSample_MAX     DBL_MAX        // Maximum representable number (1E+37).
42
+#define cmSample_MIN     DBL_MIN        // Minimum representable number (1E-37).
44 43
 
45 44
 #endif
46 45
 
47
-//-----------------------------------------------------------------
48
-//-----------------------------------------------------------------
49
-//-----------------------------------------------------------------
46
+  //-----------------------------------------------------------------
47
+  //-----------------------------------------------------------------
48
+  //-----------------------------------------------------------------
50 49
 
51 50
 #ifndef CM_FLOAT_REAL
52 51
 #define CM_FLOAT_REAL 0
@@ -54,25 +53,27 @@ extern "C" {
54 53
 
55 54
 #if CM_FLOAT_REAL == 1
56 55
 
57
-  typedef float          cmReal_t;      ///< cmReal_t is a float
58
-  typedef float _Complex cmComplexR_t;  ///< cmComplexR_t is single precision.
56
+  typedef float          cmReal_t;      // cmReal_t is a float
57
+  typedef float _Complex cmComplexR_t;  // cmComplexR_t is single precision.
59 58
 
60
-#define cmReal_EPSILON FLT_EPSILON      ///< Minimum increment between 1.0 and the next greaterv value. (1E-5)
61
-#define cmReal_MAX     FLT_MAX          ///< Maximum representable number (1E+37).
62
-#define cmReal_MIN     FLT_MIN          ///< Minimum representable number (1E-37).
59
+#define cmReal_EPSILON FLT_EPSILON      // Minimum increment between 1.0 and the next greaterv value. (1E-5)
60
+#define cmReal_MAX     FLT_MAX          // Maximum representable number (1E+37).
61
+#define cmReal_MIN     FLT_MIN          // Minimum representable number (1E-37).
63 62
 
64 63
 #else
65 64
 
66
-  typedef  double          cmReal_t;      ///< cmReal_t is a double.
67
-  typedef  double _Complex cmComplexR_t;  ///< cmComplexR_t is double precision.
65
+  typedef  double          cmReal_t;      // cmReal_t is a double.
66
+  typedef  double _Complex cmComplexR_t;  // cmComplexR_t is double precision.
68 67
 
69
-#define cmReal_EPSILON DBL_EPSILON  ///< Minimum increment between 1.0 and the next greaterv value (1E-9).
70
-#define cmReal_MAX     DBL_MAX      ///< Maximum representable number (1E+37).
71
-#define cmReal_MIN     DBL_MIN      ///< Minimum representable number (1E-37).
68
+#define cmReal_EPSILON DBL_EPSILON  // Minimum increment between 1.0 and the next greaterv value (1E-9).
69
+#define cmReal_MAX     DBL_MAX      // Maximum representable number (1E+37).
70
+#define cmReal_MIN     DBL_MIN      // Minimum representable number (1E-37).
72 71
 
73 72
 
74 73
 #endif
75 74
 
75
+  //)
76
+  
76 77
 #ifdef __cplusplus
77 78
 }
78 79
 #endif

+ 3
- 3
cmFrameFile.c View File

@@ -1031,7 +1031,7 @@ cmFfRC_t cmFrameFileFrameCreate( cmFrameFileH_t h, unsigned frameType, unsigned
1031 1031
   p->frame.f.mtxCnt       = 0;
1032 1032
   p->frame.f.streamId     = streamId;
1033 1033
   p->frame.f.flags        = flags;
1034
-  p->frame.f.time.seconds = 0;
1034
+  p->frame.f.tm.seconds = 0;
1035 1035
 
1036 1036
   return rc;
1037 1037
 }
@@ -1327,10 +1327,10 @@ cmFfRC_t cmFrameFileFrameNext( cmFrameFileH_t h, unsigned keyFrameTypeId, unsign
1327 1327
     return rc;
1328 1328
 
1329 1329
   if( cmIsFlag(p->frame.f.flags,kSampleIdxTimeFl) )
1330
-    p->frame.f.time.sampleIdx = sampleIdx;
1330
+    p->frame.f.tm.sampleIdx = sampleIdx;
1331 1331
 
1332 1332
   if( cmIsFlag(p->frame.f.flags,kSecondsTimeFl) )
1333
-    p->frame.f.time.seconds = seconds;
1333
+    p->frame.f.tm.seconds = seconds;
1334 1334
 
1335 1335
   
1336 1336
   return rc;

+ 10
- 7
cmFrameFile.h View File

@@ -1,16 +1,17 @@
1 1
 #ifndef cmFrameFile_h
2 2
 #define cmFrameFile_h
3 3
 
4
-/*
5
-  file  -> cmFfFile_t frame*
6
-  frame -> cmFfFrame_t mtx*
7
-  mtx   -> cmFfMtx_t data*   
8
- */
9
-
10 4
 #ifdef __cplusplus
11 5
 extern "C" {
12 6
 #endif
13 7
 
8
+  //( { file_desc:"File reader and writer for time series data as used by cmFeatFile" kw:[file audio]}
9
+  //
10
+  // file  -> cmFfFile_t frame*
11
+  // frame -> cmFfFrame_t mtx*
12
+  // mtx   -> cmFfMtx_t data*   
13
+  //
14
+
14 15
 
15 16
   enum
16 17
   {
@@ -139,7 +140,7 @@ extern "C" {
139 140
     {
140 141
       unsigned sampleIdx;
141 142
       double   seconds;
142
-    } time;
143
+    } tm;
143 144
     
144 145
   } cmFfFrame_t;
145 146
 
@@ -353,6 +354,8 @@ extern "C" {
353 354
 #define kRealFmtId              kDoubleFmtId
354 355
 #endif
355 356
 
357
+  //)
358
+  
356 359
 #ifdef __cplusplus
357 360
 }
358 361
 #endif

+ 6
- 8
cmGlobal.h View File

@@ -1,15 +1,14 @@
1
-//{
2
-//(
3
-// cmGlobal.h contains the global macros, header files, and 
4
-//  typedefs availale to all other cm modules. 
1
+
2
+
3
+#ifndef cmGlobal_h
4
+#define cmGlobal_h
5
+
6
+//( { file_desc:"This is the globally included prefix file for all 'cm' files." kw:[base] }
5 7
 //
6 8
 // All operating system dependencies should be resolved in this file via 
7 9
 // testing for OS_LINUX, OS_OSX, or OS_W32.
8 10
 //)
9 11
 
10
-#ifndef cmGlobal_h
11
-#define cmGlobal_h
12
-
13 12
 //(
14 13
 #include "config.h" // created by 'configure'
15 14
 #include <stdio.h>
@@ -150,6 +149,5 @@ extern "C" {
150 149
 #endif
151 150
 
152 151
 //)
153
-//}
154 152
 
155 153
 #endif

+ 94
- 82
cmGnuPlot.h View File

@@ -1,85 +1,91 @@
1 1
 #ifndef cmGnuPlot_h
2 2
 #define cmGnuPlot_h
3 3
 
4
-enum
5
-{
6
-  kOkPlRC,
7
-  kSignalFailedPlRC,
8
-  kPipeFailedPlRC,
9
-  kForkFailedPlRC,
10
-  kExecFailedPlRC,
11
-  kPipeCloseFailedPlRC,
12
-  kPlotNotFoundPlRC,
13
-  kNoCurPlotPlRC,
14
-  kPlotDataFileFailPlRC,
15
-  kFopenFailedPlRC,
16
-  kFcloseFailedPlRC
17
-};
18
-
19
-enum
20
-{
21
-  kInvalidPlotPtId    = 0x000,
22
-  kPlusPlotPtId       = 0x001,
23
-  kXPlotPtId          = 0x002,
24
-  kAsteriskPlotPtId   = 0x003,
25
-  kSquarePlotPtId     = 0x004,
26
-  kFillSquarePlotPtId = 0x005,
27
-  kCirclePlotPtId     = 0x006,
28
-  kFillCirclePlotPtId = 0x007,
29
-  kTriPlotPtId        = 0x008,
30
-  kFillTriPlotPtId    = 0x009,
31
-  kInvTriPlotPtId     = 0x00a,
32
-  kInvFillTriPlotPtId = 0x00b,
33
-  kDiamondPlotPtId    = 0x00c,
34
-  kFillDiamonPlotPtId = 0x00d,
35
-  kPlotPtMask         = 0x00f,
36
-};
37
-
38
-enum
39
-{
40
-  kInvalidPlotLineId   = 0x000,  // -2 after translation
41
-  kSolidPlotLineId     = 0x010,  // -1 after translation
42
-  kDashPlotLineId      = 0x020,  //  0 after translation
43
-  kPlotLineMask        = 0x0f0,
44
-  kPlotLineShift       = 4
45
-};
46
-
47
-enum 
48
-{
49
-  kImpulsePlotFl       = 0x100
50
-};
51
-
52
-/// Set terminal to NULL to use the default terminal.
53
-cmRC_t cmPlotInitialize( const char* terminalStr );
54
-
55
-// Combines initializaion and setup in a single call.
56
-cmRC_t cmPlotInitialize2( const char* terminalStr, const char* title, unsigned rowCnt, unsigned colCnt );
57
-
58
-cmRC_t cmPlotFinalize();
59
-
60
-/// Setup the plot page
61
-cmRC_t cmPlotSetup( const char* title, unsigned rowCnt, unsigned colCnt );
62
-
63
-/// Select sub-plot to apply subsequent commands to
64
-cmRC_t cmPlotSelectSubPlot( unsigned ri, unsigned ci );
65
-
66
-/// Clear the current current subplot 
67
-cmRC_t cmPlotClear();
68
-
69
-/// Set the labels on the current sub-plot
70
-cmRC_t cmPlotSetLabels( const char* title, const char* xLabelStr, const char* yLabelStr, const char* zLabelStr ); 
71
-
72
-/// Set the default ranges for the x, y and z axes. To leave the ranges at their current values set the min and max to -1.
73
-/// The range values are used to form data sets when data is not explicitely given.
74
-cmRC_t cmPlotSetRange( double xMin, double xMax, double yMin, double yMax, double zMin, double zMax ); 
75
-
76
-/// If x or y is given as NULL then the values will be taken from the range settings xMin:xMax or yMin:yMax.
77
-/// Use the gnuplot command:'test' to see the valid lineType and pointType values for a given terminal
78
-/// Color string may be any of the predefined color labels: show palette colornames or and rgb value: e.g. #FF00FF
79
-cmRC_t cmPlotLineF( const char* legendStr, const float*  x, const float*  y, const float*  z, unsigned n, const char* colorStr, unsigned styleFlags );
80
-cmRC_t cmPlotLineD( const char* legendStr, const double* x, const double* y, const double* z, unsigned n, const char* colorStr, unsigned styleFlags );
81
-
82
-cmRC_t cmPlotLineMD( const double* x, const double* y, const double* z, unsigned rn, unsigned cn, unsigned styleFlags );
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
8
+  //( { file_desc:"Interface to GNU Plot." kw:[plot]}
9
+  
10
+  enum
11
+  {
12
+    kOkPlRC,
13
+    kSignalFailedPlRC,
14
+    kPipeFailedPlRC,
15
+    kForkFailedPlRC,
16
+    kExecFailedPlRC,
17
+    kPipeCloseFailedPlRC,
18
+    kPlotNotFoundPlRC,
19
+    kNoCurPlotPlRC,
20
+    kPlotDataFileFailPlRC,
21
+    kFopenFailedPlRC,
22
+    kFcloseFailedPlRC
23
+  };
24
+
25
+  enum
26
+  {
27
+    kInvalidPlotPtId    = 0x000,
28
+    kPlusPlotPtId       = 0x001,
29
+    kXPlotPtId          = 0x002,
30
+    kAsteriskPlotPtId   = 0x003,
31
+    kSquarePlotPtId     = 0x004,
32
+    kFillSquarePlotPtId = 0x005,
33
+    kCirclePlotPtId     = 0x006,
34
+    kFillCirclePlotPtId = 0x007,
35
+    kTriPlotPtId        = 0x008,
36
+    kFillTriPlotPtId    = 0x009,
37
+    kInvTriPlotPtId     = 0x00a,
38
+    kInvFillTriPlotPtId = 0x00b,
39
+    kDiamondPlotPtId    = 0x00c,
40
+    kFillDiamonPlotPtId = 0x00d,
41
+    kPlotPtMask         = 0x00f,
42
+  };
43
+
44
+  enum
45
+  {
46
+    kInvalidPlotLineId   = 0x000,  // -2 after translation
47
+    kSolidPlotLineId     = 0x010,  // -1 after translation
48
+    kDashPlotLineId      = 0x020,  //  0 after translation
49
+    kPlotLineMask        = 0x0f0,
50
+    kPlotLineShift       = 4
51
+  };
52
+
53
+  enum 
54
+  {
55
+    kImpulsePlotFl       = 0x100
56
+  };
57
+
58
+  /// Set terminal to NULL to use the default terminal.
59
+  cmRC_t cmPlotInitialize( const char* terminalStr );
60
+
61
+  // Combines initializaion and setup in a single call.
62
+  cmRC_t cmPlotInitialize2( const char* terminalStr, const char* title, unsigned rowCnt, unsigned colCnt );
63
+
64
+  cmRC_t cmPlotFinalize();
65
+
66
+  /// Setup the plot page
67
+  cmRC_t cmPlotSetup( const char* title, unsigned rowCnt, unsigned colCnt );
68
+
69
+  /// Select sub-plot to apply subsequent commands to
70
+  cmRC_t cmPlotSelectSubPlot( unsigned ri, unsigned ci );
71
+
72
+  /// Clear the current current subplot 
73
+  cmRC_t cmPlotClear();
74
+
75
+  /// Set the labels on the current sub-plot
76
+  cmRC_t cmPlotSetLabels( const char* title, const char* xLabelStr, const char* yLabelStr, const char* zLabelStr ); 
77
+
78
+  /// Set the default ranges for the x, y and z axes. To leave the ranges at their current values set the min and max to -1.
79
+  /// The range values are used to form data sets when data is not explicitely given.
80
+  cmRC_t cmPlotSetRange( double xMin, double xMax, double yMin, double yMax, double zMin, double zMax ); 
81
+
82
+  /// If x or y is given as NULL then the values will be taken from the range settings xMin:xMax or yMin:yMax.
83
+  /// Use the gnuplot command:'test' to see the valid lineType and pointType values for a given terminal
84
+  /// Color string may be any of the predefined color labels: show palette colornames or and rgb value: e.g. #FF00FF
85
+  cmRC_t cmPlotLineF( const char* legendStr, const float*  x, const float*  y, const float*  z, unsigned n, const char* colorStr, unsigned styleFlags );
86
+  cmRC_t cmPlotLineD( const char* legendStr, const double* x, const double* y, const double* z, unsigned n, const char* colorStr, unsigned styleFlags );
87
+
88
+  cmRC_t cmPlotLineMD( const double* x, const double* y, const double* z, unsigned rn, unsigned cn, unsigned styleFlags );
83 89
 
84 90
 
85 91
 #if CM_FLOAT_SMP == 1
@@ -95,8 +101,14 @@ cmRC_t cmPlotLineMD( const double* x, const double* y, const double* z, unsigned
95 101
 #endif
96 102
 
97 103
 
98
-cmRC_t cmPlotDraw();
99
-cmRC_t cmPlotPrint( bool printDataFl );
100
-cmRC_t cmPlotDrawAndPrint( bool printDataFl );
104
+  cmRC_t cmPlotDraw();
105
+  cmRC_t cmPlotPrint( bool printDataFl );
106
+  cmRC_t cmPlotDrawAndPrint( bool printDataFl );
107
+
108
+  //)
109
+  
110
+#ifdef __cplusplus
111
+}
112
+#endif
101 113
 
102 114
 #endif

+ 2
- 0
cmGr.h View File

@@ -5,6 +5,7 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Low level device independent API for descibing interactive graphics objects." kw:[plot] }
8 9
   enum 
9 10
   {
10 11
     kAliceBlueGrId            = 0xf0f8ff,
@@ -867,6 +868,7 @@ extern "C" {
867 868
 
868 869
   void     cmGrReport( cmGrH_t h, cmRpt_t* rpt );
869 870
 
871
+  //)
870 872
   
871 873
 #ifdef __cplusplus
872 874
 }

+ 4
- 1
cmGrDevCtx.h View File

@@ -4,7 +4,8 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
-
7
+  //( { file_desc:"Device independent graphics context object used by cmGr." kw:[plot]}
8
+  
8 9
   enum
9 10
   {
10 11
     kOkGrDcRC = cmOkRC,
@@ -195,6 +196,8 @@ extern "C" {
195 196
   // Is any of the rectangle visible in this drawing context.
196 197
   bool            cmGrDcRectIsVisible(  cmGrDcH_t h, const cmGrPExt_t* r );
197 198
 
199
+  //)
200
+  
198 201
 #ifdef __cplusplus
199 202
 }
200 203
 #endif

+ 15
- 2
cmGrPage.h View File

@@ -4,6 +4,8 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
+
8
+  //( { file_desc:"Device independent plotting window with one or more plot views." kw:[plot]}
7 9
   
8 10
   enum
9 11
   {
@@ -74,7 +76,11 @@ extern "C" {
74 76
   const cmChar_t*  cmGrPageLabelFuncLabel(    cmGrPgH_t h, unsigned id );
75 77
   void*            cmGrPageLabelFuncArg(      cmGrPgH_t h, unsigned id );
76 78
 
77
-
79
+  //----------------------------------------------------------------------------
80
+  //)
81
+  //( { label:cmGrView file_desc:"Device independent plotting view." kw:[plot]}
82
+  //
83
+  
78 84
   // Get a view handle from the view index.
79 85
   cmGrVwH_t cmGrPageViewHandle( cmGrPgH_t h,  unsigned vwIdx );
80 86
 
@@ -132,9 +138,14 @@ extern "C" {
132 138
     kSelH_VwId
133 139
   } cmGrViewValueId_t;
134 140
   const cmChar_t* cmGrViewValue( cmGrVwH_t h, cmGrViewValueId_t id, cmChar_t* buf, unsigned bufCharCnt );
135
-
141
+  
136 142
   // Get an axis handle.
137 143
   cmGrAxH_t     cmGrViewAxisHandle(    cmGrVwH_t h,  cmGrAxisIdx_t axisIdx  );
144
+
145
+  //----------------------------------------------------------------------------
146
+  //)  
147
+  //( { label:cmGrAxis file_desc:"Device independent plotting axis." kw:[plot]}
148
+  //
138 149
   
139 150
   bool            cmGrAxisIsValid(            cmGrAxH_t h );
140 151
   // kHashMarkGrFl | kHashLabelGrFl
@@ -161,6 +172,8 @@ extern "C" {
161 172
   // or cmGrPageLabelFuncIndexToId().
162 173
   void            cmGrAxisSetLabelFunc(      cmGrAxH_t h, unsigned pgLabelFuncId );
163 174
 
175
+  //)
176
+  
164 177
 #ifdef __cplusplus
165 178
 }
166 179
 #endif

+ 3
- 0
cmGrPlot.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Device indenpendent, multi-axis, interactive, plotting system based on cmGrPage, cmGrAxis and cmGr." kw:[plot]}
9
+  
8 10
   enum
9 11
   {
10 12
     kOkGrPlRC,
@@ -229,6 +231,7 @@ extern "C" {
229 231
   // Set the default object callback and arg.
230 232
   void         cmGrPlotSetCb( cmGrPlH_t h, cmGrPlotCbFunc_t func, void* arg );
231 233
 
234
+  //)
232 235
 
233 236
 #ifdef __cplusplus
234 237
 }

+ 4
- 1
cmGrPlotAudio.h View File

@@ -6,12 +6,15 @@
6 6
 extern "C" {
7 7
 #endif
8 8
 
9
-
9
+  //( { file_desc:"Override a cmGrPlotObj to make an efficient audio plot object." kw:[plot audio]}
10
+  
10 11
   cmGrPlRC_t  cmGrPlotAudioFileObjCreate(
11 12
     cmGrPlObjH_t oH,
12 13
     cmAfmFileH_t afH,
13 14
     unsigned     audioChIdx );
14 15
 
16
+  //)
17
+  
15 18
 #ifdef __cplusplus
16 19
 }
17 20
 #endif

+ 4
- 0
cmHashTbl.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Hash table for storing arbitary data blobs." kw:[container]}
9
+  
8 10
   enum
9 11
   {
10 12
     kOkHtRC,
@@ -60,6 +62,8 @@ extern "C" {
60 62
 
61 63
   cmHtRC_t cmHashTblTest( cmCtx_t* ctx );
62 64
 
65
+  //)
66
+  
63 67
 #ifdef __cplusplus
64 68
 }
65 69
 #endif

+ 2
- 3
cmJson.h View File

@@ -5,8 +5,8 @@
5 5
 #ifdef __cplusplus
6 6
 extern "C" {
7 7
 #endif
8
-  //{
9
-  //(
8
+  
9
+  //( { file_desc: "JSON reader and writer" kw:[file] }
10 10
   //
11 11
   //  Limitations:
12 12
   //
@@ -501,7 +501,6 @@ extern "C" {
501 501
   cmJsRC_t      cmJsonTest( const char* fn, cmCtx_t* ctx );
502 502
 
503 503
   //)
504
-  //}
505 504
 
506 505
 #ifdef __cplusplus
507 506
 }

+ 62
- 55
cmKeyboard.h View File

@@ -1,66 +1,73 @@
1 1
 #ifndef cmKeyboard_h
2 2
 #define cmKeyboard_h
3 3
 
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
4 7
 
5
-enum
6
-{
7
-  kInvalidKId,
8
-  kAsciiKId,
9
-  kLeftArrowKId,
10
-  kRightArrowKId,
11
-  kUpArrowKId,
12
-  kDownArrowKId,
13
-  kHomeKId,
14
-  kEndKId,
15
-  kPgUpKId,
16
-  kPgDownKId,
17
-  kInsertKId,
18
-  kDeleteKId,
8
+  //( { file_desc:"Query and get keypresses directly from the console." kw:[system] }
19 9
   
20
-};
21
-
22
-
23
-
24
-
10
+  enum
11
+  {
12
+    kInvalidKId,
13
+    kAsciiKId,
14
+    kLeftArrowKId,
15
+    kRightArrowKId,
16
+    kUpArrowKId,
17
+    kDownArrowKId,
18
+    kHomeKId,
19
+    kEndKId,
20
+    kPgUpKId,
21
+    kPgDownKId,
22
+    kInsertKId,
23
+    kDeleteKId,
24
+  
25
+  };
25 26
 
26
-typedef struct
27
-{
28
-  unsigned code;
29
-  char     ch;
30
-  bool     ctlFl;
31
-  bool     altFl;
32
-} cmKbRecd;
27
+  typedef struct
28
+  {
29
+    unsigned code;
30
+    char     ch;
31
+    bool     ctlFl;
32
+    bool     altFl;
33
+  } cmKbRecd;
33 34
 
34
-// Set 'p' to NULL if the value of the key is not required.
35
-void cmKeyPress( cmKbRecd* p );
35
+  // Set 'p' to NULL if the value of the key is not required.
36
+  void cmKeyPress( cmKbRecd* p );
36 37
 
37 38
 
38
-// Return non-zero if a key is waiting to be read otherwise return 0.
39
-// Use getchar() to pick up the key.
40
-// 
41
-// Example:
42
-// while( 1 )
43
-// {
44
-//    if( cmIsKeyWaiting() == 0 )
45
-//       usleep(20000);
46
-//    else
47
-//    {
48
-//      char c = getchar();
49
-//      switch(c)
50
-//      {
51
-//        ....
52
-//      } 
53
-//    }
54
-//
55
-// }
56
-//
57
-// TODO: Note that this function turns off line-buffering on stdin.
58
-// It should be changed to a three function sequence.
59
-// bool org_state =  cmSetStdinLineBuffering(false);
60
-// ....
61
-// cmIsKeyWaiting()
62
-// ....
63
-// cmSetStdinLineBuffering(org_state)
64
-int cmIsKeyWaiting();
39
+  // Return non-zero if a key is waiting to be read otherwise return 0.
40
+  // Use getchar() to pick up the key.
41
+  // 
42
+  // Example:
43
+  // while( 1 )
44
+  // {
45
+  //    if( cmIsKeyWaiting() == 0 )
46
+  //       usleep(20000);
47
+  //    else
48
+  //    {
49
+  //      char c = getchar();
50
+  //      switch(c)
51
+  //      {
52
+  //        ....
53
+  //      } 
54
+  //    }
55
+  //
56
+  // }
57
+  //
58
+  // TODO: Note that this function turns off line-buffering on stdin.
59
+  // It should be changed to a three function sequence.
60
+  // bool org_state =  cmSetStdinLineBuffering(false);
61
+  // ....
62
+  // cmIsKeyWaiting()
63
+  // ....
64
+  // cmSetStdinLineBuffering(org_state)
65
+  int cmIsKeyWaiting();
65 66
 
67
+  //)
68
+  
69
+#ifdef __cplusplus
70
+  extern "C" {
71
+#endif
72
+  
66 73
 #endif

+ 1
- 5
cmLex.h View File

@@ -1,11 +1,8 @@
1 1
 #ifndef cmLex_h
2 2
 #define cmLex_h
3 3
 
4
-//{
5
-//(
6
-//)
7 4
 
8
-//(
5
+//( { file_desc:"User configurable lexer for tokenizing text files." kw:[text]}
9 6
 
10 7
 
11 8
 // Predefined Lexer Id's
@@ -158,6 +155,5 @@ const cmChar_t* cmLexRcToMsg( unsigned rc );
158 155
 void cmLexTest( cmRpt_t* rpt );
159 156
 
160 157
 //)
161
-//}
162 158
 
163 159
 #endif

+ 3
- 1
cmLib.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Manage shared-libraries and query them for known symbols." kw:[system]}
9
+  
8 10
   enum
9 11
   {
10 12
     kOkLibRC = cmOkRC,
@@ -54,7 +56,7 @@ extern "C" {
54 56
   // Return the libraries file name.
55 57
   const cmChar_t* cmLibName( cmLibH_t h, unsigned libId );
56 58
   
57
-  
59
+  //)
58 60
 
59 61
 #ifdef __cplusplus
60 62
 }

+ 1
- 1
cmLinkedHeap.c View File

@@ -141,7 +141,7 @@ bool     _cmLHeapFree(    cmLHeap_t* lhp, void* dataPtr )
141 141
     lbp->nextPtr = (char*)allocPtr; // ... then make it the space to alloc
142 142
   else           
143 143
     lbp->freeCnt += *allocPtr; // ... otherwise increase the free count
144
-  //(freeCnt tracks unused space that is not at the end of the block and therefore cannot be reused.)
144
+  // freeCnt tracks unused space that is not at the end of the block and therefore cannot be reused.
145 145
 
146 146
   // if all the space for this block has been freed then the
147 147
   // next space to allocate must be at the base

+ 11
- 2
cmLinkedHeap.h View File

@@ -5,8 +5,18 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  //{
8
+  //( { file_desc:"Implements a block based memory heap manager." kw:[base]}
9
+  //
10
+  // There are two advantages to using this memory manager over the cmMallocDebug
11
+  // manager. It alleviates memory fragmentation by pre-allocating large blocks of memory
12
+  // which are then used to fullfill many small memory requests. Second it can
13
+  // act as a garbage collector by releasing all the memory it is managing at once.
14
+  // This can reduce code complexity by eliminating for a class instance to release internally
15
+  // allocated objects.
16
+  //)
17
+
9 18
   //(
19
+  
10 20
   typedef cmHandle_t cmLHeapH_t;
11 21
   
12 22
   extern cmLHeapH_t cmLHeapNullHandle;
@@ -84,7 +94,6 @@ extern "C" {
84 94
 #endif
85 95
 
86 96
   //)
87
-  //}
88 97
 
89 98
 #ifdef __cplusplus
90 99
 }

+ 4
- 0
cmMain.c View File

@@ -1,3 +1,5 @@
1
+//( { file_desc:"Template 'main.c' for 'libcm' based program"  kw:[demo]}
2
+
1 3
 #include "cmGlobal.h"
2 4
 #include "cmRpt.h"
3 5
 #include "cmMem.h"
@@ -31,3 +33,5 @@ int main(int argc, char* argv[] )
31 33
   cmMdFinalize();
32 34
   return 0;
33 35
 }
36
+
37
+//)

+ 10
- 14
cmMallocDebug.h View File

@@ -1,6 +1,11 @@
1
-//{ { label:cmMd }
2
-//(
3
-// Implements an extended memory allocation and tracking manager.
1
+#ifndef cmMallocDebug_h
2
+#define cmMallocDebug_h
3
+
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
8
+//( { file_desc:"Implements an extended memory allocation and tracking manager." kw:[base] }
4 9
 //
5 10
 // cmMallocDebug is a wrapper to cmMem.h for calls to malloc() and free().
6 11
 // Most of the cmMdXXX() calls are directly associated with same named 
@@ -8,15 +13,8 @@
8 13
 // cmMm object where malloc() and free() are the callback functions 
9 14
 // provided to cmMmInitialize().
10 15
 // 
11
-//)
12
-
13
-#ifndef cmMallocDebug_h
14
-#define cmMallocDebug_h
15
-
16
-#ifdef __cplusplus
17
-extern "C" {
18
-#endif
19
-  //(
16
+//
17
+  
20 18
   // Initialize the malloc debug manager. guardByteCnt, alignByteeCnt, flags, and rpt
21 19
   // are used to initialize an internal cmMm object.  See cmMm for their semantics.
22 20
   cmMmRC_t  cmMdInitialize( unsigned guardByteCnt, unsigned alignByteCnt, unsigned flags, cmRpt_t* rptPtr );
@@ -165,6 +163,4 @@ extern "C" {
165 163
 #endif
166 164
 
167 165
 
168
-//}
169
-
170 166
 #endif

+ 127
- 115
cmMath.h View File

@@ -1,120 +1,132 @@
1 1
 #ifndef cmMath_h
2 2
 #define cmMath_h
3 3
 
4
-double   cmX80ToDouble( unsigned char s[10] );
5
-void     cmDoubleToX80( double v, unsigned char s[10] );
6
-
7
-bool     cmIsPowerOfTwo(   unsigned i );
8
-unsigned cmNextPowerOfTwo( unsigned i );
9
-unsigned cmNearPowerOfTwo( unsigned i );
10
-
11
-bool     cmIsOddU(    unsigned v );
12
-bool     cmIsEvenU(   unsigned v );
13
-unsigned cmNextOddU(  unsigned v );
14
-unsigned cmPrevOddU(  unsigned v );
15
-unsigned cmNextEvenU( unsigned v );
16
-unsigned cmPrevEvenU( unsigned v );
17
-
18
-/// Increment or decrement 'idx' by 'delta' always wrapping the result into the range
19
-/// 0 to (maxN-1).
20
-/// 'idx': initial value 
21
-/// 'delta':  incremental amount
22
-/// 'maxN' - 1 : maximum return value.
23
-unsigned cmModIncr(int idx, int delta, int maxN );
24
-
25
-// modified bessel function of first kind, order 0
26
-// ref: orfandis appendix B io.m
27
-double   cmBessel0( double x );
28
-
29
-
30
-//=================================================================
31
-// The following elliptic-related function approximations come from
32
-// Parks & Burrus, Digital Filter Design, Appendix program 9, pp. 317-326
33
-// which in turn draws directly on other sources
34
-
35
-// calculate complete elliptic integral (quarter period) K
36
-// given *complimentary* modulus kc
37
-cmReal_t cmEllipK( cmReal_t kc );
38
-
39
-// calculate elliptic modulus k
40
-// given ratio of complete elliptic integrals r = K/K'
41
-// (solves the "degree equation" for fixed N = K*K1'/K'K1)
42
-cmReal_t cmEllipDeg( cmReal_t r );
43
-
44
-// calculate arc elliptic tangent u (elliptic integral of the 1st kind)
45
-// given argument x = sc(u,k) and *complimentary* modulus kc
46
-cmReal_t cmEllipArcSc( cmReal_t x, cmReal_t kc );
47
-
48
-// calculate Jacobi elliptic functions sn, cn, and dn
49
-// given argument u and *complimentary* modulus kc
50
-cmRC_t   cmEllipJ( cmReal_t u, cmReal_t kc, cmReal_t* sn, cmReal_t* cn, cmReal_t* dn );
51
-
52
-
53
-//=================================================================
54
-// bilinear transform
55
-// z = (2*sr + s)/(2*sr - s)
56
-cmRC_t cmBlt( unsigned n, cmReal_t sr, cmReal_t* rp, cmReal_t* ip );
57
-
58
-
59
-//=================================================================
60
-// Pitch conversion
61
-unsigned cmHzToMidi( double hz );
62
-float    cmMidiToHz( unsigned midi );
63
-
64
-//=================================================================
65
-// Floating point byte swapping
66
-unsigned           cmFfSwapFloatToUInt( float v );
67
-float              cmFfSwapUIntToFloat( unsigned v );
68
-unsigned long long cmFfSwapDoubleToULLong( double v );
69
-double             cmFfSwapULLongToDouble( unsigned long long v );
70
-
71
-//=================================================================
72
-int      cmRandInt( int min, int max );
73
-unsigned cmRandUInt( unsigned min, unsigned max );
74
-float    cmRandFloat( float min, float max );
75
-double   cmRandDouble( double min, double max );
76
-
77
-//=================================================================
78
-bool cmIsCloseD( double   x0, double   x1, double eps );
79
-bool cmIsCloseF( float    x0, float    x1, double eps );
80
-bool cmIsCloseI( int      x0, int      x1, double eps );
81
-bool cmIsCloseU( unsigned x0, unsigned x1, double eps );
82
-
83
-//=================================================================
84
-// Run a length 'lfsrN' linear feedback shift register (LFSR) for 'yN' iterations to
85
-// produce a length 'yN' bit string in yV[yN].
86
-// 'lfsrN' count of bits in the shift register range: 2<= lfsrN <= 32.
87
-// 'tapMask' is a bit mask which gives the tap indexes positions for the LFSR. 
88
-// The least significant bit corresponds to the maximum delay tap position.  
89
-// The min tap position is therefore denoted by the tap mask bit location 1 << (lfsrN-1).
90
-// A minimum of two taps must exist.
91
-// 'seed' sets the initial delay state.
92
-// 'yV[yN]' is the the output vector
93
-// 'yN' is count of elements in yV.
94
-// The function resturn kOkAtRC on success or kInvalidArgsRCRC if any arguments are invalid.
95
-// /sa cmLFSR_Test.
96
-void   cmLFSR( unsigned lfsrN, unsigned tapMask, unsigned seed, unsigned* yV, unsigned yN );
97
-
98
-// Example and test code for cmLFSR() 
99
-bool cmLFSR_Test();
100
-
101
-
102
-// Generate a set of 'goldN' Gold codes using the Maximum Length Sequences (MLS) generated
103
-// by a length 'lfsrN' linear feedback shift register.
104
-// 'err' is an error object to be set if the the function fails.
105
-// 'lfsrN' is the length of the Linear Feedback Shift Registers (LFSR) used to generate the MLS.
106
-// 'poly_coeff0' tap mask for the first LFSR.
107
-// 'coeff1' tap mask the the second LFSR.
108
-// 'goldN' is the count of Gold codes to generate. 
109
-// 'yM[mlsN', goldN] is a column major output matrix where each column contains a Gold code.
110
-// 'mlsN' is the length of the maximum length sequence for each Gold code which can be
111
-// calculated as mlsN = (1 << a->lfsrN) - 1.
112
-// Note that values of 'lfsrN' and the 'poly_coeffx' must be carefully selected such that
113
-// they will produce a MLS.  For example to generate a MLS with length 31 set 'lfsrN' to 5 and
114
-// then select poly_coeff from two different elements of the set {0x12 0x14 0x17 0x1B 0x1D 0x1E}.
115
-// See http://www.ece.cmu.edu/~koopman/lfsr/index.html for a complete set of MSL polynomial
116
-// coefficients for given LFSR lengths.
117
-// Returns false if insufficient balanced pairs exist.
118
-bool   cmGenGoldCodes( unsigned lfsrN, unsigned poly_coeff0, unsigned poly_coeff1, unsigned goldN, int* yM, unsigned mlsN  );
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
7
+
8
+  //( { file_desc:"Math utility functions" kw:[math] }
9
+  
10
+  double   cmX80ToDouble( unsigned char s[10] );
11
+  void     cmDoubleToX80( double v, unsigned char s[10] );
12
+
13
+  bool     cmIsPowerOfTwo(   unsigned i );
14
+  unsigned cmNextPowerOfTwo( unsigned i );
15
+  unsigned cmNearPowerOfTwo( unsigned i );
16
+
17
+  bool     cmIsOddU(    unsigned v );
18
+  bool     cmIsEvenU(   unsigned v );
19
+  unsigned cmNextOddU(  unsigned v );
20
+  unsigned cmPrevOddU(  unsigned v );
21
+  unsigned cmNextEvenU( unsigned v );
22
+  unsigned cmPrevEvenU( unsigned v );
23
+
24
+  /// Increment or decrement 'idx' by 'delta' always wrapping the result into the range
25
+  /// 0 to (maxN-1).
26
+  /// 'idx': initial value 
27
+  /// 'delta':  incremental amount
28
+  /// 'maxN' - 1 : maximum return value.
29
+  unsigned cmModIncr(int idx, int delta, int maxN );
30
+
31
+  // modified bessel function of first kind, order 0
32
+  // ref: orfandis appendix B io.m
33
+  double   cmBessel0( double x );
34
+
35
+
36
+  //=================================================================
37
+  // The following elliptic-related function approximations come from
38
+  // Parks & Burrus, Digital Filter Design, Appendix program 9, pp. 317-326
39
+  // which in turn draws directly on other sources
40
+
41
+  // calculate complete elliptic integral (quarter period) K
42
+  // given *complimentary* modulus kc
43
+  cmReal_t cmEllipK( cmReal_t kc );
44
+
45
+  // calculate elliptic modulus k
46
+  // given ratio of complete elliptic integrals r = K/K'
47
+  // (solves the "degree equation" for fixed N = K*K1'/K'K1)
48
+  cmReal_t cmEllipDeg( cmReal_t r );
49
+
50
+  // calculate arc elliptic tangent u (elliptic integral of the 1st kind)
51
+  // given argument x = sc(u,k) and *complimentary* modulus kc
52
+  cmReal_t cmEllipArcSc( cmReal_t x, cmReal_t kc );
53
+
54
+  // calculate Jacobi elliptic functions sn, cn, and dn
55
+  // given argument u and *complimentary* modulus kc
56
+  cmRC_t   cmEllipJ( cmReal_t u, cmReal_t kc, cmReal_t* sn, cmReal_t* cn, cmReal_t* dn );
57
+
58
+
59
+  //=================================================================
60
+  // bilinear transform
61
+  // z = (2*sr + s)/(2*sr - s)
62
+  cmRC_t cmBlt( unsigned n, cmReal_t sr, cmReal_t* rp, cmReal_t* ip );
63
+
64
+
65
+  //=================================================================
66
+  // Pitch conversion
67
+  unsigned cmHzToMidi( double hz );
68
+  float    cmMidiToHz( unsigned midi );
69
+
70
+  //=================================================================
71
+  // Floating point byte swapping
72
+  unsigned           cmFfSwapFloatToUInt( float v );
73
+  float              cmFfSwapUIntToFloat( unsigned v );
74
+  unsigned long long cmFfSwapDoubleToULLong( double v );
75
+  double             cmFfSwapULLongToDouble( unsigned long long v );
76
+
77
+  //=================================================================
78
+  int      cmRandInt( int min, int max );
79
+  unsigned cmRandUInt( unsigned min, unsigned max );
80
+  float    cmRandFloat( float min, float max );
81
+  double   cmRandDouble( double min, double max );
82
+
83
+  //=================================================================
84
+  bool cmIsCloseD( double   x0, double   x1, double eps );
85
+  bool cmIsCloseF( float    x0, float    x1, double eps );
86
+  bool cmIsCloseI( int      x0, int      x1, double eps );
87
+  bool cmIsCloseU( unsigned x0, unsigned x1, double eps );
88
+
89
+  //=================================================================
90
+  // Run a length 'lfsrN' linear feedback shift register (LFSR) for 'yN' iterations to
91
+  // produce a length 'yN' bit string in yV[yN].
92
+  // 'lfsrN' count of bits in the shift register range: 2<= lfsrN <= 32.
93
+  // 'tapMask' is a bit mask which gives the tap indexes positions for the LFSR. 
94
+  // The least significant bit corresponds to the maximum delay tap position.  
95
+  // The min tap position is therefore denoted by the tap mask bit location 1 << (lfsrN-1).
96
+  // A minimum of two taps must exist.
97
+  // 'seed' sets the initial delay state.
98
+  // 'yV[yN]' is the the output vector
99
+  // 'yN' is count of elements in yV.
100
+  // The function resturn kOkAtRC on success or kInvalidArgsRCRC if any arguments are invalid.
101
+  // /sa cmLFSR_Test.
102
+  void   cmLFSR( unsigned lfsrN, unsigned tapMask, unsigned seed, unsigned* yV, unsigned yN );
103
+
104
+  // Example and test code for cmLFSR() 
105
+  bool cmLFSR_Test();
106
+
107
+
108
+  // Generate a set of 'goldN' Gold codes using the Maximum Length Sequences (MLS) generated
109
+  // by a length 'lfsrN' linear feedback shift register.
110
+  // 'err' is an error object to be set if the the function fails.
111
+  // 'lfsrN' is the length of the Linear Feedback Shift Registers (LFSR) used to generate the MLS.
112
+  // 'poly_coeff0' tap mask for the first LFSR.
113
+  // 'coeff1' tap mask the the second LFSR.
114
+  // 'goldN' is the count of Gold codes to generate. 
115
+  // 'yM[mlsN', goldN] is a column major output matrix where each column contains a Gold code.
116
+  // 'mlsN' is the length of the maximum length sequence for each Gold code which can be
117
+  // calculated as mlsN = (1 << a->lfsrN) - 1.
118
+  // Note that values of 'lfsrN' and the 'poly_coeffx' must be carefully selected such that
119
+  // they will produce a MLS.  For example to generate a MLS with length 31 set 'lfsrN' to 5 and
120
+  // then select poly_coeff from two different elements of the set {0x12 0x14 0x17 0x1B 0x1D 0x1E}.
121
+  // See http://www.ece.cmu.edu/~koopman/lfsr/index.html for a complete set of MSL polynomial
122
+  // coefficients for given LFSR lengths.
123
+  // Returns false if insufficient balanced pairs exist.
124
+  bool   cmGenGoldCodes( unsigned lfsrN, unsigned poly_coeff0, unsigned poly_coeff1, unsigned goldN, int* yM, unsigned mlsN  );
125
+
126
+  //)
127
+  
128
+#ifdef __cplusplus
129
+}
130
+#endif
119 131
 
120 132
 #endif

+ 8
- 6
cmMem.h View File

@@ -1,6 +1,4 @@
1
-//{
2
-//(
3
-// The cmMem class implements a memory allocation manager interface.
1
+//( { file_desc: "Implements a memory allocation manager interface." kw:[ base ]}
4 2
 //
5 3
 //
6 4
 // Using cmMem allows memory leaks and some instances of memory corruption 
@@ -19,13 +17,16 @@
19 17
 // 1. A client memory manager creates and configures a cmMm object via cmMmInitialize().
20 18
 // As part of the configuration the client gives callback functions which implement
21 19
 // actual memory allocation and release.  In practice this means the callback probably
22
-// call malloc() or free(). 
20
+// call malloc() or free().
21
+//
23 22
 // 2. At some point later when the client needs to allocate a block of memory it calls
24 23
 // cmMmAllocate() with the size of the requested block.  cmMm translates this request
25 24
 // into a call to the client provided memory allocation callback to get a block of raw
26 25
 // memory which is slightly larger than the request block.
26
+//
27 27
 // 3. Given the raw memory block cmMm conditions it in the following ways and returns
28 28
 // it to the client.
29
+//
29 30
 // * The base of the blocks data area is shifted such that it is has an arbitrary 
30 31
 // address aligned according to the value set by the alignByteCnt parameter to cmMmInitialize().
31 32
 // Address aligment is sometimes required by routines which make use of the the SIMD
@@ -54,9 +55,11 @@
54 55
 // writes to freed memory areas.  When deferred release is enabled the freeFunc() is not called
55 56
 // on any blocks until cmMmFinalize().  If the program continually allocates memory over the 
56 57
 // life of the program this may mean that the program will eventually exhaust physical memory.
58
+//
57 59
 // 2. If tracking is enabled (kTrackMmFl) then the block pointer is looked up in the internal database.
58 60
 // If the pointer is not found then a kMissingRecdRC is returned indicating an attempt to release
59
-// a non-allocated block.  
61
+// a non-allocated block.
62
+//
60 63
 // 3. If tracking is enabled (kTrackMmFl) then the block is marked as released in the 
61 64
 // internal tracking database. At the end of the program all blocks should be marked for release
62 65
 // otherwise they are considered leaks.  
@@ -223,7 +226,6 @@ extern "C" {
223 226
   cmMmRC_t cmMmCheckAllGuards( cmMmH_t h );
224 227
 
225 228
   //)
226
-  //}
227 229
 #ifdef __cplusplus
228 230
 }
229 231
 #endif

+ 4
- 0
cmMidi.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"MIDI utility constants and functions." kw:[midi]}
9
+  
8 10
   enum
9 11
   {
10 12
     kMidiChCnt           = 16,
@@ -154,6 +156,8 @@ extern "C" {
154 156
   // of this range will be returned as kInvalidMidiPitch.   
155 157
   cmMidiByte_t    cmSciPitchToMidi( const char* sciPitchStr );
156 158
 
159
+  //)
160
+  
157 161
 #ifdef __cplusplus
158 162
 }
159 163
 #endif

+ 6
- 3
cmMidiFile.h View File

@@ -5,6 +5,7 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"MIDI file reader and writer." kw:[midi file]}  
8 9
   // MIDI file timing:
9 10
   // Messages in the MIDI file are time tagged with a delta offset in 'ticks'
10 11
   // from the previous message in the same track.
@@ -22,9 +23,9 @@ extern "C" {
22 23
   //
23 24
   // As part of the file reading process, the status byte of note-on messages 
24 25
   // with velocity=0 are is changed to a note-off message. See _cmMidiFileReadChannelMsg().
25
-
26
-
27
-
26
+  //)
27
+  
28
+  //(
28 29
   typedef cmHandle_t cmMidiFileH_t;
29 30
   typedef unsigned   cmMfRC_t;
30 31
 
@@ -175,6 +176,8 @@ extern "C" {
175 176
   bool                  cmMidiFileIsNull( cmMidiFileH_t h );
176 177
   void                  cmMidiFileTest( const char* fn, cmCtx_t* ctx );
177 178
 
179
+  //)
180
+  
178 181
 #ifdef __cplusplus
179 182
 }
180 183
 #endif

+ 41
- 37
cmMidiFilePlay.h View File

@@ -5,53 +5,57 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-typedef cmHandle_t cmMfpH_t;
9
-typedef cmRC_t     cmMfpRC_t;
10
-
11
-typedef void (*cmMfpCallback_t)( void* userCbPtr, unsigned dmicros, const cmMidiTrackMsg_t* msgPtr );
12
-
13
-enum
14
-{
15
-  kOkMfpRC = cmOkRC,            // 0
16
-  kInvalidHandleMfpRC,          // 1
17
-  kFileOpenFailMfpRC,           // 2 
18
-  kInvalidFileMfpRC,            // 3
19
-  kMemAllocFailMfpRC,           // 4
20
-  kSmpteTickNotImpleMfpRC,      // 5
21
-  kEndOfFileMfpRC,              // 6
22
-  kSmpteTickNotImplMfpRC        // 7
8
+  //( { file_desc:"Device indepenent MIDI file player." kw:[midi]}
23 9
   
24
-};
10
+  typedef cmHandle_t cmMfpH_t;
11
+  typedef cmRC_t     cmMfpRC_t;
12
+
13
+  typedef void (*cmMfpCallback_t)( void* userCbPtr, unsigned dmicros, const cmMidiTrackMsg_t* msgPtr );
14
+
15
+  enum
16
+  {
17
+    kOkMfpRC = cmOkRC,            // 0
18
+    kInvalidHandleMfpRC,          // 1
19
+    kFileOpenFailMfpRC,           // 2 
20
+    kInvalidFileMfpRC,            // 3
21
+    kMemAllocFailMfpRC,           // 4
22
+    kSmpteTickNotImpleMfpRC,      // 5
23
+    kEndOfFileMfpRC,              // 6
24
+    kSmpteTickNotImplMfpRC        // 7
25
+  
26
+  };
25 27
 
26
-extern cmMfpH_t cmMfpNullHandle;
28
+  extern cmMfpH_t cmMfpNullHandle;
27 29
 
28
-cmMfpRC_t cmMfpCreate(     cmMfpH_t* hp, cmMfpCallback_t cbFunc, void* userCbPtr, cmCtx_t* ctx );
29
-cmMfpRC_t cmMfpDestroy(    cmMfpH_t* hp );
30
-bool      cmMfpIsValid(    cmMfpH_t h );
30
+  cmMfpRC_t cmMfpCreate(     cmMfpH_t* hp, cmMfpCallback_t cbFunc, void* userCbPtr, cmCtx_t* ctx );
31
+  cmMfpRC_t cmMfpDestroy(    cmMfpH_t* hp );
32
+  bool      cmMfpIsValid(    cmMfpH_t h );
31 33
 
32
-// Load a MIDI file into the player. This MIDI file will be automatically
33
-// closed when a new file is loaded at a later time or the MIDI file player handle is destroyed.
34
-cmMfpRC_t cmMfpLoadFile(   cmMfpH_t h, const char* fn );
34
+  // Load a MIDI file into the player. This MIDI file will be automatically
35
+  // closed when a new file is loaded at a later time or the MIDI file player handle is destroyed.
36
+  cmMfpRC_t cmMfpLoadFile(   cmMfpH_t h, const char* fn );
35 37
 
36
-// Load a MIDI file into the player using a file owned by the host.
37
-// This file will NOT be closed when a new file is loaded at a later time
38
-// or the MIDI file player handle is destroyed.
39
-cmMfpRC_t cmMfpLoadHandle( cmMfpH_t h, cmMidiFileH_t mfH );
38
+  // Load a MIDI file into the player using a file owned by the host.
39
+  // This file will NOT be closed when a new file is loaded at a later time
40
+  // or the MIDI file player handle is destroyed.
41
+  cmMfpRC_t cmMfpLoadHandle( cmMfpH_t h, cmMidiFileH_t mfH );
40 42
 
41
-// Reset the play position of the player to an offset in microseconds from 
42
-// the beginning of the file.  If there are no message at or after 'offsMicrosecs'
43
-// then the function will return kEndOfFileMfpRC.
44
-cmMfpRC_t cmMfpSeek(       cmMfpH_t h, unsigned offsMicrosecs );
43
+  // Reset the play position of the player to an offset in microseconds from 
44
+  // the beginning of the file.  If there are no message at or after 'offsMicrosecs'
45
+  // then the function will return kEndOfFileMfpRC.
46
+  cmMfpRC_t cmMfpSeek(       cmMfpH_t h, unsigned offsMicrosecs );
45 47
 
46
-// This is the driving clock call for the player. 'deltaMicroSecs' is the
47
-// elapsed time in microseconds since the last call to this function.
48
-// Call to 'cbFunc', as set in by cmMfpCreate() occur from this function.
49
-cmMfpRC_t cmMfpClock(      cmMfpH_t h, unsigned deltaMicroSecs );
48
+  // This is the driving clock call for the player. 'deltaMicroSecs' is the
49
+  // elapsed time in microseconds since the last call to this function.
50
+  // Call to 'cbFunc', as set in by cmMfpCreate() occur from this function.
51
+  cmMfpRC_t cmMfpClock(      cmMfpH_t h, unsigned deltaMicroSecs );
50 52
 
51
-cmMfpRC_t cmMfpTest( const char* fn, cmCtx_t* ctx );
53
+  cmMfpRC_t cmMfpTest( const char* fn, cmCtx_t* ctx );
52 54
 
53
-cmRC_t cmMfpTest2( const char* midiFn, const char* audioFn, cmCtx_t* ctx );
55
+  cmRC_t cmMfpTest2( const char* midiFn, const char* audioFn, cmCtx_t* ctx );
54 56
 
57
+  //)
58
+  
55 59
 #ifdef __cplusplus
56 60
 }
57 61
 #endif

+ 9
- 2
cmMidiPort.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //(  { file_desc:"Device independent MIDI port related code." kw:[midi]}
9
+
8 10
   typedef unsigned cmMpRC_t;
9 11
 
10 12
   // Flags used to identify input and output ports on MIDI devices
@@ -30,7 +32,9 @@ extern "C" {
30 32
   };
31 33
 
32 34
   typedef void (*cmMpCallback_t)( const cmMidiPacket_t* pktArray, unsigned pktCnt );
33
-
35
+  
36
+  //)
37
+  //(  { label:cmMpParser file_desc:"MIDI event parser converts raw MIDI events into cmMidiPacket_t messages." kw:[midi]}
34 38
 
35 39
   //===============================================================================================
36 40
   // MIDI Parser
@@ -62,6 +66,8 @@ extern "C" {
62 66
   // Returns true if the parser uses the given callback.
63 67
   bool          cmMpParserHasCallback(     cmMpParserH_t h, cmMpCallback_t cbFunc, void* cbDataPtr );
64 68
 
69
+  //)
70
+  //(  { label:cmMidiPort file_desc:"Device independent MIDI port." kw:[midi]}
65 71
 
66 72
   //===============================================================================================
67 73
   // MIDI Device Interface
@@ -92,7 +98,8 @@ extern "C" {
92 98
   void        cmMpReport( cmRpt_t* rpt );
93 99
 
94 100
   void cmMpTest( cmCtx_t* ctx );
95
-
101
+  //)
102
+  
96 103
 #ifdef __cplusplus
97 104
 }
98 105
 #endif

+ 3
- 0
cmMsgProtocol.h View File

@@ -7,6 +7,7 @@
7 7
 extern "C" {
8 8
 #endif
9 9
 
10
+  //( { file_desc:"Global constants and data structures for transmiting messages between threads and network nodes.", kw:[real_time]}
10 11
   #define cmAudDspSys_FILENAME "aud_dsp.js"
11 12
 
12 13
 
@@ -134,6 +135,8 @@ extern "C" {
134 135
   cmMsgRC_t cmMsgPeekInstId(     const void* msgArray[], unsigned msgByteCntArray[], unsigned segCnt, unsigned* retValPtr );
135 136
   cmMsgRC_t cmMsgPeekInstVarId(  const void* msgArray[], unsigned msgByteCntArray[], unsigned segCnt, unsigned* retValPtr );
136 137
 
138
+  //)
139
+  
137 140
 #ifdef __cplusplus
138 141
 }
139 142
 #endif

+ 2
- 3
cmPgmOpts.h View File

@@ -1,8 +1,8 @@
1 1
 #ifndef cmPgmOpts_h
2 2
 #define cmPgmOpts_h
3 3
 
4
-//{
5
-//(
4
+//( { file_desc:"Command line argument description and parsing API." kw:[base]}
5
+//
6 6
 // Command line program option syntax:
7 7
 //
8 8
 //
@@ -206,7 +206,6 @@ extern "C" {
206 206
   void cmPgmOptPrintParms(   cmPgmOptH_t h, cmRpt_t* rpt );
207 207
 
208 208
   //)
209
-  //}
210 209
 
211 210
 #ifdef __cplusplus
212 211
 }

+ 4
- 1
cmPrefs.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Manage persistent application preferences." kw:[base] }
9
+  
8 10
   typedef unsigned cmPrRC_t;
9 11
   typedef cmHandle_t cmPrH_t;
10 12
 
@@ -188,7 +190,8 @@ extern "C" {
188 190
 
189 191
   void cmPrefsTest( cmCtx_t* ctx, const char* ifn, const char* ofn );
190 192
     
191
-
193
+  //)
194
+  
192 195
 #ifdef __cplusplus
193 196
 }
194 197
 #endif

+ 112
- 134
cmProc.h View File

@@ -5,7 +5,10 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  //------------------------------------------------------------------------------------------------------------
8
+  //( { file_desc:"Processor Library 1" kw:[proclib]}
9
+  //)
10
+
11
+  //( { label:cmAudioFileRd file_desc:"Audio file reader based on cmAudioFile" kw:[proc] }
9 12
   typedef struct
10 13
   {
11 14
     cmObj             obj;
@@ -23,28 +26,30 @@ extern "C" {
23 26
     cmMtxFile*        mfp;
24 27
   } cmAudioFileRd;
25 28
 
26
-  /// set p to NULL to dynamically allocate the object
27
-  /// fn and chIdx are optional - set fn to NULL to allocate the reader without opening a file.
28
-  /// If fn is valid then chIdx must also be valid.
29
-  /// Set 'endSmpIdx' to cmInvalidIdx to return the entire signal in cmAudioFileRdRead().
30
-  /// Set 'endSmpIdx' to 0 to return all samples between 0 and the end of the file.
29
+  // set p to NULL to dynamically allocate the object
30
+  // fn and chIdx are optional - set fn to NULL to allocate the reader without opening a file.
31
+  // If fn is valid then chIdx must also be valid.
32
+  // Set 'endSmpIdx' to cmInvalidIdx to return the entire signal in cmAudioFileRdRead().
33
+  // Set 'endSmpIdx' to 0 to return all samples between 0 and the end of the file.
31 34
   cmAudioFileRd*     cmAudioFileRdAlloc( cmCtx* c, cmAudioFileRd* p, unsigned procSmpCnt, const char* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx );
32 35
   cmRC_t             cmAudioFileRdFree(  cmAudioFileRd** p );
33 36
   cmRC_t             cmAudioFileRdOpen(  cmAudioFileRd* p, unsigned procSmpCnt,  const cmChar_t* fn, unsigned chIdx, unsigned begSmpIdx, unsigned endSmpIdx ); 
34 37
   cmRC_t             cmAudioFileRdClose( cmAudioFileRd* p );  
35 38
 
36 39
 
37
-  /// Returns cmEofRC if the end of file is encountered.
40
+  // Returns cmEofRC if the end of file is encountered.
38 41
   cmRC_t             cmAudioFileRdRead(  cmAudioFileRd* p );
39 42
   cmRC_t             cmAudioFileRdSeek(  cmAudioFileRd* p, unsigned frmIdx );
40 43
 
41
-  /// Find the overall minimum, maximum, and mean sample values without changing the current file location.
44
+  // Find the overall minimum, maximum, and mean sample values without changing the current file location.
42 45
   cmRC_t             cmAudioFileRdMinMaxMean( cmAudioFileRd* p, unsigned chIdx, cmSample_t* minPtr, cmSample_t* maxPtr, cmSample_t* meanPtr );
43 46
 
47
+  //)
44 48
 
49
+  //( { label:cmShiftBuf file_desc:"Audio shift buffer processor" kw:[proc] }
45 50
   //------------------------------------------------------------------------------------------------------------
46
-  /// The buffer is intended to synchronize sample block rates between processes and to provide an overlapped 
47
-  /// input buffer.
51
+  // The buffer is intended to synchronize sample block rates between processes and to provide an overlapped 
52
+  // input buffer.
48 53
   typedef struct cmShiftBuf_str
49 54
   {
50 55
     cmObj       obj;
@@ -61,89 +66,36 @@ extern "C" {
61 66
 
62 67
 
63 68
 
64
-  /// Set p to NULL to dynamically allocate the object.  hopSmpCnt must be  <= wndSmpCnt.
69
+  // Set p to NULL to dynamically allocate the object.  hopSmpCnt must be  <= wndSmpCnt.
65 70
   cmShiftBuf*       cmShiftBufAlloc( cmCtx* c, cmShiftBuf* p, unsigned procSmpCnt, unsigned wndSmpCnt, unsigned hopSmpCnt );
66 71
   cmRC_t            cmShiftBufFree(  cmShiftBuf** p );
67 72
   cmRC_t            cmShiftBufInit(  cmShiftBuf* p, unsigned procSmpCnt, unsigned wndSmpCnt, unsigned hopSmpCnt );
68 73
   cmRC_t            cmShiftBufFinal( cmShiftBuf* p );
69 74
 
70
-  /// Returns true if a new hop is ready to be read otherwise returns false.
71
-  /// In general cmShiftBufExec() should be called in a loop until it returns false. 
72
-  /// Note that 'sp' and 'sn' are ignored except for the first call after the function returns false.
73
-  /// This means that when called in a loop 'sp' and 'sn' are only used on the first time through the loop.
74
-  /// When procSmpCnt is less than hopSmpCnt the loop will only execute when at least wndSmpCnt 
75
-  /// new samples have been buffered.
76
-  /// When procSmpCnt is greater than hopSmpCnt the loop will execute multiple times until less 
75
+  // Returns true if a new hop is ready to be read otherwise returns false.
76
+  // In general cmShiftBufExec() should be called in a loop until it returns false. 
77
+  // Note that 'sp' and 'sn' are ignored except for the first call after the function returns false.
78
+  // This means that when called in a loop 'sp' and 'sn' are only used on the first time through the loop.
79
+  // When procSmpCnt is less than hopSmpCnt the loop will only execute when at least wndSmpCnt 
80
+  // new samples have been buffered.
81
+  // When procSmpCnt is greater than hopSmpCnt the loop will execute multiple times until less 
77 82
   //  than wndSmpCnt new samples are available.
78
-  /// Note that 'sn' must always be less than or equal to procSmpCnt.
79
-  ///
80
-  /// Example:
81
-  /// while( fill(sp,sn) )                      // fill sp[] with sn samples
82
-  /// {
83
-  ///    // shift by hopSmpCnt samples on all passes - insert new samples on first pass
84
-  ///    while( cmShiftBufExec(p,sp,sn) )       
85
-  ///       proc(p->outV,p->outN);              // process p->outV[wndSmpCnt]
86
-  /// }
83
+  // Note that 'sn' must always be less than or equal to procSmpCnt.
84
+  //
85
+  // Example:
86
+  // while( fill(sp,sn) )                      // fill sp[] with sn samples
87
+  // {
88
+  //    // shift by hopSmpCnt samples on all passes - insert new samples on first pass
89
+  //    while( cmShiftBufExec(p,sp,sn) )       
90
+  //       proc(p->outV,p->outN);              // process p->outV[wndSmpCnt]
91
+  // }
87 92
   bool              cmShiftBufExec(  cmShiftBuf* p, const cmSample_t* sp, unsigned sn );
88 93
 
89 94
   void              cmShiftBufTest( cmCtx* c );
90
-
91
-
92 95
   //------------------------------------------------------------------------------------------------------------
93
-  /*
94
-  typedef struct
95
-  {
96
-    cmComplexS_t*   complexV;
97
-    cmSample_t*     outV;
98
-    cmFftPlanS_t     plan;
99
-  } cmIFftObjS;
100
-
101
-  typedef struct
102
-  {
103
-    cmComplexR_t*   complexV;
104
-    cmReal_t*       outV;
105
-    cmFftPlanR_t    plan;
106
-  } cmIFftObjR;
107
-
108
-  typedef struct
109
-  {
110
-    cmObj           obj;
111
-    unsigned        binCnt;
112
-    unsigned        outN;
113
-
114
-    union 
115
-    {
116
-      cmIFftObjS sr;
117
-      cmIFftObjR rr;
118
-    }u;
119
-  
120
-  } cmIFft;
121
-
122
-  cmIFft*  cmIFftAllocS( cmCtx* c, cmIFft* p, unsigned binCnt );
123
-  cmIFft*  cmIFftAllocR( cmCtx* c, cmIFft* p, unsigned binCnt );
124
-
125
-  cmRC_t   cmIFftFreeS(  cmIFft** pp );
126
-  cmRC_t   cmIFftFreeR(  cmIFft** pp );
127
-
128
-  cmRC_t   cmIFftInitS(  cmIFft* p, unsigned binCnt );
129
-  cmRC_t   cmIFftInitR(  cmIFft* p, unsigned binCnt );
130
-
131
-  cmRC_t   cmIFftFinalS( cmIFft* p );
132
-  cmRC_t   cmIFftFinalR( cmIFft* p );
96
+  //)
133 97
 
134
-  // x must contain 'binCnt' elements.
135
-  cmRC_t   cmIFftExecS(     cmIFft* p, cmComplexS_t* x );
136
-  cmRC_t   cmIFftExecR(     cmIFft* p, cmComplexR_t* x );
137
-
138
-  cmRC_t   cmIFftExecPolarS( cmIFft* p, const cmReal_t* magV, const cmReal_t* phsV ); 
139
-  cmRC_t   cmIFftExecPolarR( cmIFft* p, const cmReal_t* magV, const cmReal_t* phsV ); 
140
-
141
-  cmRC_t   cmIFftExecRectS(  cmIFft* p, const cmReal_t* rV,   const cmReal_t* iV );
142
-  cmRC_t   cmIFftExecPolarR( cmIFft* p, const cmReal_t* magV, const cmReal_t* phsV ); 
143
-
144
-  void cmIFftTest( cmRpt_t* rptFuncPtr );
145
-  */
146
-  //------------------------------------------------------------------------------------------------------------
98
+  //( { label:cmWindowFunc file_desc:"Fourier Transform window function generator." kw:[proc]}
147 99
 
148 100
   enum
149 101
   {
@@ -174,8 +126,8 @@ extern "C" {
174 126
     cmMtxFile*  mfp;
175 127
   } cmWndFunc;
176 128
 
177
-  /// Set p to NULL to dynamically allocate the object
178
-  /// if wndId is set to a valid value this function will internally call cmWndFuncInit()
129
+  // Set p to NULL to dynamically allocate the object
130
+  // if wndId is set to a valid value this function will internally call cmWndFuncInit()
179 131
   cmWndFunc*  cmWndFuncAlloc( cmCtx* c, cmWndFunc* p, unsigned wndId, unsigned wndSmpCnt, double kaierSideLobeRejectDb );
180 132
   cmRC_t      cmWndFuncFree(  cmWndFunc** pp );
181 133
   cmRC_t      cmWndFuncInit(  cmWndFunc* p, unsigned wndId, unsigned wndSmpCnt, double kaiserSideLobeRejectDb );
@@ -184,9 +136,11 @@ extern "C" {
184 136
 
185 137
 
186 138
   void cmWndFuncTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH );
187
-
188 139
   //------------------------------------------------------------------------------------------------------------
189
-  /// Spectral frame delay. A circular buffer for spectral (or other fixed length) vectors.
140
+  //)
141
+
142
+  //( { label:cmSpecDelay file_desc:"Spectral frame delay. A circular buffer for spectral (or other fixed length) vectors." kw:[proc]}
143
+  
190 144
   typedef struct
191 145
   {
192 146
     cmObj       obj;
@@ -197,24 +151,25 @@ extern "C" {
197 151
   } cmSpecDelay;
198 152
 
199 153
 
200
-  /// Set p to NULL to dynamically allocate the object.
201
-  /// Allocate a spectral frame delay capable of delaying for 'maxDelayCnt' hops and 
202
-  /// where each vector contains 'binCnt' elements.
154
+  // Set p to NULL to dynamically allocate the object.
155
+  // Allocate a spectral frame delay capable of delaying for 'maxDelayCnt' hops and 
156
+  // where each vector contains 'binCnt' elements.
203 157
   cmSpecDelay*      cmSpecDelayAlloc( cmCtx* c, cmSpecDelay* p, unsigned maxDelayCnt, unsigned binCnt );
204 158
   cmRC_t            cmSpecDelayFree(  cmSpecDelay** p );
205 159
 
206 160
   cmRC_t            cmSpecDelayInit( cmSpecDelay* p, unsigned maxDelayCnt, unsigned binCnt );
207 161
   cmRC_t            cmSpecDelayFinal(cmSpecDelay* p );
208 162
 
209
-  /// Give an input vector to the delay. 'sn' must <= binCnt
163
+  // Give an input vector to the delay. 'sn' must <= binCnt
210 164
   cmRC_t            cmSpecDelayExec(  cmSpecDelay* p, const cmSample_t* sp, unsigned sn );
211 165
 
212
-  /// Get a pointer to a delayed vector. 'delayCnt' indicates the length of the delay in hops.
213
-  /// (e.g. 1 is the previous hop, 2 is two hops previous, ... )
166
+  // Get a pointer to a delayed vector. 'delayCnt' indicates the length of the delay in hops.
167
+  // (e.g. 1 is the previous hop, 2 is two hops previous, ... )
214 168
   const cmSample_t* cmSpecDelayOutPtr(cmSpecDelay* p, unsigned delayCnt );
215
-
216
-
217 169
   //------------------------------------------------------------------------------------------------------------
170
+  //)
171
+  
172
+  //( { label:cmFilter file_desc:"General purpose, LTI, Octave compatible, filter." kw:[proc] }
218 173
   typedef struct cmFilter_str
219 174
   {
220 175
     cmObj     obj;
@@ -257,9 +212,10 @@ extern "C" {
257 212
 
258 213
   void      cmFilterTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH );
259 214
   void      cmFilterFilterTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH );
260
-
261
-
262 215
   //------------------------------------------------------------------------------------------------------------
216
+  //)
217
+
218
+  //( { label:cmComplexDetect file_desc:"Complex domain onset detection function." kw:[proc] }
263 219
   typedef struct
264 220
   {
265 221
     cmObj        obj;
@@ -271,14 +227,16 @@ extern "C" {
271 227
     //unsigned     cdfSpRegId;
272 228
   } cmComplexDetect;
273 229
 
274
-  /// Set p to NULL to dynamically allocate the object.
230
+  // Set p to NULL to dynamically allocate the object.
275 231
   cmComplexDetect* cmComplexDetectAlloc(cmCtx* c, cmComplexDetect* p, unsigned binCnt );
276 232
   cmRC_t           cmComplexDetectFree( cmComplexDetect** pp);
277 233
   cmRC_t           cmComplexDetectInit( cmComplexDetect* p, unsigned binCnt );
278 234
   cmRC_t           cmComplexDetectFinal(cmComplexDetect* p);
279 235
   cmRC_t           cmComplexDetectExec( cmComplexDetect* p, const cmSample_t* magV, const cmSample_t* phsV, unsigned binCnt  );
280
-
281 236
   //------------------------------------------------------------------------------------------------------------
237
+  //)
238
+
239
+  //( { label:cmComplexOnset file_desc:"Complex onset detection function" kw:[proc]}
282 240
   typedef struct
283 241
   {
284 242
     cmObj        obj;
@@ -298,8 +256,10 @@ extern "C" {
298 256
   cmRC_t          cmComplexOnsetFinal( cmComplexOnset* p);
299 257
   cmRC_t          cmComplexOnsetExec(  cmComplexOnset* p, cmSample_t cdf );
300 258
   cmRC_t          cmComplexOnsetCalc(  cmComplexOnset* p );
301
-
302 259
   //------------------------------------------------------------------------------------------------------------
260
+  //)
261
+
262
+  //( { label:cmMfcc file_desc:"Mel Frequency Cepstral Coefficient (MFCC) measurement function." kw:[proc] }
303 263
   typedef struct
304 264
   {
305 265
     cmObj       obj;
@@ -321,8 +281,10 @@ extern "C" {
321 281
   cmRC_t  cmMfccExecPower(      cmMfcc* p, const cmReal_t* magPowV, unsigned binCnt );
322 282
   cmRC_t  cmMfccExecAmplitude(  cmMfcc* p, const cmReal_t* magAmpV, unsigned binCnt );
323 283
   void    cmMfccTest();
324
-
325 284
   //------------------------------------------------------------------------------------------------------------
285
+  //)
286
+
287
+  //( { label:cmSones file_desc:"Sones measurement function." kw:[proc] }
326 288
   typedef struct
327 289
   {
328 290
     cmObj       obj;
@@ -350,8 +312,10 @@ extern "C" {
350 312
   cmRC_t   cmSonesExec(  cmSones*  p, const cmReal_t* magPowV, unsigned binCnt ); 
351 313
 
352 314
   void     cmSonesTest();
353
-
354 315
   //------------------------------------------------------------------------------------------------------------
316
+  //)
317
+
318
+  //( { label: cmAudioOffsetScale file_desc:"Audio signal pre-processing normalizer." kw:[proc] }
355 319
   typedef struct
356 320
   {
357 321
     cmObj             obj;
@@ -371,15 +335,15 @@ extern "C" {
371 335
   } cmAudioOffsetScale;
372 336
 
373 337
 
374
-  /// This processor adds an offset to an audio signal and scales into dB (SPL) using one of two techniques
375
-  /// 1) Measures the effective sound pressure (via RMS) and then scales the signal to the reference dB (SPL) 
376
-  ///    In this case dBref is commonly set to 70. See Timony, 2004, Implementing Loudness Models in Matlab.
377
-  /// 
378
-  /// 2) treats the dBref as the maximum dB (SPL) and scales the signal by this amount without regard
379
-  ///    measured signal level.  In this case dBref is commonly set to 96 (max. dB (SPL) value for 16 bits)
380
-  ///    and rmsWndSecs is ignored.
381
-  ///
382
-  /// Note that setting rmsWndSecs to zero has the effect of using procSmpCnt as the window length.
338
+  // This processor adds an offset to an audio signal and scales into dB (SPL) using one of two techniques
339
+  // 1) Measures the effective sound pressure (via RMS) and then scales the signal to the reference dB (SPL) 
340
+  //    In this case dBref is commonly set to 70. See Timony, 2004, Implementing Loudness Models in Matlab.
341
+  // 
342
+  // 2) treats the dBref as the maximum dB (SPL) and scales the signal by this amount without regard
343
+  //    measured signal level.  In this case dBref is commonly set to 96 (max. dB (SPL) value for 16 bits)
344
+  //    and rmsWndSecs is ignored.
345
+  //
346
+  // Note that setting rmsWndSecs to zero has the effect of using procSmpCnt as the window length.
383 347
 
384 348
   enum { kNoAudioScaleFl=0x01, kRmsAudioScaleFl=0x02, kFixedAudioScaleFl=0x04 };
385 349
 
@@ -388,8 +352,10 @@ extern "C" {
388 352
   cmRC_t        cmAudioOffsetScaleInit(  cmAudioOffsetScale* p, unsigned procSmpCnt, double srate, cmSample_t offset, double rmsWndSecs, double dBref, unsigned flags );
389 353
   cmRC_t        cmAudioOffsetScaleFinal( cmAudioOffsetScale* p );
390 354
   cmRC_t        cmAudioOffsetScaleExec(  cmAudioOffsetScale* p, const cmSample_t* sp, unsigned sn );
391
-
392 355
   //------------------------------------------------------------------------------------------------------------
356
+  //)
357
+
358
+  //( { label:cmSpecMeas file_desc:"Measure a signals RMS, High-Frequency Content, Spectral Centroid, and Spectral Spread." kw:[proc]}
393 359
   typedef struct
394 360
   {
395 361
     cmObj      obj;
@@ -422,10 +388,10 @@ extern "C" {
422 388
     unsigned ssSpRegId;
423 389
   } cmSpecMeas;
424 390
 
425
-  /// Set wndFrmCnt to the number of spectral frames to take the measurement over.
426
-  /// Setting wndFrmCnt to 1 has the effect of calculating the value on the current frame only.
427
-  /// Set flags = kWholeSigSpecMeasFl to ignore wndFrmCnt and calculate the result on the entire signal.
428
-  /// In effect this treats the entire signal as the length of the measurement window.
391
+  // Set wndFrmCnt to the number of spectral frames to take the measurement over.
392
+  // Setting wndFrmCnt to 1 has the effect of calculating the value on the current frame only.
393
+  // Set flags = kWholeSigSpecMeasFl to ignore wndFrmCnt and calculate the result on the entire signal.
394
+  // In effect this treats the entire signal as the length of the measurement window.
429 395
   enum { kWholeSigSpecMeasFl=0x00, kUseWndSpecMeasFl=0x01 };
430 396
 
431 397
   cmSpecMeas* cmSpecMeasAlloc( cmCtx* c, cmSpecMeas* p, double srate, unsigned binCnt, unsigned wndFrmCnt, unsigned flags );
@@ -433,8 +399,10 @@ extern "C" {
433 399
   cmRC_t      cmSpecMeasInit(  cmSpecMeas* p, double srate, unsigned binCnt, unsigned wndFrmCnt, unsigned flags );
434 400
   cmRC_t      cmSpecMeasFinal( cmSpecMeas* p );
435 401
   cmRC_t      cmSpecMeasExec(  cmSpecMeas* p, const cmReal_t* magPowV, unsigned binCnt ); 
436
-
437 402
   //------------------------------------------------------------------------------------------------------------
403
+  //)
404
+
405
+  //( { label:cmSigMeas file_desc:"Measure a time domain signals zero crossing rate." kw:[proc]}
438 406
   typedef struct
439 407
   {
440 408
     cmObj       obj;
@@ -456,8 +424,10 @@ extern "C" {
456 424
   cmRC_t     cmSigMeasInit(  cmSigMeas* p, double srate, unsigned procSmpCnt, unsigned measSmpCnt );
457 425
   cmRC_t     cmSigMeasFinal( cmSigMeas* p );
458 426
   cmRC_t     cmSigMeasExec(  cmSigMeas* p, const cmSample_t* sigV, unsigned smpCnt );
459
-
460 427
   //------------------------------------------------------------------------------------------------------------
428
+  //)
429
+
430
+  //( { label:cmSRC file_desc:"Sample rate converter" kw:[proc] }
461 431
   typedef struct
462 432
   {
463 433
     cmObj        obj;
@@ -476,7 +446,7 @@ extern "C" {
476 446
 
477 447
   } cmSRC;
478 448
 
479
-  /// The srate paramater is the sample rate of the source signal provided via cmSRCExec()
449
+  // The srate paramater is the sample rate of the source signal provided via cmSRCExec()
480 450
   cmSRC* cmSRCAlloc( cmCtx* c, cmSRC* p, double srate, unsigned procSmpCnt, unsigned upFact, unsigned dnFact );
481 451
   cmRC_t cmSRCFree(  cmSRC** pp );
482 452
   cmRC_t cmSRCInit(  cmSRC* p, double srate, unsigned procSmpCnt, unsigned upFact, unsigned dnFact );
@@ -484,8 +454,10 @@ extern "C" {
484 454
   cmRC_t cmSRCExec(  cmSRC* p, const cmSample_t* sp, unsigned sn );
485 455
 
486 456
   void   cmSRCTest();
487
-
488 457
   //------------------------------------------------------------------------------------------------------------
458
+  //)
459
+
460
+  //( { label:cmConstQ file_desc:"Contant-Q transform." kw:[proc] }
489 461
   typedef struct
490 462
   {
491 463
     cmObj           obj;
@@ -510,9 +482,10 @@ extern "C" {
510 482
   cmRC_t    cmConstQInit(  cmConstQ* p, double srate, unsigned minMidiPitch, unsigned maxMidiPitch, unsigned binsPerOctave, double thresh );
511 483
   cmRC_t    cmConstQFinal( cmConstQ* p );
512 484
   cmRC_t    cmConstQExec(  cmConstQ* p, const cmComplexR_t* ftV, unsigned binCnt );
513
-
514
-
515 485
   //------------------------------------------------------------------------------------------------------------
486
+  //)
487
+  
488
+  //( { label:cmTuneHpcp file_desc:"Generate a tuned chromagram." kw:[proc]}
516 489
   typedef struct
517 490
   {
518 491
     cmObj     obj;
@@ -545,10 +518,10 @@ extern "C" {
545 518
   cmRC_t         cmTunedHpcpFinal( cmHpcp* p );
546 519
   cmRC_t         cmTunedHpcpExec(  cmHpcp* p, const cmComplexR_t* constQBinPtr, unsigned constQBinCnt );
547 520
   cmRC_t         cmTunedHpcpTuneAndFilter( cmHpcp* p);
548
-
549
-
550
-  //------------------------------------------------------------------------------------------------------------
551 521
   //------------------------------------------------------------------------------------------------------------
522
+  //)
523
+
524
+  //( { label:cmBeatHist file_desc:"Generate a beat candidate histogram." kw:[proc]}
552 525
 
553 526
   struct cmFftRR_str;
554 527
   struct cmIFftRR_str;
@@ -579,9 +552,11 @@ extern "C" {
579 552
   cmRC_t      cmBeatHistFinal( cmBeatHist* p );
580 553
   cmRC_t      cmBeatHistExec(  cmBeatHist* p, cmSample_t df );
581 554
   cmRC_t      cmBeatHistCalc(  cmBeatHist* p );
582
-
583 555
   //------------------------------------------------------------------------------------------------------------
584
-  // Gaussian Mixture Model containing N Gaussian PDF's each of dimension D
556
+  //)
557
+
558
+  //( { label:cmGmm file_desc"Gaussian Mixture Model containing N Gaussian PDF's each of dimension D." kw:[proc model]}
559
+  
585 560
   typedef struct
586 561
   {
587 562
     cmObj     obj;
@@ -639,9 +614,11 @@ extern "C" {
639 614
   void     cmGmmPrint( cmGmm_t* p, bool detailsFl );
640 615
 
641 616
   void     cmGmmTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH );
642
-
643 617
   //------------------------------------------------------------------------------------------------------------
644
-  // Continuous Hidden Markov Model
618
+  //)
619
+  
620
+  //( { label:cmChmm file_desc:"Continuous Hidden Markov Model" kw:[proc model]}
621
+  
645 622
   typedef struct
646 623
   {
647 624
     cmObj       obj;
@@ -652,9 +629,7 @@ extern "C" {
652 629
     cmReal_t*   aM;       // aM[ N x N] transition probability mtx
653 630
     cmGmm_t**   bV;       // bV[ N ] observation probability mtx (array of pointers to GMM's) 
654 631
     cmReal_t*   bM;       // bM[ N,T]  state-observation probability matrix 
655
-
656 632
     cmMtxFile* mfp;
657
-
658 633
   } cmChmm_t;
659 634
 
660 635
   // Continuous HMM consisting of stateN states where the observations 
@@ -706,10 +681,11 @@ extern "C" {
706 681
   void      cmChmmPrint(    cmChmm_t* p );
707 682
 
708 683
   void      cmChmmTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH  );
684
+  //------------------------------------------------------------------------------------------------------------
685
+  //)
709 686
 
710 687
 
711
-  //------------------------------------------------------------------------------------------------------------
712
-  // Chord recognizer
688
+  //( { label:cmChord file_desc:"HMM based chord recognizer." kw:[proc]}
713 689
 
714 690
   typedef struct 
715 691
   {
@@ -739,14 +715,16 @@ extern "C" {
739 715
     cmReal_t  cdtsVar;      
740 716
 
741 717
   } cmChord;
742
-
718
+  
743 719
   cmChord*   cmChordAlloc( cmCtx* c, cmChord*  p, const cmReal_t* chromaM, unsigned T );
744 720
   cmRC_t     cmChordFree(  cmChord** p );
745 721
   cmRC_t     cmChordInit(  cmChord*  p, const cmReal_t* chromaM, unsigned T );
746 722
   cmRC_t     cmChordFinal( cmChord*  p );
747 723
 
748 724
   void       cmChordTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH ); 
749
-
725
+  //------------------------------------------------------------------------------------------------------------
726
+  //)
727
+  
750 728
 #ifdef __cplusplus
751 729
 }
752 730
 #endif

+ 97
- 31
cmProc2.h View File

@@ -5,7 +5,11 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  //------------------------------------------------------------------------------------------------------------
8
+  //( { file_desc:"Processor Library 2" kw:[proclib]}
9
+  //)
10
+
11
+  //( { label:cmArray file_desc:"Expandable array designed to work easily with the cmProcObj model" kw:[proc]}
12
+  
9 13
   // cmArray is an expandable array designed to work easily with the alloc/init/final/free model
10 14
   // used by this library.  The arrays can be safely used by using the cmArrayAllocXXX macros 
11 15
   // with static cmArray member fields during object allocation. cmArrayResizeXXX macros are then
@@ -53,8 +57,10 @@ extern "C" {
53 57
 #define cmArrayPtr(     type, p )            (type*)(p)->ptr
54 58
 #define cmArrayCount(   p )                  (p)->eleCnt
55 59
 
56
-
57 60
   //------------------------------------------------------------------------------------------------------------
61
+  //)
62
+  //( { label:cmAudioFileWr file_desc:"Audio file writer" kw:[proc]}
63
+    
58 64
   typedef struct
59 65
   {
60 66
     cmObj         obj;
@@ -72,8 +78,10 @@ extern "C" {
72 78
   cmRC_t             cmAudioFileWrFinal( cmAudioFileWr* p );
73 79
   cmRC_t             cmAudioFileWrExec(  cmAudioFileWr* p, unsigned chIdx, const cmSample_t* sp, unsigned sn );
74 80
   void               cmAudioFileWrTest();
75
-
76 81
   //------------------------------------------------------------------------------------------------------------
82
+  //)
83
+  
84
+  //( { label:cmMatrixBuf file_desc:"Store and recall real values in matrix form." kw:[proc]}
77 85
   typedef struct
78 86
   {
79 87
     cmObj      obj;
@@ -98,6 +106,9 @@ extern "C" {
98 106
 
99 107
 
100 108
   //------------------------------------------------------------------------------------------------------------
109
+  //)
110
+
111
+  //( { label:cmSigGen file_desc:"Generate periodic and noise signals." kw:[proc]}
101 112
 
102 113
   enum
103 114
   {
@@ -139,6 +150,9 @@ extern "C" {
139 150
   cmRC_t    cmSigGenExec(  cmSigGen*  p );
140 151
 
141 152
   //------------------------------------------------------------------------------------------------------------
153
+  //)
154
+  
155
+  //( { label:cmDelay file_desc:"Fixed length audio delay." kw:[proc]}
142 156
   typedef struct
143 157
   {
144 158
     cmObj*      obj;
@@ -160,8 +174,10 @@ extern "C" {
160 174
   cmRC_t            cmDelayAdvance( cmDelay* p, unsigned sn );
161 175
   cmRC_t            cmDelayExec(    cmDelay* p, const cmSample_t* sp, unsigned sn, bool bypassFl );
162 176
   void              cmDelayTest();
163
-
164 177
   //------------------------------------------------------------------------------------------------------------
178
+  //)
179
+  
180
+  //( { label:cmFIR file_desc:"Finite impulse response filter." kw:[proc]}
165 181
   typedef struct
166 182
   {
167 183
     cmObj       obj;
@@ -192,10 +208,11 @@ extern "C" {
192 208
   cmRC_t cmFIRExec(       cmFIR* p, const cmSample_t* sp, unsigned sn );
193 209
   void   cmFIRTest0( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH );
194 210
   void   cmFIRTest1( cmCtx* ctx );
195
-  
196
-  //------------------------------------------------------------------------------------------------------------
197
-  // Apply a generic function to a windowed signal with a one sample hop size.
198 211
 
212
+  //------------------------------------------------------------------------------------------------------------
213
+  //)
214
+  
215
+  //( { label:cmFuncFilter file_desc:"Apply a generic function to a windowed signal with a one sample hop size.." kw:[proc]}
199 216
   typedef cmSample_t (*cmFuncFiltPtr_t)( const cmSample_t* sp, unsigned sn, void* userPtr );
200 217
 
201 218
   typedef struct
@@ -217,8 +234,10 @@ extern "C" {
217 234
   cmRC_t        cmFuncFilterFinal( cmFuncFilter* p );
218 235
   cmRC_t        cmFuncFilterExec(  cmFuncFilter* p, const cmSample_t* sp, unsigned sn );
219 236
   void          cmFuncFilterTest();
220
-
221 237
   //------------------------------------------------------------------------------------------------------------
238
+  //)
239
+  
240
+  //( { label:cmDhmm file_desc:"Discrete observation HMM" kw:[proc]}
222 241
   typedef struct
223 242
   {
224 243
     cmObj           obj;
@@ -245,6 +264,9 @@ extern "C" {
245 264
   void    cmDhmmTest();
246 265
 
247 266
   //------------------------------------------------------------------------------------------------------------
267
+  //)
268
+  
269
+  //( { label:cmConvolve file_desc:"Convolve a signal with an impulse response." kw:[proc]}
248 270
   typedef struct
249 271
   {
250 272
     cmObj     obj;
@@ -285,6 +307,9 @@ extern "C" {
285 307
   cmRC_t      cmConvolveTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH );
286 308
 
287 309
   //------------------------------------------------------------------------------------------------------------
310
+  //)
311
+
312
+  //( { label:cmBfcc file_desc:"Generate Bark Frequency Cepstral Coefficients from STFT frames." kw:[proc]}
288 313
   typedef struct
289 314
   {
290 315
     cmObj     obj; 
@@ -304,6 +329,8 @@ extern "C" {
304 329
   void    cmBfccTest( cmRpt_t* rpt, cmLHeapH_t lhH, cmSymTblH_t stH );
305 330
 
306 331
   //------------------------------------------------------------------------------------------------------------
332
+  //)
333
+  //( { label:cmCepstrum file_desc:"Generate Cepstral Coefficients from STFT frames." kw:[proc]}
307 334
   typedef struct
308 335
   {
309 336
     cmObj     obj; 
@@ -324,7 +351,10 @@ extern "C" {
324 351
   cmRC_t  cmCepsFinal( cmCeps* p );
325 352
   cmRC_t  cmCepsExec(  cmCeps* p, const cmReal_t* magV, const cmReal_t* phsV, unsigned binCnt );
326 353
 
354
+  //------------------------------------------------------------------------------------------------------------
355
+  //)
327 356
 
357
+  //( { label:cmOla file_desc:"Generate a signal from an via overlap-add." kw:[proc]}
328 358
   //------------------------------------------------------------------------------------------------------------
329 359
   typedef struct
330 360
   {
@@ -355,9 +385,10 @@ extern "C" {
355 385
   cmRC_t cmOlaExecS( cmOla* p, const cmSample_t* xV, unsigned xN );
356 386
   cmRC_t cmOlaExecR( cmOla* p, const cmReal_t*   xV, unsigned xN );
357 387
   const cmSample_t* cmOlaExecOut(cmOla* p );
388
+  //------------------------------------------------------------------------------------------------------------
389
+  //)
358 390
 
359
-
360
-
391
+  //( { label:cmPhsToFrq file_desc:"Given STFT phase spectrum frames return the instantaneous frequency." kw:[proc]}
361 392
   //------------------------------------------------------------------------------------------------------------
362 393
 
363 394
   typedef struct
@@ -380,9 +411,11 @@ extern "C" {
380 411
   cmRC_t  cmPhsToFrqFinal(cmPhsToFrq*  p );
381 412
   cmRC_t  cmPhsToFrqExec( cmPhsToFrq*  p, const cmReal_t* phsV );
382 413
  
383
-
384 414
   //------------------------------------------------------------------------------------------------------------
385
-
415
+  //)
416
+  
417
+  //( { label:cmPvAnl file_desc:"Perform the phase-vocoder analysis stage." kw:[proc]}
418
+ 
386 419
   enum 
387 420
   {
388 421
     kNoCalcHzPvaFl = 0x00,
@@ -420,6 +453,8 @@ extern "C" {
420 453
   bool     cmPvAnlExec( cmPvAnl* p, const cmSample_t* x, unsigned xN );
421 454
 
422 455
   //------------------------------------------------------------------------------------------------------------
456
+  //)
457
+  //( { label:cmPvSyn file_desc:"Perform the phase-vocoder synthesis stage." kw:[proc]}
423 458
 
424 459
   typedef struct
425 460
   {
@@ -451,11 +486,10 @@ extern "C" {
451 486
   cmRC_t     cmPvSynExec( cmPvSyn* p, const cmReal_t* magV, const cmReal_t* phsV );
452 487
   const cmSample_t* cmPvSynExecOut(cmPvSyn* p );
453 488
 
454
-
455
-
456 489
   //------------------------------------------------------------------------------------------------------------
457
-
458
-
490
+  //)
491
+  
492
+  //( { label:cmMidiSynth file_desc:"Synthesis independent MIDI synthesizer control structure." kw:[proc]}
459 493
   // callback selector values
460 494
   enum
461 495
   {
@@ -532,8 +566,10 @@ extern "C" {
532 566
   cmRC_t       cmMidiSynthOnMidi(cmMidiSynth* p, const cmMidiPacket_t* pktArray, unsigned pktCnt );
533 567
   cmRC_t       cmMidiSynthExec(  cmMidiSynth* p, cmSample_t** outChArray, unsigned outChCnt );
534 568
 
535
-
536 569
   //------------------------------------------------------------------------------------------------------------
570
+  //)
571
+
572
+  //( { label:cmWtVoice file_desc:"Wavetable oscillator implementation for use with cmMidiSyn." kw:[proc]}
537 573
 
538 574
   // state id's
539 575
   enum
@@ -568,6 +604,8 @@ extern "C" {
568 604
 
569 605
 
570 606
   //------------------------------------------------------------------------------------------------------------
607
+  //)
608
+  //( { label:cmWtVoiceBank file_desc:"A bank of cmWtVoice oscillator for use with cmMidiSynth." kw:[proc]}
571 609
 
572 610
   typedef struct
573 611
   {
@@ -596,8 +634,9 @@ extern "C" {
596 634
   int        cmWtVoiceBankExec( cmWtVoiceBank* p, struct cmMidiVoice_str* voicePtr, unsigned sel, cmSample_t* chArray[], unsigned chCnt );
597 635
 
598 636
 
599
-
600 637
   //------------------------------------------------------------------------------------------------------------
638
+  //)
639
+  //( { label:cmAudioFileBuf file_desc:"Generate a signal by caching all or part of an audio file." kw:[proc]}
601 640
 
602 641
   typedef struct
603 642
   {
@@ -620,8 +659,10 @@ extern "C" {
620 659
   // If less than outN samples are available then the remaining samples are set to 0.  
621 660
   unsigned        cmAudioFileBufExec( cmAudioFileBuf* p, unsigned smpIdx, cmSample_t* outV, unsigned outN, bool sumIntoOutFl );
622 661
 
623
-
624 662
   //------------------------------------------------------------------------------------------------------------
663
+  //)
664
+
665
+  //( { label:cmMDelay file_desc:"Multi-tap audio delay with feedback." kw:[proc]} 
625 666
   // Multi-delay.  Each of the taps of this delay operates as a independent delay with feedback.
626 667
   
627 668
   // Delay line specification.
@@ -657,6 +698,9 @@ extern "C" {
657 698
   void      cmMDelayReport( cmMDelay* p, cmRpt_t* rpt );
658 699
 
659 700
   //------------------------------------------------------------------------------------------------------------
701
+  //)
702
+  
703
+  //( { label:cmAudioSegPlayer file_desc:"Buffer and playback an arbitrary number of audio signals." kw:[proc]}
660 704
   enum
661 705
   {
662 706
     kEnableAspFl  = 0x01,
@@ -696,9 +740,9 @@ extern "C" {
696 740
   cmRC_t            cmAudioSegPlayerEnable( cmAudioSegPlayer* p, unsigned id, bool enableFl, unsigned outSmpIdx );
697 741
   cmRC_t            cmAudioSegPlayerReset(  cmAudioSegPlayer* p );
698 742
   cmRC_t            cmAudioSegPlayerExec(   cmAudioSegPlayer* p, cmSample_t** outChPtr, unsigned chCnt, unsigned outSmpCnt );
699
-
700
-
701 743
   //------------------------------------------------------------------------------------------------------------
744
+  //)
745
+
702 746
   /*
703 747
   cmReal_t (*cmCluster0DistFunc_t)( void* userPtr, const cmReal_t* v0, const cmReal_t* v1, unsigned binCnt );
704 748
 
@@ -729,7 +773,7 @@ extern "C" {
729 773
   cmRC_t           cmCluster0Exec(  cmCluster0* p, const cmReal_t* v, unsigned vn );
730 774
   */
731 775
 
732
-  //------------------------------------------------------------------------------------------------------------
776
+  //( { label:cmNmf file_desc:"Non-negative matrix factorization implementation." kw:[proc]}
733 777
   typedef struct
734 778
   {
735 779
     cmObj     obj;
@@ -770,8 +814,10 @@ extern "C" {
770 814
   // 
771 815
   cmRC_t   cmNmfExec( cmNmf_t* p, const cmReal_t* v, unsigned cn );
772 816
 
773
-
774 817
   //------------------------------------------------------------------------------------------------------------
818
+  //)
819
+
820
+  //( { label:cmVectArray file_desc:"Store and recall arrays of arbitrary length numeric vectors." kw:[proc]}
775 821
   // cmVectArray buffers row vectors of arbitrary length in  memory.
776 822
   // The buffers may then be access using the cmVectArrayGetXXX() functions.
777 823
   // The entire contents of the file may be written to a file using atVectArrayWrite().
@@ -943,7 +989,10 @@ extern "C" {
943 989
   cmRC_t   cmVectArrayFormVectColU( cmVectArray_t* p, unsigned groupIdx, unsigned groupCnt, unsigned colIdx, unsigned** vRef, unsigned* vnRef );
944 990
   cmRC_t   cmVectArrayTest( cmCtx* ctx, const char* fn, bool genFl );  
945 991
 
946
-  //-----------------------------------------------------------------------------------------------------------------------
992
+  //------------------------------------------------------------------------------------------------------------
993
+  //)
994
+
995
+  //( { label:cmWhFilt file_desc:"Spectral whitening filter." kw:[proc]}  
947 996
   // Spectral whitening filter.
948 997
   // Based on: Klapuri, A., 2006: Multiple fundamental frequency estimation by summing
949 998
   //  harmonic amplitudes.
@@ -967,6 +1016,9 @@ extern "C" {
967 1016
   cmRC_t    cmWhFiltExec( cmWhFilt* p, const cmReal_t* xV, cmReal_t* yV, unsigned xyN );
968 1017
 
969 1018
   //-----------------------------------------------------------------------------------------------------------------------
1019
+  //)
1020
+  
1021
+  //( { label:cmFrqTrk file_desc:"Track sinusoids from STFT frame data." kw:[proc]}  
970 1022
   typedef enum
971 1023
   {
972 1024
     kNoStateFrqTrkId,
@@ -1089,8 +1141,10 @@ extern "C" {
1089 1141
   cmRC_t    cmFrqTrkExec( cmFrqTrk* p, const cmReal_t* magV, const cmReal_t* phsV, const cmReal_t* hzV );
1090 1142
   void      cmFrqTrkPrint( cmFrqTrk* p );
1091 1143
 
1092
-  //------------------------------------------------------------------------------------------------------------
1093
-
1144
+  //-----------------------------------------------------------------------------------------------------------------------
1145
+  //)
1146
+  
1147
+  //( { label:cmFbCtl file_desc:"Perform acoustic feedback control by attenuating loud sinusoid signals." kw:[proc]}  
1094 1148
   typedef struct
1095 1149
   {
1096 1150
     double   srate;
@@ -1122,7 +1176,10 @@ extern "C" {
1122 1176
   cmRC_t     cmFbCtlFinal(cmFbCtl_t* p );
1123 1177
   cmRC_t     cmFbCtlExec( cmFbCtl_t* p, const cmReal_t* xV );
1124 1178
 
1125
-  //-----------------------------------------------------------------------------------------------------------------------
1179
+  //------------------------------------------------------------------------------------------------------------
1180
+  //)
1181
+  
1182
+  //( { label:cmExpander file_desc:"Expander implementation for audio dynamics processing." kw:[proc]}    
1126 1183
 
1127 1184
   typedef struct
1128 1185
   {
@@ -1148,7 +1205,11 @@ extern "C" {
1148 1205
   cmRC_t      cmExpanderFinal( cmExpander* p );
1149 1206
   cmRC_t      cmExpanderExec( cmExpander* p, cmSample_t* x, cmSample_t* y, unsigned xyN );
1150 1207
   cmRC_t      cmExpanderExecD( cmExpander* p, double* x, double* y, unsigned xyN );
1208
+
1151 1209
   //-----------------------------------------------------------------------------------------------------------------------
1210
+  //)
1211
+
1212
+  //( { label:cmExpanderBank file_desc:"Bank of audio dynamics expanders based on cmExpander." kw:[proc]}    
1152 1213
   typedef struct
1153 1214
   {
1154 1215
     cmObj obj;
@@ -1166,8 +1227,10 @@ extern "C" {
1166 1227
   cmRC_t      cmExpanderBankExec(  cmExpanderBank* p, cmSample_t* x, unsigned bandN );
1167 1228
   cmRC_t      cmExpanderBankExecD(  cmExpanderBank* p, double* x, unsigned bandN );
1168 1229
   
1169
-
1170
-  //------------------------------------------------------------------------------------------------------------
1230
+  //-----------------------------------------------------------------------------------------------------------------------
1231
+  //)
1232
+  
1233
+  //( { label:cmSpecDist file_desc:"Spectral distortion algorithm based on non-linear transform." kw:[proc]}    
1171 1234
 
1172 1235
   enum
1173 1236
   {
@@ -1248,8 +1311,11 @@ extern "C" {
1248 1311
   cmRC_t            cmSpecDistExec( cmSpecDist_t* p, const cmSample_t* sp, unsigned sn );
1249 1312
   const cmSample_t* cmSpecDistOut(  cmSpecDist_t* p );
1250 1313
 
1251
-
1252 1314
   //------------------------------------------------------------------------------------------------------------
1315
+  //)
1316
+  
1317
+  //( { label:cmBinMtxFile file_desc:"Write a binary matrix which can be read by readBinFile.m." kw:[proc]}
1318
+  
1253 1319
   // Write a binary matrix file in the format acceppted by the octave function readBinFile.m
1254 1320
 
1255 1321
   typedef struct cmBinMtxFile_str
@@ -1291,7 +1357,7 @@ extern "C" {
1291 1357
   // Use cmBinMtxFileSize() to determine the buffer size prior to calling this function.
1292 1358
   // colCntV[colCnt] is optional.
1293 1359
   cmRC_t cmBinMtxFileRead( cmCtx_t* ctx, const cmChar_t* fn, unsigned rowCnt, unsigned colCnt, unsigned eleByteCnt, void* buf, unsigned* colCntV );
1294
-
1360
+  //)
1295 1361
 
1296 1362
 
1297 1363
 

+ 79
- 29
cmProc3.h View File

@@ -4,6 +4,10 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
+  //( { file_desc:"Processor Library 3" kw:[proclib]}
8
+  //)
9
+  
10
+  //( { label:cmPitchShift file_desc:"Time-domain pitch shifter based on sample rate conversion." kw:[proc]}    
7 11
 
8 12
   typedef struct
9 13
   {
@@ -45,7 +49,9 @@ extern "C" {
45 49
   cmRC_t        cmPitchShiftFinal(cmPitchShift* p );
46 50
   cmRC_t        cmPitchShiftExec( cmPitchShift* p, const cmSample_t* x, cmSample_t* y, unsigned n, double shiftRatio, bool bypassFl );
47 51
 
48
-  //=======================================================================================================================
52
+  //------------------------------------------------------------------------------------------------------------
53
+  //)
54
+  //( { label:cmLoopRecord file_desc:"Audio interactive loop recorder." kw:[proc]}    
49 55
 
50 56
   typedef struct
51 57
   {
@@ -90,7 +96,9 @@ extern "C" {
90 96
   cmRC_t        cmLoopRecordExec( cmLoopRecord* p, const cmSample_t* x, cmSample_t* y, unsigned xn, bool bypassFl, bool recdFl, bool playFl, double ratio, double pgain, double rgain );
91 97
 
92 98
 
93
-  //=======================================================================================================================
99
+  //------------------------------------------------------------------------------------------------------------
100
+  //)
101
+  //( { label:cmGateDetector file_desc:"Detect when a signal onsets and offsets." kw:[proc]}    
94 102
   typedef struct
95 103
   {
96 104
     cmObj       obj;
@@ -115,8 +123,9 @@ extern "C" {
115 123
   cmRC_t       cmGateDetectFinal(cmGateDetect* p );
116 124
   cmRC_t       cmGateDetectExec( cmGateDetect* p, const cmSample_t* x, unsigned xn );
117 125
   
118
-
119
-  //=======================================================================================================================
126
+  //------------------------------------------------------------------------------------------------------------
127
+  //)
128
+  //( { label:cmGateDetector2 file_desc:"Improved gate detector to detect when a signal onsets and offsets." kw:[proc]}    
120 129
   typedef struct
121 130
   {
122 131
     unsigned medCnt;       // length of the median filter
@@ -164,14 +173,17 @@ extern "C" {
164 173
 
165 174
 
166 175
   cmGateDetect2* cmGateDetectAlloc2( cmCtx* c, cmGateDetect2* p, unsigned procSmpCnt, const cmGateDetectParams* args );
167
-  cmRC_t       cmGateDetectFree2( cmGateDetect2** p );
168
-  cmRC_t       cmGateDetectInit2( cmGateDetect2* p, unsigned procSmpCnt, const cmGateDetectParams* args );
169
-  cmRC_t       cmGateDetectFinal2(cmGateDetect2* p );
170
-  cmRC_t       cmGateDetectExec2( cmGateDetect2* p, const cmSample_t* x, unsigned xn );
171
-  void       cmGateDetectSetOnThreshDb2( cmGateDetect2* p, cmReal_t db );
172
-  void       cmGateDetectSetOffThreshDb2( cmGateDetect2* p, cmReal_t db );
176
+  cmRC_t         cmGateDetectFree2( cmGateDetect2** p );
177
+  cmRC_t         cmGateDetectInit2( cmGateDetect2* p, unsigned procSmpCnt, const cmGateDetectParams* args );
178
+  cmRC_t         cmGateDetectFinal2(cmGateDetect2* p );
179
+  cmRC_t         cmGateDetectExec2( cmGateDetect2* p, const cmSample_t* x, unsigned xn );
180
+  void           cmGateDetectSetOnThreshDb2( cmGateDetect2* p, cmReal_t db );
181
+  void           cmGateDetectSetOffThreshDb2( cmGateDetect2* p, cmReal_t db );
173 182
 
174
-  //=======================================================================================================================
183
+  //------------------------------------------------------------------------------------------------------------
184
+  //)
185
+
186
+  //( { label:cmAutoGain file_desc:"Automatically balance a set of audio signals by adjusting their level." kw:[proc fluxo]}    
175 187
   
176 188
   //
177 189
   // Calculate a set of automatic gain adjustments for a set of audio channels.
@@ -230,7 +242,10 @@ extern "C" {
230 242
 
231 243
   void        cmAutoGainPrint( cmAutoGain* p, cmRpt_t* rpt );
232 244
 
233
-  //=======================================================================================================================
245
+  //------------------------------------------------------------------------------------------------------------
246
+  //)
247
+  
248
+  //( { label:cmChCfg file_desc:"Configure a 'fluxo' pickup channel." kw:[proc fluxo]}
234 249
   typedef struct
235 250
   {
236 251
     unsigned        ch;
@@ -261,8 +276,11 @@ extern "C" {
261 276
   void     cmChCfgPrint( cmChCfg* p, cmRpt_t* rpt );
262 277
   unsigned cmChCfgChannelCount( cmCtx_t* ctx, const cmChar_t* fn, unsigned* nsChCntPtr );
263 278
   unsigned cmChCfgChannelIndex( cmCtx_t* ctx, const cmChar_t* fn, unsigned chIdx );
279
+  
280
+  //------------------------------------------------------------------------------------------------------------
281
+  //)
264 282
 
265
-  //=======================================================================================================================
283
+  //( { label:cmChordDetector file_desc:"Chord detector based on evaluating signals from cmGateDetector2." kw:[proc]}    
266 284
 
267 285
   typedef struct 
268 286
   {
@@ -293,7 +311,10 @@ extern "C" {
293 311
   cmRC_t         cmChordDetectExec(  cmChordDetect* p, unsigned procSmpCnt, const bool* gateV, const cmReal_t* rmsV, unsigned chCnt );
294 312
   cmRC_t         cmChordDetectSetSpanMs( cmChordDetect* p, cmReal_t maxTimeSpanMs );
295 313
 
296
-  //=======================================================================================================================
314
+  //------------------------------------------------------------------------------------------------------------
315
+  //)
316
+
317
+  //( { label:cmXfader file_desc:"Audio cross fade controller." kw:[proc]}    
297 318
   // This object is not really a cross-fader.  It is really just a multichannel
298 319
   // fader - which just calculates the fade gain but does not actually apply it
299 320
   // to the audio signal - unless you use cmXfaderExecAudio()
@@ -335,7 +356,10 @@ extern "C" {
335 356
   void      cmXfaderAllOff( cmXfader* p );
336 357
   void      cmXfaderJumpToDestinationGain( cmXfader* p ); // jump to dest. gain based on gate state
337 358
 
338
-  //=======================================================================================================================
359
+  //------------------------------------------------------------------------------------------------------------
360
+  //)
361
+
362
+  //( { label:cmFader file_desc:"Fade in/out an audio signal based on the state of a gate control signal." kw:[proc]}      
339 363
   // This fader object accepts a gate signal. When the gate is high it increments
340 364
   // the gain until it reaches 1.0. When the gate is low it decrements the gain
341 365
   // until it reaches 0.0.  The fade time is the lenght of time the gain will take
@@ -355,7 +379,10 @@ extern "C" {
355 379
   cmRC_t    cmFaderExec(  cmFader* p, unsigned procSmpCnt, bool gateFl, bool mixFl, const cmSample_t* x, cmSample_t* y );
356 380
   void      cmFaderSetFadeTime( cmFader* p, cmReal_t fadeTimeMs );
357 381
 
358
-  //=======================================================================================================================
382
+  //------------------------------------------------------------------------------------------------------------
383
+  //)
384
+
385
+  //( { label:cmCombFilt file_desc:"Comb and Inverse Comb filter algorithm with a variable fractional delay." kw:[proc]}      
359 386
   struct cmIDelay_str;
360 387
   typedef struct
361 388
   {
@@ -384,7 +411,10 @@ extern "C" {
384 411
   void        cmCombFiltSetAlpha( cmCombFilt* p, cmReal_t alpha );
385 412
   cmRC_t      cmCombFiltSetHz( cmCombFilt* p, cmReal_t hz );
386 413
 
387
-  //=======================================================================================================================
414
+  //------------------------------------------------------------------------------------------------------------
415
+  //)
416
+
417
+  //( { label:cmDcFilt file_desc:"DC Filter algorithm." kw:[proc]}      
388 418
 
389 419
   typedef struct
390 420
   {
@@ -402,9 +432,10 @@ extern "C" {
402 432
   cmRC_t    cmDcFiltFinal( cmDcFilt* p );
403 433
   cmRC_t    cmDcFiltExec(  cmDcFilt* p, const cmSample_t* x, cmSample_t* y, unsigned n );
404 434
 
405
-  //=======================================================================================================================
406
-  
407
-  // interpolating delay - used by the comb filter
435
+  //------------------------------------------------------------------------------------------------------------
436
+  //)
437
+
438
+  //( { label:cmIDelay file_desc:"Variable interpolating fractional audio delay line." kw:[proc]}      
408 439
   
409 440
   typedef struct cmIDelay_str
410 441
   {
@@ -429,7 +460,10 @@ extern "C" {
429 460
   cmRC_t    cmIDelaySetTapMs( cmIDelay* p, unsigned tapIdx, cmReal_t tapMs );
430 461
   
431 462
   
432
-  //=======================================================================================================================
463
+  //------------------------------------------------------------------------------------------------------------
464
+  //)
465
+
466
+  //( { label:cmGroupSel file_desc:"Assign channel to dynamic groups under gate control." kw:[proc]}      
433 467
   
434 468
   // This object sequentially assigns channels to groups when their gates go high.
435 469
   // 'chsPerGroup' channels will be assigned to each group.  No channel will be
@@ -481,7 +515,10 @@ extern "C" {
481 515
   // and groups that will be removed on the next cycle have their 'releaseFl' set.
482 516
   cmRC_t      cmGroupSelExec( cmGroupSel* p );
483 517
   
484
-  //=======================================================================================================================
518
+  //------------------------------------------------------------------------------------------------------------
519
+  //)
520
+
521
+  //( { label:cmAudioNofM file_desc:"Route N of M possible input channels to N output channels under gate control." kw:[proc]}      
485 522
   
486 523
   // Route N of M input channels to N output channels.
487 524
   // The N channels are selected from the first N gates to go high.
@@ -526,7 +563,10 @@ extern "C" {
526 563
   cmRC_t       cmAudioNofMSetFadeMs( cmAudioNofM* p, cmReal_t fadeTimeMs );
527 564
 
528 565
 
529
-  //=======================================================================================================================
566
+  //------------------------------------------------------------------------------------------------------------
567
+  //)
568
+
569
+  //( { label:cmAdsr file_desc:"ADSR audio evelope generator." kw:[proc]}      
530 570
 
531 571
   enum { kDlyAdsrId, kAtkAdsrId, kDcyAdsrId, kSusAdsrId, kRlsAdsrId, kDoneAdsrId };
532 572
 
@@ -546,9 +586,6 @@ extern "C" {
546 586
     cmReal_t susLevel;
547 587
     int      rlsSmp;
548 588
 
549
-
550
-
551
-
552 589
     unsigned state;             // current state
553 590
     int      durSmp;            // time in current state
554 591
     cmReal_t level;             // current level 
@@ -575,7 +612,10 @@ extern "C" {
575 612
   void      cmAdsrSetLevel( cmAdsr* p, cmReal_t level, unsigned id );
576 613
   void      cmAdsrReport( cmAdsr* p, cmRpt_t* rpt );
577 614
 
578
-  //=======================================================================================================================
615
+  //------------------------------------------------------------------------------------------------------------
616
+  //)
617
+
618
+  //( { label:cmCompressor file_desc:"Audio dynamics compressor algorithm." kw:[proc]}      
579 619
   enum { kAtkCompId, kRlsCompId };
580 620
 
581 621
   typedef struct
@@ -616,7 +656,11 @@ extern "C" {
616 656
   void    cmCompressorSetThreshDb(  cmCompressor* p, cmReal_t thresh );
617 657
   void    cmCompressorSetRmsWndMs( cmCompressor* p, cmReal_t ms );
618 658
 
619
-  //=======================================================================================================================
659
+  
660
+  //------------------------------------------------------------------------------------------------------------
661
+  //)
662
+
663
+  //( { label:cmBiQuad file_desc:"General purpose Biquad filter algorithm." kw:[proc]}      
620 664
 
621 665
   // BiQuad Audio Eq's based on Robert Bristow-Johnson's recipes.
622 666
   // http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
@@ -660,7 +704,10 @@ extern "C" {
660 704
   void        cmBiQuadEqSet( cmBiQuadEq* p, unsigned mode, cmReal_t f0Hz, cmReal_t Q, cmReal_t gainDb );
661 705
 
662 706
 
663
-  //=======================================================================================================================
707
+  //------------------------------------------------------------------------------------------------------------
708
+  //)
709
+
710
+  //( { label:cmDistDs file_desc:"Guitar style distortion effect." kw:[proc]}      
664 711
   typedef struct
665 712
   {
666 713
     cmObj      obj;
@@ -686,7 +733,10 @@ extern "C" {
686 733
   cmRC_t    cmDistDsInit( cmDistDs* p, cmReal_t srate, cmReal_t inGain, cmReal_t downSrate, cmReal_t bits, bool rectFl, bool fullFl, cmReal_t clipDb, cmReal_t outGain, bool bypassFl );
687 734
   cmRC_t    cmDistDsFinal( cmDistDs* p );
688 735
   cmRC_t    cmDistDsExec(  cmDistDs* p, const cmSample_t* x, cmSample_t* y, unsigned n );
736
+  //------------------------------------------------------------------------------------------------------------
737
+  //)
689 738
 
739
+  
690 740
   //=======================================================================================================================
691 741
   /*
692 742
   typedef struct

+ 26
- 12
cmProc4.h View File

@@ -5,11 +5,12 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Processor Library 4" kw:[proclib]}
9
+  //)
8 10
 
9
-  //=======================================================================================================================  
10
-  //
11
-  // Simplified string alignment function based on Levenshtein edit distance.
12
-  //
11
+  
12
+  //( { label:cmEditDist file_desc:"Simplified string alignment function based on Levenshtein edit distance." kw:[proc] } 
13
+  
13 14
   enum { kEdMinIdx, kEdSubIdx, kEdDelIdx, kEdInsIdx, kEdCnt };
14 15
 
15 16
   typedef struct
@@ -87,7 +88,10 @@ extern "C" {
87 88
   // Main test function.
88 89
   void ed_main();
89 90
 
90
-  //=======================================================================================================================
91
+  //------------------------------------------------------------------------------------------------------------
92
+  //)
93
+
94
+  //( { label:cmScoreMatch file_desc:"Event oriented local score matching algorithm based on edit distance." kw:[proc] } 
91 95
   enum 
92 96
   { 
93 97
     kSmMinIdx, // 
@@ -200,9 +204,10 @@ extern "C" {
200 204
   // necessarily an error.
201 205
   cmRC_t     cmScMatchExec(  cmScMatch* p, unsigned locIdx, unsigned locN, const cmScMatchMidi_t* midiV, unsigned midiN, double min_cost );
202 206
 
203
-  //=======================================================================================================================
204
-
207
+  //------------------------------------------------------------------------------------------------------------
208
+  //)
205 209
 
210
+  //( { label:cmScoreMatcher file_desc:"MIDI score following algorithm based cmScoreMatch." kw:[proc] } 
206 211
   typedef struct
207 212
   {
208 213
     unsigned locIdx;    // index into cmScMatch_t.loc[]
@@ -246,8 +251,6 @@ extern "C" {
246 251
     bool                 printFl;
247 252
   } cmScMatcher;
248 253
 
249
-
250
-
251 254
   cmScMatcher* cmScMatcherAlloc( 
252 255
     cmCtx*          c,        // Program context.
253 256
     cmScMatcher*    p,        // Existing cmScMatcher to reallocate or NULL to allocate a new cmScMatcher.
@@ -310,7 +313,10 @@ extern "C" {
310 313
 
311 314
   void cmScMatcherPrint( cmScMatcher* p );
312 315
 
313
-  //=======================================================================================================================
316
+  //------------------------------------------------------------------------------------------------------------
317
+  //)
318
+
319
+  //( { label:cmScMeas file_desc:"Measure and report some differences between the score and the performance." kw:[proc] } 
314 320
 
315 321
   typedef struct
316 322
   {
@@ -391,7 +397,10 @@ extern "C" {
391 397
   // notes in each marker region and the score. 
392 398
   void       cmScAlignScanMarkers(  cmRpt_t* rpt, cmTlH_t tlH, cmScH_t scH );
393 399
 
394
-  //=======================================================================================================================
400
+  //------------------------------------------------------------------------------------------------------------
401
+  //)
402
+
403
+  //( { label:cmScMod file_desc:"Store and recall parameter information under score follower control." kw:[proc] } 
395 404
   /*
396 405
     Syntax: <loc> <mod> <var> <type>   <params>
397 406
     <loc> - score location
@@ -523,7 +532,10 @@ extern "C" {
523 532
   cmRC_t         cmScModulatorExec(  cmScModulator* p, unsigned scLocIdx );
524 533
   cmRC_t         cmScModulatorDump(  cmScModulator* p );
525 534
 
526
-  //=======================================================================================================================
535
+  //------------------------------------------------------------------------------------------------------------
536
+  //)
537
+
538
+  //( { label:cmRecdPlay file_desc:"Record fragments of audio, store them,and play them back at a later time." kw:[proc] } 
527 539
   //
528 540
   // Record fragments of audio, store them, and play them back at a later time.
529 541
   //
@@ -594,7 +606,9 @@ extern "C" {
594 606
   cmRC_t         cmRecdPlayBeginFade(   cmRecdPlay* p, unsigned labelSymId, double fadeDbPerSec );
595 607
 
596 608
   cmRC_t         cmRecdPlayExec(        cmRecdPlay* p, const cmSample_t** iChs, cmSample_t** oChs, unsigned chCnt, unsigned smpCnt );
609
+  //)
597 610
 
611
+  
598 612
 #ifdef __cplusplus
599 613
 }
600 614
 #endif

+ 22
- 16
cmProc5.h View File

@@ -5,10 +5,11 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Process Library 5", kw:[proclib]}
9
+  //)
8 10
 
9
-  //=======================================================================================================================
10
-  // Goertzel Filter
11
-  //
11
+  
12
+  //( { label:cmGoertzel file_desc:"Goertzel tone detection filter." kw:[proc]}
12 13
 
13 14
   typedef struct
14 15
   {
@@ -38,10 +39,10 @@ extern "C" {
38 39
   cmRC_t cmGoertzelSetFcHz( cmGoertzel* p, unsigned chIdx, double hz );
39 40
   cmRC_t cmGoertzelExec( cmGoertzel* p, const cmSample_t* in, unsigned procSmpCnt,  double* outV, unsigned chCnt );
40 41
 
42
+  //------------------------------------------------------------------------------------------------------------
43
+  //)
41 44
 
42
-  //=======================================================================================================================
43
-  // Gold Code Signal Generator
44
-  //
45
+  //( { label:cmGoldCode file_desc:"Gold code random generator." kw:[proc]}
45 46
 
46 47
   typedef struct
47 48
   {
@@ -110,9 +111,10 @@ extern "C" {
110 111
   cmRC_t cmGoldSigTest( cmCtx* ctx );
111 112
 
112 113
 
113
-  //=======================================================================================================================
114
-  // Phase aligned transform generalized cross correlator
115
-  //
114
+  //------------------------------------------------------------------------------------------------------------
115
+  //)
116
+
117
+  //( { label:cmPhat file_desc:"Phase-aligned transform for generalized cross correlator." kw:[proc]}
116 118
 
117 119
   // Flags for use with the 'flags' argument to cmPhatAlloc() 
118 120
   enum
@@ -192,9 +194,10 @@ extern "C" {
192 194
   cmRC_t cmPhatWrite( cmPhat_t* p, const char* dirStr );
193 195
 
194 196
 
195
-  //=======================================================================================================================
196
-  // 
197
-  //
197
+  //------------------------------------------------------------------------------------------------------------
198
+  //)
199
+
200
+  //( { label:cmReflectCal file_desc:"Calculate the time of flight of Gold code acoustic reflections." kw:[proc]}
198 201
 
199 202
 
200 203
   typedef struct
@@ -225,9 +228,11 @@ extern "C" {
225 228
   cmRC_t cmReflectCalcExec(  cmReflectCalc_t* p, const cmSample_t* xV, cmSample_t* yV, unsigned xyN );
226 229
   cmRC_t cmReflectCalcWrite( cmReflectCalc_t* p, const char* dirStr );
227 230
 
228
-  //=======================================================================================================================
229
-  // 
230
-  //
231
+  //------------------------------------------------------------------------------------------------------------
232
+  //)
233
+
234
+  //( { label:cmNlms file_desc:"Normalized least mean squares echo canceller." kw:[proc]}
235
+  
231 236
   typedef struct
232 237
   {
233 238
     cmObj          obj;
@@ -260,7 +265,8 @@ extern "C" {
260 265
   void        cmNlmsEcSetMu(     cmNlmsEc_t* p, float mu );
261 266
   void        cmNlmsEcSetDelayN( cmNlmsEc_t* p, unsigned delayN );
262 267
   void        cmNlmsEcSetIrN(    cmNlmsEc_t* p, unsigned irN );
263
-  
268
+  //)
269
+
264 270
   
265 271
 #ifdef __cplusplus
266 272
 }

+ 3
- 2
cmProcObj.h View File

@@ -5,7 +5,7 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  /*
8
+  /*( { file_desc:"Base class for all 'proc' objects." kw:[proclib] } 
9 9
 
10 10
     The first field in all objects must be an cmObj record.
11 11
 
@@ -164,7 +164,8 @@ extern "C" {
164 164
 #define cmMtxFileRealExecN(f,p,n,s) cmMtxFileDoubleExec((f),(p),(n),(s))
165 165
 #endif
166 166
 
167
-
167
+  //)
168
+  
168 169
 #ifdef __cplusplus
169 170
 }
170 171
 #endif

+ 3
- 0
cmRbm.h View File

@@ -5,6 +5,7 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Restricted Bolzmann Machine object." kw:[model] }
8 9
 enum
9 10
 {
10 11
   kOkRbmRC = cmOkRC,
@@ -38,6 +39,8 @@ enum
38 39
 
39 40
   void cmRbmBinaryTest(cmCtx_t* ctx);
40 41
 
42
+  //)
43
+  
41 44
 #ifdef __cplusplus
42 45
 }
43 46
 #endif

+ 1
- 4
cmRpt.h View File

@@ -5,12 +5,10 @@
5 5
 #ifdef __cplusplus
6 6
 extern "C" {
7 7
 #endif
8
-  //{
9 8
 
10 9
   
11
-  //(
10
+  //( { file_desc: "The cmRpt class provides console style output for all objects in the cm system." kw:[base]}
12 11
   // 
13
-  // The cmRpt class provides console style output for all objects in the cm system.
14 12
   // 
15 13
   // The cmRpt class provides console output style output, like stdout and stderr
16 14
   // for most of the classes in the cm library.
@@ -51,7 +49,6 @@ extern "C" {
51 49
   void cmRptVErrorf( cmRpt_t* rpt, const cmChar_t* fmt, va_list vl );
52 50
   void cmRptErrorf(  cmRpt_t* rpt, const cmChar_t* fmt, ... );
53 51
   //)
54
-  //}
55 52
 
56 53
 #ifdef __cplusplus
57 54
   }

+ 4
- 1
cmRtNet.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"rtSys networking component." kw:[rtsys network] }
9
+  
8 10
   /*
9 11
    Nodes and Endpoints:
10 12
    ---------------------
@@ -202,7 +204,8 @@ extern "C" {
202 204
         4)  The symbol -=- in the flow chart implies a network transmission.
203 205
 
204 206
    */  
205
-
207
+  //)
208
+  
206 209
 #ifdef __cplusplus
207 210
 }
208 211
 #endif

+ 4
- 7
cmRtSys.h View File

@@ -1,5 +1,4 @@
1
-// cmRtSys.h
2
-// Implements a real-time audio processing engine.
1
+//( { file_desc:"Improved real-time audio processing engine." kw:[rtsys] }
3 2
 //
4 3
 // The audio system is composed a collection of independent sub-systems.
5 4
 // Each sub-system maintains a thread which runs asynchrounsly
@@ -48,10 +47,7 @@
48 47
 // Messages arriving while the mutex is locked are queued and
49 48
 // delivered to the DSP procedure at the end of the DSP execution
50 49
 // procedure.
51
-//
52
-// Usage example and testing code:
53
-// See  cmRtSysTest().
54
-// \snippet cmRtSys.c cmRtSysTest
50
+//)
55 51
 
56 52
 #ifndef cmRtSys_h
57 53
 #define cmRtSys_h
@@ -60,6 +56,7 @@
60 56
 extern "C" {
61 57
 #endif
62 58
 
59
+  //(
63 60
   // Audio system result codes
64 61
   enum
65 62
   {
@@ -329,7 +326,7 @@ extern "C" {
329 326
   cmRtRC_t cmRtSysNetReport( cmRtSysH_t h );
330 327
   cmRtRC_t cmRtSysNetReportSyncEnable( cmRtSysH_t h, bool enableFl );
331 328
   cmRtRC_t cmRtSysNetGetHandle( cmRtSysH_t h, unsigned rtSubIdx, cmRtNetH_t* hp );
332
-
329
+  //)
333 330
 
334 331
 #ifdef __cplusplus
335 332
 }

+ 4
- 2
cmRtSysMsg.h View File

@@ -4,7 +4,8 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
-
7
+  //( { file_desc:"rtSys message contants and data structures." kw:[rtsys] }
8
+  
8 9
   // Reserved DSP message selector id's (second field of all 
9 10
   // host<->audio system messages)
10 11
   enum
@@ -105,7 +106,8 @@ extern "C" {
105 106
     // char msg[ msgByteCnt ]
106 107
   } cmRtNetMsg_t;
107 108
 
108
-
109
+  //)
110
+  
109 111
 #ifdef __cplusplus
110 112
 }
111 113
 #endif

+ 2
- 9
cmSerialize.h View File

@@ -5,14 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  //{
9
-  //(
10
-  // cmSerialize is an API for serializing data structures into 
11
-  // byte streams and then deserializing them back into data structures.
12
-  //
13
-  //)
14
-
15
-  //(
8
+  //( { file_desc:" An API for serializing data structures into byte streams and then deserializing them back into data structures." kw:[base]}
9
+  
16 10
 
17 11
   // Result codes
18 12
   enum
@@ -299,7 +293,6 @@ extern "C" {
299 293
   cmSrRC_t cmSrTest( cmCtx_t* ctx );
300 294
 
301 295
   //)
302
-  //}
303 296
 
304 297
 #ifdef __cplusplus
305 298
 }

+ 4
- 1
cmStack.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Push-down stack data structure for binary blobs." kw:[container] }
9
+  
8 10
   enum
9 11
   {
10 12
     kOkStRC = cmOkRC,
@@ -62,7 +64,8 @@ extern "C" {
62 64
 
63 65
 #define cmStackEle(h,t,i) (*(t*)cmStackGet(h,i))
64 66
 
65
-
67
+  //)
68
+  
66 69
 #ifdef __cplusplus
67 70
 }
68 71
 #endif

+ 4
- 0
cmStrStream.h View File

@@ -6,6 +6,8 @@
6 6
 extern "C" {
7 7
 #endif
8 8
 
9
+  //( { file_desc:"String stream text sink." kw:[text] }
10
+  
9 11
   enum
10 12
   {
11 13
     kOkSsRC = cmOkRC,
@@ -34,6 +36,8 @@ extern "C" {
34 36
   void*     cmOStrStreamAllocBuf(  cmStrStreamH_t h );
35 37
   cmChar_t* cmOStrStreamAllocText( cmStrStreamH_t h );
36 38
 
39
+  //)
40
+  
37 41
 #ifdef __cplusplus
38 42
 }
39 43
 #endif

+ 1
- 7
cmSymTbl.h View File

@@ -4,13 +4,8 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
-  //{
8
-  //(
9
-  //  Symbol table component.
10
-  //)
11
-
7
+  //( { file_desc:"Symbol table object." kw:[base] }
12 8
   
13
-  //(
14 9
   typedef cmHandle_t cmSymTblH_t;
15 10
 
16 11
   extern cmSymTblH_t cmSymTblNullHandle;
@@ -61,7 +56,6 @@ extern "C" {
61 56
   void        cmSymTblTest(cmCtx_t* ctx);
62 57
   
63 58
   //)
64
-  //}
65 59
 
66 60
 #ifdef __cplusplus
67 61
 }

+ 4
- 0
cmTagFile.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Read a 'ctags' output file." kw:[file] }
9
+  
8 10
   // Read a ctags file generated by:
9 11
   //
10 12
   // ctags --c-kinds=+p --fields=+n  file.h
@@ -61,6 +63,8 @@ extern "C" {
61 63
 
62 64
   cmTfRC_t cmTfTest( cmCtx_t* ctx, const cmChar_t* fn );
63 65
 
66
+  //)
67
+  
64 68
 #ifdef __cplusplus
65 69
 }
66 70
 #endif

+ 4
- 2
cmTaskMgr.h View File

@@ -5,7 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  /*
8
+  /*( { file_desc:"Task manager for controlling and monitoring tasks running in independent thread." kw:[parallel]}
9
+
9 10
     Usage:
10 11
     1) Use cmTaskMgrInstall() to register a worker function 
11 12
     (cmTaskMgrFunc_t) with the task manager.
@@ -353,7 +354,8 @@ extern "C" {
353 354
   cmTmWorkerRC_t cmTaskMgrWorkerMsgSend( cmTaskMgrFuncArg_t* a, const void* buf, unsigned bufByteCnt );
354 355
 
355 356
   cmTmRC_t cmTaskMgrTest(cmCtx_t* ctx);
356
-
357
+  //)
358
+  
357 359
 #ifdef __cplusplus
358 360
 }
359 361
 #endif

+ 2
- 3
cmText.h View File

@@ -5,8 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-  //{
9
-  //(
8
+  //( { file_desc:"Text processing functions." kw:[text]}
9
+  //
10 10
   // The cmText API supports two basic tasks: the generation of
11 11
   // formatted text into dynamic arrays and text to number parsing.
12 12
   // 
@@ -297,7 +297,6 @@ extern "C" {
297 297
 
298 298
 
299 299
   //)
300
-  //}
301 300
 
302 301
 #ifdef __cplusplus
303 302
 }

+ 55
- 49
cmTextTemplate.h View File

@@ -1,55 +1,61 @@
1 1
 #ifndef cmTextTemplate_h
2 2
 #define cmTextTemplate_h
3 3
 
4
+#ifdef __cplusplus
5
+extern "C" {
6
+#endif
4 7
 
5
-enum
6
-{
7
-  kOkTtRC = cmOkRC,
8
-  kFileFailTtRC,
9
-  kLHeapFailTtRC,
10
-  kSyntaxErrTtRC,
11
-  kFindFailTtRC,
12
-  kInvalidTypeTtRC,
13
-  kJsonFailTtRC
14
-};
15
-
16
-typedef cmHandle_t cmTtH_t;
17
-typedef unsigned   cmTtRC_t;
18
-extern cmTtH_t cmTtNullHandle;
19
-
20
-// Initialize a template file.
21
-cmTtRC_t cmTextTemplateInitialize( cmCtx_t* ctx, cmTtH_t* hp, const cmChar_t* fn );
22
-
23
-// Finalize a template file
24
-cmTtRC_t cmTextTemplateFinalize( cmTtH_t* hp );
25
-
26
-// Return true if the template file is intialized.
27
-bool     cmTextTemplateIsValid( cmTtH_t h );
28
-
29
-// Set the value of a template variable.
30
-// The node identified by { label,index, label, index ... } must
31
-// be a variable node.  The function will fail if a 'set' or 'text' node
32
-// is identified.
33
-// Set 'value' to NULL to erase a previously set value.
34
-cmTtRC_t cmTextTemplateSetValue( cmTtH_t h, const cmChar_t* value, const cmChar_t* label, unsigned index, ... );
35
-
36
-// Create a copy of the sub-tree identified by the variable path
37
-// and insert it as the left sibling of the sub-tree's root.
38
-cmTtRC_t cmTextTemplateRepeat( cmTtH_t h, const cmChar_t* label, unsigned index, ... );
39
-
40
-// Write the template file.
41
-cmTtRC_t cmTextTemplateWrite( cmTtH_t h, const cmChar_t* fn );
42
-
43
-// Apply a template value JSON file to this template
44
-cmTtRC_t cmTextTemplateApply( cmTtH_t h, const cmChar_t* fn );
45
-
46
-
47
-// Print an annotated template tree.
48
-void cmTtPrintTree( cmTtH_t h, cmRpt_t* rpt );
49
-
50
-
51
-cmTtRC_t cmTextTemplateTest( cmCtx_t* ctx, const cmChar_t* fn );
52
-
53
-
8
+  //( { file_desc:"Generate text using templates with replaceable variables." kw:[text] }
9
+  enum
10
+  {
11
+    kOkTtRC = cmOkRC,
12
+    kFileFailTtRC,
13
+    kLHeapFailTtRC,
14
+    kSyntaxErrTtRC,
15
+    kFindFailTtRC,
16
+    kInvalidTypeTtRC,
17
+    kJsonFailTtRC
18
+  };
19
+
20
+  typedef cmHandle_t cmTtH_t;
21
+  typedef unsigned   cmTtRC_t;
22
+  extern  cmTtH_t    cmTtNullHandle;
23
+
24
+  // Initialize a template file.
25
+  cmTtRC_t cmTextTemplateInitialize( cmCtx_t* ctx, cmTtH_t* hp, const cmChar_t* fn );
26
+
27
+  // Finalize a template file
28
+  cmTtRC_t cmTextTemplateFinalize( cmTtH_t* hp );
29
+
30
+  // Return true if the template file is intialized.
31
+  bool     cmTextTemplateIsValid( cmTtH_t h );
32
+
33
+  // Set the value of a template variable.
34
+  // The node identified by { label,index, label, index ... } must
35
+  // be a variable node.  The function will fail if a 'set' or 'text' node
36
+  // is identified.
37
+  // Set 'value' to NULL to erase a previously set value.
38
+  cmTtRC_t cmTextTemplateSetValue( cmTtH_t h, const cmChar_t* value, const cmChar_t* label, unsigned index, ... );
39
+
40
+  // Create a copy of the sub-tree identified by the variable path
41
+  // and insert it as the left sibling of the sub-tree's root.
42
+  cmTtRC_t cmTextTemplateRepeat( cmTtH_t h, const cmChar_t* label, unsigned index, ... );
43
+
44
+  // Write the template file.
45
+  cmTtRC_t cmTextTemplateWrite( cmTtH_t h, const cmChar_t* fn );
46
+
47
+  // Apply a template value JSON file to this template
48
+  cmTtRC_t cmTextTemplateApply( cmTtH_t h, const cmChar_t* fn );
49
+
50
+  // Print an annotated template tree.
51
+  void cmTtPrintTree( cmTtH_t h, cmRpt_t* rpt );
52
+
53
+  cmTtRC_t cmTextTemplateTest( cmCtx_t* ctx, const cmChar_t* fn );
54
+  
55
+  //)
56
+  
57
+#ifdef __cplusplus
58
+}
59
+#endif
54 60
 
55 61
 #endif

+ 23
- 6
cmThread.h View File

@@ -4,6 +4,7 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
+  //( { file_desc:"Threads and thread safe containers." kw:[parallel] }
7 8
 
8 9
   typedef cmHandle_t cmThreadH_t;
9 10
   typedef unsigned   cmThRC_t;
@@ -85,8 +86,10 @@ extern "C" {
85 86
   void          cmThreadSetWaitTimeOutMicros( cmThreadH_t h, unsigned usecs );
86 87
 
87 88
   void          cmThreadTest( cmRpt_t* rpt );
89
+  //)
88 90
 
89
-
91
+  //( { label:cmThreadMutex file_desc:"Thread mutex object." kw[parallel]}
92
+  //============================================================================
90 93
   typedef struct
91 94
   {
92 95
     void* h;
@@ -109,6 +112,9 @@ extern "C" {
109 112
   cmThRC_t cmThreadMutexSignalCondVar( cmThreadMutexH_t h );
110 113
 
111 114
 
115
+  //)
116
+  //( { label:cmTsQueue file_desc:"Thread safe message queue." kw[parallel]}
117
+  //============================================================================
112 118
 
113 119
   // cmThread safe message queue.
114 120
   //
@@ -190,6 +196,9 @@ extern "C" {
190 196
  
191 197
   bool     cmTsQueueIsValid(    cmTsQueueH_t h);
192 198
 
199
+  //)
200
+  //( { label:cmTs1p1c file_desc:"Single producer/Single consumer non-blocking thread safe queue." kw[parallel]}
201
+  //============================================================================
193 202
 
194 203
   // Single producer / Single consumer thread-safe queue.
195 204
   // These functions have identical semantics and return values
@@ -221,6 +230,9 @@ extern "C" {
221 230
   
222 231
   bool       cmTs1p1cIsValid( cmTs1p1cH_t h );  
223 232
 
233
+  //)
234
+  //( { label:cmThCAS file_desc:"Non-blocking primitive operations." kw[parallel]}
235
+  //============================================================================
224 236
 
225 237
   // Thread safe compare-and-swap (actualy compare-and-test). 
226 238
   // Returns true if the *addr==new when the function returns 
@@ -241,6 +253,9 @@ extern "C" {
241 253
   void     cmThUIntDecr( unsigned* addr, unsigned decr );
242 254
   void     cmThFloatDecr(float*    addr, float    decr );
243 255
 
256
+  //)
257
+  //( { label:cmMp1c file_desc:"Multiple producer, single consumer non-blocking thread-safe queue." kw[parallel]}
258
+  //============================================================================
244 259
   // Multiple producer / Single consumer thread-safe queue.
245 260
   // These functions have identical semantics and return values
246 261
   // to the same named cmTsQueueXXXX() calls above.
@@ -272,15 +287,17 @@ extern "C" {
272 287
   
273 288
   bool       cmTsMp1cIsValid( cmTsMp1cH_t h );  
274 289
 
275
-
290
+  void cmTsQueueTest( cmRpt_t* rpt );
291
+  void cmTs1p1cTest( cmRpt_t* rpt );
292
+  void cmTsMp1cTest( cmRpt_t* rpt );
293
+  
294
+  //)
295
+  //( { label:cmSleep file_desc:"Sleep related functions." kw:[time] }
276 296
   // Sleep functions
277 297
   void cmSleepUs( unsigned microseconds );
278 298
   void cmSleepMs( unsigned milliseconds );
299
+  //)
279 300
 
280
-
281
-  void cmTsQueueTest( cmRpt_t* rpt );
282
-  void cmTs1p1cTest( cmRpt_t* rpt );
283
-  void cmTsMp1cTest( cmRpt_t* rpt );
284 301
 #ifdef __cplusplus
285 302
 }
286 303
 #endif

+ 3
- 8
cmTime.h View File

@@ -1,8 +1,7 @@
1 1
 
2
-//{ { label:cmTime
3
-//    kw: [ time ] }
2
+//( { file_desc:"Time cand clock related functions." kw: [ time system ] }
3
+//
4 4
 //
5
-//( 
6 5
 // This interface is used to read the systems high resolution timer and 
7 6
 // calculate elapsed time.
8 7
 //)
@@ -16,12 +15,9 @@ extern "C" {
16 15
 #endif
17 16
 
18 17
   //(
19
-
20 18
   typedef  struct timespec cmTimeSpec_t;
21 19
 
22
-  /* 
23
-     get the time 
24
-   */
20
+  // Get the time 
25 21
   void cmTimeGet( cmTimeSpec_t* t );
26 22
 
27 23
   // Return the elapsed time (t1 - t0) in microseconds
@@ -51,7 +47,6 @@ extern "C" {
51 47
   void cmTimeSetZero( cmTimeSpec_t* t0 );
52 48
 
53 49
   //)
54
-  //}
55 50
 
56 51
 #ifdef __cplusplus
57 52
 }

+ 3
- 1
cmUdpNet.h View File

@@ -5,7 +5,7 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
-/*
8
+/*( { file_desc:"UDP based network object." kw:[network] }
9 9
   A cmUdpNet is a wrapper around a single cmUdpPort. This object
10 10
   maintains an array of remote nodes which map application defined
11 11
   node label/id's to IP address/port. This allows the application
@@ -136,6 +136,8 @@ void     cmUdpNetReport( cmUdpNetH_t h, cmRpt_t* rpt );
136 136
 
137 137
 cmRC_t cmUdpNetTest( cmCtx_t* ctx, int argc, const char* argv[] );
138 138
 
139
+  //)
140
+  
139 141
 #ifdef __cplusplus
140 142
 }
141 143
 #endif

+ 4
- 1
cmUdpPort.h View File

@@ -4,7 +4,8 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
-
7
+  //( { file_desc:"UDP socket interface class." kw:[network] }
8
+  
8 9
   #include <netinet/in.h>
9 10
 
10 11
   enum
@@ -140,6 +141,8 @@ extern "C" {
140 141
   cmUdpRC_t cmUdpTest( cmCtx_t* ctx, const char* remoteIpAddr, cmUdpPort_t port );
141 142
   cmUdpRC_t cmUdpTestV( cmCtx_t* ctx, unsigned argc, const char* argv[]);
142 143
 
144
+  //)
145
+  
143 146
 #ifdef __cplusplus
144 147
 }
145 148
 #endif

+ 8
- 4
cmUi.h View File

@@ -4,7 +4,8 @@
4 4
 #ifdef __cplusplus
5 5
 extern "C" {
6 6
 #endif
7
-  /*
7
+  /*( { file_desc:"UI control manager for rtSys." kw:[rtSys]}
8
+
8 9
     cmUI implements a platform independent UI control manager 
9 10
     for multiple simultaneous applications. In this context
10 11
     an 'application' can be seen as a plug-in style program.
@@ -108,8 +109,10 @@ extern "C" {
108 109
     7) There is no duplex model for validating and then displaying the
109 110
     value of a control.
110 111
 
111
-   */
112
-
112
+  */
113
+  //)
114
+  
115
+  //(
113 116
   typedef cmHandle_t cmUiH_t;
114 117
 
115 118
 
@@ -384,7 +387,8 @@ extern "C" {
384 387
   cmUiRC_t   cmUiLastRC( cmUiH_t uiH );
385 388
   cmUiRC_t   cmUiSetRC( cmUiH_t uiH, cmUiRC_t rc );
386 389
 
387
-
390
+  //)
391
+  
388 392
 #ifdef __cplusplus
389 393
 }
390 394
 #endif

+ 3
- 0
cmUiDrvr.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( {file_desc:"UI independent driver used by an rtSys application to communicate with the UI." kw:[rtsys]}
9
+  
8 10
   typedef unsigned cmUiRC_t;
9 11
 
10 12
   // cmUi result codes
@@ -170,6 +172,7 @@ extern "C" {
170 172
   double          cmUiDriverArgGetDouble( const cmUiDriverArg_t* a );
171 173
   const cmChar_t* cmUiDriverArgGetString( const cmUiDriverArg_t* a );
172 174
 
175
+  //)
173 176
 
174 177
 #ifdef __cplusplus
175 178
 }

+ 4
- 0
cmUiRtSysMstr.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Application side API for communicating with the UI audio master controls and meters." kw:[rtsys]}
9
+  
8 10
   enum
9 11
   {
10 12
     kOkAmRC = cmOkRC,
@@ -33,6 +35,8 @@ extern "C" {
33 35
   // Clear the status indicators.
34 36
   void cmUiRtSysMstrClearStatus( cmUiRtMstrH_t h );
35 37
 
38
+  //)
39
+  
36 40
 #ifdef __cplusplus
37 41
 }
38 42
 #endif

+ 3
- 0
cmVirtNet.h View File

@@ -5,6 +5,7 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"Wrapper object for cmUdpNet to handle UDP network communications." kw:[network]}
8 9
   enum
9 10
   {
10 11
     kOkVnRC = cmOkRC,
@@ -66,6 +67,8 @@ extern "C" {
66 67
 
67 68
   cmVnRC_t cmVnTest( cmCtx_t* ctx );
68 69
 
70
+  //)
71
+  
69 72
 #ifdef __cplusplus
70 73
 }
71 74
 #endif

+ 139
- 481
dsp/cmDspBuiltIn.c
File diff suppressed because it is too large
View File


+ 4
- 1
dsp/cmDspClass.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"'snap' unit processor interface." kw:[snap] }
9
+  
8 10
   typedef unsigned   cmDspRC_t;
9 11
 
10 12
   enum
@@ -416,7 +418,8 @@ extern "C" {
416 418
   cmDspRC_t   cmDspUiMsgListCreate(cmDspCtx_t* ctx, cmDspInst_t* inst, unsigned height, unsigned listVarId, unsigned selVarId );
417 419
 
418 420
  
419
-
421
+  //)
422
+  
420 423
 #ifdef __cplusplus
421 424
 }
422 425
 #endif

+ 218
- 143
dsp/cmDspFx.c View File

@@ -1,3 +1,5 @@
1
+//( { file_desc:"'snap' audio effects processor units." kw:[snap]}
2
+
1 3
 #include "cmPrefix.h"
2 4
 #include "cmGlobal.h"
3 5
 #include "cmFloatTypes.h"
@@ -40,7 +42,9 @@
40 42
 
41 43
 #include "cmDspSys.h"
42 44
 
43
-//==========================================================================================================================================
45
+//------------------------------------------------------------------------------------------------------------
46
+//)
47
+//( { label:cmDspDelay file_desc:"Simple audio delay with feedback." kw:[sunit] }
44 48
 enum
45 49
 {
46 50
   kBypassDyId,
@@ -155,7 +159,7 @@ cmDspRC_t _cmDspDelayRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
155 159
   return rc;
156 160
 }
157 161
 
158
-struct cmDspClass_str* cmDelayClassCons( cmDspCtx_t* ctx )
162
+cmDspClass_t* cmDelayClassCons( cmDspCtx_t* ctx )
159 163
 {
160 164
   cmDspClassSetup(&_cmDelayDC,ctx,"Delay",
161 165
     NULL,
@@ -170,7 +174,9 @@ struct cmDspClass_str* cmDelayClassCons( cmDspCtx_t* ctx )
170 174
   return &_cmDelayDC;
171 175
 }
172 176
 
173
-//==========================================================================================================================================
177
+//------------------------------------------------------------------------------------------------------------
178
+//)
179
+//( { label:cmDspMtDelay file_desc:"Multi-tap audio delay with feedback." kw:[sunit] }
174 180
 enum
175 181
 {
176 182
   kBypassMtId,
@@ -345,7 +351,7 @@ cmDspRC_t _cmDspMtDelayRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
345 351
   return rc;
346 352
 }
347 353
 
348
-cmDspRC_t  _cmDspMtDelayRecvFunc(   cmDspCtx_t* ctx, struct cmDspInst_str* inst,  unsigned attrSymId, const cmDspValue_t* value )
354
+cmDspRC_t  _cmDspMtDelayRecvFunc(   cmDspCtx_t* ctx, cmDspInst_t*  inst,  unsigned attrSymId, const cmDspValue_t* value )
349 355
 {
350 356
   cmDspRC_t       rc = kOkDspRC;
351 357
   cmDspMtDelay_t* p  = (cmDspMtDelay_t*)inst;
@@ -364,7 +370,7 @@ cmDspRC_t  _cmDspMtDelayRecvFunc(   cmDspCtx_t* ctx, struct cmDspInst_str* inst,
364 370
 }
365 371
 
366 372
 
367
-struct cmDspClass_str* cmMtDelayClassCons( cmDspCtx_t* ctx )
373
+cmDspClass_t* cmMtDelayClassCons( cmDspCtx_t* ctx )
368 374
 {
369 375
   cmDspClassSetup(&_cmMtDelayDC,ctx,"MtDelay",
370 376
     NULL,
@@ -380,7 +386,9 @@ struct cmDspClass_str* cmMtDelayClassCons( cmDspCtx_t* ctx )
380 386
   return &_cmMtDelayDC;
381 387
 }
382 388
 
383
-//==========================================================================================================================================
389
+//------------------------------------------------------------------------------------------------------------
390
+//)
391
+//( { label:cmDspPShift file_desc:"Time-domain pitch shifter." kw:[sunit] }
384 392
 enum
385 393
 {
386 394
   kBypassPsId,
@@ -468,7 +476,7 @@ cmDspRC_t _cmDspPShiftRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
468 476
   return cmDspSetEvent(ctx,inst,evt);
469 477
 }
470 478
 
471
-struct cmDspClass_str* cmPShiftClassCons( cmDspCtx_t* ctx )
479
+cmDspClass_t* cmPShiftClassCons( cmDspCtx_t* ctx )
472 480
 {
473 481
   cmDspClassSetup(&_cmPShiftDC,ctx,"PShift",
474 482
     NULL,
@@ -483,7 +491,9 @@ struct cmDspClass_str* cmPShiftClassCons( cmDspCtx_t* ctx )
483 491
   return &_cmPShiftDC;
484 492
 }
485 493
 
486
-//==========================================================================================================================================
494
+//------------------------------------------------------------------------------------------------------------
495
+//)
496
+//( { label:cmDspLoopRecd file_desc:"Loop recorder." kw:[sunit] }
487 497
 enum
488 498
 {
489 499
   kTimeLrId,
@@ -616,7 +626,7 @@ cmDspRC_t _cmDspLoopRecdRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
616 626
   return rc;
617 627
 }
618 628
 
619
-struct cmDspClass_str* cmLoopRecdClassCons( cmDspCtx_t* ctx )
629
+cmDspClass_t* cmLoopRecdClassCons( cmDspCtx_t* ctx )
620 630
 {
621 631
   cmDspClassSetup(&_cmLoopRecdDC,ctx,"LoopRecd",
622 632
     NULL,
@@ -631,7 +641,9 @@ struct cmDspClass_str* cmLoopRecdClassCons( cmDspCtx_t* ctx )
631 641
   return &_cmLoopRecdDC;
632 642
 }
633 643
 
634
-//==========================================================================================================================================
644
+//------------------------------------------------------------------------------------------------------------
645
+//)
646
+//( { label:cmDspRectify file_desc:"Full-wave rectifier." kw:[sunit] }
635 647
 enum
636 648
 {
637 649
   kBypassRcId,
@@ -715,7 +727,7 @@ cmDspRC_t _cmDspRectifyRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
715 727
   return cmDspSetEvent(ctx,inst,evt);
716 728
 }
717 729
 
718
-struct cmDspClass_str* cmRectifyClassCons( cmDspCtx_t* ctx )
730
+cmDspClass_t* cmRectifyClassCons( cmDspCtx_t* ctx )
719 731
 {
720 732
   cmDspClassSetup(&_cmRectifyDC,ctx,"Rectify",
721 733
     NULL,
@@ -731,7 +743,9 @@ struct cmDspClass_str* cmRectifyClassCons( cmDspCtx_t* ctx )
731 743
 }
732 744
 
733 745
 
734
-//==========================================================================================================================================
746
+//------------------------------------------------------------------------------------------------------------
747
+//)
748
+//( { label:cmDspGateDetect file_desc:"Track the onset and offset of an incoming signal." kw:[sunit] }
735 749
 enum
736 750
 {
737 751
   kWndMsGdId,
@@ -862,7 +876,7 @@ cmDspRC_t _cmDspGateDetectRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
862 876
   return rc;
863 877
 }
864 878
 
865
-struct cmDspClass_str* cmGateDetectClassCons( cmDspCtx_t* ctx )
879
+cmDspClass_t* cmGateDetectClassCons( cmDspCtx_t* ctx )
866 880
 {
867 881
   cmDspClassSetup(&_cmGateDetectDC,ctx,"GateDetect",
868 882
     NULL,
@@ -878,62 +892,62 @@ struct cmDspClass_str* cmGateDetectClassCons( cmDspCtx_t* ctx )
878 892
 }
879 893
 
880 894
 
881
-//==========================================================================================================================================
882
-/*
883
-  The purpose of this object is to calculate, store and retrieve gain coefficents
884
-  for a set of audio channels.  The gain coefficients are designed to balance the
885
-  volume of each channel relative to the others.  During gain calibration
886
-  a sample of each channel is taken and it's average volume is determined.  
887
-  After an example of all channels has been received a new set of gain coefficients
888
-  is calculated which decreases the volume of loud channels and increases the
889
-  volume of quiet channels.
890
-
891
-  The gain coefficents are made available via a set of 'gain-###' output ports.
892
-
893
-  This object acts as an interface to the cmAutoGain processor.  
894
-
895
-  As input it takes a channel configuration JSON file of the form:
896
-  {
897
-    ch_array : 
898
-    [ ["ch","ssi","pitch","midi","gain"]
899
-      [ 0,    0,    "C4",   60,    1.0 ]
900
-               ....
901
-      [ n     0,    "C5",   72,    1.0 ]
902
-    ] 
903
-  }      
904
-
905
-  Each array in 'ch_array' gives the configuration of a channel.
906
-  
895
+//------------------------------------------------------------------------------------------------------------
896
+//)
897
+//( { label:cmDspAutoGain file_desc:"Normalize a set of audio input signals to acheive a consistent level." kw:[sunit] }
898
+// The purpose of this object is to calculate, store and retrieve gain coefficents
899
+// for a set of audio channels.  The gain coefficients are designed to balance the
900
+// volume of each channel relative to the others.  During gain calibration
901
+// a sample of each channel is taken and it's average volume is determined.  
902
+// After an example of all channels has been received a new set of gain coefficients
903
+// is calculated which decreases the volume of loud channels and increases the
904
+// volume of quiet channels.
905
+//
906
+//  The gain coefficents are made available via a set of 'gain-###' output ports.
907
+//
908
+//  This object acts as an interface to the cmAutoGain processor.  
909
+//
910
+//  As input it takes a channel configuration JSON file of the form:
911
+//  {
912
+//    ch_array : 
913
+//    [ ["ch","ssi","pitch","midi","gain"]
914
+//      [ 0,    0,    "C4",   60,    1.0 ]
915
+//               ....
916
+//      [ n     0,    "C5",   72,    1.0 ]
917
+//    ] 
918
+//  }      
919
+//
920
+//  Each array in 'ch_array' gives the configuration of a channel.
921
+//  
922
+//
923
+//  It also requires a JSON resource object of the form
924
+//    gdParms: 
925
+//    {
926
+//      medCnt: 5                   
927
+//      avgCnt: 9       
928
+//      suprCnt: 6       
929
+//      offCnt: 3       
930
+//      suprCoeff: 1.400000       
931
+//      onThreshDb: -53.000000       
932
+//      offThreshDb: -80.000000       
933
+//    }    
934
+//
935
+//    These arguments are used to configure the cmAutoGain Proessor gate detector function.
936
+//
937
+//  During runtime the object accepts the following action selector symbol id's:
938
+//    a. start  - begin a new calibration  session 
939
+//    b. proc   - end a calibration session and calculate new gain coeff's
940
+//    c. cancel - cancel a calibration session   
941
+//    d. write  - write the channel configuration file 
942
+//    e. print  - print the current auto gain calibration state
943
+//
944
+//  After a 'start' msg the object accepts channel id's throught its 'id' input port.
945
+//  Each 'id' identifies the channel which it will process next.
946
+//  Upon reception of a channel id the object routes subsequent audio to its
947
+//  internal cmAutoGain processor until it receives the next channel id 
948
+//  or a 'proc' or 'cancel' symbol.
949
+
907 950
 
908
-  It also requires a JSON resource object of the form
909
-    gdParms: 
910
-    {
911
-      medCnt: 5                   
912
-      avgCnt: 9       
913
-      suprCnt: 6       
914
-      offCnt: 3       
915
-      suprCoeff: 1.400000       
916
-      onThreshDb: -53.000000       
917
-      offThreshDb: -80.000000       
918
-    }    
919
-
920
-    These arguments are used to configure the cmAutoGain Proessor gate detector function.
921
-
922
-  During runtime the object accepts the following action selector symbol id's:
923
-    a. start  - begin a new calibration  session 
924
-    b. proc   - end a calibration session and calculate new gain coeff's
925
-    c. cancel - cancel a calibration session   
926
-    d. write  - write the channel configuration file 
927
-    e. print  - print the current auto gain calibration state
928
-
929
-  After a 'start' msg the object accepts channel id's throught its 'id' input port.
930
-  Each 'id' identifies the channel which it will process next.
931
-  Upon reception of a channel id the object routes subsequent audio to its
932
-  internal cmAutoGain processor until it receives the next channel id 
933
-  or a 'proc' or 'cancel' symbol.
934
-
935
-
936
-*/
937 951
 //==========================================================================================================================================
938 952
 enum
939 953
 {
@@ -1202,7 +1216,7 @@ cmDspRC_t _cmDspAutoGainRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
1202 1216
   return rc;
1203 1217
 }
1204 1218
 
1205
-struct cmDspClass_str* cmAutoGainClassCons( cmDspCtx_t* ctx )
1219
+cmDspClass_t* cmAutoGainClassCons( cmDspCtx_t* ctx )
1206 1220
 {
1207 1221
   cmDspClassSetup(&_cmAutoGainDC,ctx,"AutoGain",
1208 1222
     NULL,
@@ -1217,7 +1231,9 @@ struct cmDspClass_str* cmAutoGainClassCons( cmDspCtx_t* ctx )
1217 1231
   return &_cmAutoGainDC;
1218 1232
 }
1219 1233
 
1220
-//==========================================================================================================================================
1234
+//------------------------------------------------------------------------------------------------------------
1235
+//)
1236
+//( { label:cmDspEnvFollow file_desc:"Generate a control signal from by analyzing the power envelope of an incoming audio signal." kw:[sunit] }
1221 1237
 enum
1222 1238
 {
1223 1239
   kHopMsEfId,     // RMS window length in milliseconds
@@ -1388,7 +1404,7 @@ cmDspRC_t _cmDspEnvFollowRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt
1388 1404
   return rc;
1389 1405
 }
1390 1406
 
1391
-struct cmDspClass_str* cmEnvFollowClassCons( cmDspCtx_t* ctx )
1407
+cmDspClass_t* cmEnvFollowClassCons( cmDspCtx_t* ctx )
1392 1408
 {
1393 1409
   cmDspClassSetup(&_cmEnvFollowDC,ctx,"EnvFollow",
1394 1410
     NULL,
@@ -1403,7 +1419,9 @@ struct cmDspClass_str* cmEnvFollowClassCons( cmDspCtx_t* ctx )
1403 1419
   return &_cmEnvFollowDC;
1404 1420
 }
1405 1421
 
1406
-//==========================================================================================================================================
1422
+//------------------------------------------------------------------------------------------------------------
1423
+//)
1424
+//( { label:cmDspXfader file_desc:"Gate controlled fader bank." kw:[sunit] }
1407 1425
 // Fade in and out an arbitrary number of audio signals based on gate signals.
1408 1426
 // When the gate is high the signal fades in and when the gate is low the signal fades out.
1409 1427
 // Constructor Args:
@@ -1646,7 +1664,7 @@ cmDspRC_t _cmDspXfaderRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
1646 1664
   return rc;
1647 1665
 }
1648 1666
 
1649
-struct cmDspClass_str* cmXfaderClassCons( cmDspCtx_t* ctx )
1667
+cmDspClass_t* cmXfaderClassCons( cmDspCtx_t* ctx )
1650 1668
 {
1651 1669
   cmDspClassSetup(&_cmXfaderDC,ctx,"Xfader",
1652 1670
     NULL,
@@ -1662,7 +1680,9 @@ struct cmDspClass_str* cmXfaderClassCons( cmDspCtx_t* ctx )
1662 1680
 }
1663 1681
 
1664 1682
 
1665
-//==========================================================================================================================================
1683
+//------------------------------------------------------------------------------------------------------------
1684
+//)
1685
+//( { label:cmDspChCfg file_desc:"Configure a 'fluxo' channel." kw:[sunit] }
1666 1686
 
1667 1687
 enum
1668 1688
 {
@@ -1864,7 +1884,7 @@ cmDspRC_t _cmDspChCfgRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
1864 1884
   return rc;
1865 1885
 }
1866 1886
 
1867
-struct cmDspClass_str* cmChCfgClassCons( cmDspCtx_t* ctx )
1887
+cmDspClass_t* cmChCfgClassCons( cmDspCtx_t* ctx )
1868 1888
 {
1869 1889
   cmDspClassSetup(&_cmChCfgDC,ctx,"ChCfg",
1870 1890
     NULL,
@@ -1879,7 +1899,9 @@ struct cmDspClass_str* cmChCfgClassCons( cmDspCtx_t* ctx )
1879 1899
   return &_cmChCfgDC;
1880 1900
 }
1881 1901
 
1882
-//==========================================================================================================================================
1902
+//------------------------------------------------------------------------------------------------------------
1903
+//)
1904
+//( { label:cmDspChordDetect file_desc:"Detect a predefined chord based on signal gates." kw:[sunit] }
1883 1905
 enum
1884 1906
 {
1885 1907
   kRsrcCdId,
@@ -2062,7 +2084,7 @@ cmDspRC_t _cmDspChordDetectRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspE
2062 2084
   return rc;
2063 2085
 }
2064 2086
 
2065
-struct cmDspClass_str* cmChordDetectClassCons( cmDspCtx_t* ctx )
2087
+cmDspClass_t* cmChordDetectClassCons( cmDspCtx_t* ctx )
2066 2088
 {
2067 2089
   cmDspClassSetup(&_cmChordDetectDC,ctx,"ChordDetect",
2068 2090
     NULL,
@@ -2077,7 +2099,10 @@ struct cmDspClass_str* cmChordDetectClassCons( cmDspCtx_t* ctx )
2077 2099
   return &_cmChordDetectDC;
2078 2100
 }
2079 2101
 
2080
-//==========================================================================================================================================
2102
+//------------------------------------------------------------------------------------------------------------
2103
+//)
2104
+//( { label:cmDspFader file_desc:"Single channel gate controlled fader." kw:[sunit] }
2105
+
2081 2106
 enum
2082 2107
 {
2083 2108
   kTimeFaId,
@@ -2168,7 +2193,7 @@ cmDspRC_t _cmDspFaderRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
2168 2193
   return rc;
2169 2194
 }
2170 2195
 
2171
-struct cmDspClass_str* cmFaderClassCons( cmDspCtx_t* ctx )
2196
+cmDspClass_t* cmFaderClassCons( cmDspCtx_t* ctx )
2172 2197
 {
2173 2198
   cmDspClassSetup(&_cmFaderDC,ctx,"Fader",
2174 2199
     NULL,
@@ -2183,7 +2208,9 @@ struct cmDspClass_str* cmFaderClassCons( cmDspCtx_t* ctx )
2183 2208
   return &_cmFaderDC;
2184 2209
 }
2185 2210
 
2186
-//==========================================================================================================================================
2211
+//------------------------------------------------------------------------------------------------------------
2212
+//)
2213
+//( { label:cmDspNoteSelect file_desc:"'fluxo' gate based logic controller." kw:[sunit fluxo] }
2187 2214
 enum
2188 2215
 {
2189 2216
   kChCntNsId,
@@ -2421,7 +2448,7 @@ cmDspRC_t _cmDspNoteSelectRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
2421 2448
   return rc;
2422 2449
 }
2423 2450
 
2424
-struct cmDspClass_str* cmNoteSelectClassCons( cmDspCtx_t* ctx )
2451
+cmDspClass_t* cmNoteSelectClassCons( cmDspCtx_t* ctx )
2425 2452
 {
2426 2453
   cmDspClassSetup(&_cmNoteSelectDC,ctx,"NoteSelect",
2427 2454
     NULL,
@@ -2436,7 +2463,9 @@ struct cmDspClass_str* cmNoteSelectClassCons( cmDspCtx_t* ctx )
2436 2463
   return &_cmNoteSelectDC;
2437 2464
 }
2438 2465
 
2439
-//==========================================================================================================================================
2466
+//------------------------------------------------------------------------------------------------------------
2467
+//)
2468
+//( { label:cmDspNetNoteSelect file_desc:"'fluxo' transmit gate information over the UDP network." kw:[sunit fluxo] }
2440 2469
 
2441 2470
 enum
2442 2471
 {
@@ -2708,7 +2737,7 @@ cmDspRC_t _cmDspNetNoteSelectRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDs
2708 2737
   return rc;
2709 2738
 }
2710 2739
 
2711
-struct cmDspClass_str* cmNetNoteSelectClassCons( cmDspCtx_t* ctx )
2740
+cmDspClass_t* cmNetNoteSelectClassCons( cmDspCtx_t* ctx )
2712 2741
 {
2713 2742
   cmDspClassSetup(&_cmNetNoteSelectDC,ctx,"NetNoteSelect",
2714 2743
     NULL,
@@ -2724,7 +2753,9 @@ struct cmDspClass_str* cmNetNoteSelectClassCons( cmDspCtx_t* ctx )
2724 2753
 }
2725 2754
 
2726 2755
 
2727
-//==========================================================================================================================================
2756
+//------------------------------------------------------------------------------------------------------------
2757
+//)
2758
+//( { label:cmDspCombFilt file_desc:"Comb and Inverse comb filter." kw:[sunit] }
2728 2759
 enum
2729 2760
 {
2730 2761
   kBypassCfId,
@@ -2840,7 +2871,7 @@ cmDspRC_t _cmDspCombFiltRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
2840 2871
   return rc;
2841 2872
 }
2842 2873
 
2843
-struct cmDspClass_str* cmCombFiltClassCons( cmDspCtx_t* ctx )
2874
+cmDspClass_t* cmCombFiltClassCons( cmDspCtx_t* ctx )
2844 2875
 {
2845 2876
   cmDspClassSetup(&_cmCombFiltDC,ctx,"CombFilt",
2846 2877
     NULL,
@@ -2855,7 +2886,9 @@ struct cmDspClass_str* cmCombFiltClassCons( cmDspCtx_t* ctx )
2855 2886
   return &_cmCombFiltDC;
2856 2887
 }
2857 2888
 
2858
-//==========================================================================================================================================
2889
+//------------------------------------------------------------------------------------------------------------
2890
+//)
2891
+//( { label:cmDspScalarOp file_desc:"Perform arithmetic functions on scalar values." kw:[sunit] }
2859 2892
 enum
2860 2893
 {
2861 2894
   kPortCntSoId,
@@ -3012,7 +3045,7 @@ cmDspRC_t _cmDspScalarOpRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
3012 3045
   return rc;
3013 3046
 }
3014 3047
 
3015
-struct cmDspClass_str* cmScalarOpClassCons( cmDspCtx_t* ctx )
3048
+cmDspClass_t* cmScalarOpClassCons( cmDspCtx_t* ctx )
3016 3049
 {
3017 3050
   cmDspClassSetup(&_cmScalarOpDC,ctx,"ScalarOp",
3018 3051
     NULL,
@@ -3027,7 +3060,9 @@ struct cmDspClass_str* cmScalarOpClassCons( cmDspCtx_t* ctx )
3027 3060
   return &_cmScalarOpDC;
3028 3061
 }
3029 3062
 
3030
-//==========================================================================================================================================
3063
+//------------------------------------------------------------------------------------------------------------
3064
+//)
3065
+//( { label:cmDspGroupSel file_desc:"Select one group of audio channels from a set of audio channel groups." kw:[sunit] }
3031 3066
 
3032 3067
 enum
3033 3068
 {
@@ -3182,7 +3217,7 @@ cmDspRC_t _cmDspGroupSelRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
3182 3217
   return rc;
3183 3218
 }
3184 3219
 
3185
-struct cmDspClass_str* cmGroupSelClassCons( cmDspCtx_t* ctx )
3220
+cmDspClass_t* cmGroupSelClassCons( cmDspCtx_t* ctx )
3186 3221
 {
3187 3222
   cmDspClassSetup(&_cmGroupSelDC,ctx,"GroupSel",
3188 3223
     NULL,
@@ -3198,7 +3233,9 @@ struct cmDspClass_str* cmGroupSelClassCons( cmDspCtx_t* ctx )
3198 3233
 }
3199 3234
 
3200 3235
 
3201
-//==========================================================================================================================================
3236
+//------------------------------------------------------------------------------------------------------------
3237
+//)
3238
+//( { label:cmDspNofM file_desc:"Select N channels from a set of M channels based on their current gate states." kw:[sunit] }
3202 3239
 
3203 3240
 enum
3204 3241
 {
@@ -3348,7 +3385,7 @@ cmDspRC_t _cmDspAudioNofM_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
3348 3385
   return rc;
3349 3386
 }
3350 3387
 
3351
-struct cmDspClass_str* cmAudioNofMClassCons( cmDspCtx_t* ctx )
3388
+cmDspClass_t* cmAudioNofMClassCons( cmDspCtx_t* ctx )
3352 3389
 {
3353 3390
   cmDspClassSetup(&_cmAudioNofM_DC,ctx,"AudioNofM",
3354 3391
     NULL,
@@ -3365,7 +3402,9 @@ struct cmDspClass_str* cmAudioNofMClassCons( cmDspCtx_t* ctx )
3365 3402
 
3366 3403
 
3367 3404
 
3368
-//==========================================================================================================================================
3405
+//------------------------------------------------------------------------------------------------------------
3406
+//)
3407
+//( { label:cmDspRingMod file_desc:"Ring modulator." kw:[sunit] }
3369 3408
 enum
3370 3409
 {
3371 3410
   kInChCntRmId,
@@ -3467,7 +3506,7 @@ cmDspRC_t _cmDspRingModRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
3467 3506
   return cmDspSetEvent(ctx,inst,evt);
3468 3507
 }
3469 3508
 
3470
-struct cmDspClass_str* cmRingModClassCons( cmDspCtx_t* ctx )
3509
+cmDspClass_t* cmRingModClassCons( cmDspCtx_t* ctx )
3471 3510
 {
3472 3511
   cmDspClassSetup(&_cmRingModDC,ctx,"RingMod",
3473 3512
     NULL,
@@ -3482,7 +3521,9 @@ struct cmDspClass_str* cmRingModClassCons( cmDspCtx_t* ctx )
3482 3521
   return &_cmRingModDC;
3483 3522
 }
3484 3523
 
3485
-//==========================================================================================================================================
3524
+//------------------------------------------------------------------------------------------------------------
3525
+//)
3526
+//( { label:cmDspMsgDelay file_desc:"Delay an arbitrary value." kw:[sunit] }
3486 3527
 enum
3487 3528
 {
3488 3529
   kMaxCntMdId,
@@ -3703,7 +3744,7 @@ cmDspRC_t _cmDspMsgDelayRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
3703 3744
   return rc;
3704 3745
 }
3705 3746
 
3706
-struct cmDspClass_str* cmMsgDelayClassCons( cmDspCtx_t* ctx )
3747
+cmDspClass_t* cmMsgDelayClassCons( cmDspCtx_t* ctx )
3707 3748
 {
3708 3749
   cmDspClassSetup(&_cmMsgDelayDC,ctx,"MsgDelay",
3709 3750
     NULL,
@@ -3718,7 +3759,9 @@ struct cmDspClass_str* cmMsgDelayClassCons( cmDspCtx_t* ctx )
3718 3759
   return &_cmMsgDelayDC;
3719 3760
 }
3720 3761
 
3721
-//==========================================================================================================================================
3762
+//------------------------------------------------------------------------------------------------------------
3763
+//)
3764
+//( { label:cmDspLine file_desc:"Programmable line generator." kw:[sunit] }
3722 3765
 enum
3723 3766
 {
3724 3767
   kBegLnId,
@@ -3874,7 +3917,7 @@ cmDspRC_t _cmDspLineRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* e
3874 3917
   return rc;
3875 3918
 }
3876 3919
 
3877
-struct cmDspClass_str* cmLineClassCons( cmDspCtx_t* ctx )
3920
+cmDspClass_t* cmLineClassCons( cmDspCtx_t* ctx )
3878 3921
 {
3879 3922
   cmDspClassSetup(&_cmLineDC,ctx,"Line",
3880 3923
     NULL,
@@ -3890,7 +3933,10 @@ struct cmDspClass_str* cmLineClassCons( cmDspCtx_t* ctx )
3890 3933
 }
3891 3934
 
3892 3935
 
3893
-//==========================================================================================================================================
3936
+//------------------------------------------------------------------------------------------------------------
3937
+//)
3938
+//( { label:cmDspAdsr file_desc:"ADSR envelope generator." kw:[sunit] }
3939
+
3894 3940
 enum
3895 3941
 {
3896 3942
   kTrigModeAdId,
@@ -4007,14 +4053,12 @@ cmDspRC_t _cmDspAdsrExec( cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
4007 4053
   // HACK HACK HACK HACK
4008 4054
   //
4009 4055
 
4010
-  /*
4011
-  double db  = rms<0.00001 ? -100.0 :  20.0*log10(rms);
4012
-  double dbMax = -15.0;
4013
-  double dbMin = -58.0;
4014
-
4015
-  db = cmMin(dbMax,cmMax(dbMin,db));
4016
-  double scale =  (db - dbMin) / (dbMax-dbMin);
4017
-  */
4056
+  //  double db  = rms<0.00001 ? -100.0 :  20.0*log10(rms);
4057
+  //  double dbMax = -15.0;
4058
+  //  double dbMin = -58.0;
4059
+  //
4060
+  //  db = cmMin(dbMax,cmMax(dbMin,db));
4061
+  //  double scale =  (db - dbMin) / (dbMax-dbMin);
4018 4062
 
4019 4063
   cmReal_t     out    = cmAdsrExec( p->p, cmDspSamplesPerCycle(ctx), gateFl, tscale, ascale );
4020 4064
 
@@ -4083,7 +4127,7 @@ cmDspRC_t _cmDspAdsrRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* e
4083 4127
   return rc;
4084 4128
 }
4085 4129
 
4086
-struct cmDspClass_str* cmAdsrClassCons( cmDspCtx_t* ctx )
4130
+cmDspClass_t* cmAdsrClassCons( cmDspCtx_t* ctx )
4087 4131
 {
4088 4132
   cmDspClassSetup(&_cmAdsrDC,ctx,"Adsr",
4089 4133
     NULL,
@@ -4098,7 +4142,9 @@ struct cmDspClass_str* cmAdsrClassCons( cmDspCtx_t* ctx )
4098 4142
   return &_cmAdsrDC;
4099 4143
 }
4100 4144
 
4101
-//==========================================================================================================================================
4145
+//------------------------------------------------------------------------------------------------------------
4146
+//)
4147
+//( { label:cmDspAdsr file_desc:"Audio dynamics compressor." kw:[sunit] }
4102 4148
 enum
4103 4149
 {
4104 4150
   kBypassCmId,
@@ -4251,7 +4297,7 @@ cmDspRC_t _cmDspCompressorRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
4251 4297
   return rc;
4252 4298
 }
4253 4299
 
4254
-struct cmDspClass_str* cmCompressorClassCons( cmDspCtx_t* ctx )
4300
+cmDspClass_t* cmCompressorClassCons( cmDspCtx_t* ctx )
4255 4301
 {
4256 4302
   cmDspClassSetup(&_cmCompressorDC,ctx,"Compressor",
4257 4303
     NULL,
@@ -4266,7 +4312,9 @@ struct cmDspClass_str* cmCompressorClassCons( cmDspCtx_t* ctx )
4266 4312
   return &_cmCompressorDC;
4267 4313
 }
4268 4314
 
4269
-//==========================================================================================================================================
4315
+//------------------------------------------------------------------------------------------------------------
4316
+//)
4317
+//( { label:cmDspBiquad file_desc:"Programmable Biquad EQ filter." kw:[sunit] }
4270 4318
 enum
4271 4319
 {
4272 4320
   kBypassBqId,
@@ -4435,7 +4483,7 @@ cmDspRC_t _cmDspBiQuadEqRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
4435 4483
   return rc;
4436 4484
 }
4437 4485
 
4438
-struct cmDspClass_str* cmBiQuadEqClassCons( cmDspCtx_t* ctx )
4486
+cmDspClass_t* cmBiQuadEqClassCons( cmDspCtx_t* ctx )
4439 4487
 {
4440 4488
   cmDspClassSetup(&_cmBiQuadEqDC,ctx,"BiQuadEq",
4441 4489
     NULL,
@@ -4450,7 +4498,10 @@ struct cmDspClass_str* cmBiQuadEqClassCons( cmDspCtx_t* ctx )
4450 4498
   return &_cmBiQuadEqDC;
4451 4499
 }
4452 4500
 
4453
-//==========================================================================================================================================
4501
+//------------------------------------------------------------------------------------------------------------
4502
+//)
4503
+//( { label:cmDspDistDs file_desc:"Guitar style distortion effect." kw:[sunit] }
4504
+
4454 4505
 enum
4455 4506
 {
4456 4507
   kBypassDsId,
@@ -4593,7 +4644,7 @@ cmDspRC_t _cmDspDistDsRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
4593 4644
   return rc;
4594 4645
 }
4595 4646
 
4596
-struct cmDspClass_str* cmDistDsClassCons( cmDspCtx_t* ctx )
4647
+cmDspClass_t* cmDistDsClassCons( cmDspCtx_t* ctx )
4597 4648
 {
4598 4649
   cmDspClassSetup(&_cmDistDsDC,ctx,"DistDs",
4599 4650
     NULL,
@@ -4608,7 +4659,9 @@ struct cmDspClass_str* cmDistDsClassCons( cmDspCtx_t* ctx )
4608 4659
   return &_cmDistDsDC;
4609 4660
 }
4610 4661
 
4611
-//==========================================================================================================================================
4662
+//------------------------------------------------------------------------------------------------------------
4663
+//)
4664
+//( { label:cmDspDbToLin file_desc:"Convert decibel units to linear units." kw:[sunit] }
4612 4665
 enum
4613 4666
 {
4614 4667
   kInDlId,
@@ -4660,7 +4713,7 @@ cmDspRC_t _cmDspDbToLinRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
4660 4713
   return rc;
4661 4714
 }
4662 4715
 
4663
-struct cmDspClass_str* cmDbToLinClassCons( cmDspCtx_t* ctx )
4716
+cmDspClass_t* cmDbToLinClassCons( cmDspCtx_t* ctx )
4664 4717
 {
4665 4718
   cmDspClassSetup(&_cmDbToLinDC,ctx,"DbToLin",
4666 4719
     NULL,
@@ -4675,7 +4728,10 @@ struct cmDspClass_str* cmDbToLinClassCons( cmDspCtx_t* ctx )
4675 4728
   return &_cmDbToLinDC;
4676 4729
 }
4677 4730
 
4678
-//==========================================================================================================================================
4731
+//------------------------------------------------------------------------------------------------------------
4732
+//)
4733
+//( { label:cmDspNofM2 file_desc:"Pass an N of M possible inputs to the output." kw:[sunit] }
4734
+
4679 4735
 // Pass any N of M inputs
4680 4736
 enum
4681 4737
 {
@@ -5055,7 +5111,7 @@ cmDspRC_t _cmDspNofM_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
5055 5111
   return rc;
5056 5112
 }
5057 5113
 
5058
-struct cmDspClass_str* cmNofMClassCons( cmDspCtx_t* ctx )
5114
+cmDspClass_t* cmNofMClassCons( cmDspCtx_t* ctx )
5059 5115
 {
5060 5116
   cmDspClassSetup(&_cmNofM_DC,ctx,"NofM",
5061 5117
     NULL,
@@ -5071,7 +5127,9 @@ struct cmDspClass_str* cmNofMClassCons( cmDspCtx_t* ctx )
5071 5127
 }
5072 5128
 
5073 5129
 
5074
-//==========================================================================================================================================
5130
+//------------------------------------------------------------------------------------------------------------
5131
+//)
5132
+//( { label:cmDsp1ofN file_desc:"Pass 1 or N possible inputs to the output." kw:[sunit] }
5075 5133
 
5076 5134
 enum
5077 5135
 {
@@ -5247,7 +5305,7 @@ cmDspRC_t _cmDsp1ofN_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
5247 5305
   return rc;
5248 5306
 }
5249 5307
 
5250
-struct cmDspClass_str* cm1ofNClassCons( cmDspCtx_t* ctx )
5308
+cmDspClass_t* cm1ofNClassCons( cmDspCtx_t* ctx )
5251 5309
 {
5252 5310
   cmDspClassSetup(&_cm1ofN_DC,ctx,"1ofN",
5253 5311
     NULL,
@@ -5262,7 +5320,10 @@ struct cmDspClass_str* cm1ofNClassCons( cmDspCtx_t* ctx )
5262 5320
   return &_cm1ofN_DC;
5263 5321
 }
5264 5322
 
5265
-//==========================================================================================================================================
5323
+//------------------------------------------------------------------------------------------------------------
5324
+//)
5325
+//( { label:cmDsp1Up file_desc:"Send 'true' on the selected channel and 'false' on the deselected channel." kw:[sunit] }
5326
+
5266 5327
 // Send a 'true' out on the selected channel.
5267 5328
 // Send a 'false' out on the deselected channel.
5268 5329
 enum
@@ -5358,7 +5419,7 @@ cmDspRC_t _cmDsp1Up_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* e
5358 5419
   return rc;
5359 5420
 }
5360 5421
 
5361
-struct cmDspClass_str* cm1UpClassCons( cmDspCtx_t* ctx )
5422
+cmDspClass_t* cm1UpClassCons( cmDspCtx_t* ctx )
5362 5423
 {
5363 5424
   cmDspClassSetup(&_cm1Up_DC,ctx,"1Up",
5364 5425
     NULL,
@@ -5373,8 +5434,10 @@ struct cmDspClass_str* cm1UpClassCons( cmDspCtx_t* ctx )
5373 5434
   return &_cm1Up_DC;
5374 5435
 }
5375 5436
 
5376
-//==========================================================================================================================================
5377
-// Convert a 'true'/'false' gate to an 'on'/'off' symbol
5437
+//------------------------------------------------------------------------------------------------------------
5438
+//)
5439
+//( { label:cmDspGateToSym file_desc:"Convert a 'true'/'false' gate to an 'on'/'off' symbol." kw:[sunit] }
5440
+// 
5378 5441
 enum
5379 5442
 {
5380 5443
   kOnSymGsId,
@@ -5456,7 +5519,7 @@ cmDspRC_t _cmDspGateToSym_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
5456 5519
   return rc;
5457 5520
 }
5458 5521
 
5459
-struct cmDspClass_str* cmGateToSymClassCons( cmDspCtx_t* ctx )
5522
+cmDspClass_t* cmGateToSymClassCons( cmDspCtx_t* ctx )
5460 5523
 {
5461 5524
   cmDspClassSetup(&_cmGateToSym_DC,ctx,"GateToSym",
5462 5525
     NULL,
@@ -5471,7 +5534,9 @@ struct cmDspClass_str* cmGateToSymClassCons( cmDspCtx_t* ctx )
5471 5534
   return &_cmGateToSym_DC;
5472 5535
 }
5473 5536
 
5474
-//==========================================================================================================================================
5537
+//------------------------------------------------------------------------------------------------------------
5538
+//)
5539
+//( { label:cmDspPortToSym file_desc:"Send a pre-defined symbol every time a message arrives a given input port." kw:[sunit] }
5475 5540
 enum
5476 5541
 {
5477 5542
   kOutPtsId,
@@ -5571,7 +5636,7 @@ cmDspRC_t _cmDspPortToSym_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
5571 5636
   return rc;
5572 5637
 }
5573 5638
 
5574
-struct cmDspClass_str* cmPortToSymClassCons( cmDspCtx_t* ctx )
5639
+cmDspClass_t* cmPortToSymClassCons( cmDspCtx_t* ctx )
5575 5640
 {
5576 5641
   cmDspClassSetup(&_cmPortToSym_DC,ctx,"PortToSym",
5577 5642
     NULL,
@@ -5586,7 +5651,9 @@ struct cmDspClass_str* cmPortToSymClassCons( cmDspCtx_t* ctx )
5586 5651
   return &_cmPortToSym_DC;
5587 5652
 }
5588 5653
 
5589
-//==========================================================================================================================================
5654
+//------------------------------------------------------------------------------------------------------------
5655
+//)
5656
+//( { label:cmDspRouter file_desc:"Route the input value to one of multiple output ports." kw:[sunit] }
5590 5657
  
5591 5658
 enum
5592 5659
 {
@@ -5729,13 +5796,11 @@ cmDspRC_t _cmDspRouter_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
5729 5796
     return kOkDspRC;
5730 5797
   } 
5731 5798
 
5732
-  /*
5733
-  if( evt->dstVarId == kOutChIdxRtId && cmDsvGetUInt(evt->valuePtr) < p->oChCnt )
5734
-  {
5735
-    const cmChar_t* symLbl = cmSymTblLabel(ctx->stH,inst->symId);
5736
-    cmDspInstErr(ctx,inst,kOkDspRC,"Router: ch:%i %s\n",cmDsvGetUInt(evt->valuePtr),symLbl==NULL?"":symLbl);
5737
-  }
5738
-  */
5799
+//  if( evt->dstVarId == kOutChIdxRtId && cmDsvGetUInt(evt->valuePtr) < p->oChCnt )
5800
+//  {
5801
+//    const cmChar_t* symLbl = cmSymTblLabel(ctx->stH,inst->symId);
5802
+//    cmDspInstErr(ctx,inst,kOkDspRC,"Router: ch:%i %s\n",cmDsvGetUInt(evt->valuePtr),symLbl==NULL?"":symLbl);
5803
+//  }
5739 5804
   
5740 5805
   // store the incoming value
5741 5806
   if( evt->dstVarId < p->baseBaseOutRtId )
@@ -5763,7 +5828,7 @@ cmDspRC_t _cmDspRouter_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
5763 5828
   return rc;
5764 5829
 }
5765 5830
 
5766
-struct cmDspClass_str* cmRouterClassCons( cmDspCtx_t* ctx )
5831
+cmDspClass_t* cmRouterClassCons( cmDspCtx_t* ctx )
5767 5832
 {
5768 5833
   cmDspClassSetup(&_cmRouter_DC,ctx,"Router",
5769 5834
     NULL,
@@ -5778,7 +5843,10 @@ struct cmDspClass_str* cmRouterClassCons( cmDspCtx_t* ctx )
5778 5843
   return &_cmRouter_DC;
5779 5844
 }
5780 5845
 
5781
-//==========================================================================================================================================
5846
+//------------------------------------------------------------------------------------------------------------
5847
+//)
5848
+//( { label:cmDspAvailCh file_desc:"Track active an inactive processing channels." kw:[sunit] }
5849
+//
5782 5850
 // Purpose: AvailCh can be used to implement a channel switching circuit.
5783 5851
 // 
5784 5852
 // Inputs:
@@ -6061,7 +6129,7 @@ cmDspRC_t _cmDspAvailCh_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
6061 6129
   return rc;
6062 6130
 }
6063 6131
 
6064
-struct cmDspClass_str* cmAvailChClassCons( cmDspCtx_t* ctx )
6132
+cmDspClass_t* cmAvailChClassCons( cmDspCtx_t* ctx )
6065 6133
 {
6066 6134
   cmDspClassSetup(&_cmAvailCh_DC,ctx,"AvailCh",
6067 6135
     NULL,
@@ -6077,7 +6145,9 @@ struct cmDspClass_str* cmAvailChClassCons( cmDspCtx_t* ctx )
6077 6145
 }
6078 6146
 
6079 6147
  
6080
-//==========================================================================================================================================
6148
+//------------------------------------------------------------------------------------------------------------
6149
+//)
6150
+//( { label:cmDspPreset file_desc:"Store and recall preset.  Show a preset list user interface unit." kw:[sunit] }
6081 6151
  
6082 6152
 enum
6083 6153
 {
@@ -6333,7 +6403,7 @@ cmDspRC_t _cmDspPreset_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
6333 6403
   return rc;
6334 6404
 }
6335 6405
 
6336
-struct cmDspClass_str* cmPresetClassCons( cmDspCtx_t* ctx )
6406
+cmDspClass_t* cmPresetClassCons( cmDspCtx_t* ctx )
6337 6407
 {
6338 6408
   cmDspClassSetup(&_cmPreset_DC,ctx,"Preset",
6339 6409
     NULL,
@@ -6349,7 +6419,9 @@ struct cmDspClass_str* cmPresetClassCons( cmDspCtx_t* ctx )
6349 6419
 }
6350 6420
 
6351 6421
  
6352
-//==========================================================================================================================================
6422
+//------------------------------------------------------------------------------------------------------------
6423
+//)
6424
+//( { label:cmDspBcastSym file_desc:"Broadcast a symbol/value to all units registered to listen for the symbol." kw:[sunit] }
6353 6425
 
6354 6426
 enum
6355 6427
 {
@@ -6412,7 +6484,7 @@ cmDspRC_t _cmDspBcastSym_Recv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt
6412 6484
   return rc;
6413 6485
 }
6414 6486
 
6415
-struct cmDspClass_str* cmBcastSymClassCons( cmDspCtx_t* ctx )
6487
+cmDspClass_t* cmBcastSymClassCons( cmDspCtx_t* ctx )
6416 6488
 {
6417 6489
   cmDspClassSetup(&_cmBcastSym_DC,ctx,"BcastSym",
6418 6490
     NULL,
@@ -6427,7 +6499,9 @@ struct cmDspClass_str* cmBcastSymClassCons( cmDspCtx_t* ctx )
6427 6499
   return &_cmBcastSym_DC;
6428 6500
 }
6429 6501
 
6430
-//==========================================================================================================================================
6502
+//------------------------------------------------------------------------------------------------------------
6503
+//)
6504
+//( { label:cmDspSegLine file_desc:"Line segment generator." kw:[sunit] }
6431 6505
 enum
6432 6506
 {
6433 6507
   kRsrcSlId,
@@ -6545,7 +6619,7 @@ cmDspRC_t _cmDspSegLineRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
6545 6619
   return rc;
6546 6620
 }
6547 6621
 
6548
-struct cmDspClass_str* cmSegLineClassCons( cmDspCtx_t* ctx )
6622
+cmDspClass_t* cmSegLineClassCons( cmDspCtx_t* ctx )
6549 6623
 {
6550 6624
   cmDspClassSetup(&_cmSegLineDC,ctx,"SegLine",
6551 6625
     NULL,
@@ -6560,3 +6634,4 @@ struct cmDspClass_str* cmSegLineClassCons( cmDspCtx_t* ctx )
6560 6634
   return &_cmSegLineDC;
6561 6635
 }
6562 6636
 
6637
+//)

+ 234
- 208
dsp/cmDspKr.c View File

@@ -18,6 +18,8 @@
18 18
 #include "cmThread.h"
19 19
 #include "cmUdpPort.h"
20 20
 #include "cmUdpNet.h"
21
+//( { file_desc:"'snap' audio effects performance analysis units." kw:[snap]}
22
+
21 23
 #include "cmTime.h"
22 24
 #include "cmAudioSys.h"
23 25
 #include "cmDspCtx.h"
@@ -45,6 +47,10 @@
45 47
 #include "cmSyncRecd.h"
46 48
 #include "cmTakeSeqBldr.h"
47 49
 
50
+//------------------------------------------------------------------------------------------------------------
51
+//)
52
+//( { label:cmDspKr file_desc:"Spectral non-linear distortion effect." kw:[sunit] }
53
+
48 54
 enum
49 55
 {
50 56
   kWndSmpCntKrId,
@@ -71,8 +77,6 @@ typedef struct
71 77
 cmDspClass_t _cmKrDC;
72 78
 
73 79
 
74
-//==========================================================================================================================================
75
-
76 80
 cmDspInst_t*  _cmDspKrAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl )
77 81
 {
78 82
   cmDspVarArg_t args[] =
@@ -262,7 +266,7 @@ cmDspRC_t _cmDspKrRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t* evt
262 266
   return rc;
263 267
 }
264 268
 
265
-struct cmDspClass_str* cmKrClassCons( cmDspCtx_t* ctx )
269
+cmDspClass_t* cmKrClassCons( cmDspCtx_t* ctx )
266 270
 {
267 271
   cmDspClassSetup(&_cmKrDC,ctx,"Kr",
268 272
     NULL,
@@ -277,9 +281,9 @@ struct cmDspClass_str* cmKrClassCons( cmDspCtx_t* ctx )
277 281
   return &_cmKrDC;
278 282
 }
279 283
 
280
-
281
-//==========================================================================================================================================
282
-// Time Line UI Object
284
+//------------------------------------------------------------------------------------------------------------
285
+//)
286
+//( { label:cmDspTimeLine file_desc:"Time line user interface unit." kw:[sunit] }
283 287
 
284 288
 enum
285 289
 {
@@ -446,7 +450,7 @@ cmDspRC_t _cmDspTimeLineRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
446 450
   return kOkDspRC;
447 451
 }
448 452
 
449
-struct cmDspClass_str* cmTimeLineClassCons( cmDspCtx_t* ctx )
453
+cmDspClass_t* cmTimeLineClassCons( cmDspCtx_t* ctx )
450 454
 {
451 455
   cmDspClassSetup(&_cmTimeLineDC,ctx,"TimeLine",
452 456
     NULL,
@@ -461,8 +465,9 @@ struct cmDspClass_str* cmTimeLineClassCons( cmDspCtx_t* ctx )
461 465
   return &_cmTimeLineDC;
462 466
 }
463 467
 
464
-//==========================================================================================================================================
465
-// Score UI Object
468
+//------------------------------------------------------------------------------------------------------------
469
+//)
470
+//( { label:cmDspScore file_desc:"Musical score user interface unit." kw:[sunit] }
466 471
 
467 472
 enum
468 473
 {
@@ -637,7 +642,7 @@ cmDspRC_t _cmDspScoreRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
637 642
   return kOkDspRC;
638 643
 }
639 644
 
640
-struct cmDspClass_str* cmScoreClassCons( cmDspCtx_t* ctx )
645
+cmDspClass_t* cmScoreClassCons( cmDspCtx_t* ctx )
641 646
 {
642 647
   cmDspClassSetup(&_cmScoreDC,ctx,"Score",
643 648
     NULL,
@@ -652,8 +657,9 @@ struct cmDspClass_str* cmScoreClassCons( cmDspCtx_t* ctx )
652 657
   return &_cmScoreDC;
653 658
 }
654 659
 
655
-//==========================================================================================================================================
656
-// MIDI File Player
660
+//------------------------------------------------------------------------------------------------------------
661
+//)
662
+//( { label:cmDspMidiFilePlay file_desc:"MIDI file player." kw:[sunit] }
657 663
 
658 664
 enum
659 665
 {
@@ -684,14 +690,12 @@ typedef struct
684 690
   bool          errFl;
685 691
 } cmDspMidiFilePlay_t;
686 692
 
687
-/*
688
-  'bsi' and 'esi' give the starting and ending sample for MIDI file playback.
689
-  These indexes are relative to the start of the file.
690
-  When the player recieves a 'start' msg it sets the current sample index
691
-  'si' to 'bsi' and begins scanning for the next note to play.  
692
-  On each call to the _cmDspMidiFilePlayExec() msgs that fall in the interval
693
-  si:si+sPc-1 will be transmitted.  (where sPc are the number of samples per DSP cycle).
694
- */
693
+//  'bsi' and 'esi' give the starting and ending sample for MIDI file playback.
694
+//  These indexes are relative to the start of the file.
695
+//  When the player recieves a 'start' msg it sets the current sample index
696
+//  'si' to 'bsi' and begins scanning for the next note to play.  
697
+//  On each call to the _cmDspMidiFilePlayExec() msgs that fall in the interval
698
+//  si:si+sPc-1 will be transmitted.  (where sPc are the number of samples per DSP cycle).
695 699
 
696 700
 cmDspInst_t*  _cmDspMidiFilePlayAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl )
697 701
 {
@@ -866,7 +870,7 @@ cmDspRC_t _cmDspMidiFilePlayRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDsp
866 870
   return kOkDspRC;
867 871
 }
868 872
 
869
-struct cmDspClass_str* cmMidiFilePlayClassCons( cmDspCtx_t* ctx )
873
+cmDspClass_t* cmMidiFilePlayClassCons( cmDspCtx_t* ctx )
870 874
 {
871 875
   cmDspClassSetup(&_cmMidiFilePlayDC,ctx,"MidiFilePlay",
872 876
     NULL,
@@ -881,7 +885,10 @@ struct cmDspClass_str* cmMidiFilePlayClassCons( cmDspCtx_t* ctx )
881 885
   return &_cmMidiFilePlayDC;
882 886
 }
883 887
 
884
-//==========================================================================================================================================
888
+//------------------------------------------------------------------------------------------------------------
889
+//)
890
+//( { label:cmDspScFol file_desc:"MIDI performance score follower." kw:[sunit] }
891
+
885 892
 enum
886 893
 {
887 894
   kFnSfId,
@@ -1003,27 +1010,25 @@ void _cmScFolMatcherCb( cmScMatcher* p, void* arg, cmScMatcherResult_t* rp )
1003 1010
       if(ap->sfp->smp->set[i].value != DBL_MAX )
1004 1011
       {
1005 1012
 
1006
-        /*
1007
-        switch( ap->sfp->smp->set[i].sp->varId )
1008
-        {
1009
-          case kEvenVarScId:
1010
-            cmDspSetDouble(ap->ctx,inst,kEvenSfId,ap->sfp->smp->set[i].value);
1011
-            break;
1012
-
1013
-          case kDynVarScId:
1014
-            cmDspSetDouble(ap->ctx,inst,kDynSfId,ap->sfp->smp->set[i].value);
1015
-            break;
1016
-
1017
-          case kTempoVarScId:
1018
-            cmDspSetDouble(ap->ctx,inst,kTempoSfId,ap->sfp->smp->set[i].value);
1019
-            break;
1020
-
1021
-          default:
1022
-            { assert(0); }
1023
-        }           
1024
-
1025
-        cmDspSetDouble(ap->ctx,inst,kCostSfId,ap->sfp->smp->set[i].match_cost);
1026
-        */
1013
+//        switch( ap->sfp->smp->set[i].sp->varId )
1014
+//        {
1015
+//          case kEvenVarScId:
1016
+//            cmDspSetDouble(ap->ctx,inst,kEvenSfId,ap->sfp->smp->set[i].value);
1017
+//            break;
1018
+//
1019
+//          case kDynVarScId:
1020
+//            cmDspSetDouble(ap->ctx,inst,kDynSfId,ap->sfp->smp->set[i].value);
1021
+//            break;
1022
+//
1023
+//          case kTempoVarScId:
1024
+//            cmDspSetDouble(ap->ctx,inst,kTempoSfId,ap->sfp->smp->set[i].value);
1025
+//            break;
1026
+//
1027
+//          default:
1028
+//            { assert(0); }
1029
+//        }           
1030
+//
1031
+//        cmDspSetDouble(ap->ctx,inst,kCostSfId,ap->sfp->smp->set[i].match_cost);
1027 1032
 
1028 1033
         // Set the values in the global variable storage
1029 1034
         cmDspValue_t vv,cv;
@@ -1051,15 +1056,13 @@ void _cmScFolMatcherCb( cmScMatcher* p, void* arg, cmScMatcherResult_t* rp )
1051 1056
 
1052 1057
       }
1053 1058
 
1054
-    /*
1055
-    // trigger 'section' starts 
1056
-    for(i=ap->sfp->smp->vsli; i<ap->sfp->smp->nsli; ++i)
1057
-    {
1058
-      const cmScoreLoc_t* locPtr = cmScoreLoc(ap->sfp->smp->mp->scH,i);
1059
-      if( locPtr->begSectPtr != NULL )
1060
-        cmDspSetUInt(ap->ctx,inst,kSectIndexSfId,locPtr->begSectPtr->index);
1061
-    }
1062
-    */
1059
+//    // trigger 'section' starts 
1060
+//    for(i=ap->sfp->smp->vsli; i<ap->sfp->smp->nsli; ++i)
1061
+//    {
1062
+//      const cmScoreLoc_t* locPtr = cmScoreLoc(ap->sfp->smp->mp->scH,i);
1063
+//      if( locPtr->begSectPtr != NULL )
1064
+//        cmDspSetUInt(ap->ctx,inst,kSectIndexSfId,locPtr->begSectPtr->index);
1065
+//    }
1063 1066
   }
1064 1067
 }
1065 1068
 
@@ -1184,7 +1187,7 @@ cmDspRC_t _cmDspScFolRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
1184 1187
   return rc;
1185 1188
 }
1186 1189
 
1187
-struct cmDspClass_str* cmScFolClassCons( cmDspCtx_t* ctx )
1190
+cmDspClass_t* cmScFolClassCons( cmDspCtx_t* ctx )
1188 1191
 {
1189 1192
   cmDspClassSetup(&_cmScFolDC,ctx,"ScFol",
1190 1193
     NULL,
@@ -1199,7 +1202,9 @@ struct cmDspClass_str* cmScFolClassCons( cmDspCtx_t* ctx )
1199 1202
   return &_cmScFolDC;
1200 1203
 }
1201 1204
 
1202
-//==========================================================================================================================================
1205
+//------------------------------------------------------------------------------------------------------------
1206
+//)
1207
+//( { label:cmDspScMod file_desc:"Score driven parameter automation." kw:[sunit] }
1203 1208
 
1204 1209
 enum
1205 1210
 {
@@ -1385,7 +1390,7 @@ cmDspRC_t _cmDspScModExec(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
1385 1390
   return rc;
1386 1391
 }
1387 1392
 
1388
-struct cmDspClass_str* cmScModClassCons( cmDspCtx_t* ctx )
1393
+cmDspClass_t* cmScModClassCons( cmDspCtx_t* ctx )
1389 1394
 {
1390 1395
   cmDspClassSetup(&_cmModulatorDC,ctx,"ScMod",
1391 1396
     NULL,
@@ -1400,7 +1405,9 @@ struct cmDspClass_str* cmScModClassCons( cmDspCtx_t* ctx )
1400 1405
   return &_cmModulatorDC;
1401 1406
 }
1402 1407
 
1403
-//==========================================================================================================================================
1408
+//------------------------------------------------------------------------------------------------------------
1409
+//)
1410
+//( { label:cmDspGSwitch file_desc:"Route all inputs to one of a group of outputs." kw:[sunit] }
1404 1411
 
1405 1412
 enum
1406 1413
 {
@@ -1583,7 +1590,7 @@ cmDspRC_t _cmDspGSwitchRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
1583 1590
 }
1584 1591
 
1585 1592
 
1586
-struct cmDspClass_str* cmGSwitchClassCons( cmDspCtx_t* ctx )
1593
+cmDspClass_t* cmGSwitchClassCons( cmDspCtx_t* ctx )
1587 1594
 {
1588 1595
   cmDspClassSetup(&_cmGSwitchDC,ctx,"GSwitch",
1589 1596
     NULL,
@@ -1599,7 +1606,9 @@ struct cmDspClass_str* cmGSwitchClassCons( cmDspCtx_t* ctx )
1599 1606
 }
1600 1607
 
1601 1608
 
1602
-//==========================================================================================================================================
1609
+//------------------------------------------------------------------------------------------------------------
1610
+//)
1611
+//( { label:cmDspScaleRange file_desc:"Offset and scale a scalar value." kw:[sunit] }
1603 1612
 
1604 1613
 enum
1605 1614
 {
@@ -1684,7 +1693,7 @@ cmDspRC_t _cmDspScaleRangeRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
1684 1693
 }
1685 1694
 
1686 1695
 
1687
-struct cmDspClass_str* cmScaleRangeClassCons( cmDspCtx_t* ctx )
1696
+cmDspClass_t* cmScaleRangeClassCons( cmDspCtx_t* ctx )
1688 1697
 {
1689 1698
   cmDspClassSetup(&_cmScaleRangeDC,ctx,"ScaleRange",
1690 1699
     NULL,
@@ -1700,7 +1709,9 @@ struct cmDspClass_str* cmScaleRangeClassCons( cmDspCtx_t* ctx )
1700 1709
 }
1701 1710
 
1702 1711
 
1703
-//==========================================================================================================================================
1712
+//------------------------------------------------------------------------------------------------------------
1713
+//)
1714
+//( { label:cmDspActiveMeas file_desc:"Issue stored parameter values at specified score locations." kw:[sunit] }
1704 1715
 
1705 1716
 enum
1706 1717
 {
@@ -1730,12 +1741,10 @@ typedef struct cmDspAmRecd_str
1730 1741
 } cmDspAmRecd_t;
1731 1742
 
1732 1743
 
1733
-/*
1734
-int cmDspActiveMeasRecdCompare(const void * p0, const void * p1)
1735
-{
1736
-  return ((int)((cmDspActiveMeasRecd_t*)p0)->loc) - (int)(((cmDspActiveMeasRecd_t*)p1)->loc);
1737
-}
1738
-*/
1744
+//int cmDspActiveMeasRecdCompare(const void * p0, const void * p1)
1745
+//{
1746
+//  return ((int)((cmDspActiveMeasRecd_t*)p0)->loc) - (int)(((cmDspActiveMeasRecd_t*)p1)->loc);
1747
+//}
1739 1748
 
1740 1749
 typedef struct
1741 1750
 {
@@ -1985,96 +1994,94 @@ cmDspRC_t _cmDspActiveMeasRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
1985 1994
 
1986 1995
   }
1987 1996
 
1988
-  /*
1989
-  switch( evt->dstVarId )
1990
-  {
1991
-    case kSflocAmId:
1992
-      if( p->nextFullIdx != cmInvalidIdx )
1993
-      {
1994
-        // get the recv'd score location
1995
-        unsigned sflocIdx = cmDspUInt(inst,kSflocAmId);
1996
-
1997
-        unsigned prvLoc = cmInvalidIdx;
1998
-
1999
-        // for each remaining avail record
2000
-        for(; p->nextFullIdx < p->nextEmptyIdx; p->nextFullIdx++)
2001
-        {
2002
-          cmDspActiveMeasRecd_t* r = p->array + p->nextFullIdx;
2003
-
2004
-          // if this records score location is after the recv'd score loc then we're done
2005
-          if( r->loc > sflocIdx )
2006
-            break;
2007
-
2008
-          // deterimine the records type
2009
-          unsigned varId = cmInvalidId;
2010
-          switch( r->type )
2011
-          {
2012
-            case kEvenVarScId:   varId = kEvenAmId;  break;
2013
-            case kDynVarScId:    varId = kDynAmId;   break;
2014
-            case kTempoVarScId:  varId = kTempoAmId; break;
2015
-            default:
2016
-              { assert(0); }
2017
-          }
2018
-
2019
-          // if this score location has not yet been sent then send it now
2020
-          if( prvLoc != r->loc )
2021
-            cmDspSetUInt(ctx,inst,kScLocAmId,r->loc);
2022
-
2023
-          // transmit the records value and cost
2024
-          cmDspSetDouble(ctx,inst,varId,r->value);
2025
-          cmDspSetDouble(ctx,inst,kCostAmId,r->cost);
2026
-
2027
-          prvLoc = r->loc;
2028
-        } 
2029
-        
2030
-
2031
-      }
2032
-      break;
2033
-
2034
-    case kCmdAmId:
2035
-      {
2036
-        unsigned cmdSymId = cmDspSymbol(inst,kCmdAmId);
2037
-
2038
-        if( cmdSymId == p->addSymId )
2039
-        {
2040
-          if( p->nextEmptyIdx >= p->cnt )
2041
-            cmDspInstErr(ctx,inst,kProcFailDspRC,"The active measurement list is full cnt=%i.",p->cnt);
2042
-          else
2043
-          {
2044
-            cmDspActiveMeasRecd_t* r = p->array + p->nextEmptyIdx;
2045
-            r->loc   = cmDspUInt(  inst,kLocAmId);
2046
-            r->type  = cmDspUInt(  inst,kTypeAmId);
2047
-            r->value = cmDspDouble(inst,kValueAmId);
2048
-            r->cost  = cmDspDouble(inst,kCstAmId);
2049
-            p->nextEmptyIdx += 1;
2050
-
2051
-            qsort(p->array,p->nextEmptyIdx,sizeof(p->array[0]),cmDspActiveMeasRecdCompare);
2052
-
2053
-            if( p->nextEmptyIdx == 1 && p->nextFullIdx == cmInvalidIdx )
2054
-              p->nextFullIdx = 0;
2055
-
2056
-          }
2057
-        }
2058
-          
2059
-        if( cmdSymId == p->clearSymId )
2060
-          rc = _cmDspActiveMeasClear(ctx,p);
2061
-        else
2062
-          if( cmdSymId == p->printSymId )
2063
-            rc = _cmDspActiveMeasPrint(ctx,p);
2064
-          else
2065
-            if(cmdSymId == p->rewindSymId )
2066
-              p->nextFullIdx = 0;
2067
-      }
2068
-      break;
2069
-
2070
-  }
2071
-  */
1997
+  //  switch( evt->dstVarId )
1998
+  //  {
1999
+  //    case kSflocAmId:
2000
+  //      if( p->nextFullIdx != cmInvalidIdx )
2001
+  //      {
2002
+  //        // get the recv'd score location
2003
+  //        unsigned sflocIdx = cmDspUInt(inst,kSflocAmId);
2004
+  //
2005
+  //        unsigned prvLoc = cmInvalidIdx;
2006
+  //
2007
+  //        // for each remaining avail record
2008
+  //        for(; p->nextFullIdx < p->nextEmptyIdx; p->nextFullIdx++)
2009
+  //        {
2010
+  //          cmDspActiveMeasRecd_t* r = p->array + p->nextFullIdx;
2011
+  //
2012
+  //          // if this records score location is after the recv'd score loc then we're done
2013
+  //          if( r->loc > sflocIdx )
2014
+  //            break;
2015
+  //
2016
+  //          // deterimine the records type
2017
+  //          unsigned varId = cmInvalidId;
2018
+  //          switch( r->type )
2019
+  //          {
2020
+  //            case kEvenVarScId:   varId = kEvenAmId;  break;
2021
+  //            case kDynVarScId:    varId = kDynAmId;   break;
2022
+  //            case kTempoVarScId:  varId = kTempoAmId; break;
2023
+  //            default:
2024
+  //              { assert(0); }
2025
+  //          }
2026
+  //
2027
+  //          // if this score location has not yet been sent then send it now
2028
+  //          if( prvLoc != r->loc )
2029
+  //            cmDspSetUInt(ctx,inst,kScLocAmId,r->loc);
2030
+  //
2031
+  //          // transmit the records value and cost
2032
+  //          cmDspSetDouble(ctx,inst,varId,r->value);
2033
+  //          cmDspSetDouble(ctx,inst,kCostAmId,r->cost);
2034
+  //
2035
+  //          prvLoc = r->loc;
2036
+  //        } 
2037
+  //        
2038
+  //
2039
+  //      }
2040
+  //      break;
2041
+  //
2042
+  //    case kCmdAmId:
2043
+  //      {
2044
+  //        unsigned cmdSymId = cmDspSymbol(inst,kCmdAmId);
2045
+  //
2046
+  //        if( cmdSymId == p->addSymId )
2047
+  //        {
2048
+  //          if( p->nextEmptyIdx >= p->cnt )
2049
+  //            cmDspInstErr(ctx,inst,kProcFailDspRC,"The active measurement list is full cnt=%i.",p->cnt);
2050
+  //          else
2051
+  //          {
2052
+  //            cmDspActiveMeasRecd_t* r = p->array + p->nextEmptyIdx;
2053
+  //            r->loc   = cmDspUInt(  inst,kLocAmId);
2054
+  //            r->type  = cmDspUInt(  inst,kTypeAmId);
2055
+  //            r->value = cmDspDouble(inst,kValueAmId);
2056
+  //            r->cost  = cmDspDouble(inst,kCstAmId);
2057
+  //            p->nextEmptyIdx += 1;
2058
+  //
2059
+  //            qsort(p->array,p->nextEmptyIdx,sizeof(p->array[0]),cmDspActiveMeasRecdCompare);
2060
+  //
2061
+  //            if( p->nextEmptyIdx == 1 && p->nextFullIdx == cmInvalidIdx )
2062
+  //              p->nextFullIdx = 0;
2063
+  //
2064
+  //          }
2065
+  //        }
2066
+  //          
2067
+  //        if( cmdSymId == p->clearSymId )
2068
+  //          rc = _cmDspActiveMeasClear(ctx,p);
2069
+  //        else
2070
+  //          if( cmdSymId == p->printSymId )
2071
+  //            rc = _cmDspActiveMeasPrint(ctx,p);
2072
+  //          else
2073
+  //            if(cmdSymId == p->rewindSymId )
2074
+  //              p->nextFullIdx = 0;
2075
+  //      }
2076
+  //      break;
2077
+  //
2078
+  //  }
2072 2079
 
2073 2080
   return rc;
2074 2081
 }
2075 2082
 
2076 2083
 
2077
-struct cmDspClass_str* cmActiveMeasClassCons( cmDspCtx_t* ctx )
2084
+cmDspClass_t* cmActiveMeasClassCons( cmDspCtx_t* ctx )
2078 2085
 {
2079 2086
   cmDspClassSetup(&_cmActiveMeasDC,ctx,"ActiveMeas",
2080 2087
     NULL,
@@ -2089,33 +2096,35 @@ struct cmDspClass_str* cmActiveMeasClassCons( cmDspCtx_t* ctx )
2089 2096
   return &_cmActiveMeasDC;
2090 2097
 }
2091 2098
 
2092
-//==========================================================================================================================================
2093
-// Audio MIDI Sync
2094
-/*
2095
- Usage:
2096
- 1)  In the program resource file setup a list of sync points.
2097
- 'asmp' refers to a sample offset into the audio file 'af'
2098
- which should match to the midi event index 'mid' in the
2099
- midi file 'mf'.
2100
-
2101
-  amSync :
2102
-  [
2103
-   { af:"af-16" asmp:34735276  mf:"mf-10"  mid:350 }
2104
-   { af:"af-16" asmp:71802194  mf:"mf-10"  mid:787 }
2105
-  ]
2106
-
2107
- 2) Feed the 'fidx' output from a wave table loaded with 'af' into the 'asmp' input port of this amSync object.
2108
-    Feed the 'id' output from the MIDI file player loaded with 'mf' into the 'mid' input port of this amSync object.
2109
-
2110
- 3) Run the players. 
2111
- 4) When the run is complete send any message to the 'sel' port of this amSync object.
2112
-    The 'frm:' field of the printed output gives the difference in samples between
2113
-    MIDI and audio sync points.
2114
-
2115
-    If the value is positive then the MIDI point is after the Audio point.
2116
-    If the value is negative then the MIDI point is before the audio point.
2099
+//------------------------------------------------------------------------------------------------------------
2100
+//)
2101
+//( { label:cmDspAmSync  file_desc:"Calculate MIDI to Audio latency offsets." kw:[sunit] }
2102
+//
2103
+//
2104
+// Usage:
2105
+// 1)  In the program resource file setup a list of sync points.
2106
+// 'asmp' refers to a sample offset into the audio file 'af'
2107
+// which should match to the midi event index 'mid' in the
2108
+// midi file 'mf'.
2109
+//
2110
+//  amSync :
2111
+//  [
2112
+//   { af:"af-16" asmp:34735276  mf:"mf-10"  mid:350 }
2113
+//   { af:"af-16" asmp:71802194  mf:"mf-10"  mid:787 }
2114
+//  ]
2115
+//
2116
+// 2) Feed the 'fidx' output from a wave table loaded with 'af' into the 'asmp' input port of this amSync object.
2117
+//    Feed the 'id' output from the MIDI file player loaded with 'mf' into the 'mid' input port of this amSync object.
2118
+//
2119
+// 3) Run the players. 
2120
+// 4) When the run is complete send any message to the 'sel' port of this amSync object.
2121
+//    The 'frm:' field of the printed output gives the difference in samples between
2122
+//    MIDI and audio sync points.
2123
+//
2124
+//    If the value is positive then the MIDI point is after the Audio point.
2125
+//    If the value is negative then the MIDI point is before the audio point.
2126
+//
2117 2127
 
2118
-*/
2119 2128
 
2120 2129
 enum
2121 2130
 {
@@ -2350,7 +2359,7 @@ cmDspRC_t _cmDspAmSyncRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t*
2350 2359
   return kOkDspRC;
2351 2360
 }
2352 2361
 
2353
-struct cmDspClass_str* cmAmSyncClassCons( cmDspCtx_t* ctx )
2362
+cmDspClass_t* cmAmSyncClassCons( cmDspCtx_t* ctx )
2354 2363
 {
2355 2364
   cmDspClassSetup(&_cmAmSyncDC,ctx,"AmSync",
2356 2365
     NULL,
@@ -2365,7 +2374,10 @@ struct cmDspClass_str* cmAmSyncClassCons( cmDspCtx_t* ctx )
2365 2374
   return &_cmAmSyncDC;
2366 2375
 }
2367 2376
 
2368
-//==========================================================================================================================================
2377
+//------------------------------------------------------------------------------------------------------------
2378
+//)
2379
+//( { label:cmDspNanoMap file_desc:"Control a MIDI synth." kw:[sunit] }
2380
+
2369 2381
 enum
2370 2382
 {
2371 2383
   kPgmNmId,
@@ -2474,7 +2486,7 @@ cmDspRC_t _cmDspNanoMapRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
2474 2486
   return kOkDspRC;
2475 2487
 }
2476 2488
 
2477
-struct cmDspClass_str* cmNanoMapClassCons( cmDspCtx_t* ctx )
2489
+cmDspClass_t* cmNanoMapClassCons( cmDspCtx_t* ctx )
2478 2490
 {
2479 2491
   cmDspClassSetup(&_cmNanoMapDC,ctx,"NanoMap",
2480 2492
     NULL,
@@ -2490,7 +2502,10 @@ struct cmDspClass_str* cmNanoMapClassCons( cmDspCtx_t* ctx )
2490 2502
   return &_cmNanoMapDC;
2491 2503
 }
2492 2504
 
2493
-//==========================================================================================================================================
2505
+//------------------------------------------------------------------------------------------------------------
2506
+//)
2507
+//( { label:cmDspRecdPlay file_desc:"Record audio segments from a live perfromance and play them back at a later time" kw:[sunit] }
2508
+
2494 2509
 enum
2495 2510
 {
2496 2511
   kChCntPrId,
@@ -2850,7 +2865,7 @@ cmDspRC_t _cmDspRecdPlayRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
2850 2865
   return kOkDspRC;
2851 2866
 }
2852 2867
 
2853
-struct cmDspClass_str* cmRecdPlayClassCons( cmDspCtx_t* ctx )
2868
+cmDspClass_t* cmRecdPlayClassCons( cmDspCtx_t* ctx )
2854 2869
 {
2855 2870
   cmDspClassSetup(&_cmRecdPlayDC,ctx,"RecdPlay",
2856 2871
     NULL,
@@ -2866,7 +2881,9 @@ struct cmDspClass_str* cmRecdPlayClassCons( cmDspCtx_t* ctx )
2866 2881
   return &_cmRecdPlayDC;
2867 2882
 }
2868 2883
 
2869
-//==========================================================================================================================================
2884
+//------------------------------------------------------------------------------------------------------------
2885
+//)
2886
+//( { label:cmDspGoertzel file_desc:"Goertzel tone detection filter" kw:[sunit] }
2870 2887
 enum
2871 2888
 {
2872 2889
   kHopFactGrId,
@@ -3025,7 +3042,7 @@ cmDspRC_t _cmDspGoertzelRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
3025 3042
   return kOkDspRC;
3026 3043
 }
3027 3044
 
3028
-struct cmDspClass_str* cmGoertzelClassCons( cmDspCtx_t* ctx )
3045
+cmDspClass_t* cmGoertzelClassCons( cmDspCtx_t* ctx )
3029 3046
 {
3030 3047
   cmDspClassSetup(&_cmGoertzelDC,ctx,"Goertzel",
3031 3048
     NULL,
@@ -3041,7 +3058,10 @@ struct cmDspClass_str* cmGoertzelClassCons( cmDspCtx_t* ctx )
3041 3058
   return &_cmGoertzelDC;
3042 3059
 }
3043 3060
 
3044
-//==========================================================================================================================================
3061
+//------------------------------------------------------------------------------------------------------------
3062
+//)
3063
+//( { label:cmDspSyncRecd file_desc:"Time align a MIDI and associated audio recording" kw:[sunit] }
3064
+
3045 3065
 enum
3046 3066
 {
3047 3067
   kRecdDirSrId,
@@ -3226,7 +3246,7 @@ cmDspRC_t _cmDspSyncRecdRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_
3226 3246
   return rc;
3227 3247
 }
3228 3248
 
3229
-struct cmDspClass_str* cmSyncRecdClassCons( cmDspCtx_t* ctx )
3249
+cmDspClass_t* cmSyncRecdClassCons( cmDspCtx_t* ctx )
3230 3250
 {
3231 3251
   cmDspClassSetup(&_cmSyncRecdDC,ctx,"SyncRecd",
3232 3252
     NULL,
@@ -3243,7 +3263,10 @@ struct cmDspClass_str* cmSyncRecdClassCons( cmDspCtx_t* ctx )
3243 3263
 }
3244 3264
 
3245 3265
 
3246
-//==========================================================================================================================================
3266
+//------------------------------------------------------------------------------------------------------------
3267
+//)
3268
+//( { label:cmDspTakeSeqBldr file_desc:"User interface unit for creating a single sequence from multiple, score aligned, MIDI fragments." kw:[sunit] }
3269
+
3247 3270
 enum
3248 3271
 {
3249 3272
   kFnTsbId,
@@ -3355,7 +3378,7 @@ cmDspRC_t _cmDspTakeSeqBldrRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspE
3355 3378
   return kOkDspRC;
3356 3379
 }
3357 3380
 
3358
-struct cmDspClass_str* cmTakeSeqBldrClassCons( cmDspCtx_t* ctx )
3381
+cmDspClass_t* cmTakeSeqBldrClassCons( cmDspCtx_t* ctx )
3359 3382
 {
3360 3383
   cmDspClassSetup(&_cmTakeSeqBldrDC,ctx,"TakeSeqBldr",
3361 3384
     NULL,
@@ -3374,7 +3397,9 @@ struct cmDspClass_str* cmTakeSeqBldrClassCons( cmDspCtx_t* ctx )
3374 3397
 
3375 3398
 
3376 3399
 
3377
-//==========================================================================================================================================
3400
+//------------------------------------------------------------------------------------------------------------
3401
+//)
3402
+//( { label:cmDspTakeSeqRend file_desc:"User interface unit for graphically rendering the MIDI sequences created by cmDspTakeSeqBldr." kw:[sunit] }
3378 3403
 enum
3379 3404
 {
3380 3405
   kBldrTsrId,
@@ -3576,7 +3601,7 @@ cmDspRC_t _cmDspTakeSeqRendRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspE
3576 3601
   return kOkDspRC;
3577 3602
 }
3578 3603
 
3579
-struct cmDspClass_str* cmTakeSeqRendClassCons( cmDspCtx_t* ctx )
3604
+cmDspClass_t* cmTakeSeqRendClassCons( cmDspCtx_t* ctx )
3580 3605
 {
3581 3606
   cmDspClassSetup(&_cmTakeSeqRendDC,ctx,"TakeSeqRend",
3582 3607
     NULL,
@@ -3593,7 +3618,9 @@ struct cmDspClass_str* cmTakeSeqRendClassCons( cmDspCtx_t* ctx )
3593 3618
 }
3594 3619
 
3595 3620
 
3596
-//==========================================================================================================================================
3621
+//------------------------------------------------------------------------------------------------------------
3622
+//)
3623
+//( { label:cmDspReflectCalc file_desc:"Estimate the time-of-flight of from an acoustic signal from a speaker to a microphone." kw:[sunit] }
3597 3624
 enum
3598 3625
 {
3599 3626
   kLfsrN_RcId,
@@ -3622,13 +3649,11 @@ typedef struct
3622 3649
 cmDspInst_t*  _cmDspReflectCalcAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl )
3623 3650
 {
3624 3651
 
3625
-  /*
3626
-  if( va_cnt !=3 )
3627
-  {
3628
-    cmDspClassErr(ctx,classPtr,kVarArgParseFailDspRC,"The 'ReflectCalc' constructor must have two arguments: a channel count and frequency array.");
3629
-    return NULL;
3630
-  }
3631
-  */
3652
+  //  if( va_cnt !=3 )
3653
+  //  {
3654
+  //    cmDspClassErr(ctx,classPtr,kVarArgParseFailDspRC,"The 'ReflectCalc' constructor must have two arguments: a channel count and frequency array.");
3655
+  //    return NULL;
3656
+  //  }
3632 3657
 
3633 3658
   cmDspReflectCalc_t* p = cmDspInstAllocV(cmDspReflectCalc_t,ctx,classPtr,instSymId,id,storeSymId,va_cnt,vl,
3634 3659
     1,         "lfsrN", kLfsrN_RcId,    0,0, kInDsvFl   | kUIntDsvFl,    "Gold code generator LFSR length",
@@ -3734,7 +3759,7 @@ cmDspRC_t _cmDspReflectCalcRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspE
3734 3759
   return kOkDspRC;
3735 3760
 }
3736 3761
 
3737
-struct cmDspClass_str* cmReflectCalcClassCons( cmDspCtx_t* ctx )
3762
+cmDspClass_t* cmReflectCalcClassCons( cmDspCtx_t* ctx )
3738 3763
 {
3739 3764
   cmDspClassSetup(&_cmReflectCalcDC,ctx,"ReflectCalc",
3740 3765
     NULL,
@@ -3751,7 +3776,9 @@ struct cmDspClass_str* cmReflectCalcClassCons( cmDspCtx_t* ctx )
3751 3776
 }
3752 3777
 
3753 3778
 
3754
-//==========================================================================================================================================
3779
+//------------------------------------------------------------------------------------------------------------
3780
+//)
3781
+//( { label:cmDspEchoCancel file_desc:"Normalized least mean squares echo canceller." kw:[sunit] }
3755 3782
 enum
3756 3783
 {
3757 3784
   kMuEcId,
@@ -3775,13 +3802,11 @@ typedef struct
3775 3802
 cmDspInst_t*  _cmDspEchoCancelAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsigned storeSymId, unsigned instSymId, unsigned id, unsigned va_cnt, va_list vl )
3776 3803
 {
3777 3804
 
3778
-  /*
3779
-  if( va_cnt !=3 )
3780
-  {
3781
-    cmDspClassErr(ctx,classPtr,kVarArgParseFailDspRC,"The 'EchoCancel' constructor must have two arguments: a channel count and frequency array.");
3782
-    return NULL;
3783
-  }
3784
-  */
3805
+  //  if( va_cnt !=3 )
3806
+  //  {
3807
+  //    cmDspClassErr(ctx,classPtr,kVarArgParseFailDspRC,"The 'EchoCancel' constructor must have two arguments: a channel count and frequency array.");
3808
+  //    return NULL;
3809
+  //  }
3785 3810
 
3786 3811
   cmDspEchoCancel_t* p = cmDspInstAllocV(cmDspEchoCancel_t,ctx,classPtr,instSymId,id,storeSymId,va_cnt,vl,
3787 3812
     1,   "mu",     kMuEcId,        0,0, kInDsvFl   | kDoubleDsvFl,   "NLSM mu coefficient.",
@@ -3905,7 +3930,7 @@ cmDspRC_t _cmDspEchoCancelRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEv
3905 3930
   return kOkDspRC;
3906 3931
 }
3907 3932
 
3908
-struct cmDspClass_str* cmEchoCancelClassCons( cmDspCtx_t* ctx )
3933
+cmDspClass_t* cmEchoCancelClassCons( cmDspCtx_t* ctx )
3909 3934
 {
3910 3935
   cmDspClassSetup(&_cmEchoCancelDC,ctx,"EchoCancel",
3911 3936
     NULL,
@@ -3920,3 +3945,4 @@ struct cmDspClass_str* cmEchoCancelClassCons( cmDspCtx_t* ctx )
3920 3945
 
3921 3946
   return &_cmEchoCancelDC;
3922 3947
 }
3948
+//)

+ 4
- 0
dsp/cmDspNet.h View File

@@ -5,6 +5,8 @@
5 5
 extern "C" {
6 6
 #endif
7 7
 
8
+  //( { file_desc:"'snap' distributed host UDP networking implementation." kw:[snap]}
9
+  
8 10
 #define cmDspSys_PARENT_SYM_TBL_BASE_ID 10000
9 11
 #define cmDspSys_AsSubIdx_Zero (0)
10 12
 
@@ -115,6 +117,8 @@ extern "C" {
115 117
 
116 118
   cmDspRC_t _cmDspSysNetSendEvent( cmDspSysH_t h, unsigned dstNetNodeId,  unsigned dstId, const cmDspEvt_t* evt );
117 119
 
120
+  //)
121
+  
118 122
 #ifdef __cplusplus
119 123
    }
120 124
 #endif

+ 150
- 4
dsp/cmDspPgm.c View File

@@ -1,3 +1,4 @@
1
+//( {  file_desc:"'snap' programs." kw:[snap] }
1 2
 #include "cmPrefix.h"
2 3
 #include "cmGlobal.h"
3 4
 #include "cmFloatTypes.h"
@@ -25,7 +26,8 @@
25 26
 #include "cmDspPgm.h"
26 27
 #include "cmDspPgmPP.h"
27 28
 #include "cmDspPgmKr.h"
28
-
29
+//)
30
+//( { label:cmDspPgm_ReflecCalc file_desc:"Acoustic time-of-flight measurement program." kw:[spgm] }
29 31
 
30 32
 cmDspRC_t _cmDspSysPgm_ReflectCalc( cmDspSysH_t h, void** userPtrPtr )
31 33
 {
@@ -71,6 +73,10 @@ cmDspRC_t _cmDspSysPgm_ReflectCalc( cmDspSysH_t h, void** userPtrPtr )
71 73
   return kOkDspRC;
72 74
 }
73 75
 
76
+//------------------------------------------------------------------------------
77
+//)
78
+//( { label:cmDspPgm_SyncRecd file_desc:"Generate MIDI / Audio synchronization data with cmDspSyncRecd." kw:[spgm] }
79
+
74 80
 cmDspRC_t _cmDspSysPgm_SyncRecd(  cmDspSysH_t h, void** userPtrPtr )
75 81
 {
76 82
   cmDspRC_t rc = kOkDspRC;
@@ -115,6 +121,9 @@ cmDspRC_t _cmDspSysPgm_SyncRecd(  cmDspSysH_t h, void** userPtrPtr )
115 121
 
116 122
 }
117 123
 
124
+//------------------------------------------------------------------------------
125
+//)
126
+//( { label:cmDspPgm_MidiFilePlay file_desc:"MIDI file player example program." kw:[spgm] }
118 127
 cmDspRC_t _cmDspSysPgm_MidiFilePlay( cmDspSysH_t h, void** userPtrPtr )
119 128
 {
120 129
   
@@ -198,7 +207,9 @@ cmDspRC_t _cmDspSysPgm_MidiFilePlay( cmDspSysH_t h, void** userPtrPtr )
198 207
 }
199 208
 
200 209
 
201
-
210
+//------------------------------------------------------------------------------
211
+//)
212
+//( { label:cmDspPgm_Midi_Test file_desc:"MIDI input/output example program." kw:[spgm] }
202 213
 cmDspRC_t _cmDspSysPgm_Test_Midi( cmDspSysH_t h, void** userPtrPtr )
203 214
 {
204 215
   cmDspRC_t rc = kOkDspRC;
@@ -250,6 +261,9 @@ cmDspRC_t _cmDspSysPgm_Test_Midi( cmDspSysH_t h, void** userPtrPtr )
250 261
   
251 262
 }
252 263
 
264
+//------------------------------------------------------------------------------
265
+//)
266
+//( { label:cmDspPgm_Stereo_Through file_desc:"Stereo audio through example program." kw:[spgm] }
253 267
 cmDspRC_t _cmDspSysPgm_Stereo_Through( cmDspSysH_t h, void** userPtrPtr )
254 268
 {
255 269
 
@@ -299,6 +313,9 @@ cmDspRC_t _cmDspSysPgm_Stereo_Through( cmDspSysH_t h, void** userPtrPtr )
299 313
   return kOkDspRC;
300 314
 }
301 315
 
316
+//------------------------------------------------------------------------------
317
+//)
318
+//( { label:cmDspPgm_Stereo_Fx file_desc:"Stereo audio effects example program." kw:[spgm] }
302 319
 cmDspRC_t _cmDspSysPgm_Stereo_Fx( cmDspSysH_t h, void** userPtrPtr )
303 320
 {
304 321
   bool useBuiltInFl = true;
@@ -367,6 +384,9 @@ cmDspRC_t _cmDspSysPgm_Stereo_Fx( cmDspSysH_t h, void** userPtrPtr )
367 384
   return kOkDspRC;
368 385
 }
369 386
 
387
+//------------------------------------------------------------------------------
388
+//)
389
+//( { label:cmDspPgm_PlaySine file_desc:"Play a sine signal." kw:[spgm] }
370 390
 cmDspRC_t _cmDspSysPgm_PlaySine( cmDspSysH_t h, void** userPtrPtr )
371 391
 {
372 392
   bool useBuiltInFl = true;
@@ -424,6 +444,9 @@ cmDspRC_t _cmDspSysPgm_PlayFile( cmDspSysH_t h, void** userPtrPtr )
424 444
 }
425 445
 
426 446
 
447
+//------------------------------------------------------------------------------
448
+//)
449
+//( { label:cmDspPgm_MultiOut file_desc:"Play to multiple output channels example program." kw:[spgm] }
427 450
 cmDspRC_t _cmDspSysPgm_MultiOut( cmDspSysH_t h, void** userPtrPtr )
428 451
 {
429 452
   cmDspRC_t    rc           = kOkDspRC;
@@ -486,6 +509,9 @@ cmDspRC_t _cmDspSysPgm_MultiOut( cmDspSysH_t h, void** userPtrPtr )
486 509
   return rc;
487 510
 }
488 511
 
512
+//------------------------------------------------------------------------------
513
+//)
514
+//( { label:cmDspPgm_MultiIn file_desc:"Multiple audio inputs example program." kw:[spgm] }
489 515
 cmDspRC_t _cmDspSysPgm_MultiIn(cmDspSysH_t h, void** userPtrPtr)
490 516
 {
491 517
   int          chCnt = 8;
@@ -516,6 +542,9 @@ cmDspRC_t _cmDspSysPgm_MultiIn(cmDspSysH_t h, void** userPtrPtr)
516 542
 }
517 543
 
518 544
 
545
+//------------------------------------------------------------------------------
546
+//)
547
+//( { label:cmDspPgm_GateDetect file_desc:"Gate detector example program." kw:[spgm] }
519 548
 cmDspRC_t _cmDspSysPgm_GateDetect( cmDspSysH_t h, void** userPtrPtr )
520 549
 {
521 550
   bool            useBuiltInFl = true;
@@ -556,6 +585,9 @@ cmDspRC_t _cmDspSysPgm_GateDetect( cmDspSysH_t h, void** userPtrPtr )
556 585
   return kOkDspRC;
557 586
 }
558 587
 
588
+//------------------------------------------------------------------------------
589
+//)
590
+//( { label:cmDspPgm_Record file_desc:"Record audio to an audio file." kw:[spgm] }
559 591
 cmDspRC_t _cmDspSysPgm_Record(cmDspSysH_t h, void** userPtrPtr)
560 592
 {
561 593
   int          chCnt = 8;
@@ -593,6 +625,9 @@ cmDspRC_t _cmDspSysPgm_Record(cmDspSysH_t h, void** userPtrPtr)
593 625
   return kOkDspRC;
594 626
 }
595 627
 
628
+//------------------------------------------------------------------------------
629
+//)
630
+//( { label:cmDspPgm_PitchShift file_desc:"Pitch-shifter example program." kw:[spgm] }
596 631
 cmDspRC_t _cmDspSysPgm_PitchShiftFile( cmDspSysH_t h, void** userPtrPtr )
597 632
 {
598 633
   bool            useBuiltInFl = true;
@@ -634,6 +669,9 @@ cmDspRC_t _cmDspSysPgm_PitchShiftFile( cmDspSysH_t h, void** userPtrPtr )
634 669
   return kOkDspRC;
635 670
 }
636 671
 
672
+//------------------------------------------------------------------------------
673
+//)
674
+//( { label:cmDspPgm_LoopRecd file_desc:"Loop-recorder example program." kw:[spgm] }
637 675
 cmDspRC_t _cmDspSysPgm_LoopRecd( cmDspSysH_t h, void** userPtrPtr )
638 676
 {
639 677
   bool            useBuiltInFl = true;
@@ -670,6 +708,9 @@ cmDspRC_t _cmDspSysPgm_LoopRecd( cmDspSysH_t h, void** userPtrPtr )
670 708
 
671 709
 
672 710
 
711
+//------------------------------------------------------------------------------
712
+//)
713
+//( { label:cmDspPgm_UiTest file_desc:"User Interface example program." kw:[spgm] }
673 714
 cmDspRC_t _cmDspSysPgm_UiTest(cmDspSysH_t h, void** userPtrPtr )
674 715
 {
675 716
   cmDspRC_t rc        = kOkDspRC;
@@ -716,6 +757,9 @@ cmDspRC_t _cmDspSysPgm_UiTest(cmDspSysH_t h, void** userPtrPtr )
716 757
 
717 758
 }
718 759
 
760
+//------------------------------------------------------------------------------
761
+//)
762
+//( { label:cmDspPgm_Xfade file_desc:"Cross fader example program." kw:[spgm] }
719 763
 cmDspRC_t _cmDspSysPgm_Xfade( cmDspSysH_t h, void** userPtrPtr )
720 764
 {
721 765
   cmDspRC_t rc         = kOkDspRC;
@@ -779,6 +823,9 @@ cmDspRC_t _cmDspSysPgm_Xfade( cmDspSysH_t h, void** userPtrPtr )
779 823
   return cmDspSysLastRC(h);
780 824
 }
781 825
 
826
+//------------------------------------------------------------------------------
827
+//)
828
+//( { label:cmDspPgm_Pgm6 file_desc:"Stereo strectral non-linear distortion example." kw:[spgm] }
782 829
 cmDspRC_t _cmDspSysPgm6( cmDspSysH_t h, void* audioDir )
783 830
 {
784 831
   cmDspRC_t rc        = kOkDspRC;
@@ -917,6 +964,9 @@ cmDspRC_t _cmDspSysPgm6( cmDspSysH_t h, void* audioDir )
917 964
   return cmDspSysLastRC(h);
918 965
 }
919 966
 
967
+//------------------------------------------------------------------------------
968
+//)
969
+//( { label:cmDspPgm_Guitar file_desc:"Similiar to Pgm6." kw:[spgm] }
920 970
 cmDspRC_t _cmDspSysPgmGuitar( cmDspSysH_t h, void** userPtrPtr )
921 971
 {
922 972
   cmDspRC_t rc        = kOkDspRC;
@@ -1056,6 +1106,9 @@ cmDspRC_t _cmDspSysPgmGuitar( cmDspSysH_t h, void** userPtrPtr )
1056 1106
 
1057 1107
 
1058 1108
 
1109
+//------------------------------------------------------------------------------
1110
+//)
1111
+//( { label:cmDspPgm_Pickups0 file_desc:"'fluxo' with loop-record, echo, rectify, and pitch-shift." kw:[spgm fluxo] }
1059 1112
 
1060 1113
 cmDspRC_t _cmDspSysPgm_Pickups0( cmDspSysH_t h, void** userPtrPtr )
1061 1114
 {
@@ -1169,6 +1222,10 @@ cmDspRC_t _cmDspSysPgm_Pickups0( cmDspSysH_t h, void** userPtrPtr )
1169 1222
   return kOkDspRC;
1170 1223
 }
1171 1224
 
1225
+//------------------------------------------------------------------------------
1226
+//)
1227
+//( { label:cmDspPgm_AutoGain file_desc:"'fluxo' channel calibration program." kw:[spgm fluxo] }
1228
+
1172 1229
 #include "cmAudioFile.h"
1173 1230
 #include "cmProcObj.h"
1174 1231
 #include "cmProc.h"
@@ -1414,6 +1471,9 @@ cmDspRC_t _cmDspSysPgm_AutoGain( cmDspSysH_t h, void** userPtrPtr )
1414 1471
   
1415 1472
 }
1416 1473
 
1474
+//------------------------------------------------------------------------------
1475
+//)
1476
+//( { label:cmDspPgm_PickupFxFile file_desc:"'fluxo' noise shapers." kw:[spgm fluxo] }
1417 1477
 cmDspRC_t _cmDspSysPgm_PickupFxFile( cmDspSysH_t h, void** userPtrPtr )
1418 1478
 {
1419 1479
   cmDspRC_t       rc        = kOkDspRC;
@@ -1509,6 +1569,9 @@ cmDspRC_t _cmDspSysPgm_PickupFxFile( cmDspSysH_t h, void** userPtrPtr )
1509 1569
   return rc;
1510 1570
 }
1511 1571
 
1572
+//------------------------------------------------------------------------------
1573
+//)
1574
+//( { label:cmDspPgm_NoiseTails file_desc:"'fluxo' noise shapers." kw:[spgm fluxo] }
1512 1575
 cmDspRC_t _cmDspSysPgm_NoiseTails( cmDspSysH_t h, void** userPtrPtr )
1513 1576
 {
1514 1577
   cmDspRC_t       rc        = kOkDspRC;
@@ -1609,6 +1672,9 @@ cmDspRC_t _cmDspSysPgm_NoiseTails( cmDspSysH_t h, void** userPtrPtr )
1609 1672
   return rc;
1610 1673
 }
1611 1674
 
1675
+//------------------------------------------------------------------------------
1676
+//)
1677
+//( { label:cmDspPgm_NoiseTails2 file_desc:"'fluxo' noise shapers." kw:[spgm fluxo] }
1612 1678
 cmDspRC_t _cmDspSysPgm_NoiseTails2( cmDspSysH_t h, void** userPtrPtr )
1613 1679
 {
1614 1680
   cmDspRC_t       rc           = kOkDspRC;
@@ -1781,6 +1847,9 @@ cmDspRC_t _cmDspSysPgm_NoiseTails2( cmDspSysH_t h, void** userPtrPtr )
1781 1847
 
1782 1848
 
1783 1849
 
1850
+//------------------------------------------------------------------------------
1851
+//)
1852
+//( { label:cmDspPgm_CombFilt file_desc:"Comb filter example program." kw:[spgm] }
1784 1853
 cmDspRC_t _cmDspSysPgm_CombFilt( cmDspSysH_t h, void** userPtrPtr )
1785 1854
 {
1786 1855
   cmDspRC_t rc        = kOkDspRC;
@@ -1808,6 +1877,9 @@ cmDspRC_t _cmDspSysPgm_CombFilt( cmDspSysH_t h, void** userPtrPtr )
1808 1877
   return rc;  
1809 1878
 }
1810 1879
 
1880
+//------------------------------------------------------------------------------
1881
+//)
1882
+//( { label:cmDspPgm_ScalarOp file_desc:"Scalar operations example program." kw:[spgm] }
1811 1883
 cmDspRC_t _cmDspSysPgm_ScalarOp( cmDspSysH_t h, void** userPtrPtr )
1812 1884
 {
1813 1885
   cmDspRC_t rc;
@@ -1839,6 +1911,9 @@ cmDspRC_t _cmDspSysPgm_ScalarOp( cmDspSysH_t h, void** userPtrPtr )
1839 1911
 }
1840 1912
 
1841 1913
 
1914
+//------------------------------------------------------------------------------
1915
+//)
1916
+//( { label:cmDspPgm_RingMod file_desc:"Ring modulation example program." kw:[spgm] }
1842 1917
 cmDspRC_t _cmDspSysPgm_RingMod( cmDspSysH_t h, void** userPtrPtr )
1843 1918
 {
1844 1919
   cmDspRC_t       rc          = kOkDspRC;
@@ -1948,6 +2023,9 @@ cmDspRC_t _cmDspSysPgm_RingMod( cmDspSysH_t h, void** userPtrPtr )
1948 2023
   return rc;
1949 2024
 }
1950 2025
 
2026
+//------------------------------------------------------------------------------
2027
+//)
2028
+//( { label:cmDspPgm_RingMod2 file_desc:"Ring modulation example program." kw:[spgm] }
1951 2029
 cmDspRC_t _cmDspSysPgm_RingMod2( cmDspSysH_t h, void** userPtrPtr )
1952 2030
 {
1953 2031
   cmDspRC_t       rc          = kOkDspRC;
@@ -2037,6 +2115,9 @@ cmDspRC_t _cmDspSysPgm_RingMod2( cmDspSysH_t h, void** userPtrPtr )
2037 2115
   return rc;
2038 2116
 }
2039 2117
 
2118
+//------------------------------------------------------------------------------
2119
+//)
2120
+//( { label:cmDspPgm_MsgDelay file_desc:"Message delay example program." kw:[spgm] }
2040 2121
 cmDspRC_t _cmDspSysPgm_MsgDelay( cmDspSysH_t h, void** userPtrPtr )
2041 2122
 {
2042 2123
 
@@ -2059,6 +2140,9 @@ cmDspRC_t _cmDspSysPgm_MsgDelay( cmDspSysH_t h, void** userPtrPtr )
2059 2140
 }
2060 2141
 
2061 2142
 
2143
+//------------------------------------------------------------------------------
2144
+//)
2145
+//( { label:cmDspPgm_Adsr file_desc:"ADSR envelope generator example program." kw:[spgm] }
2062 2146
 cmDspRC_t _cmDspSysPgm_Adsr( cmDspSysH_t h, void** userPtrPtr )
2063 2147
 {
2064 2148
   cmDspRC_t rc;
@@ -2108,6 +2192,10 @@ cmDspRC_t _cmDspSysPgm_Adsr( cmDspSysH_t h, void** userPtrPtr )
2108 2192
 }
2109 2193
 
2110 2194
 
2195
+
2196
+//------------------------------------------------------------------------------
2197
+//)
2198
+//( { label:cmDspPgm_Adsr file_desc:"Dynamics compressor example program." kw:[spgm] }
2111 2199
 cmDspRC_t _cmDspSysPgm_Compressor( cmDspSysH_t h, void** userPtrPtr )
2112 2200
 {
2113 2201
   cmDspRC_t rc;
@@ -2170,6 +2258,9 @@ cmDspRC_t _cmDspSysPgm_Compressor( cmDspSysH_t h, void** userPtrPtr )
2170 2258
 }
2171 2259
 
2172 2260
 
2261
+//------------------------------------------------------------------------------
2262
+//)
2263
+//( { label:cmDspPgm_BiQuadEq file_desc:"Biquad EQ example program." kw:[spgm] }
2173 2264
 cmDspRC_t _cmDspSysPgm_BiQuadEq( cmDspSysH_t h, void** userPtrPtr )
2174 2265
 {
2175 2266
   cmDspRC_t       rc        = kOkDspRC;
@@ -2218,6 +2309,9 @@ cmDspRC_t _cmDspSysPgm_BiQuadEq( cmDspSysH_t h, void** userPtrPtr )
2218 2309
 }
2219 2310
 
2220 2311
 
2312
+//------------------------------------------------------------------------------
2313
+//)
2314
+//( { label:cmDspPgm_DistDs file_desc:"Guitar distortion example program." kw:[spgm] }
2221 2315
 cmDspRC_t _cmDspSysPgm_DistDs( cmDspSysH_t h, void** userPtrPtr )
2222 2316
 {
2223 2317
   cmDspRC_t       rc        = kOkDspRC;
@@ -2274,6 +2368,9 @@ cmDspRC_t _cmDspSysPgm_DistDs( cmDspSysH_t h, void** userPtrPtr )
2274 2368
   
2275 2369
 }
2276 2370
 
2371
+//------------------------------------------------------------------------------
2372
+//)
2373
+//( { label:cmDspPgm_Seq file_desc:"Message list 'seq' mode example program." kw:[spgm] }
2277 2374
 cmDspRC_t _cmDspSysPgm_Seq( cmDspSysH_t h, void** userPtrPtr )
2278 2375
 {
2279 2376
   cmDspRC_t rc;
@@ -2300,6 +2397,9 @@ cmDspRC_t _cmDspSysPgm_Seq( cmDspSysH_t h, void** userPtrPtr )
2300 2397
   return rc;
2301 2398
 }
2302 2399
 
2400
+//------------------------------------------------------------------------------
2401
+//)
2402
+//( { label:cmDspPgm_ThunkNet file_desc:"UDP network receiver example program." kw:[spgm] }
2303 2403
 cmDspRC_t _cmDspSysPgm_ThunkNet( cmDspSysH_t h, void** userPtrPtr )
2304 2404
 {
2305 2405
   cmDspRC_t rc;
@@ -2318,6 +2418,9 @@ cmDspRC_t _cmDspSysPgm_ThunkNet( cmDspSysH_t h, void** userPtrPtr )
2318 2418
   return rc;
2319 2419
 }
2320 2420
 
2421
+//------------------------------------------------------------------------------
2422
+//)
2423
+//( { label:cmDspPgm_WhirlNet file_desc:"UDP network sender example program." kw:[spgm] }
2321 2424
 cmDspRC_t _cmDspSysPgm_WhirlNet( cmDspSysH_t h, void** userPtrPtr )
2322 2425
 {
2323 2426
   cmDspRC_t rc;
@@ -2335,6 +2438,9 @@ cmDspRC_t _cmDspSysPgm_WhirlNet( cmDspSysH_t h, void** userPtrPtr )
2335 2438
   
2336 2439
 }
2337 2440
 
2441
+//------------------------------------------------------------------------------
2442
+//)
2443
+//( { label:cmDspPgm_NofM file_desc:"Select NofM example program." kw:[spgm] }
2338 2444
 cmDspRC_t _cmDspSysPgm_NofM( cmDspSysH_t h, void** userPtrPtr )
2339 2445
 {
2340 2446
   cmDspRC_t rc;
@@ -2403,6 +2509,9 @@ cmDspRC_t _cmDspSysPgm_NofM( cmDspSysH_t h, void** userPtrPtr )
2403 2509
   return rc;
2404 2510
 }
2405 2511
 
2512
+//------------------------------------------------------------------------------
2513
+//)
2514
+//( { label:cmDspPgm_1ofM file_desc:"Select 1 of N example program." kw:[spgm] }
2406 2515
 cmDspRC_t _cmDspSysPgm_1ofN( cmDspSysH_t h, void** userPtrPtr )
2407 2516
 {
2408 2517
   cmDspRC_t rc;
@@ -2438,6 +2547,9 @@ cmDspRC_t _cmDspSysPgm_1ofN( cmDspSysH_t h, void** userPtrPtr )
2438 2547
   return rc;
2439 2548
 }
2440 2549
 
2550
+//------------------------------------------------------------------------------
2551
+//)
2552
+//( { label:cmDspPgm_Router file_desc:"Router example program." kw:[spgm] }
2441 2553
 cmDspRC_t _cmDspSysPgm_Router( cmDspSysH_t h, void** userPtrPtr )
2442 2554
 {
2443 2555
   cmDspRC_t rc;
@@ -2476,6 +2588,9 @@ cmDspRC_t _cmDspSysPgm_Router( cmDspSysH_t h, void** userPtrPtr )
2476 2588
   return rc;
2477 2589
 }
2478 2590
 
2591
+//------------------------------------------------------------------------------
2592
+//)
2593
+//( { label:cmDspPgm_Preset file_desc:"Preset save/restore example program." kw:[spgm] }
2479 2594
 cmDspRC_t _cmDspSysPgm_Preset( cmDspSysH_t h, void** userPtrPtr )
2480 2595
 {
2481 2596
   cmDspRC_t rc;
@@ -2516,6 +2631,9 @@ cmDspRC_t _cmDspSysPgm_Preset( cmDspSysH_t h, void** userPtrPtr )
2516 2631
   return rc;
2517 2632
 }
2518 2633
 
2634
+//------------------------------------------------------------------------------
2635
+//)
2636
+//( { label:cmDspPgm_RsrcWr file_desc:"Set a resource value example program." kw:[spgm] }
2519 2637
 cmDspRC_t _cmDspSysPgm_RsrcWr( cmDspSysH_t h, void** userPtrPtr )
2520 2638
 {
2521 2639
   cmDspRC_t    rc      = kOkDspRC;
@@ -2545,6 +2663,9 @@ cmDspRC_t _cmDspSysPgm_RsrcWr( cmDspSysH_t h, void** userPtrPtr )
2545 2663
   return rc;
2546 2664
 }
2547 2665
 
2666
+//------------------------------------------------------------------------------
2667
+//)
2668
+//( { label:cmDspPgm_1Up file_desc:"1Up example program." kw:[spgm] }
2548 2669
 cmDspRC_t _cmDspSysPgm_1Up( cmDspSysH_t h, void** userPtrPtr )
2549 2670
 {
2550 2671
   cmDspRC_t rc;
@@ -2572,6 +2693,9 @@ cmDspRC_t _cmDspSysPgm_1Up( cmDspSysH_t h, void** userPtrPtr )
2572 2693
   return rc;
2573 2694
 }
2574 2695
 
2696
+//------------------------------------------------------------------------------
2697
+//)
2698
+//( { label:cmDspPgm_PortToSym file_desc:"PortToSym example program." kw:[spgm] }
2575 2699
 cmDspRC_t _cmDspSysPgm_PortToSym( cmDspSysH_t h, void** userPtrPtr )
2576 2700
 {
2577 2701
   cmDspRC_t rc = kOkDspRC;
@@ -2606,6 +2730,9 @@ cmDspRC_t _cmDspSysPgm_PortToSym( cmDspSysH_t h, void** userPtrPtr )
2606 2730
   return rc;
2607 2731
 }
2608 2732
 
2733
+//------------------------------------------------------------------------------
2734
+//)
2735
+//( { label:cmDspPgm_Line file_desc:"Line generator example program." kw:[spgm] }
2609 2736
 cmDspRC_t _cmDspSysPgm_Line( cmDspSysH_t h, void** userPtrPtr )
2610 2737
 {
2611 2738
   cmDspRC_t rc = kOkDspRC;
@@ -2637,6 +2764,9 @@ cmDspRC_t _cmDspSysPgm_Line( cmDspSysH_t h, void** userPtrPtr )
2637 2764
   return rc;
2638 2765
 }
2639 2766
 
2767
+//------------------------------------------------------------------------------
2768
+//)
2769
+//( { label:cmDspPgm_Array file_desc:"Array and pitch converter example program." kw:[spgm] }
2640 2770
 cmDspRC_t _cmDspSysPgm_Array( cmDspSysH_t h, void** userPtrPtr )
2641 2771
 {
2642 2772
   cmDspRC_t       rc           = kOkDspRC;
@@ -2683,6 +2813,9 @@ cmDspRC_t _cmDspSysPgm_SegLine( cmDspSysH_t h, void** userPtrPtr )
2683 2813
   return rc;
2684 2814
 }
2685 2815
 
2816
+//------------------------------------------------------------------------------
2817
+//)
2818
+//( { label:cmDspPgm_AvailCh file_desc:"AvailCh and XFader example program." kw:[spgm] }
2686 2819
 cmDspRC_t _cmDspSysPgm_AvailCh( cmDspSysH_t h, void** userPtrPtr )
2687 2820
 {
2688 2821
   double   frqHz       = 440.0;
@@ -2741,6 +2874,9 @@ cmDspRC_t _cmDspSysPgm_AvailCh( cmDspSysH_t h, void** userPtrPtr )
2741 2874
 
2742 2875
 }
2743 2876
 
2877
+//------------------------------------------------------------------------------
2878
+//)
2879
+//( { label:cmDspPgm_Goertzel file_desc:"Goertzel detector example program." kw:[spgm] }
2744 2880
 cmDspRC_t _cmDspSysPgm_Goertzel( cmDspSysH_t h, void** userPtrPtr )
2745 2881
 {
2746 2882
   cmDspRC_t rc;
@@ -2801,6 +2937,9 @@ cmDspRC_t _cmDspSysPgm_Goertzel( cmDspSysH_t h, void** userPtrPtr )
2801 2937
   return rc;
2802 2938
 }
2803 2939
 
2940
+//------------------------------------------------------------------------------
2941
+//)
2942
+//( { label:cmDspPgm_TakeSeqBldr file_desc:"Take sequence builder example program." kw:[spgm] }
2804 2943
 cmDspRC_t _cmDspSysPgm_TakeSeqBldr( cmDspSysH_t h, void** userPtrPtr )
2805 2944
 {  
2806 2945
   cmDspRC_t       rc         = kOkDspRC;
@@ -2859,6 +2998,9 @@ cmDspRC_t _cmDspSysPgm_TakeSeqBldr( cmDspSysH_t h, void** userPtrPtr )
2859 2998
 }
2860 2999
 
2861 3000
 
3001
+//------------------------------------------------------------------------------
3002
+//)
3003
+//( { label:cmDspPgm_TwoD file_desc:"Two dimensional controller  example program." kw:[spgm] }
2862 3004
 cmDspRC_t _cmDspSysPgm_TwoD( cmDspSysH_t h, void** userPtrPtr )
2863 3005
 {
2864 3006
   cmDspRC_t       rc         = kOkDspRC;
@@ -2878,6 +3020,9 @@ cmDspRC_t _cmDspSysPgm_TwoD( cmDspSysH_t h, void** userPtrPtr )
2878 3020
   return rc;
2879 3021
 }
2880 3022
 
3023
+//------------------------------------------------------------------------------
3024
+//)
3025
+//( { label:cmDspPgm_BinEnc file_desc:"HRTF binaural encoder example program." kw:[spgm] }
2881 3026
 cmDspRC_t _cmDspSysPgm_BinEnc( cmDspSysH_t h, void** userPtrPtr )
2882 3027
 {
2883 3028
   cmDspRC_t       rc         = kOkDspRC;
@@ -2950,8 +3095,8 @@ cmDspRC_t _cmDspSysPgm_BinEnc( cmDspSysH_t h, void** userPtrPtr )
2950 3095
  errLabel:
2951 3096
   return rc;
2952 3097
 }
2953
-
2954
-
3098
+//)
3099
+//(
2955 3100
 _cmDspSysPgm_t _cmDspSysPgmArray[] = 
2956 3101
 {
2957 3102
   { "reflect",       _cmDspSysPgm_ReflectCalc,  NULL, NULL },
@@ -3015,3 +3160,4 @@ _cmDspSysPgm_t* _cmDspSysPgmArrayBase()
3015 3160
 }
3016 3161
 
3017 3162
 
3163
+//)

+ 0
- 0
dsp/cmDspPgmKr.c View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save