Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Converts momentary button signals to toggles

Discussion

This module works inconjunction with momentary buttons and converts the presses to toggles. That is, the output is 0 until the first 0->1 transition on the input pin. The output is then fixed at a value of 1 until the next 0->1 transition on the input pin.

The module accepts integer inputs of size numChannels = 1 and different blockSizes. The inputs are integers and a transition is counted as any value which is larger than the previous.

Type Definition

Code Block
typedef struct _ModuleToggleButton
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 inState;                                // Last input to the module
    INT32 outState;                               // Last output of the module
} ModuleToggleButtonClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

inState

int

state

1

0

Unrestricted

outState

int

state

1

0

Unrestricted

Pins

Input Pins

Name: in

Description: audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: out

Description: audio output

Data type: int

MATLAB Usage

File Name: toggle_button_module.m

...