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!

Random Melody Velocities

Besides the particular sequence of notes in a melody, their relative loudness (velocity) and timing have a large effect on the feel of a song.

The Velocity Pattern controls the loudness of each note, including whether it is off completely. It also controls timing by means of the '_' (underscore) character to sustain the prior note.

You can create a random Velocity Pattern by setting a Velocity Map and then using a random Buffer Fill. The Velocity Map is a list of characters to be used in the Velocity Pattern, including any character in the Velocity Pattern Character Table. The order of the characters in the Velocity Map doesn't matter, but the number of times a character appears in the Map controls the probablity that it will be chosen for any given beat.

So, using a Map with more '_' characters increases the probability of sustained notes, which means a slower overall feel to the song at any given Tempo. Likewise, more '0' or '.' (period) characters increases the probability of rests.

JukeBox.DQM provides a good example of this approach. It uses a Velocity Map of Bv="8888_8_8_8_8_8_0". This Map has 9 '8' full-volume characters, 6 '_' sustain characters, and one '0' rest. The Map is 16 characters long (the maximum allowed), so there is a 9/16 probability of '8', a 6/16 probability of '_', and a 1/16 probability of '0'.

A Map like this can be used with a random Buffer Fill command like Bf1V.0=(?(0,15),8). The 16-character Map means that the last 4 bits (decimal values 0-15) of a random value are used as an index into the Map to select a character. For example, if the last 4 bits were 1111 (decimal 15), then '0' would be selected from the Map and used to fill the specified buffer position.

Note that the random value range is (0,15), so each of the 16 index values has an equal probability of being chosen at random. The overall probability of any given character being chosen thus depends upon how many times it appears in the Map. You can bias this by using different random value ranges; with the Map given, '0' is the last character and would thus be selected only when the random value ended in bits 0000. So if the random range is (1,15), that index will never appear and there will be no rests.

Instead of mostly '8' characters, you can use only one or two of these and make most characters '6' (or whatever). Then the less-frequent '8's will act as accent beats in the song.

Including a range of velocity character values in the Map will give the song a greater dynamic range.

You can give a more "human" feel to the song or performance if there is some variability from beat to beat. Just using different numerals in the Velocity Map will not do this, since once the Velocity Pattern is set, every measure that uses it will be the same. Instead, you can use alphabet characters in lieu of numerals to indicate that whenever that character is played, the current note will have a velocity that is randomly chosen over a specified range.

For example, while '8' specifies a MIDI velocity of 127, and '7' specifies 112, 'a' specifies a random value within the range of 112-127. Similarly 'i' covers the same range as '6' to '8', or 96-127, and 'p' covers '5' to '8' or 80-127. The full list of characters and ranges appears in the Velocity Pattern Character Table.

JukeBox.DQM only uses the random Buffer Fill for the last 7 characters of the 8-beat Velocity Map, using Bf1V.1=(?(0,15),7), after first setting the 0 position with V1.0="8". Otherwise, the first beat might have been randomly assigned '0' (silence) or '_' (sustain). The latter would end up sustaining the final note of any prior measure. This is not necessarily a problem, just a matter of choice.

See also Changes Script Tips and Tricks, 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 30 Years of Innovative Instrumentation
© Copyright 2007 - 2017 by Interstellar Research
All rights reserved