NITETIME GOPHER 1.0 - Lake Koshkonong Node
Server: gopher.nitetime.net:70    Selector: /about/nitetime-stinger-laboratory.txt
NITETIME STINGER LABORATORY
===========================

The Nitetime Stinger Laboratory is a browser-controlled MIDI composition and
audition system for a Lowrey LC-20 electronic organ. It generates short station
IDs, dense UFO signals, layered instrument experiments, and music drawn as lines,
then sends the MIDI to the physical organ, which produces the sound.

The lab is part instrument, part synthesizer experiment, and part strange little
radio workshop. Its purpose is to help develop a recognizable nitetime.net sound:
nocturnal, mysterious, retro-futuristic, and strange enough to sound like a
transmission from somewhere else.

The local browser interface is available on the organ workstation at:

http://organ.local:8788/

Generated stingers remain short, usually one to four seconds. This is an
experimentation tool rather than a full-song sequencer.


THE LOWREY LC-20
================

The LC-20 manual documents these capabilities in General MIDI mode:

Instrument selection: programs 0 through 127, for 128 program choices
Melodic channels: MIDI channels 1 through 9 and 11 through 16
Drums: MIDI channel 10
Note-on velocity: 1 through 127
Pitch bend: supported
Volume: controller 7
Pan: controller 10
Expression: controller 11
Sustain/damper: controller 64
Bank selection: controller 22
All Notes Off: supported
System Exclusive: supported, with message definitions not established here

General MIDI mode matters. In Organ mode, channels correspond to organ divisions,
program changes select organ presets, and pitch bend is not recognized. The
webpage uses standard General MIDI instrument names, while the LC-20 determines
the actual sound produced by those programs.


BROWSING AND AUDITIONING
========================

The webpage lets visitors and operators:

- browse experiments and view descriptions and note timelines;
- play, replay, stop, or audition the previous and next item;
- mark favorites or rejected ideas;
- switch between fresh experiments, all current experiments, archived experiments,
  favorites, and rejects;
- resume from the last selected stinger.

Playback comes from the physical organ. The browser does not synthesize or record
the audio.


PAINT THE FLIGHT PATH
=====================

The drawing pad turns visual gestures into MIDI notes.

Drawing capacity: up to 20 lines
Horizontal direction: time
Vertical direction: pitch
Straight-line tool: drag between two endpoints
Smooth-curve tool: draw a gesture and let the application smooth it
Freehand tool: retain the drawn contour without that smoothing
Removing lines: undo the last line, remove an individual line, or clear the drawing
Saving: create a new numbered MIDI and save its source settings
Revising: load a saved drawing, change it, and save another version

The pitch path is sampled into discrete MIDI notes. A visually smooth curve is
therefore a smooth melodic contour, not automatically a continuous audio glide.
Separate pitch-bend controls add continuous pitch movement between MIDI bend
values.

Drawing drafts, including their settings, are stored in the browser. Permanently
saved experiments are stored on the organ workstation.


INDEPENDENT INSTRUMENTS AND PARTS
=================================

The drawing editor provides 15 melodic parts, each with its own instrument and
settings. These map to the 15 non-drum MIDI channels.

The operator chooses a part before drawing a line. Several lines can belong to the
same part. This allows all 20 lines to play, but does not create 20 independently
controlled MIDI channels. Lines sharing a part also share its instrument, sustain,
pan, expression, and pitch bend.

Each part offers:

Instrument: all 128 General MIDI program choices
Velocity: 1 through 127
Volume: 0 through 127
Expression: 0 through 127
Pan: 0 through 127, with 64 as center
Sustain: off, or held until the clip ends
Bend shape: off, rising, falling, oscillating, or upward scoop
Bend depth: 0 to 100 percent of the MIDI bend range
Bank: optional experimental controller 22 value

Bend affects the whole part, including overlapping notes. Its depth is expressed
as a percentage because the available manual page does not establish the LC-20
bend range in semitones.

Volume, expression, and pan are fixed settings per part. The editor does not yet
draw time-varying automation curves for them.


HARMONY AND MATHEMATICAL PITCH PATTERNS
=======================================

The drawing editor can constrain notes to whole-tone, diminished, augmented,
harmonic minor, and chromatic scales.

It can turn each path into:

- the drawn melody alone;
- opposing mirrored voices;
- triadic harmonies;
- a tritone shadow.

Generated batches also explore Fibonacci-derived patterns, expanding and
contracting shapes, crossing waves, accelerated runs, symmetrical contours, and
dense pitch patterns. These are deterministic note-generation methods. The lab is
not simply scattering random pitches.


BEATS AND TIMING
================

Duration: 1 to 4 seconds
Tempo: 40 to 300 BPM
Free-density sampling: 8 to 64 steps per line
Rhythmic grid: quarter, eighth, sixteenth, or 32nd notes
Swing: 0 to 60 percent
Note length: 10 to 200 percent of the sampling or grid interval
Drum patterns: none, woodblock beacon, backbeat, offbeat pulse, or sixteenth-note motor

