# Reconstruct a complete chamber performance in REAPER

You are a MIDI orchestrator reconstructing an archived chamber recording into
editable playback material. Rebuild the entire instrumental performance in
`input/performance.wav`: every audible part, its pitches, performed timing,
durations, dynamics and instrument family. This is a simulated delivery brief
using a real, attributed recording, not an asserted client commission.

The recording is Schubert's Piano Quintet in A major, Op.114, complete
movements III, IV and V (MusicNet 1728, 1729 and 1730), approximately 18 minutes. Its parts
are piano, violin, viola, cello and double bass. Follow the recording's actual
performance timing; do not quantize it into a different performance. Recover
overlapping voices and fast notes throughout all three movements. Expressive dynamics
and instrument tone should sound like those families. The source recording's
noise, microphone response and exact samples need not be reproduced.

Use the installed REAPER 7.82/Linux and x42 General MIDI Synth 0.6.4. Included
REAPER virtual instruments, samplers and effects are available; scripting,
generic signal analysis and ReaScript are allowed. REAPER must actually open,
edit and render the native project. Neither an audio-only delivery nor a
Python-only renderer is sufficient. Native GUI mouse-only operation is not a
requirement. Installed analysis libraries are generic; source-score/MIDI/label
files, author reference, grading truth and evaluator are withheld. This
workstation is offline. The software, API documentation and acquisition notes
are in software.md.

Deliver under `output/`:

1. `reconstruction.rpp`: a relocatable native REAPER project, with all performed
   notes in editable, unmuted MIDI items and functioning instrument chains.
   Keep only the reconstruction in the project; the mixed source recording may
   be analyzed elsewhere, but must not be an audio item or rendered source in
   the delivered project. Keep any instrument samples inside output/ and use
   relative paths. Flatten MIDI loops before delivery. Use fixed item playback
   speed 1 and no item stretch markers; express performed timing in the MIDI
   notes/tempo map instead. Use any valid tempo/PPQ encoding that yields the
   same performed times; a constant tempo with off-grid notes is also accepted.
2. `transcription.mid`: full performed MIDI, with the five instrument roles on
   distinct channels and appropriate GM program metadata. Use channel numbers
   0–15 in delivery.json. One role may span several channels/tracks, but a
   channel or project track must not claim two different roles. Notes, CCs and
   tempo changes in this export must agree with the native project's playback.
3. `mixdown.wav`: a complete 48 kHz stereo PCM reconstruction from the project.
4. `stems/`: five complete 48 kHz stereo PCM stems, one per role, starting at
   performance time zero. All use the same duration and time origin as the mix.
   They include that role's instrument/effects/gain/pan. Use flat role tracks with direct master routing, without folders or inter-track
   sends. Several flat tracks per role are allowed. Keep the master at unity gain and centre pan, linear
   and unprocessed so the sum of these role stems reproduces mixdown.wav.
5. `delivery.json`: the exact schema below. Arbitrary stem filenames and track
   names are accepted through this mapping. Project track numbers are 1-based.
6. `overview.png`: an actual screenshot of the native arrangement, for human
   evidence only. It earns no musical credit by its existence or file size.
7. `qc_note.txt`: describe the part reconstruction, tempo representation and
   any unresolved musical uncertainty. No self-reported score is trusted.

Example schema (change channel/track mapping to your actual project):

```json
{
  "schema_version": 1,
  "project": "reconstruction.rpp",
  "midi": "transcription.mid",
  "mix": "mixdown.wav",
  "parts": [
    {"role": "piano", "midi_channels": [0], "project_tracks": [1], "stem": "stems/piano.wav"},
    {"role": "violin", "midi_channels": [1], "project_tracks": [2], "stem": "stems/violin.wav"},
    {"role": "viola", "midi_channels": [2], "project_tracks": [3], "stem": "stems/viola.wav"},
    {"role": "cello", "midi_channels": [3], "project_tracks": [4], "stem": "stems/cello.wav"},
    {"role": "double_bass", "midi_channels": [4], "project_tracks": [5], "stem": "stems/double_bass.wav"}
  ]
}
```

Evaluation is a weighted continuous score: pitch/onset 25%, performed
rhythm/duration 25%, dynamic contour 10%, instrument identity 10%, rendered
instrument tone 20%, and native arrangement/delivery consistency 10%.
The optional native export helper in software/ can render the five role stems
   and mix simultaneously, so modulation phases remain consistent. It contains
   no transcription, score, reference notes or grading truth.
The complete metric, tolerances, accepted equivalents and local error behavior
are in `input/delivery_contract.md`. Missing or malformed MIDI gets zero total;
ordinary missing/incorrect project, sound or documentation loses corresponding
components, rather than changing all correct music into a format failure.

