Versions Compared

Key

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

Overview

Source module which periodically outputs an impulse

Discussion

This module has a single mono output pin and generates a periodic impulse of value 1; all other output samples are set to 0. The variable .period specifies the period of the generation process in samples. .period can be adjusted at run-time. If .period = SAMPLERATE, then the module generates an impulse every second. If .period = 1, then the module outputs a DC constant. If .period = 0, then the module stops output values.

As with all source modules, you have to set the blockSize and sampleRate of the output pin. The module is initialized so that it fires immediately; sample 0 of block 0 is set to 1.0f.

Type Definition

Code Block
typedef struct _ModuleImpulseSourceFract32
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 period;                                 // Period or rate of the impulse generator
    INT32 sampleIndex;                            // Specifies the index of the next non-zero value
} ModuleImpulseSourceFract32Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

period

int

parameter

0

48000

0:240000

samples

sampleIndex

int

state

1

0

Unrestricted

Pins

Output Pins

Name: out

Description: audio output

Data type: fract32

MATLAB Usage

File Name: impulse_source_fract32_module.m

...