Data AcQuisition And Real-Time Analysis
Scope - Spectrum - Spectrogram - Signal Generator
Software for Windows
Science with your Sound Card!
The following is from the Daqarta Help system:



Spectrum Analyzer

Signal Generator

(Absolutely FREE!)


Pitch Tracker


DaqMusiq Generator
(Free Music... Forever!)

Engine Simulator

LCR Meter

Remote Operation

DC Measurements

True RMS Voltmeter

Sound Level Meter

Frequency Counter
    Spectral Event

    MHz Frequencies

Data Logger

Waveform Averager


Post-Stimulus Time
Histogram (PSTH)

THD Meter

IMD Meter

Precision Phase Meter

Pulse Meter

Macro System

Multi-Trace Arrays

Trigger Controls


Spectral Peak Track

Spectrum Limit Testing

Direct-to-Disk Recording



Frequency response

Distortion measurement

Speech and music

Microphone calibration

Loudspeaker test

Auditory phenomena

Musical instrument tuning

Animal sound

Evoked potentials

Rotating machinery


Product test

Contact us about
your application!

MIDI Changes Script Loops

Changes: {n ... }

Loops allow MIDI Changes scripts to execute commands or groups of commands repeatedly, as in conventional programming languages.

A loop begins with { ("left curly brace") followed immediately by the desired number of repetitions. Any number of commands may follow, on any number of lines. The loop ends with } ("right curly brace").

The number of repetitions may be any unsigned integer or valid expression, including current MIDI control values, random values, current computer keyboard states or mouse position, input or buffered notes, oscillators, and User Variables. Note: A value of 0, whether set directly or the result of an expression, will result in one pass through the loop, not zero passes.

Unlike conventional programming languages, a Changes script allows you to specify an infinite loop by using '!' in place of the repetition number. This is a very useful feature: Since the whole Changes script automatically repeats after it executes its final command, it normally behaves like a big infinite loop by default. But suppose you want a group of commands to run only once, at the start of the performance, to set some initial parameters or to play a lead-in or intro. After those initial commands you want to run the rest of the script repeatedly.

The infinite loop solves this. You just follow the setup commands with an infinite loop holding the rest of the commands. When the script processor reaches the end of that loop, it jumps back to the start of the loop, not the start of the script. It never attempts to go past the end of the overall script, which would cause it to wrap back to the start.

Loops may be nested up to 8 levels deep, though you can have any number of loops at each level. If you attempt to go beyond 8 levels, the Changes debugger will report "Too many nested loops" for that script and will prevent it from running.

Obviously, however, you can only have a single infinite loop in any script.

Note: Every loop must include at least one Wait command. Otherwise, the loop would run through all its repetitions without any note being played until afterward. A Wait in a nested loop is counted as a Wait in all prior loop levels.

If a loop does not have any Waits, the Changes debugger will report "No Waits in loop" for that Voice Setup and will not allow the performance to run.

If the loop has a Wait command, but the specified Wait expression evaluates to zero during execution of any given loop pass, that loop will be abandoned at the end of that pass, even if the requested number of loops has not been reached.

See also Changes Script Overview, Changes Script Editor, MIDI Voice Setup Dialogs, Pitch-to-MIDI dialog, Pitch Track Toolbox - Overview


Questions? Comments? Contact us!

We respond to ALL inquiries, typically within 24 hrs.
Over 35 Years of Innovative Instrumentation
© Copyright 2007 - 2023 by Interstellar Research
All rights reserved