Timing reference comes from MusicNet score-alignment annotations. The dataset
authors report trained-musician verification and approximately 4% label error;
this is not a claim of perfect independent boundaries. Punctuation, formatting,
file size and self-reported correctness are not musical success criteria.
Professional calibration/QC for this constructed workflow remains pending.

Preserve source attribution. `input/ATTRIBUTION.txt` identifies the primary
release, recording and source collection and discloses the development origin.


## Complete multi-movement edition (v7)

Reconstruct the complete consecutive Scherzo, theme-and-variations, and finale
of Schubert's Piano Quintet Op.114 (MusicNet recordings 1728, 1729 and 1730),
about 18 minutes and all five instrumental roles. input/performance.wav contains
the original performances in order with a disclosed four-second silent gap
between movements; no source audio is shortened or omitted.
input/movement_manifest.json gives source identifiers, exact start/duration
and region names. It supplies no notes, score, voice alignments or answer.

Deliver ONE continuous editable REAPER reconstruction and ONE continuous MIDI,
master mix and five role stems covering the entire programme, including the
gaps. Keep the five role ownerships consistent through all movements, including
changing textures, register, sustained string lines and piano accompaniment.
Missing sections and substituted/copied notes remain in the musical score's
normal precision/recall accounting. Reusing an analysis method is permitted.

Add named project regions for the three movement bounds and describe unresolved
voice/transcription choices in qc_note.txt. Region/QC presentation is review
evidence, with no score merely from its presence or wording. Native playback,
editable MIDI and actual waveform agreement remain scored under the public
contract; the published weights and musical tolerances apply to the complete programme.

The workstation's bulk workspace is durable shared storage. Use the provided
local /workspace/.runtime directory for REAPER configuration, HOME, caches and
small temporary settings; configuration atomic writes require that local path.
Keep big analysis arrays and audio outside .runtime. The generic exporter uses
local private native settings and bulk waveform storage, with no answer data.


# Actual software and available workstation

REAPER 7.82 for Linux x86-64 edits and renders .rpp MIDI/instrument projects.
Official download: https://www.reaper.fm/download.php
Recorded archive: reaper782_linux_x86_64.tar.xz
SHA-256: a4aa961534f22ae5ae910e4ec0c200dcb4476c9f7556806fe09a9743cd582563
REAPER is proprietary, with a fully functional 60-day evaluation; continued
use requires an appropriate licence. No purchased licence is claimed here.
Runtime command: `reaper [project.rpp | script.lua ...]`.
`reaper -help` describes -cfgfile, -newinst, -nonewinst and -renderproject.
ReaScript API: https://www.reaper.fm/sdk/reascript/reascripthelp.html
Lua scripts run inside the real REAPER process and may call its MIDI and render
APIs. The native reference was actually built/rendered and reopens with this
software; GUI mouse-only authoring is not required.

x42 General MIDI Synth 0.6.4 is an actual LV2 sampled GM instrument, backed by
GeneralUser GS. Official acquisition: https://x42-plugins.com/x42/x42-gmsynth
Plugin URI: http://gareus.org/oss/lv2/gmsynth
Find it in REAPER as `General MIDI Synth`; MIDI program_change selects sounds.
GM numbers here use MIDI's 0-based program encoding:
piano 0; violin 40; viola 41; cello 42; double bass 43.
The plugin has its own GPL terms and GeneralUser samples retain their creator's
separate licence/attribution. GeneralUser author: S. Christian Collins,
https://www.schristiancollins.com/generaluser
Record/install licences when redistributing components. Installation archives
are not automatically licensed as task inputs and are not included in this
solver material. Generic instruments are installed in the workstation.

Included REAPER ReaPlugs/JS instruments/effects and generic Python audio-analysis
libraries are permitted. Python only assists analysis, automation and scoring;
the delivered native project must actually replay in REAPER. No pretrained
task-specific score/label files or solution builders are provided. The local
blind workstation uses the normal 7200-second, 400-action, 4-CPU, 6-GiB budget;
it has an Xvfb screen and generic screenshot tools. These are local evaluation
settings, not a claim that the remote ALE runtime was executed.

Offline API documentation: /opt/toolchain/reascripthelp.html. Generic MIDI Python library mido 1.3.3 is installed; use python3. The REAPER command wrapper isolates its native shared-library environment. A short generic single-note playback control is run before the blind trial; it contains no task solution.

Optional general exporter: after saving your own reconstruction.rpp, transcription.mid and delivery.json, run `python3 software/export_native.py --output output --input input/performance.wav`. It invokes actual REAPER to export simultaneous master/stems, leaving the saved project and MIDI intact. Manual equivalent export is permitted. It contains no audio transcription or answer data.

For this version, large writable workspace/audio is on durable bulk storage, and native settings use private local .runtime. Use local settings as documented; this is an infrastructure adaptation, not a reduced solver resource/time budget.