Drums use channel 10. Melody and harmony use the other channels.

The performance engine accepts up to 4,096 note attacks across all parts. That is
a software limit, not a measured guarantee of simultaneous LC-20 polyphony.
Dense MIDI also has transmission-time limits, so playback allows time for the
MIDI data to travel to the instrument.


SIMPLE EDITING AND LAYERED AUDITIONS
====================================

Alongside the drawing system, a simpler note editor can change pitch, start time,
duration, and velocity. It supports up to 256 note positions and provides quick
transpose and timing controls.

For ordinary stingers, the instrument panel can layer up to three sounds on
channels 1 through 3. Presets include:

UFO Stack
Ghost Bells
Alien Brass

These layers play the same pattern with progressively softer velocities. The
drawing editor goes further by supporting different lines on independent parts.
Multipart drawings are edited through Load selected drawing rather than the
simpler three-layer controls.


THE CURRENT COLLECTION
======================

At the time of this report, the collection contains 147 experiments:

001 through 020: original small melodic logos, archived
021 through 070: first dense UFO batch, archived
071 through 120: voiced versions of that UFO batch, archived
121 through 140: twenty freshly composed, voiced LC-20 stingers, fresh view
141 through 147: seven saved drawing experiments, active

There are 27 active experiments and 120 archived experiments.

Earlier generated files were moved into an archive during cleanup. Their contents
were verified against SHA-256 checksums. The seven drawing experiments were
preserved.

Every generated MIDI receives a new sequential filename. Archived numbers are
included when allocating the next number, so they are not reused.

Favorites and rejects are copies. Marking an experiment does not delete its
original. Saved records include descriptions and note data. New drawing records
also retain geometry, part assignments, instruments, rhythm settings, and controls.
Supported variation workflows record their source experiment.

This allows continued experimentation without destroying earlier work.


PLAYBACK COORDINATION AND CLEANUP
=================================

The web player uses the existing USB MIDI interface through ALSA aplaymidi. It
dynamically resolves the device and supports an explicit MIDI-port override when
needed.

The lab shares playback locks with the terminal audition tool and the station
controller, preventing the web lab from playing over either one.

New multipart performances finish by sending cleanup on their used channels:

- release sustain;
- send All Notes Off;
- center pitch bend;
- center pan;
- set expression to 127;
- set volume to 100.

Stop also sends explicit note-offs and those resets. Instrument programs and
optional bank selections remain selected. The lab cannot automatically restore
unknown previous panel settings.


RELATIONSHIP TO THE BROADCAST SYSTEM
====================================

The Stinger Laboratory lives separately from the automated Nitetime station. It
reuses the station's Python environment and MIDI hardware, but does not add
experiments to song rotation, modify the song catalog, or turn the OBS display
server into a control panel.

Once a final station signature is selected, a chosen MIDI can be deliberately
integrated into the station's interstitial mechanism. No candidate is promoted
automatically or chosen as the winner.


SOFTWARE AND OPERATION
======================

The implementation uses Python, mido, ALSA MIDI tools, and a browser interface.
No large software collection was installed for the lab.

The service starts with the organ workstation and can be managed locally by the
operator. The browser service uses request and session checks for local-network
access, and currently uses HTTP rather than HTTPS.

The main implementation areas are:

lab.py: numbering, MIDI generation, preservation, and terminal audition
web_lab.py: web interface, playback, and locking
synthesis.py: drawn paths, scales, harmonies, rhythm, and drums
performance.py: independent parts, controllers, bends, and cleanup
index.html: interface structure
app.js: drawing tools and browser controls
style.css: visual design

Instructions are kept with the Stinger Laboratory project.


WHAT HAS BEEN VERIFIED
======================

Automated checks cover sequential saving, archival preservation, instrument
assignments, balanced note events, controller cleanup, 20-line rendering, drums,
swing, playback locking, authentication behavior, and drawing-tool logic. The
live webpage and request validation were also checked.

Those checks did not constitute an audible hardware test of every program or
controller.

The following remain unmeasured or experimental:

- exact LC-20 polyphony and voice-stealing behavior;
- maximum reliably timed dense MIDI throughput;
- actual pitch-bend sensitivity;
- contents of selectable banks;
- model-specific System Exclusive programming;
- undocumented modulation, chorus, or reverb controls;
- audio recording and automatic sound analysis;
- independent bends for notes sharing one channel;
- full-song sequencing.

The lab provides a practical way to explore those musical boundaries through the
LC-20 while keeping each result saved and repeatable.


NITETIME.NET // SIGNAL LAB ACTIVE
SIGNAL ACTIVE   //   WISCO 608   //   Gateway locked to gopher.nitetime.net