home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Synthesizer Source / Synthesizer Folder / WaveTableOscControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  4.1 KB  |  114 lines  |  [TEXT/KAHL]

  1. /* WaveTableOscControl.h */
  2.  
  3. #ifndef Included_WaveTableOscControl_h
  4. #define Included_WaveTableOscControl_h
  5.  
  6. /* WaveTableOscControl module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* FastFixedPoint */
  12. /* FixedPoint */
  13. /* Memory */
  14. /* EnvelopeState */
  15. /* SampleConsts */
  16. /* LFOGenerator */
  17. /* Multisampler */
  18. /* OscillatorSpecifier */
  19. /* Envelope */
  20. /* LFOListSpecifier */
  21. /* FastModulation */
  22. /* 64BitMath */
  23. /* ErrorDaemon */
  24.  
  25. #include "FixedPoint.h"
  26. #include "FastFixedPoint.h"
  27. #include "ModulationSpecifier.h"
  28.  
  29. struct WaveTableTemplateRec;
  30. typedef struct WaveTableTemplateRec WaveTableTemplateRec;
  31.  
  32. struct WaveTableStateRec;
  33. typedef struct WaveTableStateRec WaveTableStateRec;
  34.  
  35. /* forwards */
  36. struct OscillatorRec;
  37. struct ArrayRec;
  38. struct ErrorDaemonRec;
  39.  
  40. /* get rid of all cached memory for state or template records */
  41. void                                    FlushWaveTableOscControl(void);
  42.  
  43. /* perform one envelope update cycle */
  44. void                                    UpdateWaveTableEnvelopes(WaveTableStateRec* State);
  45.  
  46. /* dispose of the wave table state record */
  47. void                                    DisposeWaveTableState(WaveTableStateRec* State);
  48.  
  49. /* dispose of the wave table information template */
  50. void                                    DisposeWaveTableTemplate(WaveTableTemplateRec* Template);
  51.  
  52. /* create a new wave table template */
  53. WaveTableTemplateRec*    NewWaveTableTemplate(struct OscillatorRec* Oscillator,
  54.                                                 float EnvelopeTicksPerSecond, long SamplingRate,
  55.                                                 MyBoolean Stereo, MyBoolean TimeInterp, MyBoolean WaveInterp,
  56.                                                 struct ErrorDaemonRec* ErrorDaemon);
  57.  
  58. /* create a new wave table state object. */
  59. WaveTableStateRec*        NewWaveTableState(WaveTableTemplateRec* Template,
  60.                                                 float FreqForMultisampling, float Accent1, float Accent2,
  61.                                                 float Accent3, float Accent4, float Loudness, float HurryUp,
  62.                                                 long* PreOriginTimeOut, float StereoPosition,
  63.                                                 float InitialFrequency, float LoudnessLFOAmplitudeScaling,
  64.                                                 float LoudnessLFOFrequencyScaling, MyBoolean DoingModulation);
  65.  
  66. /* fix up pre-origin time for the wave table state object */
  67. void                                    FixUpWaveTableStatePreOrigin(WaveTableStateRec* State,
  68.                                                 long ActualPreOrigin);
  69.  
  70. /* set a new frequency for a wave table state object.  used for portamento */
  71. /* and modulation of frequency (vibrato) */
  72. void                                    WaveTableStateNewFrequency(WaveTableStateRec* State,
  73.                                                 float NewFrequencyHertz);
  74.  
  75. /* send a key-up signal to one of the oscillators */
  76. void                                    WaveTableKeyUpSustain1(WaveTableStateRec* State);
  77. void                                    WaveTableKeyUpSustain2(WaveTableStateRec* State);
  78. void                                    WaveTableKeyUpSustain3(WaveTableStateRec* State);
  79.  
  80. /* restart a wave table oscillator.  this is used for tie continuations */
  81. void                                    RestartWaveTableState(WaveTableStateRec* State,
  82.                                                 float NewFreqMultisampling, float NewAccent1, float NewAccent2,
  83.                                                 float NewAccent3, float NewAccent4, float NewLoudness,
  84.                                                 float NewHurryUp, MyBoolean RetriggerEnvelopes,
  85.                                                 float NewStereoPosition, float NewInitialFrequency,
  86.                                                 float NewLoudnessLFOAmplitudeScaling,
  87.                                                 float NewLoudnessLFOFrequencyScaling);
  88.  
  89. /* generate a sequence of samples (called for each envelope clock) */
  90. void                                    WaveTableGenSamples(WaveTableStateRec* State,
  91.                                                 long SampleCount, largefixedsigned* RawBuffer);
  92.  
  93. /* find out if the wave table oscillator has finished */
  94. MyBoolean                            WaveTableIsItFinished(WaveTableStateRec* State);
  95.  
  96. /* generate a single sample (called for modulation chains) */
  97. /* OutputPlace should have 1 entry for mono output or 2 entries for stereo output */
  98. float                                    WaveTableGenOneSample(WaveTableStateRec* State,
  99.                                                 ModulationTypes* PhaseGenModulateHow,
  100.                                                 float* PhaseGenModulationScaling,
  101.                                                 float* PhaseGenModulationOrigin,
  102.                                                 float* PhaseGenOldValues,
  103.                                                 long* PhaseGenIndirectionTable,
  104.                                                 long NumberOfPhaseGenModulators,
  105.                                                 ModulationTypes* OutputModulateHow,
  106.                                                 float* OutputModulationScaling,
  107.                                                 float* OutputModulationOrigin,
  108.                                                 float* OutputOldValues,
  109.                                                 long* OutputIndirectionTable,
  110.                                                 long NumberOfOutputModulators,
  111.                                                 largefixedsigned* OutputPlace);
  112.  
  113. #endif
  114.