# Complete public evaluation contract — music-quintet-v7-20261009

This is a contributor's standalone local rubric, not an official ALE result.
The objective is the entire recording and all five roles, not a short melody.
The source-aligned note reference has upstream annotation uncertainty. The
rendered reference's velocity/dynamic realization is constructed from the
recording's mixed envelope, not independently measured acoustic stem truth.
The timbral and dynamic thresholds are author-selected and professional
calibration remains pending. Alternative instruments within the required
families may differ from the reference samples and need not match waveforms.

## Delivery interpretation

Use the manifest in instruction.md. Roles are exactly piano, violin, viola,
cello, double_bass. Channel ownership and native track ownership are disjoint;
several channels/tracks for one role are allowed. Track numbers are 1–64 and
MIDI channels are 0–15. Do not route one role's audio through another role's
tracks. Use flat tracks, with direct master routing and no folders/inter-track
 sends. Native replay temporarily routes each role to a unity-gain bus and
 simultaneously renders the master and five buses. These in-memory routing
 changes are never saved into the candidate project. Keep the master at unity gain and centre pan,
linear at full stereo width, with no master FX or audio automation. Tempo-map automation remains allowed. Keep all track and master solo controls off, and keep every mapped role track's direct master send enabled. Reference duration is the source WAV's
duration (approximately 18 minutes; exact frame duration in movement_manifest.json). Every stem and mix starts at zero,
has this duration within 100 ms, and uses the same frame count. WAVs are stereo
48000 Hz PCM16/24/32 or IEEE float; finite samples within full scale are required.

Use standard synchronous MIDI type 0 or 1 with positive PPQ. All performed
note times are decoded through the complete tempo map into seconds; changing
PPQ or tempo representation without changing performed times has no penalty.
Note-ons/offs must be balanced, with positive durations inside the programme
(100 ms end tolerance). Repeated overlapping notes of the same channel/pitch
are paired FIFO. No more than 50000 notes, 5000 channel-controller events or 2 MB MIDI/manifest; native project
at most 8 MB and 64 tracks; each WAV at most 600 MB. Use regular files and
relative paths within output/, without symlinks. Machine directory aliases
above output/ are canonicalized. All samples/assets required by the project
must be included in output/ with references relative to the project file. A nested project may use ../assets when every traversed path stays inside output/ and contains no symlink. Absolute native media references, missing assets and symlinked delivery paths lose native credit. Installed generic instrument components (for example the supplied x42 GeneralUser instrument) are software dependencies and need not be copied into output/. Missing metadata or an
invalid role map prevents musical ownership and gets zero total, as does a
missing or malformed MIDI. Empty MIDI gets zero musical credit.

## Components (weights sum to 1)

- Pitch/onset, 0.25: maximum one-to-one matching by role, equal MIDI pitch, and
  onset within 80 ms. Score is global note F1 = 2 matches/(delivered+reference
  notes). Extra, duplicated and unassigned notes stay in the denominator.
- Rhythm/duration, 0.25: independent maximum one-to-one matching by role,
  onset within 80 ms, and duration error at most max(150 ms, 30% of reference
  duration). Pitch is not required for this separate rhythm component. Score
  uses the same global F1. Actual performed seconds are used in both metrics.
- Instrument identity, 0.10: pitch-matched notes whose MIDI program is in the
  declared role's family, divided by max(delivered count, reference count).
  Zero-based GM programs: piano 0–7, violin 40, viola 41, cello 42, bass 43.
  Metadata alone cannot earn the rendered-tone component.
- Dynamics, 0.10: mean over five roles of Pearson correlation of 250 ms RMS
  contours in dB, clipped to [0,1]. RMS is floored at 1e-5; silent/constant
  contours get zero. The comparison is with constructed reference stems.
- Rendered tone, 0.20: per role, mean spectral-shape similarity with per-frame log-energy centering.
  Stereo average is resampled to 16 kHz. Hann-window FFT1024, hop512, twenty
  triangular mel bands from 50 to 7500 Hz, log-band centering, orthonormal DCT
  coefficients 1–12. Centering reduces overall-gain effects; the fixed log-energy floor means exact gain invariance is not promised for near-silent narrow-band signals. Frames below 1e-4 of maximum spectral power are omitted.
  Let distance be RMS difference between the mean feature vectors. Score is
  clip((6-distance)/5,0,1): a 1-unit deadband and zero at 6 units. Silence gets
  zero. This is broad tonal resemblance, not perfect acoustic identity.
- Arrangement/consistency, 0.10: 40% exported-note/native-note agreement,
  20% delivered mix/native master render agreement, 20% mean delivered
  stem/native role render agreement, 10% stem-sum/mix agreement, and 10%
  fraction of roles with active editable native notes.

