Daqarta
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:

Features:

Oscilloscope

Spectrum Analyzer

8-Channel
Signal Generator

(Absolutely FREE!)

Spectrogram

Pitch Tracker

Pitch-to-MIDI

DaqMusiq Generator
(Free Music... Forever!)

Engine Simulator

LCR Meter

Remote Operation

DC Measurements

True RMS Voltmeter

Sound Level Meter

Frequency Counter
    Period
    Event
    Spectral Event

    Temperature
    Pressure
    MHz Frequencies

Data Logger

Waveform Averager

Histogram

Post-Stimulus Time
Histogram (PSTH)

THD Meter

IMD Meter

Precision Phase Meter

Pulse Meter

Macro System

Multi-Trace Arrays

Trigger Controls

Auto-Calibration

Spectral Peak Track

Spectrum Limit Testing

Direct-to-Disk Recording

Accessibility

Applications:

Frequency response

Distortion measurement

Speech and music

Microphone calibration

Loudspeaker test

Auditory phenomena

Musical instrument tuning

Animal sound

Evoked potentials

Rotating machinery

Automotive

Product test

Contact us about
your application!

GlossyFishSticks and GlossyFishBones MIDI Setups

Samples: See Random Composition Plus Percussion

Introduction:

When either setup is loaded, right-clicking on the Pitch-to-MIDI title bar or any non-control portion of the dialog will open Help at this topic.

GlossyFishSticks and GlossyFishBones combine features of GlossyFish with GlossySticks and GlossyBones to give richer, more-varied performances, with full instrumentation plus percussion.

They also continue to allow hot-keys for scale changes, which can completely change the character of a performance.

Both setups use the basic GlossyFish structure for the tonal voice scripts, enhanced to allow more control over the instruments used. An added parameter allows controlled repetition of the initial musical themes. (See Theme Pattern Repeat, below.)

Additionally, there are parameters to control the duration of a pure-percussion "intro" delay, as well as the range of delays for the individual voices to come in. Compared to GlossyFish, this change goes beyond the mere addition of Percussion. The melody itself seems enhanced by the fact that the tonal instruments aren't all active right from the start. Instead, after the long Percussion intro, they usually come in one (or a few) at a time. This tends to briefly focus attention on these instruments, and often adds drama as well.

The Percussion scripts both include the GlossyBones technique for replacement of unwanted instruments. Otherwise, these scripts are nearly identical to the original GlossySticks and GlossyBones scripts.


Theme Pattern Repeat:

A significant difference with GlossyFish is that GlossyFishSticks and GlossyFishBones use a pattern repeat threshold parameter Ur to allow the initial random musical themes to be repeated throughout the performance, with a controllable probability.

By default, all performances continue indefinitely without repeating exactly. This is because when each instrument part or "theme" finishes, a new random instrument and note pattern replace it. This gives wide-ranging individual performances, if you wait long enough.

But typically when you start a random performance, you won't keep listening unless your attention is captured early in the performance... you will just toggle Pitch-to-MIDI off and back on, to restart with a new shuffle of the deck.

This leads to the converse: If you do like the initial part of the performance, you might want to hear those same themes recurring throughout the performance. To enable this, GlossyFishSticks and GlossyFishBones save the initial settings for each of the 8 tonal voices, and can re-use those later instead of the random replacement settings.

The pattern repeat threshold Ur controls the probability that subsequent random settings for any voice will be replaced by its saved originals. The default value for Ur is 0, set near the start of the Voice 1 Changes script (see below) after the pattern length limits UL and UU are set. Any time a voice randomly chooses a replacement pattern length smaller than Ur, the original settings are used instead.

Thus, in the default case where the pattern limits are between UL=7 and UU=11, there are 5 possible pattern lengths. If Ur is set to 8, there is a one-in-five chance that the random length will be less than that, triggering a repeat of the original voice settings. Setting higher Ur values increases the likelihood; when Ur is greater than UU, the original settings will be re-used every time.

When a Voice's pattern length is less than Ur, the default operation is to repeat that pattern exactly, using the same Instrument, Hold Beats, and Level as well as the same Velocity and Note patterns. You can modify the Changes scripts to use the original pattern but use a new random Instrument, etc. This will provide thematic continuity but still have a lot of novelty. See Voice 1 Changes Script, below, for details.

