-
Notifications
You must be signed in to change notification settings - Fork 1
my module
senso edited this page Jun 22, 2026
·
2 revisions
#example #template #simple #data #callback
Simple frequency-to-period converter (legacy callback style).
| Module Name | template simple |
| Type | mtSimple |
| Color | clDataModuleColor |
| Source | examples/MyModule/ |
A very simple module that converts a frequency (Hz) to its corresponding period (ms). Functionally identical to TemplateModuleSimple but uses an older callback pattern (parameter index instead of callback IDs).
| # | Name | Type | I/O | Range | Scale | Default |
|---|---|---|---|---|---|---|
| 0 | freq |
ptDataFader |
Input | 0.1 – 20000 Hz | scLog |
50 |
| 1 | period |
ptDataFader |
Output (ReadOnly) | 0.05 – 10000 ms | scLog |
— |
-
onCallBack: ChecksMessage->wParam == 0(parameter index) to detect freq changes, then callscomputePeriod(). -
computePeriod(): Setsperiod = 1000.0 / freq.
This example uses the old-style callback pattern where wParam is the parameter index:
if (Message->wParam == 0) // parameter index — legacy patternThe modern recommended pattern uses named callback IDs (see TemplateModuleSimple).
onGetModuleInfo · onInitModule · onGetParamInfo · onCallBack · onProcess
- TemplateModuleSimple — Same logic with modern callback IDs
- DataMultiply — Another simple data module