Dynamics and rendered-tone scores for each role are multiplied by that role's
pitch F1, its delivered-stem/native-render agreement, and the native/exported
note agreement. Thus copying the source audio or labeling it as several stems
does not earn sound credit without a matching editable native reconstruction.

Native/exported agreement is the minimum of joint note F1 and channel-control
F1. Joint notes must match role, pitch, onset within 5 ms, duration within 5 ms,
and velocity within 1. Controls include CC, pitch bend, channel pressure and
polyphonic pressure, matched by role, channel voice, event type/index/value
and time within 5 ms. A one-to-one channel rename is inferred independently
within each role from maximum joint matched-note ownership; control agreement
resolves note-identical ties. Moving a controller to another unused channel
does not match, while consistently renaming note and control channels does.
Harmless repeated identical absolute state declarations on the same channel are collapsed. Each invocation of channel commands CC120/121/123–127 and relative parameter increments/decrements CC96/97 remains an event. CC122 is an absolute local-control state. CC121 applies the GM RP-015 controller reset: expression, modulation, pedals, parameter selectors, bend and pressures reset; bank, volume, pan, sound/effect controllers and registered/non-registered parameter values remain. Ordinary high-resolution controller MSB updates clear the associated LSB; data-entry CC6/38 belongs to the currently selected RPN/NRPN parameter. A state restoration after reset or relative parameter change is not a redundant declaration. Reset-sensitive declarations keep their reset epoch when matched; unaffected states remain eligible for harmless duplicate collapse. These are controller/export consistency rules; weights and time tolerances are unchanged. Protocol sources: https://midi.org/midi-1-0-control-change-messages and https://midi.org/response-to-reset-all-controllers. Program
metadata is scored under instrument identity and is not a required native FX
preset representation. Tempo/PPQ equivalents preserve performed seconds.
Native project notes are read through REAPER's actual MIDI/time-map API. Only
active, unmuted MIDI notes count. All unmuted source note/controller events must lie within their active item bounds, with 5 microseconds allowed for API serialization rounding; remove unused events outside those bounds and flatten cropped/looped source spans to the performed timeline. An enabled source-loop flag is harmless when the item ends before the first source cycle ends; actually repeating sources are invalid. Apply take pitch shifts to the editable MIDI notes and leave the take pitch offset at zero. Each mapped track must be unmuted, with exactly one enabled, online instrument at the first top-level FX position. Bake MIDI processing before the instrument, take FX, additional instrument generators and FX containers into the editable notes, then remove those processing stages from the final native project. Audio-only processing after the first instrument remains allowed; it is assessed by the published audio metrics and export consistency, without requiring reference-sample equality. No track audio/FX automation is allowed; tempo-map automation remains accepted. These final-project checks prevent source MIDI from masquerading as differently performed MIDI; they do not prohibit using processing tools while editing. Only the active take may play: with multiple takes, disable Play all takes. Audio items, non-unit item speed, item stretch
markers, out-of-bounds notes or over-limit projects make native credit zero.
Flatten loops and do not use rendering-time note generators as substitutes
for the required editable notes. The grader actually opens and renders the
candidate project in a separate offline process with no hidden data mounted.

Render agreement is clip(1 - max(0,RMS(candidate-native)-3e-5)/max(0.05*RMS(native),1e-5),
0,1), at the same time origin. This checks the candidate against its OWN
native playback, not reference-sample equality. A 3e-5 RMS deadband accepts ordinary PCM16/24 quantization and stem summation;
larger error has the stated linear falloff. Tiny PCM quantization is accepted; shifted, normalized or unrelated exports lose consistency credit.
For stem-sum comparison, the delivered mix is the denominator signal. Musical
sound comparison uses the broad dynamic/tone metrics above.

## Error behavior and evidence

Missing/malformed MIDI or role mapping scores zero total. Missing/bad project
or audio loses the associated native/audio components; correct MIDI remains
eligible for pitch, rhythm and instrument credit. Candidate-native timeout or
failure within the fixed replay limit (180 seconds, 4 CPUs, 6 GiB) loses native
credit. Screenshot and QC note are requested evidence for review and earn no
score by their existence, wording, self-reported results or file size.

Hidden reference integrity and the required native software environment are
checked first against the executed control's hashes. Broken reference raises
ReferenceDataError; a missing/changed required software environment raises
EvaluationEnvironmentError. Both produce score=null, never a candidate zero.
No candidate repairs are applied before grading. The weighted score is in
[0,1] and is a rubric score, not a statistical success rate or expert approval.

The programme contains three complete consecutive movements. Score matching uses their actual positions on the single continuous programme timeline; full note denominators include every reference/delivered event. The source/movement manifest is public, while aligned note labels and author reference remain hidden. The fixed 180-second native replay limit is retained only if the actual full reference control succeeds within it; otherwise setup is revised before freezing, never after a model score.