Even when you set Ur to repeat every time, and leave the default settings to re-use the same parameters, you will not necessarily hear the total performance repeat very often. (We're just talking about the tonal voices here, since there is no repeat mechanism for Percussion.) The reason is that the voices have different pattern lengths, so they start, finish, and restart independently; the overall performance can only repeat when all voices happen to restart in their original sequence.

Consider a simplfied case with only two voices, which start on the same beat but have total pattern lengths of 8 and 9 beats; they won't start together again until the 72nd beat. With three voices having lengths of 7, 8, and 9 beats the repeat period goes up to 504 beats.

In reality each voice plays two different patterns of the same length, in an AABABA series. That "verse" is repeated Qv=2 times, followed by Qs=4 sustain beats and Qr=4 rest beats. Hold Beats effectively multiplies the pattern portion, so if the basic pattern length is P and Hold Beats is H, the total length is 2 * (6 * P * H) + 4 + 4, which is equivalent to 12 * P * H + 8 beats.

To find the total repeat period for 8 voices, you first use the P and H values for each to get 8 individual periods. Then find the greatest common factor that can be divided evenly into all of them, and write down the 8 factored periods. (You may note from the above formula that the factor will always be divisible by at least 4.)

Then discard any duplicate periods, and multiply all the unique periods together, then multiply by the common factor to get the total period.

In a typical example using the "Mountain Heather" seed in GlossyFishSticks, the pattern length P and Hold Beats H for each voice are as follows, including the total, and the total after dividing by the greatest common factor 4:

    Voice   P       H    12*P*H+8   Factored
      1     8       1       104        26
      2     8       4       392        98
      3     11      1       140        35
      4     9       1       116        29
      5     8       1       104        26 (discard)
      6     9       1       116        29 (discard)
      7     7       1        92        23
      8     10      2       248        62 

We discard Voice 5 because it is the same as Voice 1, and likewise discard Voice 6 because it is the same as Voice 4. The overall period is then 26 * 98 * 35 * 29 * 23 * 62 times the 4 factor, or 1.475*10^10 beats, which is over 93 years at 300 BPM.

The above example used the default of Qv=2 verses per theme, followed by Qs=4 sustain beats and Qr=4 rest beats. Consider how a minor change such as Qr=5 affects the total period. The new formula for one voice would become 12*P*H+9, making each of the individual periods just one beat longer. However, now there is no common factor!

    Voice   P       H     12*P*H+9
      1     8       1       105
      2     8       4       393
      3     11      1       141
      4     9       1       117
      5     8       1       105 (discard)
      6     9       1       117 (discard)
      7     7       1        93
      8     10      2       249 

The overal period is then 105 * 393 * 141 * 117 * 93 * 249 = 1.576*10^13 beats, which at 300 BPM is nearly 100,000 years!


Random Hold Beats:

For both GlossyFishSticks and GlossyFishBones, each voice has Hold Beats set to a random value. Hold Beats essentially slows the effective Tempo by that factor for that voice only. For Voice 1 this is done via H1=?(UM,Um), where the random limits UM=-4 and Um=4 are set initially and remain the same throughout the performance for all voices. You thus only need to edit the Voice 1 UM and Um values to experiment with this.

Notice that while UM is a negative number, Hold Beats only accepts values from 1 to 127. Thus, if the random value is zero or negative, Hold Beats is limited to 1. This means that 2/3 of the time (6/9) it will end up as 1, and 1/3 of the time it will be either 2, 3, or 4. See Controlling Probabilities under the Random Values topic.


Random Levels:

GlossyBlack, etc, used a fixed Level of 64 for each voice. GlossyFishSticks and GlossyFishBones, like GlossyFish, instead set each voice Level randomly over a 48-80 range for each Instrument change. The differing Levels of each concurrent voice give more depth to the sound stage. Also, because the total Level of all voices changes randomly over time, the performance has a changing dynamic range. This adds interest and realism.

But some types of performance may benefit from the "punch" of consistently "up front" voices. You can get that by changing the UV (maximum Level) and Uv (minimum Level) to a narrower range, or make them both the same. (In the latter case, the L1=?(Uv,UV) line selects a "random value" between identical limits, so the result is a constant.)


Random Note and Percussion Lags:

Both GlossyFishSticks and GlossyFishBones attempt to "humanize" performances by slightly shifting the start times of notes and percussion hits. This prevents everything from happening exactly "on the beat", a common trait of "machine music".

This is accomplished for tonal voices by randomly setting Note Lag to a value between 0 and Ug, which defaults to 2. Percussion Lag is set using the same limit. The Lag value is changed whenever the voice or percussion pattern is changed.

With limits of 0 and 2, the average Lag will be 1, which can be considered to be the "exact" beat. Voices or percussion instruments with Lag set to 0 will sound just before the beat, and those with Lag set to 2 will sound just after the beat.

The timing difference is approximately 10 msec per Lag step, which is determined by the Trace Update Interval. 10 msec is a good "just noticeable" value.

If you want Lag to randomly vary over a larger range, set Ug (at the start of the Voice 1 script) to a higher value. For example, if you set it to 4 then Lag will vary from 0 to 4, with the average of 2 being the new "on the beat" value.

If for some reason you want finer resolution than 10 msec steps, you can set Trace Update smaller and boost Ug correspondingly. For example, with Trace Update set to 5 msec, Ug=4 will give the original +/-10 msec range, but in 5 msec steps.

Note that Lag selection uses the alternative random generator ?r() instead of the standard ?(), so that even when you repeat a performance by setting the random seed with ?s these minor timing variations will still be different each time. To get exact repeats, you can force the alternative seed with ?r=n.

Although the Note Lag effect can be rather subtle for tonal voices, Percussion Lag is much more noticeable, particularly during the initial Percussion-only intro. The reason is that Percussion instruments typically have fast attack and decay times, allowing easy discrimination between events that come close together in time.

To hear this for yourself, just change the Ug=2 line at the start of the Voice 1 setup to Ug=0 to get rid of the variable Lag. (It affects both Note Lag and Percussion Lag.)

For a visual confirmation of the variable lag, note that the vertical lines of the Percussion instruments in the Pitch Display are not perfectly aligned; some segments of the lines may be offset by one or more line widths.


Hot-Key Scale Select:

You can use hot-keys to change the Scale used by GlossyFishSticks or GlossyFishBones at any time during a performance. The current scale is always shown in the right output display. Note that case is important:

    "?"  Random Scale
    "5"  5th (Power Chord)
    "6"  Major 6th Chord
    "7"  Dominant 7th
    "B"  Blues Major
    "b"  Blues Minor
    "C"  Chromatic
    "c"  C-notes only
    "H"  Harmonic Major
    "h"  Harmonic Minor
    "L"  Lydian
    "l"  Locrian
    "M"  Major
    "m"  Natural Minor
    "P"  Pentatonic Major
    "p"  Pentatonic Minor
    "w"  Whole Tone
    "X"  Mixolydian Pentatonic
    "y"  Blues Phrygian

The default is Pentatonic Major ('P' key), which gives a universally nice, pleasant sound. It is especially useful for "Oriental" music at slow Tempo settings, or for folk or general background music at higher tempos.


Blues Phrygian ('y' key) gives a "cool jazz" sound. Blues Minor ('b' key) is similar, but not quite as strong.


Major ('M' key) or Natural Minor ('m' key) are good for conventional ("Western") music. Chromatic ('C' key) allow lots of inharmonic note combinations for "experimental" music.


Random Scale ('?' key) picks a random number between 2048 and 4095 and uses the bit positions as keys in the scale, with the most-significant bit representing 'C' and the least representing 'B' above it. Think of "CdDeEFgGaAbB", where upper case letters indicate whole notes or white keys and lower case letters indicate flats or black keys.

For example, if the number is 2194, the binary equivalent is 100010010010, which is listed as Raga Mahathi but also happens to be the notes of a 7th chord:

    100010010010
    C...E..G..b.

The above Raga Mahathi is a nice-sounding scale, but most random scales either don't sound very good or are just plain weird. Still, random scales can be a fun way to liven up a performance... and you never know when you will make a great discovery.

Random scales, like all others, are shown in the right output display by name. If there is no standard name, then the 'C...E..G..b.' format is used. (Actually, it uses '^' instead of periods as spacers, which stand out better in the font used for output display.)


C-notes only ('c' key) does just what you'd expect... it only plays the closest 'C' note in each voice. With typical Note Range and Scale Factor settings, this usually means you get 'C's from at least two or three octaves. This doesn't sound like any particular genre of music, but it can be very useful in performances because it causes anticipation of change to come (such as shifting to a new scale).


5th (Power Chord) ('5' key) is likewise not a "normal" scale... it's just 'C' and 'G', often called a "power chord" when played as a chord in guitar music. This doesn't mean that each voice plays chords, just that it only has those two notes to choose from. But with all voices going at once, you will typically get an assortment of 'C's and 'G's in different octaves... and a really nice effect. It has a bit of the tension of the above C-notes only, and a bit of the "pure" sound of the '0'-key "No Spread" effect.


Major 6th Chord is likewise derived from a chord and is not a "normal" named scale, but it produces fully musical "smooth and mellow" performances.


When you change the scale via hot-key, the Scale for all voices changes immediately (as shown in the display at the lower right), without interrupting or restarting the performance.

Interestingly, the brain can take a while to register a scale change. For example, the Blues Minor scale (unshifted 'b' key) is distinctively different from Pentatonic Major, yet it may take a few seconds for your brain to realize this even though you deliberately caused the change yourself.

If you doubt that the scale is really changing immediately, try the unshifted 'c' key to get a scale of only 'C's... you'll hear that difference right away.


Scales List and Custom Scales:

Besides hot-keys, there is another way to select scales. It's more cumbersome to use during a performance, but it is a great way to explore the possibilities.

Click on Voice 1 in the Setup column of the Pitch-to-MIDI dialog to open the Voice 1 Setup dialog. Then click on the Scale button to open the Scale dialog, which includes the Scales list. Scroll around the list; any scale you select (by clicking on it) will become the current scale for all voices. Also, unlike hot-keys, the selected scale will become the new default for future performances.

At the bottom of the Scale dialog is the Custom Scale section, which allows you to define up to 4 different scales. You can enter the definition either by note letters or scale number, and give it a label of your choice.

To select a Custom Scale, click on the small button (1-4) between the scale number and Name fields. The right output display will show the corresponding name; it may not be the selected Custom Scale name, however, if there is a matching scale in the Scale list.

If you find a scale you want to add as a hot-key, either from the list or from Custom Scales, copy the scale number. Here we'll assume it is 2194 (Raga Mahathi, which is also a 7th chord note pattern). Then go to the Percussion dialog and hit the Float button to see the Percussion Changes script. Scroll down until you see the section with all the other hot-keys, starting with:

    [UK="?" US=?r(2048,4095)]  ;Random Scale

and ending with:

    [UK="y" US=3442]           ;Blues Phrygian

Now select an unused hot-key to assign... we'll use '&' here, which is a shifted '7'. Add a line like the following, somewhere in the above section:

    [UK="&" US=2194]   ;7th Chord

You might want to place this line right before or after the "Dominant 7th" scale line.

You can make the same modification to both GlossyFishScales and GlossyFishBones, if you choose. Then when either is running, hitting the '&' key will instantly switch to this scale. The right output display will show it as Raga Mahathi in this case, since it happens to be a named scale in Daqarta's Scale list.


Customizing Parameters:

GlossyFishSticks and GlossyFishBones employ User Variables instead of constants to set range limits for randomly-chosen parameters. These variables are set in the initial portion of the Voice 1 Changes Script (see below). This makes it easy to experiment with different parameter ranges, without having to change constant values in 8 separate voice scripts.

Performances use many random parameters, obtained using a pseudo-random number generator that is based on a single "seed" value. The seed is set with a "true random" number, but that can be overridden by setting a specific value, such as from a prior random performance that you want to repeat. (The current seed is always shown in the lower left output display.) Several specific seeds are included in the scripts, at the start of the Voice 1 script for GlossyFishSticksm, and at the start of the Percussion script for GlossyFishBones. By default they are all disabled with leading comment semicolons; remove a semicolon to repeat that specific performance.

If you find a random seed that gives a performance you really like, you can regard the performance as your own discovery. Since there are over 4 billion possible seeds (2^32-1), it's pretty unlikely that anyone else will make the same discovery if you don't divulge the seed.

Even better, you can modify the Changes scripts to really make a setup into your own creation; seeds that yield a certain performance on one setup will give completely different results on a setup with even minor differences in (say) the base pattern size limits (see below) or in the order in which random values are used. See the Theme Pattern Repeat subtopic above for a dramatic example of how a trivial change can have a huge effect.

Musical pattern (theme) length range is between UL=7 and UU=11. Ur=0 controls whether and how often the initial themes should be repeated. These were discussed above under the Theme Pattern Repeat subtopic. That also mentions allowing the themes to repeat, but with new Instruments or other parameters. See the Voice 1 Changes Script discussion, below, for more details.

The Random Hold Beats subtopic discussed use of lower UM=-4 and upper Um=4 limits to control both range and biased probability.

Random Levels discussed minimum Uv=48 and maximum UV=80 limits.

Ug=2 sets the maximum for Random Note and Percussion Lags, as discussed in that subtopic.

The theme consists of two different patterns played in AABABA sequence as one "verse". Qv=2 sets the number of verses. After all verses the final note is sustained for Qs=4 beats, followed by a rest of Qr=4 beats. Then a new random instrument, pattern length, pattern notes, and other parameters are chosen for that voice and it begins a new theme.

The maximum Instrument number is set by UI=118 and the minimum by Ui=0. You can also replace any of the General MIDI Instruments you don't care for, as shown in the Voice 1 Changes Script, below, where Bb14.109=108 replaces Bagpipe with Kalimba.

The maximum note used in the voice patterns is UN=80, which is G#5, and the minimum is Un=40, which is E2.

The percussion-only "intro" delay is between Qt=10 and QT=50 beats. At the default beat rate of 300 BPM (200 msec/beat), this gives a delay of 2-10 seconds.

After the percussion intro, the individual voices come in over a range of up to UT=50 beats (10 seconds).

In the Percussion Changes script, below, are controls for the minimum Percussion pattern length Up=4 and maximum UP=9. Each pattern is repeated UR=4 times.

The minimum Percussion instrument number is Uj=27 (Hi-Q) and the maximum is UJ=87 (Open Sudro). Unwanted General MIDI Percussion Instruments can be replaced; Bb24.32=47 replaces Click 1 with Low-Mid Tom, and Bb24.72=71 replaces Long Whistle with Short Whistle.


GlossyFishSticks Voice 1 Changes Script:

GlossyFishSticks and GlossyFishBones both use nearly identical Voice 1 Changes Scripts. The basic operation is similar to that for GlossyFish, but there are important differences. The first is that the Velocity Map no longer occupies the first line... it's now in the Percussion script, which runs before the voice scripts.

In addition, GlossyFishSticks sets the random seed at its start (as does GlossyFish), whereas GlossyBones sets it in its Percussion script since it uses random numbers during Percussion initialization.

In GlossyFish, "sound effects" instruments like Telephone and Gunshot were omitted by limiting the maximum instrument number to 118. But you may want to use some of these, or you may want to omit particular "normal" instruments. To allow this we first fill Voice 1, Buffer 4 using an increment fill from 0-127 via Bi24.0=(0,88). Then we use direct access to replace any undesired instruments. Here we replace Bagpipe (109) with an added instance of Kalimba (108) using Bb14.109=108. You can replace as many instruments as desired using the same technique.

Whenever an instrument is to be selected, we first select a random index between limits Ui and UI, and use the value at that buffer position as the instrument number. For Voice 1, that's done via I1=B14.?(Ui,UI). (See Random Selection From a Buffer under Changes Script Random Values for more details.)

The typical way to use GlossyFishSticks and GlossyFishBones is with a percussion-only "intro" of between Qt=10 and QT=50 beats. At the default beat rate of 300 BPM (200 msec/beat), this gives a delay of 2-10 seconds.

The Percussion script (which runs before this Voice 1 script) has already set variable QP to the initial Percussion button state with QP=XP, then set Percussion voices off via XP=0. This is so that the initial beat (before Percussion is initialized) won't use whatever Percussion instruments were last in use. (This is really only a concern if you want to repeat a performance exactly, including the very first beat.)

The Voice 1 script then looks to see if Percussion is intended to be on, via the IF test [QP=1. If so, the random 10-50 beat count is found and set back into QT for use by individual voice timers. Otherwise, if Percussion has been toggled off before the performance start, QT is set to zero. This is all done by the line:

[QP=1 QT=?(Qt,QT) | QT=0]

QT will then be used as the number of beats to wait before starting the tonal voices. The voices will come in over a range of up to UT=50 beats... up to 10 seconds.

To do that, we first set a variable for each voice (U1 for Voice 1 up to U8 for Voice 8) that specifies the total elapsed beats at the time it should come in. U1=QT sets Voice 1 to come in immediately after the intro. The rest of the voices will come in from QT up to UT beats beyond that, using U2=QT+?(0,UT) for Voice 2, etc.

The actual delay is done at the start of the infinite loop in Voice 1, using this IF-ELSE statement:

[mB<U1 W=1 | X1=1

The voice is held off until the elapsed beats variable mB reaches the U1 limit. If mB is less than U1, then the loop waits one beat (W=1) before retesting. Otherwise Voice 1 is toggled on with X1=1, and the remainder of the infinite loop selects an instrument, sets parameters and patterns, and plays one full song cycle.

Another major difference with GlossyFish is the Theme Pattern Repeat feature, discussed in its own subtopic (above). To implement that, the script for each voice waits until it has chosen all the random values and has set the associated parameters and patterns. It then tests to see if these are the initial settings, relying on the fact that all User Variables are initialized to 0 at the start of every performance. In Voice 1, if Q1 is found to be 0 then everything that was just set is copied to Voice 1 Buffer 3. Then Q1 is set to 1 for the rest of the performance.

Buffer 3 is treated as 4 separate sections of 64 values each. (Note that this means the UU base pattern limit can never be greater than this.) The Velocity Pattern is saved starting at position 0, and the Buffer 1 and Buffer 2 note patterns are saved starting at Buffer 3 positions 64 and 128, respectively. The pattern length, Instrument number, Hold Beats, and Level values are saved individually at positions 192 through 195.

If the test finds non-zero Q1, then this is not the initial pass. [U1<Ur tests if the new pattern length U1 is less than threshold Ur; if so, then the saved initial parameters are copied back to replace the just-selected random parameters.

If you want to use the same pattern, but play it on the new Instrument, or with the new Hold Beats or Level, you can add semicolons as desired in front of the lines that set these stored values back to the active parameters:

    I1=Bb13.193             ;Original Instrument
    H1=Bb13.194             ;Original Hold Beats
    L1=Bb13.195             ;Original Level

You'll need to do that separately for each voice.


The other Voices 2-8 are all infinite loops by default, since they omit the once-only initialization done at the start of Voice 1. They begin with similar IF-ELSE tests and operate the same way.

?s=?(-3G,3G)            ;32-bit random seed
;?s=h976C0088           ;"Mountain Heather" seed
;?s=h9AA1B50E           ;"In Memoriam" seed
;?s=hBD4BEDC0           ;"Rising Storm" seed
;?s=h1E451A44           ;"Strings Attached" seed
;?s=hEA5FDDF2           ;"Shy Away" seed
?x=0                    ;Set pseudo-random mode
oLh=s                   ;Show random seed

UL=7                    ;Base pattern lower size limit
UU=11                   ;Base pattern upper size limit
Ur=0                    ;Pattern repeat threshold
UM=-4                   ;Hold Beats lower limit
Um=4                    ;Hold Beats upper limit
UN=80                   ;Max random note in pattern
Un=40                   ;Min random note in pattern
UI=118                  ;Max Instrument number
Ui=0                    ;Min Instrument number
Bi14.0=(0,128)          ;Fill buffer posns 0-127 with index
Bb14.109=108            ;Replace Bagpipe with Kalimba
UV=80                   ;Max random Level
Uv=48                   ;Min random Level
Ug=2                    ;Max random Note Lag
Qv=2                    ;Number of verses per theme
Qs=4                    ;Sustain beats after all verses
Qr=4                    ;Rest beats after sustain
US=S1                   ;Default Voice 1 Scale
oRS=US                  ;Show Scale name
Qt=10                   ;Min intro delay for Percussion
QT=50                   ;Max intro delay (beats)
[XP=1 QT=?(Qt,QT) | QT=0]  ;No intro delay if no Perc
U1=QT                   ;Voice 1 starts after intro delay
UT=50                   ;Max voice-voice intro delay
U2=QT+?(0,UT)           ;Random delays for voices 2-8
U3=QT+?(0,UT)
U4=QT+?(0,UT)
U5=QT+?(0,UT)
U6=QT+?(0,UT)
U7=QT+?(0,UT)
U8=QT+?(0,UT)

{!                      ;Infinite loop
[mB<U1 W=1 | X1=1       ;If intro delay over, voice on
I1=B14.?(Ui,UI)         ;Random Instrument
L1=?(Uv,UV)             ;Random Level
g1=?r(0,Ug)             ;Random Note Lag
H1=?(UM,Um)             ;Biased random Hold Beats
U1=?(UL,UU)             ;Random pattern length
V1.0="8"                ;1st note velocity, always sounds
Bf1V.1=(?(0,15),U1-1)   ;Random Velocity Pattern
Bf11.0=(?(Un,UN),U1)    ;Random Note Buffer 1 Fill
Bf12.0=(?(Un,UN),U1)    ;Random Note Buffer 2 Fill
[Q1=0                   ;Initial pass?
    BC13.0=1V(0,U1-1)       ;If so, save Velocity Pattern
    BC13.64=11(0,U1-1)      ;Save Buffer 1 note pattern
    BC13.128=12(0,U1-1)     ;Save Buffer 2 note pattern
    Bb13.192=U1             ;Save pattern length
    Bb13.193=I1             ;Save Instrument number
    Bb13.194=H1             ;Save Hold Beats
    Bb13.195=L1             ;Save Level
    Q1=1                    ;Flag = initial pass done
|                       ;Else if not initial pass,
    [U1<Ur                  ;Is pattern size below threshold?
        U1=Bb13.192             ;If so, restore original size
        BC1V.0=13(0,U1-1)       ;Original Velocity Pattern
        BC11.0=13(64,U1+63)     ;Original Buffer 1
        BC12.0=13(128,U1+127)   ;Original Buffer 2
        I1=Bb13.193             ;Original Instrument
        H1=Bb13.194             ;Original Hold Beats
        L1=Bb13.195             ;Original Level
    ]                       ;End pattern threshold IF
]                       ;End initial pass IF
U1=U1*H1                ;Pattern * Hold length
{Qv                     ;Play Qv complete verses
i1=11 W=2*U1            ;select Buf 1, play twice
i1=12 W=U1              ;Buffer 2, play once
i1=11 W=U1              ;Buffer 1, play once
i1=12 W=U1              ;Buffer 2, play once
i1=11 W=U1              ;Buffer 1, play once
}                       ;End of verse
s1=1                    ;Sustain after 2nd verse
X1=0                    ;Voice 1 Instrument off
W=Qs                    ;Hold (wait) Qs beats
s1=0                    ;Sustain off
W=Qr                    ;Rest Qr beats
X1=1                    ;Instrument on
]                       ;End intro delay IF
}                       ;End of infinite loop

GlossyFishSticks Percussion Changes Script:

This script is very similar to that for GlossySticks Percussion. One difference is that GlossySticks selected instrument numbers over the range of 33-87 to avoid Click 1 (32). Here, as in GlossyBones, we use increment fill Bi24.0=(0,88) to fill Voice 2, Buffer 4 with values 0-87, then use Bb24.32=47 direct access to replace the value at index 32 with an extra copy of 47 (Low-Mid Tom). You can use any replacement you choose.

Also, the Percussion button may have been toggled off before starting, indicating that no Percussion instruments should be used, only tonal instruments. So the initial button state is saved via QP=XP, then Percussion (sound, not this script) is forced off for the initial beat via XP=0. Percussion needs to be off before before Percussion is initialized, or else the initial beat will use whatever Percussion instruments were last in use.

After the first beat (W=1 Wait) Percussion is restored to its initial state with [QX=0 XP=QP QX=1]. The variable QX, as with all User Variables, is automatically initialized to zero before the start of the performance. This statement says that IF it is zero (meaning this is the first beat), set Percussion state XP to the state saved in QP, then set QX=1 so this won't happen again. That way, you can manually toggle Percussion off at any time during the performance and it won't be forced back on by XP=QP after every beat.

Another difference with GlossySticks is that we replace Long Whistle (72) with an extra copy of Short Whistle (71) via Bb24.72=71. The Long Whistle was fine for the purely percussive performances of GlossySticks, but seems obnoxious with the more-melodic tonal performances of GlossyFishSticks.

Also, GlossySticks had a 16-character velocity map which was accessed as index positions 0-15. In GlossyFishSticks we have a 32-character map. It consists of the original 16-character GlossyFish map, used by the tonal voices, with the wider-range map of GlossySticks and GlossyBones appended to it at positions 16-31 for percussion use.

We thus create a new velocity pattern from the map with BfAV.0=(?(16,31),Ua) for Percussion voice A, and likewise for B through F.

Bv="0_8_8_8_8_8_88880_4_4_6_6_6_8888"   ;Buffer Velocity Map
QP=XP                  ;Save Percussion button state
XP=0                   ;Force Percussion off for 1st beat
Up=4                   ;Min pattern length
UP=9                   ;Max pattern length
Uj=27                  ;Min Percussion instrument
UJ=87                  ;Max Percussion instrument
Bi24.0=(0,88)          ;Fill buffer with 0-87
Bb24.32=47             ;Replace Click 1 with Low-Mid Tom
Bb24.72=71             ;Replace Long Whistle with Short
UR=4                   ;Pattern repeat count

{!                     ;Infinite loop
W=1                    ;Wait 1 beat
[QX=0 XP=QP QX=1]      ;Percussion back on after 1st beat
QA=QA-1                ;Perc A countdown
[QA<=0                 ;If 0 or less...
    Ua=?(Up,UP)            ;New random pattern length
    IA=B24.?(Uj,UJ)        ;New A instrument
    BfAV.0=(?(16,31),Ua)   ;New velocity pattern
    gA=?r(0,Ug)            ;New Percussion Lag
    QA=UR*Ua               ;Reset count for new total beats
]                      ;End IF
QB=QB-1                ;Perc B countdown
[QB<=0
    Ub=?(Up,UP)
    IB=B24.?(Uj,UJ)
    BfBV.0=(?(16,31),Ub)
    gB=?r(0,Ug)
    QB=UR*Ub
]
QC=QC-1                ;Perc C countdown
[QC<=0
    Uc=?(Up,UP)
    IC=B24.?(Uj,UJ)
    BfCV.0=(?(16,31),Uc)
    gC=?r(0,Ug)
    QC=UR*Uc
]
QD=QD-1                ;Perc D countdown
[QD<=0
    Ud=?(Up,UP)
    ID=B24.?(Uj,UJ)
    BfDV.0=(?(16,31),Ud)
    gD=?r(0,Ug)
    QD=UR*Ud
]
QE=QE-1                ;Perc E countdown
[QE<=0
    Ue=?(Up,UP)
    IE=B24.?(Uj,UJ)
    BfEV.0=(?(16,31),Ue)
    gE=?r(0,Ug)
    QE=UR*Ue
]
QF=QF-1                ;Perc F countdown
[QF<=0
    Uf=?(Up,UP)
    IF=B24.?(Uj,UJ)
    BfFV.0=(?(16,31),Uf)
    gF=?r(0,Ug)
    QF=UR*Uf
]

US=S1                      ;Set US to Voice 1 Scale
UK=K#                      ;Most-recent key hit
[UK>0                      ;Any key?  If so, test which:
[UK="?" US=?r(2048,4095)]  ;Random Scale
[UK="5" US=2064]           ;5th (Power Chord)
[UK="6" US=2196]           ;Major 6th Chord
[UK="7" US=2774]           ;Dominant 7th
[UK="B" US=2964]           :Blues Major
[UK="b" US=2418]           ;Blues Minor
[UK="C" US=4095]           ;Chromatic
[UK="c" US=2048]           ;C-notes only
[UK="H" US=2777]           ;Harmonic Major
[UK="h" US=2905]           ;Harmonic Minor
[UK="L" US=2741]           ;Lydian
[UK="l" US=3434]           ;Locrian
[UK="M" US=2773]           ;Major
[UK="m" US=2906]           ;Natural Minor
[UK="P" US=2708]           ;Pentatonic Major
[UK="p" US=2386]           ;Pentatonic Minor
[UK="w" US=2730]           ;Whole Tone
[UK="X" US=2258]           ;Mixolydian Pentatonic
[UK="y" US=3442]           ;Blues Phrygian
]                          ;End main hot-key test

[S2!=US             ;If Voice 2 Scale not as above,
S9=US               ; then update all to new scale
oRS=US              ;Show scale name or pattern
]
}                   ;End of infinite loop

GlossyFishBones Voice 1 Changes Script:

This is identical to the GlossyFishSticks Voice 1 script except that the initial random seed setup is missing. That's now in the GlossyFishBones Percussion script.

UL=7                    ;Base pattern lower size limit
UU=11                   ;Base pattern upper size limit
Ur=0                    ;Pattern repeat threshold
UM=-4                   ;Hold Beats lower limit
Um=4                    ;Hold Beats upper limit
UN=80                   ;Max random note in pattern
Un=40                   ;Min random note in pattern
UI=118                  ;Max Instrument number
Ui=0                    ;Min Instrument number
Bi14.0=(0,128)          ;Fill buffer posns 0-127 with index
Bb14.109=108            ;Replace Bagpipe with Kalimba
UV=80                   ;Max random Level
Uv=48                   ;Min random Level
Ug=2                    ;Max random Note Lag
Qv=2                    ;Number of verses per theme
Qs=4                    ;Sustain beats after all verses
Qr=4                    ;Rest beats after sustain
US=S1                   ;Default Voice 1 Scale
oRS=US                  ;Show Scale name
Qt=10                   ;Min intro delay for Percussion
QT=50                   ;Max intro delay (beats)
[QP=1 QT=?(Qt,QT) | QT=0]  ;No intro delay if no Perc
U1=QT                   ;Voice 1 starts after intro delay
UT=50                   ;Max voice-voice intro delay
U2=QT+?(0,UT)           ;Random delays for voices 2-8
U3=QT+?(0,UT)
U4=QT+?(0,UT)
U5=QT+?(0,UT)
U6=QT+?(0,UT)
U7=QT+?(0,UT)
U8=QT+?(0,UT)

{!                      ;Infinite loop
[mB<U1 W=1 | X1=1       ;If intro delay over, voice on
I1=B14.?(Ui,UI)         ;Random Instrument
L1=?(Uv,UV)             ;Random Level
g1=?r(0,Ug)             ;Random Note Lag
H1=?(UM,Um)             ;Biased random Hold Beats
U1=?(UL,UU)             ;Random pattern length
V1.0="8"                ;1st note velocity, always sounds
Bf1V.1=(?(0,15),U1-1)   ;Random Velocity Pattern
Bf11.0=(?(Un,UN),U1)    ;Random Note Buffer 1 Fill
Bf12.0=(?(Un,UN),U1)    ;Random Note Buffer 2 Fill
[Q1=0                   ;Initial pass?
    BC13.0=1V(0,U1-1)       ;If so, save Velocity Pattern
    BC13.64=11(0,U1-1)      ;Save Buffer 1 note pattern
    BC13.128=12(0,U1-1)     ;Save Buffer 2 note pattern
    Bb13.192=U1             ;Save pattern length
    Bb13.193=I1             ;Save Instrument number
    Bb13.194=H1             ;Save Hold Beats
    Bb13.195=L1             ;Save Level
    Q1=1                    ;Flag = initial pass done
|                       ;Else if not initial pass,
    [U1<Ur                  ;Is pattern size below threshold?
        U1=Bb13.192             ;If so, restore original size
        BC1V.0=13(0,U1-1)       ;Original Velocity Pattern
        BC11.0=13(64,U1+63)     ;Original Buffer 1
        BC12.0=13(128,U1+127)   ;Original Buffer 2
        I1=Bb13.193             ;Original Instrument
        H1=Bb13.194             ;Original Hold Beats
        L1=Bb13.195             ;Original Level
    ]                       ;End pattern threshold IF
]                       ;End initial pass IF
U1=U1*H1                ;Pattern * Hold length
{Qv                     ;Play Qv complete verses
i1=11 W=2*U1            ;select Buf 1, play twice
i1=12 W=U1              ;Buffer 2, play once
i1=11 W=U1              ;Buffer 1, play once
i1=12 W=U1              ;Buffer 2, play once
i1=11 W=U1              ;Buffer 1, play once
}                       ;End of verse
s1=1                    ;Sustain after 2nd verse
X1=0                    ;Voice 1 Instrument off
W=Qs                    ;Hold (wait) Qs beats
s1=0                    ;Sustain off
W=Qr                    ;Rest Qr beats
X1=1                    ;Instrument on
]                       ;End intro delay IF
}                       ;End of infinite loop

GlossyFishBones Percussion Changes Script:

This is the same as that for GlossyBones Percussion, except that where that replaced only Click 1 with Low-Mid Tom, here we additionally replace Long Whistle with Short Whistle.

Also, we create and modify the velocity pattern using velocity map index values 16-31, since the old map is now the upper half of the new 32-character map. (The 0-15 values are used by the tonal voices.)

Unlike GlossyFishSticks, which set the random seed in its Voice 1 script, GlossyFishBones sets it in Percussion (which runs before Voice 1) so it can be used to initialize the Percussion patterns.

The seed is set with a "true random" number, but that can be overridden by setting a specific value, such as from a prior random performance that you want to repeat. (The seed is always shown in the lower left output display.) Several specific seeds are included in the script, with leading comment semicolons. Remove the semicolon to repeat that specific performance.

In addition, like GlossyFishSticks Percussion, here we save the initial Percussion button state with QP=XP and force if off with XP=0 before the first beat, and restore it with [QX=0 XP=QP QX=1] after the W=1 Wait at the start of the infinite loop. That prevents uninitialized Percussion instruments from being used on the initial beat. The IF only does that on the first beat, after which QX=1, allowing you to toggle Percussion off and on during the performance.

Bv="0_8_8_8_8_8_88880_4_4_6_6_6_8888"   ;Buffer Velocity Map
?s=?(-3G,3G)            ;32-bit random seed
;?s=h2AC43E84           ;"Morning Glory"
;?s=hCDD481C8           ;"Huldra Hideaway"
;?s=hC3761FE9           ;"Sparkle"
;?s=h1767253A           ;"Badger Boogie"
;?s=h156F3B15           ;"Tune Up"
?x=0                    ;Set pseudo-random mode
oLh=s                   ;Show random seed

QP=XP                  ;Save Percussion button state
XP=0                   ;Force Percussion off for 1st beat
Up=4                   ;Min pattern length
UP=9                   ;Max pattern length
Uj=27                  ;Min Percussion instrument
UJ=87                  ;Max Percussion instrument
Bi24.0=(0,88)          ;Fill buffer with 0-87
Bb24.32=47             ;Replace Click 1 with Low-Mid Tom
Bb24.72=71             ;Replace Long Whistle with Short
UR=4                   ;Pattern repeat count
Ua=?(Up,UP)            ;Random A pattern length
BfAV.0=(?(16,31),Ua)   ;Random A Vel fill from Map
Ub=?(Up,UP)            ;Random B pattern length
BfBV.0=(?(16,31),Ub)   ;Random B Vel fill from Map
Uc=?(Up,UP)            ;Random C pattern length
BfCV.0=(?(16,31),Uc)   ;Random C Vel fill from Map
Ud=?(Up,UP)            ;Random D pattern length
BfDV.0=(?(16,31),Ud)   ;Random D Vel fill from Map
Ue=?(Up,UP)            ;Random E pattern length
BfEV.0=(?(16,31),Ue)   ;Random E Vel fill from Map
Uf=?(Up,UP)            ;Random E pattern length
BfFV.0=(?(16,31),Uf)   ;Random E Vel fill from Map

{!                     ;Infinite loop
W=1                    ;Wait 1 beat
[QX=0 XP=QP QX=1]      ;Percussion back on after 1st beat
QA=QA-1                ;Perc A countdown
[QA<=0                 ;If 0 or less...
    IA=B24.?(Uj,UJ)            ;New A instrument
    BfAV.?(0,Ua-1)=(?(16,31),1)  ;New velocity, 1 beat only
    gA=?r(0,Ug)                ;New Percussion Lag
    QA=UR*Ua                   ;Reset count for new total beats
]                      ;End IF
QB=QB-1                ;Perc B countdown
[QB<=0
    IB=B24.?(Uj,UJ)
    BfBV.?(0,Ub-1)=(?(16,31),1)
    gB=?r(0,Ug)
    QB=UR*Ub
]
QC=QC-1               ;Perc C countdown
[QC<=0
    IC=B24.?(Uj,UJ)
    BfCV.?(0,Uc-1)=(?(16,31),1)
    gC=?r(0,Ug)
    QC=UR*Uc
]
QD=QD-1                ;Perc D countdown
[QD<=0
    ID=B24.?(Uj,UJ)
    BfDV.?(0,Ud-1)=(?(16,31),1)
    gD=?r(0,Ug)
    QD=UR*Ud
]
QE=QE-1                ;Perc E countdown
[QE<=0
    IE=B24.?(Uj,UJ)
    BfEV.?(0,Ue-1)=(?(16,31),1)
    gE=?r(0,Ug)
    QE=UR*Ue
]
QF=QF-1                ;Perc F countdown
[QF<=0
    IF=B24.?(Uj,UJ)
    BfFV.?(0,Uf-1)=(?(16,31),1)
    gF=?r(0,Ug)
    QF=UR*Uf
]

US=S1                      ;Set US to Voice 1 Scale
UK=K#                      ;Most-recent key hit
[UK>0                      ;Any key?  If so, test which:
[UK="?" US=?r(2048,4095)]  ;Random Scale
[UK="5" US=2064]           ;5th (Power Chord)
[UK="6" US=2196]           ;Major 6th Chord
[UK="7" US=2774]           ;Dominant 7th
[UK="B" US=2964]           :Blues Major
[UK="b" US=2418]           ;Blues Minor
[UK="C" US=4095]           ;Chromatic
[UK="c" US=2048]           ;C-notes only
[UK="H" US=2777]           ;Harmonic Major
[UK="h" US=2905]           ;Harmonic Minor
[UK="L" US=2741]           ;Lydian
[UK="l" US=3434]           ;Locrian
[UK="M" US=2773]           ;Major
[UK="m" US=2906]           ;Natural Minor
[UK="P" US=2708]           ;Pentatonic Major
[UK="p" US=2386]           ;Pentatonic Minor
[UK="w" US=2730]           ;Whole Tone
[UK="X" US=2258]           ;Mixolydian Pentatonic
[UK="y" US=3442]           ;Blues Phrygian
]                          ;End main hot-key test

[S2!=US             ;If Voice 2 Scale not as above,
S9=US               ; then update all to new scale
oRS=US              ;Show scale name or pattern
]
}                   ;End of infinite loop

See also "Glossy" MIDI Setup Family, Example MIDI Setup Files, MIDI Setup Files, Musical Frontiers, DaqMusiq, KaleidoSynth, Pitch-to-MIDI dialog, Pitch Track Toolbox - Overview, Spectrogram / Pitch Track Controls, Spectrogram / Pitch Track (Sgram/PT)


GO:

Questions? Comments? Contact us!

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