Skip to content

my module

senso edited this page Jun 22, 2026 · 2 revisions

MyModule

#example #template #simple #data #callback

Simple frequency-to-period converter (legacy callback style).

Module Name template simple
Type mtSimple
Color clDataModuleColor
Source examples/MyModule/

Description

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).

Parameters

# 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

How It Works

  • onCallBack: Checks Message->wParam == 0 (parameter index) to detect freq changes, then calls computePeriod().
  • computePeriod(): Sets period = 1000.0 / freq.

Legacy Pattern Note

This example uses the old-style callback pattern where wParam is the parameter index:

if (Message->wParam == 0)  // parameter index — legacy pattern

The modern recommended pattern uses named callback IDs (see TemplateModuleSimple).

SDK Callbacks Used

onGetModuleInfo · onInitModule · onGetParamInfo · onCallBack · onProcess

Related Examples

SDK Reference

Clone this wiki locally