-
Notifications
You must be signed in to change notification settings - Fork 1
data oscilloscope
senso edited this page Jun 22, 2026
·
2 revisions
#example #data #drawing #settings #control #graphics
Scrolling waveform display with custom drawing.
| Module Name | data oscilloscope example |
| Type | mtControl |
| Color | clInterfaceDesignModuleColor |
| Source | examples/DataOscilloscope/ |
A visual oscilloscope that displays incoming data as a scrolling waveform. Demonstrates custom drawing with the path API, settings panels, and contextual menus.
| # | Name | Type | I/O | Range | Scale | Default | Callback |
|---|---|---|---|---|---|---|---|
| 0 | y |
ptDataField |
Input | -1 to 1 | Linear | 0.5 | ctImmediate |
| 1 | speed |
ptDataFader |
Input | 0 to 0.5 | scLog |
0.005 | ctNormal |
| 2 | color |
ptColor |
Input | — | — | — | ctImmediate |
-
onCallBack: Stores incoming y value, speed offset, and color usingstd::atomicfor thread safety -
onProcess: OnsdkRefreshSpeedClock()tick, callsadvance()which:- Adds a new point at x=0 with current y value
- Shifts all existing points to the right by the speed offset
- Removes points that have scrolled past x=1.0
- Calls
sdkRepaintPanel()to trigger redraw
-
onPaint: Draws a smooth path through all stored points using the path drawing API
-
mtControlmodule type with custom canvas -
Path drawing API:
sdkDrawPathStart(),sdkDrawPathMoveTo(),sdkDrawPathLineTo(),sdkDrawPathClose(),sdkDrawPathDraw() -
sdkRefreshSpeedClock()for frame-rate-aware animation updates -
Settings panel:
sdkAddSettingLineColor()for persistent color settings -
Contextual menu:
onCreateCommands()for right-click actions -
std::atomicfor safe data sharing between audio and GUI threads
onGetModuleInfo · onInitModule · onGetParamInfo · onCallBack · onProcess · onCreateSettings · onSettingsHasChanged · onCreateCommands · onPaint
- DataSampler — Data recording with visualization
- DrawBox — Simpler custom drawing
- DrawTrajectoryBox — Advanced path drawing