Rewrite Flight of the Bumblebee in conductor-style

Replaced 5-line tp() call with full conductor-style arrangement:
- chromRun() helper plays fast chromatic scales in background,
  only every 4th note is hittable (conducting the accent peaks)
- 7 sections: intro → first chromatic runs → development →
  E minor modulation → fff recapitulation → climax → coda
- Three speed tiers (0.09s, 0.065s, 0.055s per note) for
  increasing intensity across sections
- Continuous Am harmonic bed with strings/bass
- Duration expanded from ~35s to ~88s

https://claude.ai/code/session_01TFVkxq4PYhkSFGYHEi4uqY
This commit is contained in:
Claude
2026-04-01 16:13:05 +00:00
parent 8c50398f20
commit 6baec25e6b
+262 -5
View File
@@ -1816,11 +1816,268 @@ const CLASSICAL_PIECES=(function(){
})();
// ── Flight of the Bumblebee ──
var bumblebee=tp("Flight of the Bumblebee","Rimsky-Korsakov",180,
[E5,Eb5,D5,C5,B4,Bb4,A4,Ab4,G4,Gb4,F4,E4,F4,Gb4,G4,Ab4,A4,Bb4,B4,C5,D5,Eb5],
[2,1,0,2,3,2,1,0,3,2,1,0,1,2,3,0,1,2,3,2,0,1],
[{d:0.20,v:0.2,i:'strings'},{d:0.16,v:0.26,i:'strings'},{d:0.14,v:0.32,i:'strings'},{d:0.12,v:0.38,i:'strings'},{d:0.11,v:0.44,i:'strings'},{d:0.10,v:0.48,i:'strings'},{d:0.09,v:0.52,i:'strings'},{d:0.08,v:0.56,i:'strings'},{d:0.07,v:0.6,i:'strings'}],
[E4,Ab4,B4,E5]);
// Conductor-style: ~80s, A minor, famous chromatic runs
// Fast chromatic passages play in background; player hits accent peaks/valleys
var bumblebee=(function(){
var bg=[],mel=[];
function tutti(time,freq,dur,v){
bg.push({t:time,f:freq,d:dur,i:'strings',v:v});
bg.push({t:time,f:freq,d:dur,i:'brass',v:v*0.5});
if(freq>200)bg.push({t:time,f:freq/2,d:dur,i:'bass',v:v*0.4});
}
function timp(time,v){bg.push({t:time,f:A3,d:0.4,i:'timpani',v:v||0.5});}
// Chromatic scale note arrays
var chromDown=[E5,Eb5,D5,Db5,C5,B4,Bb4,A4,Ab4,G4,Gb4,F4,E4];
var chromUp=[E4,F4,Gb4,G4,Ab4,A4,Bb4,B4,C5,Db5,D5,Eb5,E5];
// Helper: play a fast chromatic run (background) with accent hits
// Every 4th note is hittable — player conducts the peaks
function chromRun(t0,notes,lanes,v,speed){
var ct=t0;
notes.forEach(function(f,i){
bg.push({t:ct,f:f,d:speed*0.85,i:'strings',v:v*0.6});
bg.push({t:ct,f:f,d:speed*0.85,i:'woodwind',v:v*0.3});
if(i%4===0){
mel.push({t:ct,l:lanes[Math.floor(i/4)%lanes.length]});
bg.push({t:ct,f:f,d:speed*2,i:'strings',v:v}); // accent
}
ct+=speed;
});
return ct;
}
// === CONTINUOUS HARMONIC BED ===
var harmony=[
[0,5,[A3,C4,E4],0.06], // Am - intro
[5,20,[A3,C4,E4],0.1], // Am - first runs
[20,35,[A3,C4,E4],0.14], // Am - development
[35,50,[E4,G4,B4],0.12], // Em - modulation
[50,65,[A3,C4,E4],0.18], // Am - recapitulation
[65,80,[A3,C4,E4],0.22], // Am - climax
[80,88,[A3,C4,E4],0.14] // Am - coda
];
harmony.forEach(function(h){
for(var ht=h[0];ht<h[1];ht+=2.0){
h[2].forEach(function(f){
bg.push({t:ht,f:f,d:1.9,i:'strings',v:h[3]});
});
bg.push({t:ht,f:h[2][0]/2,d:1.9,i:'bass',v:h[3]*0.5});
}
});
var t=0;
// === SECTION 1 (0-5s): INTRODUCTION — orchestra sets the scene ===
// Sustained Am chord builds, then a quick scale tease
[A3,C4,E4].forEach(function(f){
bg.push({t:0,f:f,d:3.0,i:'strings',v:0.15});
bg.push({t:0,f:f,d:3.0,i:'woodwind',v:0.08});
});
bg.push({t:0,f:A3/2,d:3.0,i:'bass',v:0.12});
// Quick chromatic tease (background only)
for(var ri=0;ri<8;ri++){
bg.push({t:3.0+ri*0.08,f:chromDown[ri],d:0.07,i:'strings',v:0.15+ri*0.02});
}
// Sparse hits to start
timp(1.5,0.3);mel.push({t:1.5,l:4});
timp(3.5,0.35);mel.push({t:3.5,l:4});
t=5.0;
// === SECTION 2 (5-20s): FIRST CHROMATIC RUNS — the famous buzzing ===
// Speed: 16th notes at ~0.09s each (very fast background)
var sp1=0.09;
// Run 1: descending E5→E4 (background buzzing, accents hittable)
t=chromRun(t,chromDown,[2,0,3,1],0.3,sp1);
t+=0.2;
// Run 2: ascending E4→E5
t=chromRun(t,chromUp,[1,3,0,2],0.32,sp1);
t+=0.25;
// Run 3: descending again, louder
t=chromRun(t,chromDown,[0,2,1,3],0.38,sp1);
t+=0.2;
// Run 4: ascending with strings thickening
var s2a=t;
for(ri=0;ri<30;ri++){
bg.push({t:s2a+ri*0.12,f:[A3,E4,A3,C4,E4,A3][ri%6],d:0.1,i:'strings',v:0.1});
}
t=chromRun(t,chromUp,[3,1,2,0],0.4,sp1);
t+=0.25;
// Repeated descending — building
t=chromRun(t,chromDown,[2,0,3,1],0.42,sp1);
t+=0.2;
t=chromRun(t,chromUp,[1,3,0,2],0.44,sp1);
t+=0.3;
// Orchestral accent between phrases
tutti(t,A4,0.4,0.45);timp(t,0.45);mel.push({t:t,l:4});t+=0.6;
// === SECTION 3 (20-35s): DEVELOPMENT — new patterns, thicker texture ===
var s3s=t;
// Woodwind sustained chords underneath
for(var bi=0;bi<8;bi++){
[A3,C4,E4].forEach(function(f){
bg.push({t:s3s+bi*1.8,f:f,d:1.6,i:'woodwind',v:0.1});
});
}
// Partial runs — just the top half, then bottom half
var chromTopDown=[E5,Eb5,D5,Db5,C5,B4,Bb4,A4];
var chromBotUp=[A4,Bb4,B4,C5,Db5,D5,Eb5,E5];
t=chromRun(t,chromTopDown,[2,0,3,1],0.42,sp1);
t+=0.15;
t=chromRun(t,chromBotUp,[1,3,0,2],0.44,sp1);
t+=0.2;
// Full descending with brass accents
chromDown.forEach(function(f,i){
bg.push({t:t+i*sp1,f:f,d:sp1*0.85,i:'strings',v:0.45});
if(i%4===0){
bg.push({t:t+i*sp1,f:f,d:sp1*3,i:'brass',v:0.3});
mel.push({t:t+i*sp1,l:[0,2,1,3][Math.floor(i/4)]});
}
});
t+=chromDown.length*sp1+0.2;
// Full ascending
t=chromRun(t,chromUp,[3,1,0,2],0.48,sp1);
t+=0.25;
// Double-speed burst (even faster!)
var sp2=0.065;
t=chromRun(t,chromDown,[2,0,3,1],0.5,sp2);
t+=0.15;
t=chromRun(t,chromUp,[1,3,0,2],0.52,sp2);
t+=0.3;
tutti(t,A4,0.4,0.5);timp(t,0.5);mel.push({t:t,l:4});t+=0.6;
// === SECTION 4 (35-50s): MODULATION TO E MINOR — new color ===
var chromDownE=[B4,Bb4,A4,Ab4,G4,Gb4,F4,E4,Eb4,D4,Db4,C4,B3];
var chromUpE=[B3,C4,Db4,D4,Eb4,E4,F4,Gb4,G4,Ab4,A4,Bb4,B4];
var s4s=t;
for(bi=0;bi<8;bi++){
[E4,G4,B4].forEach(function(f){
bg.push({t:s4s+bi*1.8,f:f,d:1.6,i:'strings',v:0.12});
});
bg.push({t:s4s+bi*1.8,f:E3,d:1.6,i:'bass',v:0.15});
}
t=chromRun(t,chromDownE,[3,1,0,2],0.45,sp1);
t+=0.2;
t=chromRun(t,chromUpE,[2,0,3,1],0.48,sp1);
t+=0.25;
t=chromRun(t,chromDownE,[0,2,1,3],0.5,sp1);
t+=0.2;
t=chromRun(t,chromUpE,[1,3,2,0],0.52,sp1);
t+=0.25;
// Fast burst in E minor
t=chromRun(t,chromDownE,[3,1,0,2],0.55,sp2);
t+=0.15;
t=chromRun(t,chromUpE,[2,0,3,1],0.55,sp2);
t+=0.3;
// Transition back to A minor
[[E4,2],[F4,1],[G4,3],[A4,0]].forEach(function(n){
tutti(t,n[0],0.25,0.5);mel.push({t:t,l:n[1]});t+=0.3;
});
timp(t,0.55);mel.push({t:t,l:4});t+=0.5;
// === SECTION 5 (50-65s): RECAPITULATION — full orchestra, louder ===
var s5s=t;
for(ri=0;ri<70;ri++){
var rf5=[A3,C4,E4,A4,E4,C4][ri%6];
bg.push({t:s5s+ri*0.1,f:rf5,d:0.09,i:'strings',v:0.12});
}
for(bi=0;bi<8;bi++){
bg.push({t:s5s+bi*1.8,f:A3/2,d:1.6,i:'bass',v:0.2});
if(bi%2===0)timp(s5s+bi*1.8,0.35);
}
// Louder runs with brass doubling accents
t=chromRun(t,chromDown,[0,2,3,1],0.55,sp1);
t+=0.15;
t=chromRun(t,chromUp,[1,3,0,2],0.58,sp1);
t+=0.2;
// Fast burst
t=chromRun(t,chromDown,[2,0,1,3],0.6,sp2);
t+=0.12;
t=chromRun(t,chromUp,[3,1,2,0],0.62,sp2);
t+=0.2;
// Repeated descending — relentless buzzing
t=chromRun(t,chromDown,[0,2,3,1],0.6,sp2);
t+=0.12;
t=chromRun(t,chromUp,[1,3,0,2],0.62,sp2);
t+=0.15;
t=chromRun(t,chromDown,[2,0,1,3],0.64,sp2);
t+=0.2;
tutti(t,A4,0.35,0.58);timp(t,0.55);mel.push({t:t,l:4});t+=0.5;
// === SECTION 6 (65-80s): CLIMAX — maximum speed, fff ===
var s6s=t;
for(ri=0;ri<80;ri++){
var rf6=[A3,E4,A4,C5,A4,E4,C4,A3][ri%8];
bg.push({t:s6s+ri*0.08,f:rf6,d:0.07,i:'strings',v:0.15});
if(ri%6===0)bg.push({t:s6s+ri*0.08,f:rf6*0.5,d:0.2,i:'brass',v:0.1});
}
for(bi=0;bi<8;bi++){
bg.push({t:s6s+bi*1.6,f:A3/2,d:1.4,i:'bass',v:0.25});
timp(s6s+bi*1.6,0.45);
}
// Fastest runs — sp3 speed
var sp3=0.055;
t=chromRun(t,chromDown,[0,2,3,1],0.65,sp3);
t+=0.1;
t=chromRun(t,chromUp,[1,3,0,2],0.68,sp3);
t+=0.1;
t=chromRun(t,chromDown,[2,0,1,3],0.7,sp3);
t+=0.1;
t=chromRun(t,chromUp,[3,1,2,0],0.7,sp3);
t+=0.15;
// Repeated rapid descents — the bumblebee is frantic
t=chromRun(t,chromDown,[0,2,3,1],0.72,sp3);
t+=0.08;
t=chromRun(t,chromDown,[2,0,1,3],0.72,sp3);
t+=0.08;
t=chromRun(t,chromUp,[1,3,0,2],0.74,sp3);
t+=0.1;
// Final ascending blast to peak
[E4,F4,G4,A4,B4,C5,D5,E5].forEach(function(f,i){
bg.push({t:t,f:f,d:0.06,i:'strings',v:0.7});
bg.push({t:t,f:f,d:0.06,i:'brass',v:0.5});
if(i%2===0)mel.push({t:t,l:[0,1,2,3][Math.floor(i/2)]});
t+=0.07;
});
t+=0.2;
// === SECTION 7 (80-88s): CODA — final chords ===
// Big orchestral chords — the bumblebee lands
var chords=[[A3,C4,E4,A4],[E4,G4,B4,E5],[A3,C4,E4,A4],[A3,C4,E4,A4]];
chords.forEach(function(ch,ci){
var ct=t+ci*1.5;
ch.forEach(function(f){
bg.push({t:ct,f:f,d:1.3,i:'strings',v:0.55});
bg.push({t:ct,f:f,d:1.3,i:'brass',v:0.45});
});
bg.push({t:ct,f:ch[0]/2,d:1.3,i:'bass',v:0.45});
timp(ct,0.6);mel.push({t:ct,l:4});
// Quick chromatic fill between chords
if(ci<3){
for(var fi=0;fi<4;fi++){
bg.push({t:ct+0.6+fi*0.08,f:chromDown[fi*3],d:0.07,i:'strings',v:0.4});
}
mel.push({t:ct+0.6,l:ci%2===0?0:2});
}
});
t+=chords.length*1.5;
// Final sustained Am chord
[A3,C4,E4,A4,E5].forEach(function(f){
bg.push({t:t,f:f,d:4.0,i:'strings',v:0.5});
bg.push({t:t,f:f,d:4.0,i:'brass',v:0.4});
});
bg.push({t:t,f:A3/2,d:3.5,i:'bass',v:0.5});
bg.push({t:t,f:A3,d:3.0,i:'timpani',v:0.6});
mel.push({t:t,l:4});
return {n:"Flight of the Bumblebee",composer:"Rimsky-Korsakov",bpm:180,duration:Math.ceil(t+4.5),isClassical:true,bg:bg,melody:mel};
})();
// ── Dance of the Sugar Plum Fairy ──
var sugarplum=(function(){