diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-27 07:54:41 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-27 07:54:41 +0300 |
| commit | eb6e4851110fc6a9ae336793fd87a2ba6fd48a5b (patch) | |
| tree | 3b09061cdf6ad8ed53d32b90366b370cd4ea03b1 | |
| parent | f075b701736d8e7527b00a0b9bdd47e3466c698b (diff) | |
Add nukem theme: action-hero hard rock with explosive WebGL effects
- New theme directory: templates/themes/nukem/ (meta.json, theme.css, theme.js)
- Red/gold/black color palette with monospace typography
- WebGL: rising sparks, falling debris, rubble blocks, explosion glow
- Sound preset: 140 BPM E-minor power riffs with fanfare stabs (wild: 180 BPM thrash)
- All nav/open/close/scroll/wild/page effects implemented
Amp-Thread-ID: https://ampcode.com/threads/T-019dcd42-8558-748b-8c28-3f848400026d
Co-authored-by: Amp <amp@ampcode.com>
| -rw-r--r-- | internal/generator/templates/themes/nukem/meta.json | 7 | ||||
| -rw-r--r-- | internal/generator/templates/themes/nukem/theme.css | 89 | ||||
| -rw-r--r-- | internal/generator/templates/themes/nukem/theme.js | 268 | ||||
| -rw-r--r-- | internal/generator/theme_sounds.go | 1368 |
4 files changed, 1117 insertions, 615 deletions
diff --git a/internal/generator/templates/themes/nukem/meta.json b/internal/generator/templates/themes/nukem/meta.json new file mode 100644 index 0000000..14d07fa --- /dev/null +++ b/internal/generator/templates/themes/nukem/meta.json @@ -0,0 +1,7 @@ +{ + "title": "SNONUX.FOO \u2014 NUKEM", + "header_html": "\u003cdiv class=\"logo\"\u003e\n \u003cspan class=\"logo-mark\"\u003e\u2622\u003c/span\u003e\n \u003cdiv class=\"logo-title\"\u003e\n \u003ch1\u003eSNONUX.FOO\u003c/h1\u003e\n \u003cp class=\"subtitle\"\u003eHail to the king, baby \u0026mdash; \u003ca href=\"https://foo.zone\"\u003efoo.zone\u003c/a\u003e is the real blog\u003c/p\u003e\n \u003cp class=\"logo-host\"\u003eServed by NetBSD on a Raspberry Pi 3\u003c/p\u003e\n \u003c/div\u003e\n \u003c/div\u003e\n \u003cdiv class=\"nav\"\u003e\n \u003ca href=\"atom.xml\" class=\"header-feed-link\" rel=\"alternate\" title=\"Atom feed\" type=\"application/atom+xml\"\u003eAtom feed\u003c/a\u003e\n \u003ca href=\"https://foo.zone/about\" class=\"transmit-btn\"\u003eLet's Rock\u003c/a\u003e\n \u003c/div\u003e", + "splash_inner_html": "\u003ccanvas class=\"splash-gl-canvas\" id=\"splash-gl-canvas\" aria-hidden=\"true\"\u003e\u003c/canvas\u003e\n \u003cdiv class=\"splash-inner\"\u003e\n \u003cdiv class=\"splash-title\"\u003eNUKEM\u003c/div\u003e\n \u003cdiv class=\"splash-tag\"\u003eIt's time to kick ass and chew bubblegum\u003c/div\u003e\n \u003cdiv class=\"splash-hint\"\u003ePress any key to blow stuff up\u003c/div\u003e\n \u003c/div\u003e", + "prev_page_text": "\u0026laquo; Lock \u0026amp; Load", + "next_page_text": "Damn, I'm Good \u0026raquo;" +} diff --git a/internal/generator/templates/themes/nukem/theme.css b/internal/generator/templates/themes/nukem/theme.css new file mode 100644 index 0000000..060cd08 --- /dev/null +++ b/internal/generator/templates/themes/nukem/theme.css @@ -0,0 +1,89 @@ + :root { --duke-red:#ff0000; --duke-gold:#ffd700; --duke-grey:#3a3a3a; + --duke-bg:#0a0a0a; --duke-dark:#111111; --duke-yellow:#ffcc00; + --duke-blood:#cc0000; --duke-light:#e0e0e0; } + * { margin:0; padding:0; box-sizing:border-box; } + body { font-family:'Courier New',monospace; background:var(--duke-bg); + color:var(--duke-light); overflow:hidden; height:100vh; height:100dvh; font-size:18px; } + #three-canvas { position:fixed; top:0; left:0; width:100%; height:100%; z-index:1; } + .overlay { position:relative; z-index:10; height:100vh; height:100dvh; display:flex; flex-direction:column; } + header { padding:10px 20px; background:rgba(10,10,10,0.9); backdrop-filter:blur(8px); + border-bottom:3px solid var(--duke-red); + display:flex; align-items:center; justify-content:space-between; } + .logo { display:flex; align-items:center; gap:12px; } + .logo-mark { font-size:2.2rem; color:var(--duke-gold); text-shadow:0 0 12px var(--duke-red); + font-weight:bold; } + .logo-title h1 { font-size:1.5rem; color:var(--duke-gold); font-weight:bold; + letter-spacing:3px; text-transform:uppercase; text-shadow:2px 2px 0 var(--duke-red); } + .logo-title .subtitle { font-size:0.8rem; color:var(--duke-light); margin-top:2px; + letter-spacing:1px; } + .logo-title .subtitle a { color:var(--duke-gold); text-decoration:none; } + .logo-title .subtitle a:hover { color:var(--duke-red); text-shadow:0 0 8px var(--duke-red); } + .logo-host { font-size:0.7rem; color:var(--duke-grey); } + .transmit-btn { border:2px solid var(--duke-red); color:var(--duke-gold); padding:8px 16px; + text-decoration:none; font-size:1rem; font-weight:bold; letter-spacing:2px; + text-transform:uppercase; transition:all 0.15s; } + .transmit-btn:hover { background:var(--duke-red); color:var(--duke-bg); + box-shadow:0 0 16px var(--duke-red); } + a.header-feed-link { color:var(--duke-gold); } + a.header-feed-link:hover { color:var(--duke-red); text-shadow:0 0 8px var(--duke-red); } + .nav-hints { background:rgba(10,10,10,0.8); border-bottom:2px solid var(--duke-grey); + color:var(--duke-light); padding:4px 20px; display:flex; gap:16px; + font-size:0.78rem; flex-wrap:wrap; } + .nav-hints kbd { background:var(--duke-dark); border:1px solid var(--duke-red); + color:var(--duke-gold); padding:0 5px; margin:0 2px; } + .content { flex:1; overflow-y:auto; padding:14px 20px; + scrollbar-width:thin; scrollbar-color:var(--duke-red) var(--duke-bg); } + .page-nav { display:flex; justify-content:center; margin:12px 0; } + .page-nav a { border:2px solid var(--duke-red); color:var(--duke-gold); padding:8px 20px; + text-decoration:none; font-size:0.95rem; font-weight:bold; letter-spacing:1px; + text-transform:uppercase; } + .page-nav a:hover { background:var(--duke-red); color:var(--duke-bg); + box-shadow:0 0 12px var(--duke-red); } + .page-nav-footer { flex-shrink:0; padding:6px 20px; display:flex; justify-content:center; + background:rgba(10,10,10,0.9); border-top:3px solid var(--duke-red); } + .post { background:rgba(17,17,17,0.85); border:2px solid var(--duke-grey); + padding:16px 18px; margin-bottom:10px; cursor:pointer; + transition:all 0.15s; } + .post:hover { border-color:var(--duke-red); + box-shadow:0 0 14px rgba(255,0,0,0.3); } + .post-active { border-color:var(--duke-gold) !important; + background:rgba(30,10,0,0.9) !important; + box-shadow:0 0 20px rgba(255,215,0,0.3),inset 3px 0 0 var(--duke-gold) !important; } + .post-header { display:flex; justify-content:space-between; margin-bottom:10px; font-size:0.95rem; } + .post-header strong { color:var(--duke-gold); } + .post-time { color:var(--duke-red); font-size:0.85rem; } + .post-text { line-height:1.55; font-size:1rem; } + .post-text a { color:var(--duke-gold); text-decoration:underline; } + .post-text a:hover { color:var(--duke-red); text-shadow:0 0 6px var(--duke-red); } + .post-image { max-width:100%; margin-top:10px; border:2px solid var(--duke-grey); } + .post-audio { width:100%; margin-top:10px; } + .post-modal { display:none; position:fixed; inset:0; z-index:100; + background:rgba(0,0,0,0.95); overflow-y:auto; padding:40px 20px; } + .post-modal.active { display:block; } + .modal-inner { max-width:740px; margin:0 auto; background:var(--duke-dark); + border:3px solid var(--duke-red); padding:28px; + box-shadow:0 0 40px rgba(255,0,0,0.35); } + .modal-close { float:right; background:var(--duke-red); border:none; + color:var(--duke-gold); font-family:'Courier New',monospace; + font-size:1rem; font-weight:bold; cursor:pointer; padding:4px 10px; + text-transform:uppercase; letter-spacing:1px; } + .modal-close:hover { background:var(--duke-gold); color:var(--duke-bg); + box-shadow:0 0 12px var(--duke-gold); } + @media(max-width:640px) { .nav-hints{display:none;} header{padding:8px 14px;} .content{padding:10px 14px;} .modal-inner{padding:20px 14px} .transmit-btn{padding-top:11px;padding-bottom:11px;min-height:44px} .modal-close{padding:10px 14px;min-width:44px;min-height:44px;text-align:center} } + [data-sno-theme="nukem"] .splash-overlay { + background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(255,0,0,0.2) 0%, transparent 60%), var(--duke-bg); + } + [data-sno-theme="nukem"] .splash-inner { + background:rgba(17,17,17,0.9); border:3px solid var(--duke-red); + text-shadow:none; box-shadow:0 0 30px rgba(255,0,0,0.4); + } + [data-sno-theme="nukem"] .splash-title { + font-size:clamp(1.6rem,5vw,2.4rem); color:var(--duke-gold); + letter-spacing:0.2em; text-transform:uppercase; font-weight:bold; + text-shadow:3px 3px 0 var(--duke-red), 0 0 20px var(--duke-red); + animation: splashDukeFlicker 2s ease-in-out infinite alternate; + } + @keyframes splashDukeFlicker { 0%,100%{text-shadow:3px 3px 0 var(--duke-red),0 0 20px var(--duke-red)} 50%{text-shadow:3px 3px 0 var(--duke-red),0 0 40px var(--duke-gold),0 0 60px var(--duke-red)} } + [data-sno-theme="nukem"] .splash-tag { color:var(--duke-light); letter-spacing:0.12em; + font-size:clamp(0.7rem,2vw,0.95rem); } + [data-sno-theme="nukem"] .splash-hint { color:var(--duke-gold); } diff --git a/internal/generator/templates/themes/nukem/theme.js b/internal/generator/templates/themes/nukem/theme.js new file mode 100644 index 0000000..5d8eed6 --- /dev/null +++ b/internal/generator/templates/themes/nukem/theme.js @@ -0,0 +1,268 @@ + + (function(){ + if(document.documentElement.classList.contains('sno-splash-skip'))return; + var cv=document.getElementById('splash-gl-canvas'); + if(!cv||typeof THREE==='undefined')return; + var raf,ren,sc,ca,sparks=[],t0=performance.now(),N=120; + function cleanup(){window.removeEventListener('resize',sz);if(raf)cancelAnimationFrame(raf);raf=null;if(ren)ren.dispose();ren=null;window._snonuxSplashWebGLCleanup=null;} + window._snonuxSplashWebGLCleanup=cleanup; + function sz(){var w=cv.clientWidth||2,h=cv.clientHeight||2;if(ren)ren.setSize(w,h,false);if(ca){ca.aspect=w/h;ca.updateProjectionMatrix();}} + ren=new THREE.WebGLRenderer({canvas:cv,antialias:false,alpha:true});ren.setClearColor(0,0);ren.setPixelRatio(1); + sc=new THREE.Scene();ca=new THREE.PerspectiveCamera(50,1,0.1,80);ca.position.z=18; + var geo=new THREE.SphereGeometry(0.12,4,4); + for(var i=0;i<N;i++){ + var c=Math.random()>0.5?0xff0000:0xffd700; + var mat=new THREE.MeshBasicMaterial({color:c,transparent:true,opacity:0.4+Math.random()*0.5}); + var m=new THREE.Mesh(geo,mat); + m.position.set((Math.random()-0.5)*24,(Math.random()-0.5)*16,(Math.random()-0.5)*6); + m.userData.vx=(Math.random()-0.5)*0.08; + m.userData.vy=0.03+Math.random()*0.06; + m.userData.vz=(Math.random()-0.5)*0.04; + sc.add(m);sparks.push(m); + } + sz();window.addEventListener('resize',sz); + function loop(){raf=requestAnimationFrame(loop); + for(var i=0;i<sparks.length;i++){ + var s=sparks[i]; + s.position.x+=s.userData.vx;s.position.y+=s.userData.vy;s.position.z+=s.userData.vz; + if(s.position.y>10){s.position.y=-10;s.position.x=(Math.random()-0.5)*24;} + } + ren.render(sc,ca);} + raf=requestAnimationFrame(loop); + })(); + + + (function() { + var _wild = false, _snoTOffset = 0, _snoLastT = 0; + var scene, camera, renderer, clock; + var N_SPARKS = 2000; + var N_DEBRIS = 400; + var sparkPoints, debrisPoints; + var spArr, spColArr, spVX, spVY, spVZ, spLife, spMaxLife; + var dbArr, dbVX, dbVY, dbVZ, dbLife, dbMaxLife; + + function resetSpark(i) { + var cx = (Math.random() - 0.5) * 80; + var cy = -25 + Math.random() * 5; + var cz = (Math.random() - 0.5) * 40 - 10; + spArr[i*3] = cx; spArr[i*3+1] = cy; spArr[i*3+2] = cz; + spVX[i] = (Math.random() - 0.5) * 0.15; + spVY[i] = 0.08 + Math.random() * 0.18; + spVZ[i] = (Math.random() - 0.5) * 0.08; + spMaxLife[i] = 0.5 + Math.random() * 0.8; + spLife[i] = Math.random(); + } + + function resetDebris(i) { + dbArr[i*3] = (Math.random() - 0.5) * 60; + dbArr[i*3+1] = 30 + Math.random() * 10; + dbArr[i*3+2] = (Math.random() - 0.5) * 30 - 10; + dbVX[i] = (Math.random() - 0.5) * 0.06; + dbVY[i] = -(0.04 + Math.random() * 0.1); + dbVZ[i] = (Math.random() - 0.5) * 0.04; + dbMaxLife[i] = 1.5 + Math.random() * 2; + dbLife[i] = Math.random(); + } + + function initThree() { + scene = new THREE.Scene(); + scene.background = new THREE.Color(0x0a0a0a); + scene.fog = new THREE.Fog(0x0a0a0a, 40, 110); + + camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.1, 150); + camera.position.set(0, 5, 45); + camera.lookAt(0, -5, 0); + + renderer = new THREE.WebGLRenderer({ canvas: document.getElementById('three-canvas'), antialias: false }); + renderer.setSize(window.innerWidth, window.innerHeight); + renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); + clock = new THREE.Clock(); + + scene.add(new THREE.AmbientLight(0x220000, 0.8)); + var redLight = new THREE.PointLight(0xff0000, 3, 80); + redLight.position.set(0, -10, 0); + scene.add(redLight); + var goldLight = new THREE.PointLight(0xffd700, 2, 60); + goldLight.position.set(10, 15, 10); + scene.add(goldLight); + + // Ground plane — dark concrete + var ground = new THREE.Mesh( + new THREE.PlaneGeometry(200, 200), + new THREE.MeshPhongMaterial({ color: 0x1a1a1a, emissive: 0x220000, emissiveIntensity: 0.3 }) + ); + ground.rotation.x = -Math.PI / 2; + ground.position.y = -25; + scene.add(ground); + + // Rubble blocks + var rubbleData = [ + [-20,-22,-18,4], [15,-21,-25,5], [-10,-23,-30,3], + [28,-22,-15,4], [-25,-21,-22,6], [5,-23,-35,3] + ]; + rubbleData.forEach(function(b) { + var mesh = new THREE.Mesh( + new THREE.BoxGeometry(b[3], b[3]*0.6, b[3]*0.8), + new THREE.MeshPhongMaterial({ color: 0x2a2a2a, emissive: 0x330000, emissiveIntensity: 0.2 }) + ); + mesh.position.set(b[0], b[1], b[2]); + mesh.rotation.set(Math.random()*0.5, Math.random(), Math.random()*0.3); + scene.add(mesh); + }); + + // Explosion glow sphere + var glow = new THREE.Mesh( + new THREE.SphereGeometry(35, 12, 12), + new THREE.MeshBasicMaterial({ color: 0xff2200, transparent: true, opacity: 0.12, blending: THREE.AdditiveBlending, depthWrite: false }) + ); + glow.position.set(0, -40, -20); + scene.add(glow); + + // Rising sparks + spArr = new Float32Array(N_SPARKS * 3); + spColArr = new Float32Array(N_SPARKS * 3); + spVX = new Float32Array(N_SPARKS); spVY = new Float32Array(N_SPARKS); spVZ = new Float32Array(N_SPARKS); + spLife = new Float32Array(N_SPARKS); spMaxLife = new Float32Array(N_SPARKS); + for (var i = 0; i < N_SPARKS; i++) resetSpark(i); + var spGeo = new THREE.BufferGeometry(); + spGeo.setAttribute('position', new THREE.BufferAttribute(spArr, 3)); + spGeo.setAttribute('color', new THREE.BufferAttribute(spColArr, 3)); + sparkPoints = new THREE.Points(spGeo, new THREE.PointsMaterial({ + size: 0.25, vertexColors: true, transparent: true, opacity: 0.9, + blending: THREE.AdditiveBlending, depthWrite: false + })); + scene.add(sparkPoints); + + // Falling debris + dbArr = new Float32Array(N_DEBRIS * 3); + dbVX = new Float32Array(N_DEBRIS); dbVY = new Float32Array(N_DEBRIS); dbVZ = new Float32Array(N_DEBRIS); + dbLife = new Float32Array(N_DEBRIS); dbMaxLife = new Float32Array(N_DEBRIS); + for (var j = 0; j < N_DEBRIS; j++) resetDebris(j); + var dbGeo = new THREE.BufferGeometry(); + dbGeo.setAttribute('position', new THREE.BufferAttribute(dbArr, 3)); + debrisPoints = new THREE.Points(dbGeo, new THREE.PointsMaterial({ + color: 0x888888, size: 0.6, transparent: true, opacity: 0.4, depthWrite: false + })); + scene.add(debrisPoints); + + window.addEventListener('resize', onResize); + animate(); + } + + function onResize() { + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + renderer.setSize(window.innerWidth, window.innerHeight); + } + + function animate() { + requestAnimationFrame(animate); + var dt = clock.getDelta(); + var realT = clock.getElapsedTime(); + _snoTOffset += (realT - _snoLastT) * (_wild ? 6 : 0); + _snoLastT = realT; + + var sparkMult = _wild ? 6 : 1; + for (var i = 0; i < N_SPARKS; i++) { + spLife[i] += dt / spMaxLife[i] * sparkMult; + if (spLife[i] > 1.0) resetSpark(i); + var idx = i * 3; + spArr[idx] += spVX[i] * sparkMult; + spArr[idx+1] += spVY[i] * sparkMult; + spArr[idx+2] += spVZ[i] * sparkMult; + var fade = Math.max(0, 1 - spLife[i] * 1.2); + // Red to gold gradient + spColArr[idx] = fade; + spColArr[idx+1] = fade * Math.max(0, 0.85 - spLife[i]); + spColArr[idx+2] = 0; + } + sparkPoints.geometry.attributes.position.needsUpdate = true; + sparkPoints.geometry.attributes.color.needsUpdate = true; + + var debrisMult = _wild ? 4 : 1; + for (var j = 0; j < N_DEBRIS; j++) { + dbLife[j] += dt / dbMaxLife[j] * debrisMult; + if (dbLife[j] > 1.0) resetDebris(j); + var di = j * 3; + dbArr[di] += dbVX[j] * debrisMult; + dbArr[di+1] += dbVY[j] * debrisMult; + dbArr[di+2] += dbVZ[j] * debrisMult; + } + debrisPoints.geometry.attributes.position.needsUpdate = true; + + // Camera shake in wild mode + if (_wild) { + camera.position.x = Math.sin(realT * 2.7) * 5; + camera.position.z = 45 + Math.sin(realT * 1.3) * 10; + camera.fov = 60 + Math.sin(realT * 3.1) * 12; + camera.updateProjectionMatrix(); + } else { + camera.position.x = Math.sin(realT * 0.15) * 2; + camera.position.z = 45; + if (camera.fov !== 60) { camera.fov = 60; camera.updateProjectionMatrix(); } + } + + renderer.render(scene, camera); + } + + initThree(); + + // Duke Nukem effects — explosive flash on open, screen shake on nav + window.snonuxOpenEffect = function(post) { + var modal = document.getElementById('post-modal'); + if (modal) { modal.classList.add('sno-modal-fly'); setTimeout(function() { modal.classList.remove('sno-modal-fly'); }, 380); } + // Explosion burst from post + var r = post ? post.getBoundingClientRect() : {left: window.innerWidth/2, top: window.innerHeight/2, width:0, height:0}; + for (var i = 0; i < 8; i++) { + (function(i) { + var e = document.createElement('div'); + var ang = (i / 8) * Math.PI * 2; var dist = 50 + Math.random() * 70; + var c = i % 2 === 0 ? '255,0,0' : '255,215,0'; + e.style.cssText = 'position:fixed;top:' + (r.top+(r.height||0)/2) + 'px;left:' + (r.left+(r.width||0)/2) + 'px;z-index:997;pointer-events:none;width:6px;height:6px;border-radius:50%;background:rgba(' + c + ',0.9);transition:all 0.4s ease,opacity 0.4s'; + document.body.appendChild(e); + setTimeout(function() { e.style.transform='translate(' + (Math.cos(ang)*dist) + 'px,' + (Math.sin(ang)*dist-40) + 'px) scale(0.2)'; e.style.opacity='0'; setTimeout(function() { e.remove(); }, 450); }, 16); + })(i); + } + }; + window.snonuxCloseEffect = function() { + var d = document.createElement('div'); + d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:rgba(255,0,0,0.15);transition:opacity 0.2s'; + document.body.appendChild(d); + setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 220); }, 15); + }; + window.snonuxScrollEffect = function(dir) { + var isDown = dir === 'down'; + var thick = _wild ? '14px' : '5px'; + var d = document.createElement('div'); + d.style.cssText = 'position:fixed;left:0;right:0;height:' + thick + ';z-index:9000;pointer-events:none;' + + 'background:linear-gradient(90deg,transparent,rgba(255,0,0,0.9),rgba(255,215,0,0.9),rgba(255,0,0,0.9),transparent);' + + (isDown ? 'top:0;' : 'bottom:0;') + + 'transition:transform 0.28s ease,opacity 0.28s ease;'; + document.body.appendChild(d); + setTimeout(function() { d.style.transform = isDown ? 'translateY(100vh)' : 'translateY(-100vh)'; d.style.opacity='0'; }, 16); + setTimeout(function() { d.remove(); }, 360); + }; + window.snonuxWildToggle = function() { + _wild = !_wild; + var b = document.getElementById('sno-wild-badge'); + if (b) b.classList.toggle('sno-wild-on', _wild); + }; + window.snonuxNavEffect = function() { + // Heavy screen shake + var ov = document.querySelector('.overlay'); + if (ov) { ov.classList.add('sno-fx-shake'); setTimeout(function() { ov.classList.remove('sno-fx-shake'); }, 400); } + var d = document.createElement('div'); + d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:rgba(255,215,0,0.15);transition:opacity 0.2s'; + document.body.appendChild(d); + setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 220); }, 25); + }; + window.snonuxPageEffect = function() { + // Double explosion flash + var d = document.createElement('div'); + d.style.cssText = 'position:fixed;inset:0;z-index:998;pointer-events:none;background:rgba(255,0,0,0.25);transition:opacity 0.18s'; + document.body.appendChild(d); + setTimeout(function() { d.style.opacity='0'; setTimeout(function() { d.remove(); }, 200); }, 15); + var ov = document.querySelector('.overlay'); + if (ov) { ov.classList.add('sno-fx-shake'); setTimeout(function() { ov.classList.remove('sno-fx-shake'); setTimeout(function() { ov.classList.add('sno-fx-shake'); setTimeout(function() { ov.classList.remove('sno-fx-shake'); }, 300); }, 30); }, 320); } + }; + })(); diff --git a/internal/generator/theme_sounds.go b/internal/generator/theme_sounds.go index a4c4f0c..6b638bc 100644 --- a/internal/generator/theme_sounds.go +++ b/internal/generator/theme_sounds.go @@ -79,13 +79,10 @@ type themeSounds struct { Ambient ambientSounds `json:"ambient,omitempty"` } -// ── helpers ──────────────────────────────────────────────────────── +// ── basic note + chord helpers ───────────────────────────────────── -func n(freq, dur float64) melodyNote { - return melodyNote{Freq: freq, Dur: dur} -} - -// ns builds a note that rings for 'dur' but advances the sequencer by 'step'. +// ns builds a note that rings for 'dur' but advances the sequencer by 'step', +// so multiple voices appended back-to-back can overlap when dur > step. func ns(freq, dur, step float64) melodyNote { return melodyNote{Freq: freq, Dur: dur, Step: step} } @@ -94,6 +91,7 @@ var ( intMajor3rd = math.Pow(2, 4.0/12) intMinor3rd = math.Pow(2, 3.0/12) intPerf5th = math.Pow(2, 7.0/12) + intMinor7th = math.Pow(2, 10.0/12) ) func major(freq float64) [3]float64 { @@ -103,87 +101,230 @@ func minor(freq float64) [3]float64 { return [3]float64{freq, freq * intMinor3rd, freq * intPerf5th} } -// power returns a root+5th power chord (only two voices — aggressive and clear). -func power(freq float64) [3]float64 { - return [3]float64{freq, freq * intPerf5th, 0} +// ── voice builders ──────────────────────────────────────────────── +// Each builder returns a slice of notes appended back-to-back into a melody. +// Because the engine advances time by note.Step (not note.Dur), notes with +// dur > step ring through the next entries — that is how distinct "voices" +// (bass, pad, lead) are stacked into one flat array. + +// hook turns explicit (freq, beats) pairs into a melodic phrase. A pair with +// freq <= 0 OR beats <= 0 is treated as a rest, and its duration is folded +// into the preceding note's step so the next real note triggers later. We +// can't emit a zero-frequency rest entry because the JS engine substitutes +// 440 Hz for falsy freq values, which would turn rests into audible tones. +// beat = seconds-per-quarter-note. dur multiplier of 1.0 = quarter note. +func hook(beat float64, pairs ...float64) []melodyNote { + out := make([]melodyNote, 0, len(pairs)/2) + leadIn := 0.0 + for i := 0; i+1 < len(pairs); i += 2 { + f, b := pairs[i], pairs[i+1] + if f <= 0 || b <= 0 { + silence := math.Abs(b) * beat + if len(out) == 0 { + leadIn += silence + } else { + out[len(out)-1].Step += silence + } + continue + } + step := b * beat + // 0.92 leaves a small gap so repeated notes re-trigger cleanly. + out = append(out, ns(f, step*0.92, step)) + } + // A leading rest in a looped phrase is equivalent to a trailing delay on + // the last note (the loop wraps), so push it onto the final note's step. + if leadIn > 0 && len(out) > 0 { + out[len(out)-1].Step += leadIn + } + return out } -// chordArp returns an up/down arpeggio of a triad; each note sustains for 'dur' -// while the sequencer only advances by 'step', so multiple voices overlap. -func chordArp(chord [3]float64, dur, step float64) []melodyNote { +// padHold lays a chord triad as a long sustained pad. The three notes are +// emitted back-to-back but each rings for almost the full duration, so they +// pile into a held chord. +func padHold(chord [3]float64, totalBeats, beat float64) []melodyNote { + dur := totalBeats * beat return []melodyNote{ - ns(chord[0], dur, step), ns(chord[1], dur, step), - ns(chord[2], dur, step), ns(chord[1], dur, step), + ns(chord[0], dur*0.96, dur*0.34), + ns(chord[1], dur*0.62, dur*0.33), + ns(chord[2], dur*0.30, dur*0.33), } } -// powerArp arpeggiates a power chord (root→5th→root→5th). -func powerArp(chord [3]float64, dur, step float64) []melodyNote { +// octaveBass: pumping synth-pop bassline — root, octave, root, fifth — over 4 +// quarter-notes. Iconic Outrun / "Take On Me" feel. +func octaveBass(root, beat float64) []melodyNote { + fifth := root * intPerf5th return []melodyNote{ - ns(chord[0], dur, step), ns(chord[1], dur, step), - ns(chord[0], dur, step), ns(chord[1], dur, step), + ns(root, beat*0.85, beat), + ns(root*2, beat*0.85, beat), + ns(root, beat*0.85, beat), + ns(fifth, beat*0.85, beat), } } -func bassNote(freq, dur, step float64) melodyNote { - return ns(freq, dur, step) +// palmMute: 8 chugging eighth-notes alternating root and fifth — heavy-metal +// palm-mute feel (think Doom Eternal / Megadeth). +func palmMute(root, beat float64) []melodyNote { + out := make([]melodyNote, 0, 8) + half := beat * 0.5 + fifth := root * intPerf5th + for i := 0; i < 8; i++ { + f := root + if i == 4 || i == 6 { + f = fifth + } + out = append(out, ns(f, half*0.45, half)) + } + return out } -// ── song builders ────────────────────────────────────────────────── +// arpUpDown: chord up-and-down across 8 sixteenths (1-3-5-8-5-3-1-3) — Mario +// chiptune feel. +func arpUpDown(chord [3]float64, beat float64) []melodyNote { + s := beat * 0.5 + return []melodyNote{ + ns(chord[0], s*0.85, s), ns(chord[1], s*0.85, s), + ns(chord[2], s*0.85, s), ns(chord[0]*2, s*0.85, s), + ns(chord[2], s*0.85, s), ns(chord[1], s*0.85, s), + ns(chord[0], s*0.85, s), ns(chord[1], s*0.85, s), + } +} -// buildRockSong creates a 4-bar loop with power-chord pads, sub-bass, and a -// driving melody line. BPM is fast; every slot is a 16th-note. -func buildRockSong( - bassOct [4]float64, chords [4][3]float64, melody [4][]melodyNote, - step float64, -) []melodyNote { - var out []melodyNote - for i := 0; i < 4; i++ { - // Sub-bass: low octave, long sustain so drone + bass overlap - out = append(out, bassNote(bassOct[i]/2, step*7.9, step*8)) - // Main bass hits on each beat - out = append(out, bassNote(bassOct[i], step*3.8, step*4)) - // Power chord stab (sustains across the measure) - out = append(out, powerArp(chords[i], step*3.5, step)...) - // Melody top-line - out = append(out, melody[i]...) +// walkBass: jazz quarter-note walking pattern root → 3rd → 5th → 3rd. +func walkBass(root, beat float64) []melodyNote { + return []melodyNote{ + ns(root, beat*0.92, beat), + ns(root*intMajor3rd, beat*0.92, beat), + ns(root*intPerf5th, beat*0.92, beat), + ns(root*intMajor3rd, beat*0.92, beat), } - return out } -// buildDriveMelody: straight eighth-note drive, no swing. Each note is a short -// punch stab so the line stays rhythmic and aggressive. -func buildDriveMelody(freqs []float64, step float64) []melodyNote { - var out []melodyNote - for _, freq := range freqs { - out = append(out, ns(freq, step*0.85, step)) +// chromDesc: 8-note chromatic descent from 'top' — Bond / Pink Panther feel. +func chromDesc(top, beat float64) []melodyNote { + out := make([]melodyNote, 0, 8) + step := beat * 0.5 + for i := 0; i < 8; i++ { + f := top * math.Pow(2, -float64(i)/12.0) + out = append(out, ns(f, step*0.6, step)) } return out } -// buildStabMelody: short 16th-note stabs with gaps for air. Perfect for fast -// drum-and-bass, hardstyle, or industrial grooves. -func buildStabMelody(freqs []float64, step float64) []melodyNote { +// fanfareStab: a punchy orchestral chord-hit held across 'beats' beats. +// Three voices land together because each rings for most of the duration. +func fanfareStab(chord [3]float64, beats, beat float64) []melodyNote { + dur := beats * beat + return []melodyNote{ + ns(chord[0], dur*0.9, dur*0.34), + ns(chord[1], dur*0.7, dur*0.33), + ns(chord[2], dur*0.5, dur*0.33), + } +} + +// reverseKick: hardstyle reverse-bass effect — a sub-octave thump followed by +// a short octave-up snap (the "wub" before the kick). +func reverseKick(root, beat float64) []melodyNote { + return []melodyNote{ + ns(root/2, beat*0.85, beat*0.5), + ns(root, beat*0.45, beat*0.5), + } +} + +// bossaBass: bossa nova bass — dotted-quarter root, eighth fifth, repeat. +func bossaBass(root, beat float64) []melodyNote { + fifth := root * intPerf5th + return []melodyNote{ + ns(root, beat*1.4, beat*1.5), + ns(fifth, beat*0.45, beat*0.5), + ns(root, beat*1.4, beat*1.5), + ns(fifth, beat*0.45, beat*0.5), + } +} + +// dubSwell: very long sustained bass — held across the whole bar. Caller +// passes the actual played frequency (no implicit octave-down) so we don't +// drop below ~30 Hz, where most speakers reproduce nothing but clicks. +func dubSwell(freq, beats, beat float64) []melodyNote { + return []melodyNote{ns(freq, beats*beat*0.95, beats*beat)} +} + +// alienSlide: 4 sliding atonal arpeggio notes spaced by minor-3rds and tritones. +func alienSlide(root, beat float64) []melodyNote { + tritone := math.Pow(2, 6.0/12) + s := beat * 0.5 + return []melodyNote{ + ns(root, s*0.85, s), + ns(root*intMinor3rd, s*0.85, s), + ns(root*tritone, s*0.85, s), + ns(root*intMinor7th, s*0.85, s), + } +} + +// concat flattens several voices into one note slice. +func concat(parts ...[]melodyNote) []melodyNote { var out []melodyNote - for i, freq := range freqs { - // On-beat stabs hit hard; off-beat ghosts are tighter - dur := step * 0.4 - if i%2 == 0 { - dur = step * 0.8 - } - out = append(out, ns(freq, dur, step)) + for _, p := range parts { + out = append(out, p...) } return out } -// ── drum-pattern helpers ──────────────────────────────────────────── +// ── drum patterns ───────────────────────────────────────────────── +// Each is a 16-step bar (one entry per 16th-note at the preset BPM). -func pat(names ...string) []string { - return names -} +func pat(names ...string) []string { return names } + +var ( + // Synth-pop punch — kick on 1+4+8, claps on 16. + drumPop = pat("kick", "_", "hat", "kick", "snare", "_", "hat", "_", "kick", "kick", "hat", "_", "snare", "_", "hat", "clap") + // Four-on-the-floor dance — kick every quarter, hat offbeat. + drumFour = pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_") + // Heavy rock — straight 4/4 with offbeat hats (Duke Nukem feel). + drumRock = pat("kick", "_", "hat", "_", "snare", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "kick") + // Industrial pulse — hammering double-kick, syncopated snare. + drumPulse = pat("kick", "kick", "_", "hat", "snare", "_", "kick", "hat", "kick", "_", "_", "hat", "snare", "kick", "_", "hat") + // Hardstyle — kick on every beat plus the offbeats (gabber). + drumHardstyle = pat("kick", "_", "_", "kick", "kick", "_", "_", "kick", "kick", "_", "_", "kick", "kick", "kick", "_", "kick") + // DnB amen-break — kick on 1+11, snare with ghosted "skips" on 4. + drumDnb = pat("kick", "_", "hat", "kick", "snare", "hat", "_", "snare", "_", "kick", "hat", "_", "snare", "_", "hat", "kick") + // Bossa nova clave (3-2 son) — Latin syncopation. + drumBossa = pat("kick", "_", "hat", "_", "_", "_", "hat", "snare", "_", "kick", "hat", "_", "snare", "_", "hat", "_") + // Boom-bap — hip-hop / film-noir groove. + drumBoom = pat("kick", "_", "_", "hat", "snare", "_", "_", "hat", "_", "_", "kick", "hat", "snare", "_", "kick", "hat") + // Dub — kick on 1, snare on 9, hi-hat on 16. Spacious. + drumDub = pat("kick", "_", "_", "_", "_", "_", "_", "_", "snare", "_", "_", "_", "_", "_", "_", "hat") + // Ambient — single soft kick + sparse clap. Mostly silence. + drumAmbient = pat("kick", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "_", "clap", "_", "_", "_") + // March — kick/snare alternate, no hat (cosmos military feel). + drumMarch = pat("kick", "_", "_", "_", "snare", "_", "_", "_", "kick", "_", "_", "_", "snare", "_", "_", "_") + // Bell tolls — only deep kicks, very sparse (cathedral). + drumBell = pat("kick", "_", "_", "_", "_", "_", "_", "_", "kick", "_", "_", "_", "_", "_", "_", "_") + // Latin funk — busy clave with conga-like accents. + drumLatin = pat("kick", "hat", "_", "hat", "snare", "kick", "hat", "_", "kick", "hat", "_", "hat", "snare", "_", "hat", "kick") + // Chiptune — bouncy NES drum-machine: kick+snare on every other 16th. + drumChip = pat("kick", "snare", "kick", "snare", "kick", "snare", "kick", "snare", "kick", "snare", "kick", "snare", "kick", "snare", "kick", "snare") + // Spy — sneaky offbeat snare with double-kick pickup. + drumSpy = pat("kick", "_", "hat", "_", "_", "snare", "hat", "_", "kick", "kick", "hat", "_", "snare", "_", "hat", "snare") + // Organic / biomech — irregular limb-like accents. + drumOrganic = pat("kick", "_", "hat", "kick", "_", "snare", "kick", "_", "_", "kick", "hat", "_", "snare", "_", "kick", "hat") + // Metal chug — double-kick galloping metal rhythm (plasma normal). + drumChug = pat("kick", "kick", "_", "kick", "snare", "_", "kick", "_", "kick", "kick", "_", "kick", "snare", "kick", "kick", "kick") + // Gated 80s electro — tight punchy clap on 5+13 (synthwave). + drumElectro = pat("kick", "_", "_", "_", "clap", "_", "hat", "_", "kick", "kick", "_", "_", "clap", "_", "hat", "snare") + // Wild rock — extra-busy version of drumRock for wild mode. + drumRockWild = pat("kick", "kick", "hat", "kick", "snare", "_", "hat", "kick", "kick", "kick", "hat", "kick", "snare", "_", "hat", "kick") +) + +// ── theme songs ─────────────────────────────────────────────────── +// +// Each theme builds two ambient presets (normal + wild). Wild is the same +// musical character as normal but faster, denser, brighter — never a +// different song, so the listener always hears "the theme" intensifying. // ════════════════════════════════════════════════════════════════════ -// NEON – synth-pop banger, C major, 150/220 +// NEON – synth-pop banger, C major, Outrun pumping octave bass // ════════════════════════════════════════════════════════════════════ func soundsNeon() themeSounds { var s themeSounds @@ -194,47 +335,37 @@ func soundsNeon() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 880, 261.63, 0.16, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 180, 90, 0.12, 0.1 - c, f, g1, c2 := power(65.41), power(87.31), power(98.00), power(130.81) - - normalMel := buildRockSong( - [4]float64{130.81, 174.61, 196.00, 130.81}, - [4][3]float64{c, f, g1, c2}, - [4][]melodyNote{ - buildDriveMelody([]float64{523.25, 587.33, 659.25, 783.99}, 0.25), - buildDriveMelody([]float64{698.46, 783.99, 880.00, 1046.5}, 0.25), - buildDriveMelody([]float64{783.99, 880.00, 1046.5, 783.99}, 0.25), - buildDriveMelody([]float64{523.25, 659.25, 783.99, 1046.5}, 0.25), - }, 0.25) - - wildMel := buildRockSong( - [4]float64{261.63, 349.23, 392.00, 261.63}, - [4][3]float64{c, f, g1, c2}, - [4][]melodyNote{ - buildStabMelody([]float64{1046.5, 1174.66, 1318.5, 1567.98}, 0.125), - buildStabMelody([]float64{1396.92, 1567.98, 1760.00, 2093.0}, 0.125), - buildStabMelody([]float64{1567.98, 1760.00, 2093.0, 1567.98}, 0.125), - buildStabMelody([]float64{1046.5, 1318.5, 1567.98, 2093.0}, 0.125), - }, 0.125) - + // Hook: sparkly major arpeggio that resolves down — C-E-G-C-A-G-E-C feel. + beat := 0.4 // 150 BPM quarter + mel := concat( + octaveBass(130.81, beat), padHold(major(261.63), 4, beat), + hook(beat, 1046.5, 0.5, 783.99, 0.5, 659.25, 0.5, 1046.5, 0.5, + 880.00, 0.5, 783.99, 0.5, 659.25, 0.5, 523.25, 0.5), + octaveBass(174.61, beat), padHold(major(349.23), 4, beat), + hook(beat, 1396.92, 0.5, 1046.5, 0.5, 880.00, 0.5, 1396.92, 0.5, + 1174.66, 0.5, 1046.5, 0.5, 880.00, 0.5, 698.46, 0.5), + ) + wbeat := 0.273 // 220 BPM + wmel := concat( + octaveBass(261.63, wbeat), padHold(major(523.25), 4, wbeat), + hook(wbeat, 1046.5, 0.25, 1318.5, 0.25, 1567.98, 0.25, 2093.0, 0.25, + 1567.98, 0.25, 1318.5, 0.25, 1046.5, 0.25, 783.99, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 150, Wave: "square", - DroneFreqs: []float64{130.81, 196.00, 261.63}, - Attack: 0.02, Release: 0.15, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.03, BPM: 150, Wave: "square", + DroneFreqs: []float64{130.81, 196.00, 261.63}, Attack: 0.02, Release: 0.15, + CutoffMin: 1200, CutoffMax: 5000, Drums: drumPop, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 220, Wave: "square", - DroneFreqs: []float64{130.81, 196.00, 261.63, 392.00}, - Attack: 0.02, Release: 0.08, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 12, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.06, BPM: 220, Wave: "square", + DroneFreqs: []float64{130.81, 261.63, 392.00, 523.25}, Attack: 0.02, Release: 0.08, + CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 12, Drums: drumPop, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// TERMINAL – dark industrial, E minor, 160/240 +// TERMINAL – industrial techno, E minor, hammering pulse // ════════════════════════════════════════════════════════════════════ func soundsTerminal() themeSounds { var s themeSounds @@ -245,44 +376,37 @@ func soundsTerminal() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "square", 900, 400, 0.14, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 200, 100, 0.1, 0.1 - e, b, a := power(82.41), power(61.74), power(110.00) - - normalMel := buildRockSong( - [4]float64{164.81, 123.47, 220.00, 164.81}, [4][3]float64{e, b, a, e}, - [4][]melodyNote{ - buildDriveMelody([]float64{329.63, 392.00, 440.00, 523.25}, 0.233), - buildDriveMelody([]float64{246.94, 293.66, 329.63, 392.00}, 0.233), - buildDriveMelody([]float64{440.00, 523.25, 587.33, 440.00}, 0.233), - buildDriveMelody([]float64{329.63, 392.00, 493.88, 329.63}, 0.233), - }, 0.233) - wildMel := buildRockSong( - [4]float64{329.63, 246.94, 440.00, 329.63}, [4][3]float64{e, b, a, e}, - [4][]melodyNote{ - buildStabMelody([]float64{659.25, 783.99, 880.00, 1046.5}, 0.117), - buildStabMelody([]float64{493.88, 587.33, 659.25, 783.99}, 0.117), - buildStabMelody([]float64{880.00, 1046.5, 1174.66, 880.00}, 0.117), - buildStabMelody([]float64{659.25, 783.99, 987.77, 659.25}, 0.117), - }, 0.117) - + // Hook: dissonant rising tritone stab — Hotline Miami / industrial menace. + beat := 0.375 // 160 BPM + mel := concat( + palmMute(82.41, beat), padHold(minor(164.81), 4, beat), + hook(beat, 329.63, 0.5, 392.00, 0.5, 466.16, 0.5, 329.63, 0.5, + 466.16, 0.5, 622.25, 0.5, 466.16, 0.5, 329.63, 0.5), + palmMute(110.00, beat), padHold(minor(220.00), 4, beat), + hook(beat, 440.00, 0.5, 523.25, 0.5, 622.25, 0.5, 440.00, 0.5, + 622.25, 0.5, 783.99, 0.5, 622.25, 0.5, 440.00, 0.5), + ) + wbeat := 0.353 // 170 BPM, but denser stabs + wmel := concat( + palmMute(164.81, wbeat), + hook(wbeat, 659.25, 0.25, 783.99, 0.25, 932.33, 0.25, 659.25, 0.25, + 932.33, 0.25, 1244.51, 0.25, 932.33, 0.25, 659.25, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 160, Wave: "square", - DroneFreqs: []float64{82.41, 123.47, 164.81}, - Attack: 0.02, Release: 0.1, CutoffMin: 1000, CutoffMax: 5000, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "snare", "kick", "kick", "hat", "kick", "snare", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.03, BPM: 160, Wave: "sawtooth", + DroneFreqs: []float64{82.41, 123.47, 164.81}, Attack: 0.02, Release: 0.1, + CutoffMin: 1000, CutoffMax: 5000, Drums: drumPulse, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 240, Wave: "square", - DroneFreqs: []float64{164.81, 246.94, 329.63, 440.00}, - Attack: 0.02, Release: 0.05, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 15, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "snare", "kick", "kick", "hat", "kick", "snare", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.065, BPM: 170, Wave: "sawtooth", + DroneFreqs: []float64{82.41, 164.81, 246.94, 329.63}, Attack: 0.02, Release: 0.05, + CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 18, Drums: drumPulse, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// SYNTHWAVE – retro-future racing, A minor, 140/200 +// SYNTHWAVE – Carpenter Brut "Turbo Killer" anthem rock, A minor // ════════════════════════════════════════════════════════════════════ func soundsSynthwave() themeSounds { var s themeSounds @@ -293,44 +417,43 @@ func soundsSynthwave() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 440, 110, 0.17, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "sine", 150, 75, 0.14, 0.09 - am, f, c, g := minor(55.00), power(87.31), power(65.41), power(98.00) - - normalMel := buildRockSong( - [4]float64{110.00, 174.61, 130.81, 196.00}, [4][3]float64{am, f, c, g}, - [4][]melodyNote{ - buildDriveMelody([]float64{220.00, 261.63, 293.66, 349.23}, 0.268), - buildDriveMelody([]float64{349.23, 392.00, 440.00, 523.25}, 0.268), - buildDriveMelody([]float64{261.63, 329.63, 392.00, 440.00}, 0.268), - buildDriveMelody([]float64{220.00, 293.66, 349.23, 392.00}, 0.268), - }, 0.268) - wildMel := buildRockSong( - [4]float64{220.00, 349.23, 261.63, 392.00}, [4][3]float64{am, f, c, g}, - [4][]melodyNote{ - buildStabMelody([]float64{440.00, 523.25, 587.33, 698.46}, 0.134), - buildStabMelody([]float64{698.46, 783.99, 880.00, 1046.5}, 0.134), - buildStabMelody([]float64{523.25, 659.25, 783.99, 880.00}, 0.134), - buildStabMelody([]float64{440.00, 587.33, 698.46, 783.99}, 0.134), - }, 0.134) - + // Driving Am-F-C-G with a sawtooth-stab lead riff. Action-rock not chill. + beat := 0.4 // 150 BPM — punchy synth-anthem + mel := concat( + octaveBass(110.00, beat), padHold(minor(220.00), 4, beat), + hook(beat, 880.00, 0.25, 1046.5, 0.25, 1318.5, 0.5, 1046.5, 0.25, 880.00, 0.25, + 659.25, 0.5, 880.00, 0.5, 1046.5, 1.0), + octaveBass(87.31, beat), padHold(major(174.61), 4, beat), + hook(beat, 698.46, 0.25, 880.00, 0.25, 1046.5, 0.5, 880.00, 0.25, 698.46, 0.25, + 523.25, 0.5, 698.46, 0.5, 880.00, 1.0), + octaveBass(130.81, beat), padHold(major(261.63), 4, beat), + hook(beat, 1046.5, 0.25, 1318.5, 0.25, 1567.98, 0.5, 1318.5, 0.25, 1046.5, 0.25, + 783.99, 0.5, 1046.5, 0.5, 1318.5, 1.0), + octaveBass(98.00, beat), padHold(major(196.00), 4, beat), + hook(beat, 783.99, 0.25, 987.77, 0.25, 1174.66, 0.5, 987.77, 0.25, 783.99, 0.25, + 587.33, 0.5, 783.99, 0.5, 987.77, 1.0), + ) + wbeat := 0.316 // 190 BPM + wmel := concat( + octaveBass(220.00, wbeat), + hook(wbeat, 1760.00, 0.25, 2093.0, 0.25, 2637.0, 0.25, 2093.0, 0.25, + 1760.00, 0.25, 1318.5, 0.25, 1760.00, 0.25, 2093.0, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 140, Wave: "square", - DroneFreqs: []float64{110.00, 174.61, 220.00}, - Attack: 0.02, Release: 0.15, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "clap"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "sawtooth", + DroneFreqs: []float64{110.00, 174.61, 220.00}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumElectro, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.06, BPM: 200, Wave: "square", - DroneFreqs: []float64{220.00, 349.23, 440.00, 523.25}, - Attack: 0.02, Release: 0.06, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 12, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "kick", "clap"), - Melody: wildMel, + Gain: 0.065, BPM: 190, Wave: "sawtooth", + DroneFreqs: []float64{220.00, 349.23, 440.00, 523.25}, Attack: 0.02, Release: 0.05, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 14, Drums: drumElectro, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// PLASMA – white-hot fusion drive, F# minor, 170/250 +// PLASMA – Doom Eternal djent, F# minor, drop-tuned palm-mute chug // ════════════════════════════════════════════════════════════════════ func soundsPlasma() themeSounds { var s themeSounds @@ -341,44 +464,37 @@ func soundsPlasma() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "square", 740, 246.94, 0.17, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 120, 60, 0.1, 0.1 - fsm, bm, cs, d := minor(92.50), minor(61.74), power(69.30), power(73.42) - - normalMel := buildRockSong( - [4]float64{185.00, 246.94, 138.59, 146.83}, [4][3]float64{fsm, bm, cs, d}, - [4][]melodyNote{ - buildDriveMelody([]float64{369.99, 440.00, 493.88, 554.37}, 0.22), - buildDriveMelody([]float64{493.88, 554.37, 587.33, 369.99}, 0.22), - buildDriveMelody([]float64{277.18, 329.63, 369.99, 440.00}, 0.22), - buildDriveMelody([]float64{293.66, 349.23, 392.00, 293.66}, 0.22), - }, 0.22) - wildMel := buildRockSong( - [4]float64{369.99, 493.88, 277.18, 293.66}, [4][3]float64{fsm, bm, cs, d}, - [4][]melodyNote{ - buildStabMelody([]float64{739.99, 880.00, 987.77, 1108.73}, 0.11), - buildStabMelody([]float64{987.77, 1108.73, 1174.66, 739.99}, 0.11), - buildStabMelody([]float64{554.37, 659.25, 739.99, 880.00}, 0.11), - buildStabMelody([]float64{587.33, 698.46, 783.99, 587.33}, 0.11), - }, 0.11) - + // Djent: low palm-mute chugs against a screaming high lead. + beat := 0.4 // 150 BPM — heavy not blistering + mel := concat( + palmMute(46.25, beat), padHold(minor(92.50), 4, beat), + hook(beat, 369.99, 0.5, 0, 0.5, 369.99, 0.5, 440.00, 0.5, + 554.37, 0.5, 440.00, 0.5, 369.99, 1.0), + palmMute(46.25, beat), padHold(minor(92.50), 4, beat), + hook(beat, 369.99, 0.5, 440.00, 0.5, 554.37, 0.5, 739.99, 0.5, + 659.25, 0.5, 554.37, 0.5, 440.00, 0.5, 369.99, 0.5), + ) + wbeat := 0.333 // 180 BPM thrash + wmel := concat( + palmMute(92.50, wbeat), + hook(wbeat, 739.99, 0.25, 880.00, 0.25, 1108.73, 0.25, 1480.00, 0.25, + 1108.73, 0.25, 880.00, 0.25, 739.99, 0.25, 554.37, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 170, Wave: "square", - DroneFreqs: []float64{92.50, 138.59, 185.00}, - Attack: 0.02, Release: 0.12, CutoffMin: 1400, CutoffMax: 5500, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "snare", "kick", "kick", "hat", "kick", "snare", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "square", + DroneFreqs: []float64{46.25, 92.50, 138.59}, Attack: 0.01, Release: 0.08, + CutoffMin: 800, CutoffMax: 5500, Drums: drumChug, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 250, Wave: "square", - DroneFreqs: []float64{92.50, 138.59, 185.00, 277.18}, - Attack: 0.02, Release: 0.04, CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 15, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "snare", "kick", "kick", "hat", "kick", "snare", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 180, Wave: "square", + DroneFreqs: []float64{46.25, 92.50, 138.59, 277.18}, Attack: 0.01, Release: 0.04, + CutoffMin: 2400, CutoffMax: 8000, DetuneCents: 22, Drums: drumChug, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// BRUTALIST – concrete demolition, C minor, 140/210 +// BRUTALIST – Akira-style minimalist techno, C minor, concrete pulse // ════════════════════════════════════════════════════════════════════ func soundsBrutalist() themeSounds { var s themeSounds @@ -389,43 +505,37 @@ func soundsBrutalist() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "square", 660, 220, 0.15, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 200, 100, 0.1, 0.1 - cm, gm, dm := minor(65.41), minor(98.00), minor(73.42) - normalMel := buildRockSong( - [4]float64{130.81, 196.00, 146.83, 130.81}, [4][3]float64{cm, gm, dm, cm}, - [4][]melodyNote{ - buildDriveMelody([]float64{261.63, 311.13, 392.00, 523.25}, 0.268), - buildDriveMelody([]float64{392.00, 415.30, 523.25, 392.00}, 0.268), - buildDriveMelody([]float64{293.66, 349.23, 392.00, 293.66}, 0.268), - buildDriveMelody([]float64{261.63, 311.13, 392.00, 523.25}, 0.268), - }, 0.268) - wildMel := buildRockSong( - [4]float64{261.63, 196.00, 146.83, 261.63}, [4][3]float64{cm, gm, dm, cm}, - [4][]melodyNote{ - buildStabMelody([]float64{523.25, 622.25, 783.99, 1046.5}, 0.134), - buildStabMelody([]float64{783.99, 830.61, 1046.5, 783.99}, 0.134), - buildStabMelody([]float64{587.33, 698.46, 783.99, 587.33}, 0.134), - buildStabMelody([]float64{523.25, 622.25, 783.99, 1046.5}, 0.134), - }, 0.134) - + // Hook: pulse-step bass with metallic stab leads. Cm-Ab-Gm-Fm. + beat := 0.429 // 140 BPM driving + mel := concat( + palmMute(65.41, beat), padHold(minor(130.81), 4, beat), + hook(beat, 523.25, 0.5, 0, 0.5, 622.25, 0.5, 0, 0.5, + 783.99, 1.0, 622.25, 1.0), + palmMute(51.91, beat), padHold(major(103.83), 4, beat), + hook(beat, 415.30, 0.5, 0, 0.5, 622.25, 0.5, 0, 0.5, + 830.61, 1.0, 622.25, 1.0), + ) + wbeat := 0.375 // 160 BPM + wmel := concat( + palmMute(130.81, wbeat), + hook(wbeat, 1046.5, 0.25, 1244.5, 0.25, 1567.98, 0.25, 1046.5, 0.25, + 1244.5, 0.25, 1046.5, 0.25, 830.61, 0.25, 622.25, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 140, Wave: "square", - DroneFreqs: []float64{65.41, 98.00, 130.81}, - Attack: 0.02, Release: 0.15, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.032, BPM: 140, Wave: "sawtooth", + DroneFreqs: []float64{65.41, 98.00, 130.81}, Attack: 0.02, Release: 0.1, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumPulse, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.065, BPM: 210, Wave: "square", - DroneFreqs: []float64{65.41, 98.00, 130.81, 196.00}, - Attack: 0.02, Release: 0.05, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 18, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.075, BPM: 180, Wave: "sawtooth", + DroneFreqs: []float64{65.41, 98.00, 130.81, 196.00}, Attack: 0.02, Release: 0.04, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 20, Drums: drumPulse, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// VOLCANO – molten hardstyle, D minor, 160/240 +// VOLCANO – hardstyle / gabber, D minor, reverse-bass kicks // ════════════════════════════════════════════════════════════════════ func soundsVolcano() themeSounds { var s themeSounds @@ -436,43 +546,39 @@ func soundsVolcano() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 440, 146.83, 0.18, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 130, 65, 0.12, 0.09 - dm, am, gm := minor(73.42), power(110.00), power(98.00) - normalMel := buildRockSong( - [4]float64{146.83, 220.00, 196.00, 146.83}, [4][3]float64{dm, am, gm, dm}, - [4][]melodyNote{ - buildDriveMelody([]float64{293.66, 349.23, 440.00, 493.88}, 0.233), - buildDriveMelody([]float64{440.00, 493.88, 587.33, 440.00}, 0.233), - buildDriveMelody([]float64{392.00, 440.00, 493.88, 392.00}, 0.233), - buildDriveMelody([]float64{293.66, 349.23, 440.00, 587.33}, 0.233), - }, 0.233) - wildMel := buildRockSong( - [4]float64{293.66, 440.00, 392.00, 293.66}, [4][3]float64{dm, am, gm, dm}, - [4][]melodyNote{ - buildStabMelody([]float64{587.33, 698.46, 880.00, 987.77}, 0.117), - buildStabMelody([]float64{880.00, 987.77, 1174.66, 880.00}, 0.117), - buildStabMelody([]float64{783.99, 880.00, 987.77, 783.99}, 0.117), - buildStabMelody([]float64{587.33, 698.46, 880.00, 1174.66}, 0.117), - }, 0.117) - + // Reverse-bass + screech lead. Dm-Bb-F-C — classic hardstyle. + beat := 0.4 // 150 BPM + mel := concat( + reverseKick(73.42, beat), reverseKick(73.42, beat), + reverseKick(73.42, beat), reverseKick(73.42, beat), + hook(beat, 587.33, 0.5, 698.46, 0.5, 880.00, 0.5, 1174.66, 0.5, + 880.00, 0.5, 698.46, 0.5, 587.33, 1.0), + reverseKick(58.27, beat), reverseKick(58.27, beat), + reverseKick(87.31, beat), reverseKick(65.41, beat), + hook(beat, 466.16, 0.5, 587.33, 0.5, 698.46, 0.5, 880.00, 0.5, + 698.46, 0.5, 587.33, 0.5, 466.16, 1.0), + ) + wbeat := 0.333 // 180 BPM + wmel := concat( + reverseKick(146.83, wbeat), reverseKick(146.83, wbeat), + hook(wbeat, 1174.66, 0.25, 1396.92, 0.25, 1760.00, 0.25, 2349.32, 0.25, + 1760.00, 0.25, 1396.92, 0.25, 1174.66, 0.25, 880.00, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 160, Wave: "square", - DroneFreqs: []float64{73.42, 110.00, 146.83}, - Attack: 0.02, Release: 0.15, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "hat", "kick", "hat", "snare", "kick", "hat", "snare", "kick", "kick", "hat", "kick", "snare", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "sawtooth", + DroneFreqs: []float64{73.42, 110.00, 146.83}, Attack: 0.01, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumHardstyle, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.065, BPM: 240, Wave: "square", - DroneFreqs: []float64{73.42, 110.00, 146.83, 196.00}, - Attack: 0.02, Release: 0.05, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 12, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "snare", "kick", "kick", "hat", "kick", "snare", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 180, Wave: "sawtooth", + DroneFreqs: []float64{73.42, 110.00, 146.83, 220.00}, Attack: 0.01, Release: 0.04, + CutoffMin: 2400, CutoffMax: 8000, DetuneCents: 18, Drums: drumHardstyle, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// AURORA – arctic storm surge, G major, 130/190 +// AURORA – arctic anthem rock, G major, soaring stadium lead // ════════════════════════════════════════════════════════════════════ func soundsAurora() themeSounds { var s themeSounds @@ -483,43 +589,43 @@ func soundsAurora() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 523, 196, 0.18, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 180, 90, 0.12, 0.09 - gm, d, em, c := power(98.00), power(73.42), power(82.41), power(65.41) - normalMel := buildRockSong( - [4]float64{196.00, 146.83, 164.81, 130.81}, [4][3]float64{gm, d, em, c}, - [4][]melodyNote{ - buildDriveMelody([]float64{392.00, 440.00, 493.88, 587.33}, 0.288), - buildDriveMelody([]float64{293.66, 349.23, 392.00, 440.00}, 0.288), - buildDriveMelody([]float64{329.63, 392.00, 440.00, 523.25}, 0.288), - buildDriveMelody([]float64{261.63, 329.63, 392.00, 523.25}, 0.288), - }, 0.288) - wildMel := buildRockSong( - [4]float64{196.00, 146.83, 164.81, 130.81}, [4][3]float64{gm, d, em, c}, - [4][]melodyNote{ - buildStabMelody([]float64{783.99, 880.00, 987.77, 1174.66}, 0.144), - buildStabMelody([]float64{587.33, 698.46, 783.99, 880.00}, 0.144), - buildStabMelody([]float64{659.25, 783.99, 880.00, 1046.5}, 0.144), - buildStabMelody([]float64{523.25, 659.25, 783.99, 1046.5}, 0.144), - }, 0.144) - + // Driving G-major anthem (G-Em-C-D) with a soaring fist-pump lead hook. + beat := 0.462 // 130 BPM + mel := concat( + octaveBass(98.00, beat), padHold(major(196.00), 4, beat), + hook(beat, 783.99, 0.5, 880.00, 0.5, 987.77, 0.5, 1174.66, 0.5, + 987.77, 0.5, 880.00, 1.0, 783.99, 0.5), + octaveBass(82.41, beat), padHold(minor(164.81), 4, beat), + hook(beat, 659.25, 0.5, 783.99, 0.5, 880.00, 0.5, 987.77, 0.5, + 880.00, 0.5, 783.99, 1.0, 659.25, 0.5), + octaveBass(65.41, beat), padHold(major(130.81), 4, beat), + hook(beat, 783.99, 0.5, 880.00, 0.5, 987.77, 0.5, 1174.66, 0.5, + 1318.5, 1.0, 1174.66, 1.0), + octaveBass(73.42, beat), padHold(major(146.83), 4, beat), + hook(beat, 880.00, 0.5, 987.77, 0.5, 1174.66, 0.5, 1318.5, 0.5, + 1174.66, 0.5, 987.77, 1.0, 880.00, 0.5), + ) + wbeat := 0.353 // 170 BPM thrash anthem + wmel := concat( + octaveBass(196.00, wbeat), + hook(wbeat, 1567.98, 0.25, 1760.00, 0.25, 1975.53, 0.25, 2349.32, 0.25, + 1975.53, 0.25, 1760.00, 0.25, 1567.98, 0.25, 1318.5, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 130, Wave: "square", - DroneFreqs: []float64{98.00, 146.83, 196.00}, - Attack: 0.02, Release: 0.18, CutoffMin: 1000, CutoffMax: 4500, - Drums: pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.032, BPM: 130, Wave: "triangle", + DroneFreqs: []float64{98.00, 146.83, 196.00}, Attack: 0.02, Release: 0.1, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumPop, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 190, Wave: "square", - DroneFreqs: []float64{98.00, 146.83, 196.00, 261.63}, - Attack: 0.02, Release: 0.08, CutoffMin: 1800, CutoffMax: 6000, DetuneCents: 12, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.065, BPM: 170, Wave: "sawtooth", + DroneFreqs: []float64{98.00, 196.00, 293.66, 392.00}, Attack: 0.02, Release: 0.05, + CutoffMin: 2200, CutoffMax: 7500, DetuneCents: 12, Drums: drumPop, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// MATRIX – hard-grid cyberpunk, C minor, 160/240 +// MATRIX – liquid drum-and-bass, C minor, sub-bass + amen-break stabs // ════════════════════════════════════════════════════════════════════ func soundsMatrix() themeSounds { var s themeSounds @@ -530,43 +636,37 @@ func soundsMatrix() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "square", 660, 220, 0.15, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 180, 90, 0.1, 0.1 - cm, fm, gm, cm2 := minor(65.41), power(87.31), power(98.00), minor(130.81) - normalMel := buildRockSong( - [4]float64{130.81, 196.00, 196.00, 130.81}, [4][3]float64{cm, fm, gm, cm2}, - [4][]melodyNote{ - buildDriveMelody([]float64{523.25, 587.33, 659.25, 783.99}, 0.233), - buildDriveMelody([]float64{698.46, 783.99, 880.00, 523.25}, 0.233), - buildDriveMelody([]float64{783.99, 880.00, 932.33, 587.33}, 0.233), - buildDriveMelody([]float64{523.25, 659.25, 783.99, 932.33}, 0.233), - }, 0.233) - wildMel := buildRockSong( - [4]float64{261.63, 392.00, 392.00, 261.63}, [4][3]float64{cm, fm, gm, cm2}, - [4][]melodyNote{ - buildStabMelody([]float64{1046.5, 1174.66, 1318.5, 1567.98}, 0.117), - buildStabMelody([]float64{1396.92, 1567.98, 1760.00, 1046.5}, 0.117), - buildStabMelody([]float64{1567.98, 1760.00, 1864.66, 1174.66}, 0.117), - buildStabMelody([]float64{1046.5, 1318.5, 1567.98, 1864.66}, 0.117), - }, 0.117) - + // Reese-bass + glitchy stabs. Cm-Ab-Bb-Cm. + beat := 0.353 // 170 BPM DnB + mel := concat( + dubSwell(41.20, 4, beat), padHold(minor(130.81), 4, beat), + hook(beat, 783.99, 0.25, 0, 0.25, 783.99, 0.5, 932.33, 0.5, + 0, 0.5, 1046.5, 0.5, 932.33, 1.0), + dubSwell(34.65, 4, beat), padHold(major(103.83), 4, beat), + hook(beat, 622.25, 0.25, 0, 0.25, 622.25, 0.5, 783.99, 0.5, + 0, 0.5, 932.33, 0.5, 783.99, 1.0), + ) + wbeat := 0.333 // 180 BPM neurofunk + wmel := concat( + palmMute(65.41, wbeat), + hook(wbeat, 1046.5, 0.25, 1244.5, 0.25, 1567.98, 0.25, 1244.5, 0.25, + 1864.66, 0.25, 1567.98, 0.25, 1244.5, 0.25, 1046.5, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 160, Wave: "square", - DroneFreqs: []float64{65.41, 130.81, 196.00}, - Attack: 0.02, Release: 0.12, CutoffMin: 1200, CutoffMax: 5000, DetuneCents: 6, - Drums: pat("kick", "_", "hat", "_", "kick", "snare", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.03, BPM: 170, Wave: "sawtooth", + DroneFreqs: []float64{32.70, 65.41, 130.81}, Attack: 0.02, Release: 0.1, + CutoffMin: 1000, CutoffMax: 5500, DetuneCents: 6, Drums: drumDnb, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.065, BPM: 240, Wave: "square", - DroneFreqs: []float64{130.81, 196.00, 261.63, 392.00}, - Attack: 0.02, Release: 0.04, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 18, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 180, Wave: "sawtooth", + DroneFreqs: []float64{65.41, 130.81, 196.00, 261.63}, Attack: 0.02, Release: 0.04, + CutoffMin: 2200, CutoffMax: 8000, DetuneCents: 18, Drums: drumDnb, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// OCEAN – deep-current surge, E minor, 130/200 +// OCEAN – surf rock, E minor, Dick Dale tremolo guitar // ════════════════════════════════════════════════════════════════════ func soundsOcean() themeSounds { var s themeSounds @@ -577,43 +677,41 @@ func soundsOcean() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 493.88, 164.81, 0.18, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 140, 70, 0.12, 0.09 - em, c, d, e2 := minor(82.41), power(65.41), power(73.42), minor(164.81) - normalMel := buildRockSong( - [4]float64{164.81, 130.81, 146.83, 329.63}, [4][3]float64{em, c, d, e2}, - [4][]melodyNote{ - buildDriveMelody([]float64{329.63, 392.00, 440.00, 493.88}, 0.288), - buildDriveMelody([]float64{261.63, 311.13, 392.00, 440.00}, 0.288), - buildDriveMelody([]float64{293.66, 349.23, 440.00, 523.25}, 0.288), - buildDriveMelody([]float64{329.63, 392.00, 493.88, 659.25}, 0.288), - }, 0.288) - wildMel := buildRockSong( - [4]float64{329.63, 261.63, 293.66, 659.25}, [4][3]float64{em, c, d, e2}, - [4][]melodyNote{ - buildStabMelody([]float64{659.25, 783.99, 880.00, 987.77}, 0.144), - buildStabMelody([]float64{523.25, 622.25, 783.99, 880.00}, 0.144), - buildStabMelody([]float64{587.33, 698.46, 880.00, 1046.5}, 0.144), - buildStabMelody([]float64{659.25, 783.99, 987.77, 1318.5}, 0.144), - }, 0.144) - + // "Misirlou"-style tremolo-picked surf riff over driving rock drums. + // Em-D-C-B7 with a chromatic descending phrygian lead. + beat := 0.429 // 140 BPM + mel := concat( + palmMute(82.41, beat), padHold(minor(164.81), 4, beat), + hook(beat, 659.25, 0.25, 698.46, 0.25, 783.99, 0.25, 698.46, 0.25, + 659.25, 0.25, 622.25, 0.25, 587.33, 0.25, 523.25, 0.25, + 493.88, 0.5, 587.33, 0.5, 659.25, 1.0), + palmMute(73.42, beat), padHold(major(146.83), 4, beat), + hook(beat, 587.33, 0.25, 622.25, 0.25, 698.46, 0.25, 622.25, 0.25, + 587.33, 0.25, 523.25, 0.25, 493.88, 0.25, 440.00, 0.25, + 493.88, 0.5, 587.33, 0.5, 659.25, 1.0), + ) + wbeat := 0.353 // 170 BPM + wmel := concat( + palmMute(164.81, wbeat), + hook(wbeat, 1318.5, 0.125, 1396.92, 0.125, 1567.98, 0.125, 1396.92, 0.125, + 1318.5, 0.125, 1244.5, 0.125, 1174.66, 0.125, 1046.5, 0.125, + 987.77, 0.25, 1174.66, 0.25, 1318.5, 0.5), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 130, Wave: "square", - DroneFreqs: []float64{82.41, 130.81, 164.81}, - Attack: 0.02, Release: 0.18, CutoffMin: 1000, CutoffMax: 4500, - Drums: pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.032, BPM: 140, Wave: "triangle", + DroneFreqs: []float64{82.41, 130.81, 164.81}, Attack: 0.02, Release: 0.08, + CutoffMin: 1500, CutoffMax: 6000, Drums: drumRock, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 200, Wave: "square", - DroneFreqs: []float64{82.41, 130.81, 164.81, 196.00}, - Attack: 0.02, Release: 0.08, CutoffMin: 1800, CutoffMax: 6500, DetuneCents: 12, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.065, BPM: 170, Wave: "sawtooth", + DroneFreqs: []float64{82.41, 164.81, 246.94, 329.63}, Attack: 0.02, Release: 0.04, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 14, Drums: drumRockWild, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// DOS – chiptune blast, C major, 180/260 +// DOS – Duke Nukem 3D "Grabbag" lick, E minor, palm-muted metal // ════════════════════════════════════════════════════════════════════ func soundsDos() themeSounds { var s themeSounds @@ -624,43 +722,47 @@ func soundsDos() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "square", 660, 220, 0.15, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 180, 90, 0.1, 0.1 - c, f, g1, c2 := power(65.41), power(87.31), power(98.00), power(130.81) - normalMel := buildRockSong( - [4]float64{130.81, 174.61, 196.00, 130.81}, [4][3]float64{c, f, g1, c2}, - [4][]melodyNote{ - buildDriveMelody([]float64{523.25, 587.33, 659.25, 783.99}, 0.2), - buildDriveMelody([]float64{698.46, 783.99, 880.00, 1046.5}, 0.2), - buildDriveMelody([]float64{783.99, 880.00, 1046.5, 783.99}, 0.2), - buildDriveMelody([]float64{523.25, 659.25, 783.99, 1046.5}, 0.2), - }, 0.2) - wildMel := buildRockSong( - [4]float64{261.63, 349.23, 392.00, 261.63}, [4][3]float64{c, f, g1, c2}, - [4][]melodyNote{ - buildStabMelody([]float64{1046.5, 1174.66, 1318.5, 1567.98}, 0.1), - buildStabMelody([]float64{1396.92, 1567.98, 1760.00, 2093.0}, 0.1), - buildStabMelody([]float64{1567.98, 1760.00, 2093.0, 1567.98}, 0.1), - buildStabMelody([]float64{1046.5, 1318.5, 1567.98, 2093.0}, 0.1), - }, 0.1) - + // THE Lee Jackson Grabbag riff: E5 E5 G5 A5 | E5 E5 G5 A5 Bb5 A5 G5 E5 + // then drop down B4 D5 E5 ... Iconic 1996 PC-DOS metal. + beat := 0.462 // 130 BPM + const ( + E2, E3, B3 = 82.41, 164.81, 246.94 + E4, G4, A4 = 329.63, 392.00, 440.00 + Bb4, B4 = 466.16, 493.88 + ) + riff := []float64{ + E4, 0.5, E4, 0.5, G4, 0.5, A4, 0.5, // bar 1a + E4, 0.5, E4, 0.5, G4, 0.5, A4, 0.5, // bar 1b + B4, 0.5, A4, 0.5, G4, 0.5, E4, 0.5, // bar 2 — the climbs-then-drops hook + Bb4, 0.5, A4, 0.5, G4, 0.5, E4, 0.5, + } + mel := concat( + palmMute(E2, beat), padHold([3]float64{E3, B3, E4}, 4, beat), + hook(beat, riff...), + ) + wbeat := 0.375 // 160 BPM thrash + wmel := concat( + palmMute(E3, wbeat), + hook(wbeat, E4*2, 0.25, E4*2, 0.25, G4*2, 0.25, A4*2, 0.25, + E4*2, 0.25, E4*2, 0.25, G4*2, 0.25, A4*2, 0.25, + B4*2, 0.25, A4*2, 0.25, G4*2, 0.25, E4*2, 0.25, + Bb4*2, 0.25, A4*2, 0.25, G4*2, 0.25, E4*2, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 180, Wave: "square", - DroneFreqs: []float64{130.81, 196.00, 261.63}, - Attack: 0.02, Release: 0.1, CutoffMin: 1500, CutoffMax: 6000, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "_", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: normalMel, + Gain: 0.032, BPM: 130, Wave: "square", + DroneFreqs: []float64{82.41, 164.81, 246.94}, Attack: 0.01, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumRock, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.065, BPM: 260, Wave: "square", - DroneFreqs: []float64{130.81, 196.00, 261.63, 392.00}, - Attack: 0.02, Release: 0.03, CutoffMin: 2500, CutoffMax: 7500, DetuneCents: 8, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 160, Wave: "square", + DroneFreqs: []float64{82.41, 164.81, 246.94, 329.63}, Attack: 0.01, Release: 0.04, + CutoffMin: 2400, CutoffMax: 8000, DetuneCents: 12, Drums: drumRockWild, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// RETRO – CRT scanline banger, A minor, 140/200 +// RETRO – 8-bit chiptune Mario bounce, A minor, NES arpeggios // ════════════════════════════════════════════════════════════════════ func soundsRetro() themeSounds { var s themeSounds @@ -671,43 +773,45 @@ func soundsRetro() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 330, 110, 0.16, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 150, 75, 0.12, 0.09 - am, dm, em, am2 := minor(55.00), minor(73.42), minor(82.41), minor(110.00) - normalMel := buildRockSong( - [4]float64{110.00, 146.83, 164.81, 110.00}, [4][3]float64{am, dm, em, am2}, - [4][]melodyNote{ - buildDriveMelody([]float64{220.00, 293.66, 329.63, 440.00}, 0.268), - buildDriveMelody([]float64{293.66, 349.23, 392.00, 440.00}, 0.268), - buildDriveMelody([]float64{329.63, 392.00, 440.00, 493.88}, 0.268), - buildDriveMelody([]float64{220.00, 261.63, 329.63, 440.00}, 0.268), - }, 0.268) - wildMel := buildRockSong( - [4]float64{220.00, 146.83, 164.81, 220.00}, [4][3]float64{am, dm, em, am2}, - [4][]melodyNote{ - buildStabMelody([]float64{440.00, 587.33, 659.25, 880.00}, 0.134), - buildStabMelody([]float64{587.33, 698.46, 783.99, 880.00}, 0.134), - buildStabMelody([]float64{659.25, 783.99, 880.00, 987.77}, 0.134), - buildStabMelody([]float64{440.00, 523.25, 659.25, 880.00}, 0.134), - }, 0.134) - + // Bouncy Am-F-G-Em arp lead — Mega Man action-platformer pace. + beat := 0.4 // 150 BPM + mel := concat( + octaveBass(110.00, beat), arpUpDown(minor(220.00), beat), + hook(beat, 880.00, 0.25, 1046.5, 0.25, 1318.5, 0.25, 1760.00, 0.25, + 1318.5, 0.25, 1046.5, 0.25, 880.00, 0.25, 659.25, 0.25), + octaveBass(87.31, beat), arpUpDown(major(174.61), beat), + hook(beat, 698.46, 0.25, 880.00, 0.25, 1046.5, 0.25, 1396.92, 0.25, + 1046.5, 0.25, 880.00, 0.25, 698.46, 0.25, 523.25, 0.25), + octaveBass(98.00, beat), arpUpDown(major(196.00), beat), + hook(beat, 783.99, 0.25, 987.77, 0.25, 1174.66, 0.25, 1567.98, 0.25, + 1174.66, 0.25, 987.77, 0.25, 783.99, 0.25, 587.33, 0.25), + octaveBass(82.41, beat), arpUpDown(minor(164.81), beat), + hook(beat, 659.25, 0.25, 783.99, 0.25, 987.77, 0.25, 1318.5, 0.25, + 987.77, 0.25, 783.99, 0.25, 659.25, 0.25, 493.88, 0.25), + ) + wbeat := 0.316 // 190 BPM + wmel := concat( + octaveBass(220.00, wbeat), + hook(wbeat, 1760.00, 0.125, 2093.0, 0.125, 2637.0, 0.125, 3520.0, 0.125, + 2637.0, 0.125, 2093.0, 0.125, 1760.00, 0.125, 1318.5, 0.125, + 880.00, 0.125, 1046.5, 0.125, 1318.5, 0.125, 1760.00, 0.125, + 1318.5, 0.125, 1046.5, 0.125, 880.00, 0.125, 659.25, 0.125), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 140, Wave: "square", - DroneFreqs: []float64{55.00, 110.00, 164.81}, - Attack: 0.02, Release: 0.18, CutoffMin: 1000, CutoffMax: 4500, - Drums: pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "square", + DroneFreqs: []float64{55.00, 110.00, 220.00}, Attack: 0.01, Release: 0.05, + CutoffMin: 1500, CutoffMax: 6500, Drums: drumChip, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 200, Wave: "square", - DroneFreqs: []float64{110.00, 220.00, 261.63, 329.63}, - Attack: 0.02, Release: 0.06, CutoffMin: 1800, CutoffMax: 6500, DetuneCents: 10, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 190, Wave: "square", + DroneFreqs: []float64{110.00, 220.00, 329.63, 440.00}, Attack: 0.005, Release: 0.03, + CutoffMin: 2500, CutoffMax: 8000, DetuneCents: 8, Drums: drumChip, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// COSMOS – supernova impact, D minor, 150/220 +// COSMOS – Imperial March stomp, D minor, action fanfare // ════════════════════════════════════════════════════════════════════ func soundsCosmos() themeSounds { var s themeSounds @@ -718,43 +822,40 @@ func soundsCosmos() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 440, 146.83, 0.18, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 150, 75, 0.12, 0.09 - dm, am, gm, dm2 := minor(73.42), power(110.00), power(98.00), minor(146.83) - normalMel := buildRockSong( - [4]float64{146.83, 220.00, 196.00, 146.83}, [4][3]float64{dm, am, gm, dm2}, - [4][]melodyNote{ - buildDriveMelody([]float64{293.66, 349.23, 440.00, 493.88}, 0.25), - buildDriveMelody([]float64{440.00, 493.88, 587.33, 293.66}, 0.25), - buildDriveMelody([]float64{392.00, 440.00, 493.88, 349.23}, 0.25), - buildDriveMelody([]float64{293.66, 349.23, 440.00, 587.33}, 0.25), - }, 0.25) - wildMel := buildRockSong( - [4]float64{293.66, 440.00, 392.00, 293.66}, [4][3]float64{dm, am, gm, dm2}, - [4][]melodyNote{ - buildStabMelody([]float64{587.33, 698.46, 880.00, 987.77}, 0.125), - buildStabMelody([]float64{880.00, 987.77, 1174.66, 587.33}, 0.125), - buildStabMelody([]float64{783.99, 880.00, 987.77, 698.46}, 0.125), - buildStabMelody([]float64{587.33, 698.46, 880.00, 1174.66}, 0.125), - }, 0.125) - + // Imperial-March-style stomping brass fanfare at action tempo. + beat := 0.4 // 150 BPM driving + mel := concat( + palmMute(73.42, beat), padHold(minor(146.83), 4, beat), + hook(beat, 587.33, 0.75, 587.33, 0.25, 587.33, 0.5, 880.00, 0.5, + 698.46, 0.25, 659.25, 0.25, 622.25, 0.25, 587.33, 0.25, 880.00, 1.0), + palmMute(58.27, beat), padHold(major(116.54), 4, beat), + hook(beat, 466.16, 0.75, 466.16, 0.25, 466.16, 0.5, 698.46, 0.5, + 554.37, 0.25, 523.25, 0.25, 493.88, 0.25, 466.16, 0.25, 698.46, 1.0), + palmMute(65.41, beat), padHold(minor(130.81), 4, beat), + hook(beat, 523.25, 0.75, 523.25, 0.25, 523.25, 0.5, 783.99, 0.5, + 622.25, 0.25, 587.33, 0.25, 554.37, 0.25, 523.25, 0.25, 783.99, 1.0), + ) + wbeat := 0.333 // 180 BPM + wmel := concat( + palmMute(146.83, wbeat), + hook(wbeat, 1174.66, 0.25, 1174.66, 0.25, 1396.92, 0.5, 1760.00, 0.5, + 2349.32, 0.5, 2093.0, 0.25, 1760.00, 0.25, 1396.92, 0.5, 1174.66, 0.5), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 150, Wave: "square", - DroneFreqs: []float64{73.42, 110.00, 146.83}, - Attack: 0.02, Release: 0.15, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "_", "hat", "snare", "kick", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "sawtooth", + DroneFreqs: []float64{73.42, 110.00, 146.83}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumMarch, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.06, BPM: 220, Wave: "square", - DroneFreqs: []float64{73.42, 146.83, 196.00, 293.66}, - Attack: 0.02, Release: 0.05, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 12, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 180, Wave: "sawtooth", + DroneFreqs: []float64{73.42, 146.83, 220.00, 293.66}, Attack: 0.02, Release: 0.05, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 16, Drums: drumChug, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// RETROFUTURE – atomic twilight stomp, E major, 140/210 +// RETROFUTURE – Tron / Daft Punk filter-square, E major // ════════════════════════════════════════════════════════════════════ func soundsRetrofuture() themeSounds { var s themeSounds @@ -765,43 +866,37 @@ func soundsRetrofuture() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 493.88, 164.81, 0.2, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 160, 80, 0.14, 0.09 - em, am, bm, e2 := power(82.41), power(55.00), power(61.74), power(164.81) - normalMel := buildRockSong( - [4]float64{164.81, 110.00, 123.47, 329.63}, [4][3]float64{em, am, bm, e2}, - [4][]melodyNote{ - buildDriveMelody([]float64{329.63, 392.00, 440.00, 493.88}, 0.268), - buildDriveMelody([]float64{220.00, 261.63, 293.66, 329.63}, 0.268), - buildDriveMelody([]float64{246.94, 293.66, 329.63, 369.99}, 0.268), - buildDriveMelody([]float64{329.63, 392.00, 493.88, 659.25}, 0.268), - }, 0.268) - wildMel := buildRockSong( - [4]float64{329.63, 220.00, 246.94, 329.63}, [4][3]float64{em, am, bm, e2}, - [4][]melodyNote{ - buildStabMelody([]float64{659.25, 783.99, 880.00, 987.77}, 0.134), - buildStabMelody([]float64{440.00, 523.25, 587.33, 659.25}, 0.134), - buildStabMelody([]float64{493.88, 587.33, 659.25, 739.99}, 0.134), - buildStabMelody([]float64{659.25, 783.99, 987.77, 1318.5}, 0.134), - }, 0.134) - + // Filtered square bass + locked-grid analog lead. E-A-B-E. + beat := 0.4 // 150 BPM driving Daft Punk action-disco + mel := concat( + octaveBass(82.41, beat), padHold(major(164.81), 4, beat), + hook(beat, 659.25, 0.5, 659.25, 0.5, 783.99, 0.5, 987.77, 0.5, + 987.77, 0.5, 783.99, 0.5, 659.25, 0.5, 493.88, 0.5), + octaveBass(110.00, beat), padHold(major(220.00), 4, beat), + hook(beat, 880.00, 0.5, 880.00, 0.5, 1046.5, 0.5, 1318.5, 0.5, + 1046.5, 0.5, 880.00, 0.5, 659.25, 0.5, 493.88, 0.5), + ) + wbeat := 0.316 // 190 BPM + wmel := concat( + octaveBass(164.81, wbeat), + hook(wbeat, 1318.5, 0.25, 1567.98, 0.25, 1864.66, 0.25, 1318.5, 0.25, + 1567.98, 0.25, 1864.66, 0.25, 1318.5, 0.25, 1046.5, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 140, Wave: "square", - DroneFreqs: []float64{82.41, 110.00, 164.81}, - Attack: 0.02, Release: 0.18, CutoffMin: 1000, CutoffMax: 4500, - Drums: pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "square", + DroneFreqs: []float64{82.41, 164.81, 246.94}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumFour, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.06, BPM: 210, Wave: "square", - DroneFreqs: []float64{82.41, 164.81, 220.00, 329.63}, - Attack: 0.02, Release: 0.06, CutoffMin: 1800, CutoffMax: 6500, DetuneCents: 10, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 190, Wave: "sawtooth", + DroneFreqs: []float64{82.41, 164.81, 329.63, 493.88}, Attack: 0.01, Release: 0.04, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 14, Drums: drumFour, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// SPACEAGE – booster-ignition, G major, 130/200 +// SPACEAGE – Star Trek action theme, G major, hero-fanfare drive // ════════════════════════════════════════════════════════════════════ func soundsSpaceage() themeSounds { var s themeSounds @@ -812,43 +907,43 @@ func soundsSpaceage() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 587, 196, 0.19, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 130, 65, 0.12, 0.09 - gm, em, cm, gm2 := power(98.00), power(82.41), power(65.41), power(196.00) - normalMel := buildRockSong( - [4]float64{196.00, 164.81, 130.81, 392.00}, [4][3]float64{gm, em, cm, gm2}, - [4][]melodyNote{ - buildDriveMelody([]float64{392.00, 440.00, 493.88, 587.33}, 0.288), - buildDriveMelody([]float64{329.63, 369.99, 392.00, 440.00}, 0.288), - buildDriveMelody([]float64{261.63, 293.66, 329.63, 392.00}, 0.288), - buildDriveMelody([]float64{392.00, 440.00, 587.33, 783.99}, 0.288), - }, 0.288) - wildMel := buildRockSong( - [4]float64{392.00, 329.63, 261.63, 392.00}, [4][3]float64{gm, em, cm, gm2}, - [4][]melodyNote{ - buildStabMelody([]float64{783.99, 880.00, 987.77, 1174.66}, 0.144), - buildStabMelody([]float64{659.25, 739.99, 783.99, 880.00}, 0.144), - buildStabMelody([]float64{523.25, 587.33, 659.25, 783.99}, 0.144), - buildStabMelody([]float64{783.99, 880.00, 1174.66, 1567.98}, 0.144), - }, 0.144) - + // Heroic ascending fanfare at action tempo — "to boldly go" energy. + beat := 0.4 // 150 BPM + mel := concat( + octaveBass(98.00, beat), padHold(major(196.00), 4, beat), + hook(beat, 783.99, 0.5, 987.77, 0.5, 1174.66, 0.5, 1567.98, 0.5, + 1318.5, 0.5, 1174.66, 0.5, 987.77, 0.5, 783.99, 0.5), + octaveBass(82.41, beat), padHold(minor(164.81), 4, beat), + hook(beat, 659.25, 0.5, 783.99, 0.5, 987.77, 0.5, 1318.5, 0.5, + 1174.66, 0.5, 987.77, 0.5, 783.99, 0.5, 659.25, 0.5), + octaveBass(110.00, beat), padHold(minor(220.00), 4, beat), + hook(beat, 880.00, 0.5, 1046.5, 0.5, 1318.5, 0.5, 1760.00, 0.5, + 1396.92, 0.5, 1318.5, 0.5, 1046.5, 0.5, 880.00, 0.5), + octaveBass(73.42, beat), padHold(major(146.83), 4, beat), + hook(beat, 587.33, 0.5, 880.00, 0.5, 1108.73, 0.5, 1318.5, 0.5, + 1567.98, 0.5, 1318.5, 0.5, 1108.73, 0.5, 880.00, 0.5), + ) + wbeat := 0.333 // 180 BPM + wmel := concat( + octaveBass(196.00, wbeat), + hook(wbeat, 1567.98, 0.25, 1975.53, 0.25, 2349.32, 0.25, 3135.96, 0.25, + 2637.0, 0.25, 2349.32, 0.25, 1975.53, 0.25, 1567.98, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 130, Wave: "square", - DroneFreqs: []float64{98.00, 130.81, 196.00}, - Attack: 0.02, Release: 0.18, CutoffMin: 1000, CutoffMax: 4500, - Drums: pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "triangle", + DroneFreqs: []float64{98.00, 130.81, 196.00}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumPop, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 200, Wave: "square", - DroneFreqs: []float64{98.00, 196.00, 261.63, 392.00}, - Attack: 0.02, Release: 0.06, CutoffMin: 1800, CutoffMax: 6500, DetuneCents: 10, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.065, BPM: 180, Wave: "sawtooth", + DroneFreqs: []float64{98.00, 196.00, 293.66, 392.00}, Attack: 0.02, Release: 0.05, + CutoffMin: 2200, CutoffMax: 7500, DetuneCents: 12, Drums: drumPop, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// TROPICAL – typhoon rush, F major, 170/260 +// TROPICALE – Latin afro-funk, F major, conga clave + brass stabs // ════════════════════════════════════════════════════════════════════ func soundsTropical() themeSounds { var s themeSounds @@ -859,43 +954,40 @@ func soundsTropical() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 523.25, 174.61, 0.2, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 170, 85, 0.12, 0.09 - fm, dm, gm, c := power(87.31), minor(73.42), power(98.00), power(65.41) - normalMel := buildRockSong( - [4]float64{174.61, 146.83, 196.00, 130.81}, [4][3]float64{fm, dm, gm, c}, - [4][]melodyNote{ - buildDriveMelody([]float64{349.23, 440.00, 523.25, 587.33}, 0.22), - buildDriveMelody([]float64{293.66, 349.23, 392.00, 440.00}, 0.22), - buildDriveMelody([]float64{392.00, 440.00, 493.88, 523.25}, 0.22), - buildDriveMelody([]float64{261.63, 349.23, 392.00, 523.25}, 0.22), - }, 0.22) - wildMel := buildRockSong( - [4]float64{349.23, 293.66, 196.00, 261.63}, [4][3]float64{fm, dm, gm, c}, - [4][]melodyNote{ - buildStabMelody([]float64{698.46, 880.00, 1046.5, 1174.66}, 0.11), - buildStabMelody([]float64{587.33, 698.46, 783.99, 880.00}, 0.11), - buildStabMelody([]float64{783.99, 880.00, 987.77, 1046.5}, 0.11), - buildStabMelody([]float64{523.25, 698.46, 783.99, 1046.5}, 0.11), - }, 0.11) - + // Tito Puente brass-stab energy, F-Bb-C-F. + beat := 0.5 // 120 BPM + mel := concat( + bossaBass(87.31, beat), padHold(major(174.61), 4, beat), + hook(beat, 698.46, 0.5, 0, 0.25, 880.00, 0.25, 1046.5, 0.5, 880.00, 0.5, + 698.46, 0.5, 880.00, 0.5, 1046.5, 1.0), + bossaBass(116.54, beat), padHold(major(233.08), 4, beat), + hook(beat, 932.33, 0.5, 0, 0.25, 1174.66, 0.25, 1396.92, 0.5, 1174.66, 0.5, + 932.33, 0.5, 1174.66, 0.5, 1396.92, 1.0), + bossaBass(130.81, beat), padHold(major(261.63), 4, beat), + hook(beat, 1046.5, 0.5, 0, 0.25, 1318.5, 0.25, 1567.98, 0.5, 1318.5, 0.5, + 1046.5, 0.5, 1318.5, 0.5, 1567.98, 1.0), + ) + wbeat := 0.353 // 170 BPM + wmel := concat( + bossaBass(174.61, wbeat), + hook(wbeat, 1396.92, 0.25, 1760.00, 0.25, 2093.0, 0.25, 1760.00, 0.25, + 2349.32, 0.25, 2093.0, 0.25, 1760.00, 0.25, 1396.92, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 170, Wave: "square", - DroneFreqs: []float64{87.31, 174.61, 196.00}, - Attack: 0.02, Release: 0.15, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: normalMel, + Gain: 0.03, BPM: 120, Wave: "sawtooth", + DroneFreqs: []float64{87.31, 174.61, 261.63}, Attack: 0.02, Release: 0.15, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumLatin, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.06, BPM: 260, Wave: "square", - DroneFreqs: []float64{87.31, 174.61, 196.00, 261.63}, - Attack: 0.02, Release: 0.04, CutoffMin: 2000, CutoffMax: 7500, DetuneCents: 12, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.065, BPM: 170, Wave: "sawtooth", + DroneFreqs: []float64{87.31, 174.61, 261.63, 349.23}, Attack: 0.02, Release: 0.06, + CutoffMin: 2200, CutoffMax: 7500, DetuneCents: 12, Drums: drumLatin, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// NOIR – midnight chase, D minor, 130/190 +// NOIR – rockabilly chase, D minor, slap-bass + chromatic guitar // ════════════════════════════════════════════════════════════════════ func soundsNoir() themeSounds { var s themeSounds @@ -906,43 +998,39 @@ func soundsNoir() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 440, 146.83, 0.18, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 130, 65, 0.12, 0.09 - dm, am, c, dm2 := minor(73.42), minor(110.00), power(65.41), minor(146.83) - normalMel := buildRockSong( - [4]float64{146.83, 220.00, 130.81, 146.83}, [4][3]float64{dm, am, c, dm2}, - [4][]melodyNote{ - buildDriveMelody([]float64{293.66, 349.23, 440.00, 523.25}, 0.288), - buildDriveMelody([]float64{440.00, 493.88, 587.33, 293.66}, 0.288), - buildDriveMelody([]float64{261.63, 311.13, 392.00, 261.63}, 0.288), - buildDriveMelody([]float64{293.66, 349.23, 440.00, 587.33}, 0.288), - }, 0.288) - wildMel := buildRockSong( - [4]float64{293.66, 440.00, 261.63, 293.66}, [4][3]float64{dm, am, c, dm2}, - [4][]melodyNote{ - buildStabMelody([]float64{587.33, 698.46, 880.00, 1046.5}, 0.144), - buildStabMelody([]float64{880.00, 987.77, 1174.66, 587.33}, 0.144), - buildStabMelody([]float64{523.25, 622.25, 783.99, 523.25}, 0.144), - buildStabMelody([]float64{587.33, 698.46, 880.00, 1174.66}, 0.144), - }, 0.144) - + // Rockabilly chase — Stray Cats slap-bass walking + Pulp-Fiction-style + // surf-rock chromatic guitar lead at action tempo. Dm-Gm-A7-Dm. + beat := 0.4 // 150 BPM rockabilly + mel := concat( + walkBass(73.42, beat), padHold(minor(146.83), 4, beat), + chromDesc(880.00, beat), + walkBass(98.00, beat), padHold(minor(196.00), 4, beat), + chromDesc(739.99, beat), + walkBass(110.00, beat), padHold(major(220.00), 4, beat), + chromDesc(659.25, beat), + walkBass(73.42, beat), padHold(minor(146.83), 4, beat), + chromDesc(587.33, beat), + ) + wbeat := 0.316 // 190 BPM + wmel := concat( + walkBass(146.83, wbeat), + chromDesc(1318.5, wbeat), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.028, BPM: 130, Wave: "square", - DroneFreqs: []float64{73.42, 110.00, 146.83}, - Attack: 0.02, Release: 0.18, CutoffMin: 1000, CutoffMax: 4500, - Drums: pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "triangle", + DroneFreqs: []float64{73.42, 110.00, 146.83}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumBoom, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 190, Wave: "square", - DroneFreqs: []float64{73.42, 146.83, 196.00, 293.66}, - Attack: 0.02, Release: 0.08, CutoffMin: 1800, CutoffMax: 6500, DetuneCents: 12, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 190, Wave: "sawtooth", + DroneFreqs: []float64{73.42, 146.83, 196.00, 293.66}, Attack: 0.02, Release: 0.05, + CutoffMin: 2200, CutoffMax: 7500, DetuneCents: 14, Drums: drumBoom, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// CATHEDRAL – bell-tower assault, C major, 120/180 +// CATHEDRAL – gothic metal organ, C minor, Type-O-Negative drive // ════════════════════════════════════════════════════════════════════ func soundsCathedral() themeSounds { var s themeSounds @@ -953,43 +1041,43 @@ func soundsCathedral() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 392, 130.81, 0.22, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 160, 80, 0.14, 0.09 - cm, fm, gm, c2 := power(65.41), power(87.31), power(98.00), power(130.81) - normalMel := buildRockSong( - [4]float64{130.81, 174.61, 196.00, 130.81}, [4][3]float64{cm, fm, gm, c2}, - [4][]melodyNote{ - buildDriveMelody([]float64{523.25, 587.33, 659.25, 783.99}, 0.31), - buildDriveMelody([]float64{698.46, 783.99, 880.00, 1046.5}, 0.31), - buildDriveMelody([]float64{783.99, 880.00, 1046.5, 783.99}, 0.31), - buildDriveMelody([]float64{523.25, 659.25, 783.99, 1046.5}, 0.31), - }, 0.31) - wildMel := buildRockSong( - [4]float64{261.63, 349.23, 392.00, 261.63}, [4][3]float64{cm, fm, gm, c2}, - [4][]melodyNote{ - buildStabMelody([]float64{1046.5, 1174.66, 1318.5, 1567.98}, 0.155), - buildStabMelody([]float64{1396.92, 1567.98, 1760.00, 2093.0}, 0.155), - buildStabMelody([]float64{1567.98, 1760.00, 2093.0, 1567.98}, 0.155), - buildStabMelody([]float64{1046.5, 1318.5, 1567.98, 2093.0}, 0.155), - }, 0.155) - + // Gothic-metal organ pedal + driven Toccata-style lead. Cm-Gm-Ab-Bb. + beat := 0.4 // 150 BPM driving gothic + mel := concat( + palmMute(65.41, beat), padHold(minor(130.81), 4, beat), + hook(beat, 523.25, 0.5, 622.25, 0.5, 783.99, 0.5, 622.25, 0.5, + 523.25, 0.5, 466.16, 0.5, 415.30, 0.5, 391.99, 0.5), + palmMute(98.00, beat), padHold(minor(196.00), 4, beat), + hook(beat, 783.99, 0.5, 932.33, 0.5, 1174.66, 0.5, 932.33, 0.5, + 783.99, 0.5, 698.46, 0.5, 622.25, 0.5, 587.33, 0.5), + palmMute(51.91, beat), padHold(major(103.83), 4, beat), + hook(beat, 415.30, 0.5, 523.25, 0.5, 622.25, 0.5, 523.25, 0.5, + 415.30, 0.5, 391.99, 0.5, 369.99, 0.5, 311.13, 0.5), + palmMute(58.27, beat), padHold(major(116.54), 4, beat), + hook(beat, 466.16, 0.5, 587.33, 0.5, 698.46, 0.5, 587.33, 0.5, + 466.16, 0.5, 415.30, 0.5, 391.99, 0.5, 349.23, 0.5), + ) + wbeat := 0.333 // 180 BPM + wmel := concat( + palmMute(130.81, wbeat), + hook(wbeat, 1046.5, 0.25, 1244.5, 0.25, 1567.98, 0.25, 1244.5, 0.25, + 1046.5, 0.25, 932.33, 0.25, 783.99, 0.25, 622.25, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 120, Wave: "square", - DroneFreqs: []float64{65.41, 130.81, 196.00}, - Attack: 0.02, Release: 0.2, CutoffMin: 800, CutoffMax: 4000, - Drums: pat("kick", "_", "hat", "_", "kick", "_", "hat", "_", "kick", "_", "hat", "_", "snare", "_", "hat", "_"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "triangle", + DroneFreqs: []float64{65.41, 98.00, 130.81}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumChug, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.055, BPM: 180, Wave: "square", - DroneFreqs: []float64{65.41, 130.81, 196.00, 261.63}, - Attack: 0.02, Release: 0.08, CutoffMin: 1600, CutoffMax: 6000, DetuneCents: 10, - Drums: pat("kick", "hat", "kick", "hat", "snare", "hat", "kick", "hat", "kick", "hat", "snare", "hat", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.07, BPM: 180, Wave: "sawtooth", + DroneFreqs: []float64{65.41, 130.81, 196.00, 261.63}, Attack: 0.02, Release: 0.05, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 14, Drums: drumChug, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// SURVEILLANCE – spy chase, E major, 150/200 +// SURVEILLANCE – John Barry spy theme, E minor, chromatic sneak // ════════════════════════════════════════════════════════════════════ func soundsSurveillance() themeSounds { var s themeSounds @@ -1000,43 +1088,40 @@ func soundsSurveillance() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "square", 990, 330, 0.14, 0.085 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "square", 280, 140, 0.09, 0.09 - em, cm, dm, bm := power(82.41), power(65.41), power(73.42), power(61.74) - normalMel := buildRockSong( - [4]float64{164.81, 130.81, 146.83, 123.47}, [4][3]float64{em, cm, dm, bm}, - [4][]melodyNote{ - buildDriveMelody([]float64{329.63, 369.99, 440.00, 493.88}, 0.25), - buildDriveMelody([]float64{261.63, 311.13, 329.63, 392.00}, 0.25), - buildDriveMelody([]float64{293.66, 349.23, 392.00, 440.00}, 0.25), - buildDriveMelody([]float64{246.94, 293.66, 329.63, 369.99}, 0.25), - }, 0.25) - wildMel := buildRockSong( - [4]float64{329.63, 261.63, 293.66, 246.94}, [4][3]float64{em, cm, dm, bm}, - [4][]melodyNote{ - buildStabMelody([]float64{659.25, 739.99, 880.00, 987.77}, 0.125), - buildStabMelody([]float64{523.25, 622.25, 659.25, 783.99}, 0.125), - buildStabMelody([]float64{587.33, 698.46, 783.99, 880.00}, 0.125), - buildStabMelody([]float64{493.88, 587.33, 659.25, 739.99}, 0.125), - }, 0.125) - + // Bond "dum-da-da-dum" + chromatic descend lead at chase tempo. + beat := 0.4 // 150 BPM action + mel := concat( + walkBass(82.41, beat), padHold(minor(164.81), 4, beat), + hook(beat, 329.63, 0.5, 392.00, 0.5, 493.88, 0.5, 392.00, 0.5, + 659.25, 1.0, 622.25, 1.0), + walkBass(110.00, beat), padHold(major(220.00), 4, beat), + chromDesc(987.77, beat), + walkBass(82.41, beat), padHold(minor(164.81), 4, beat), + hook(beat, 329.63, 0.5, 392.00, 0.5, 493.88, 0.5, 392.00, 0.5, + 740.00, 1.0, 698.46, 1.0), + walkBass(123.47, beat), padHold(major(246.94), 4, beat), + chromDesc(880.00, beat), + ) + wbeat := 0.316 // 190 BPM chase + wmel := concat( + walkBass(164.81, wbeat), + chromDesc(1318.5, wbeat), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.025, BPM: 150, Wave: "square", - DroneFreqs: []float64{82.41, 130.81, 164.81}, - Attack: 0.02, Release: 0.15, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "_", "hat", "snare", "kick", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.032, BPM: 150, Wave: "triangle", + DroneFreqs: []float64{82.41, 123.47, 164.81}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumSpy, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.065, BPM: 200, Wave: "square", - DroneFreqs: []float64{164.81, 261.63, 329.63, 493.88}, - Attack: 0.02, Release: 0.04, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 18, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.075, BPM: 190, Wave: "sawtooth", + DroneFreqs: []float64{164.81, 246.94, 329.63, 493.88}, Attack: 0.02, Release: 0.04, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 18, Drums: drumSpy, Melody: wmel, } return s } // ════════════════════════════════════════════════════════════════════ -// BIOMECH – organic stomper, C# major, 160/240 +// BIOMECH – alien organic, C# minor, atonal sliding arpeggios // ════════════════════════════════════════════════════════════════════ func soundsBiomech() themeSounds { var s themeSounds @@ -1047,41 +1132,93 @@ func soundsBiomech() themeSounds { s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "sine", 392, 130.81, 0.2, 0.09 s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "triangle", 160, 80, 0.14, 0.09 - cs, am, emin, bm := power(69.30), power(55.00), power(82.41), power(61.74) - normalMel := buildRockSong( - [4]float64{138.59, 110.00, 164.81, 123.47}, [4][3]float64{cs, am, emin, bm}, - [4][]melodyNote{ - buildDriveMelody([]float64{277.18, 329.63, 369.99, 440.00}, 0.233), - buildDriveMelody([]float64{220.00, 261.63, 293.66, 329.63}, 0.233), - buildDriveMelody([]float64{329.63, 392.00, 440.00, 493.88}, 0.233), - buildDriveMelody([]float64{246.94, 293.66, 329.63, 369.99}, 0.233), - }, 0.233) - wildMel := buildRockSong( - [4]float64{277.18, 220.00, 329.63, 246.94}, [4][3]float64{cs, am, emin, bm}, - [4][]melodyNote{ - buildStabMelody([]float64{554.37, 659.25, 739.99, 880.00}, 0.117), - buildStabMelody([]float64{440.00, 523.25, 587.33, 659.25}, 0.117), - buildStabMelody([]float64{659.25, 783.99, 880.00, 987.77}, 0.117), - buildStabMelody([]float64{493.88, 587.33, 659.25, 739.99}, 0.117), - }, 0.117) + // Alien arpeggios with tritone slide — Giger-style organic action. + beat := 0.4 // 150 BPM + mel := concat( + alienSlide(69.30, beat), padHold(minor(138.59), 4, beat), + alienSlide(138.59, beat), alienSlide(277.18, beat), + alienSlide(82.41, beat), padHold(minor(164.81), 4, beat), + alienSlide(164.81, beat), alienSlide(329.63, beat), + alienSlide(58.27, beat), padHold(major(116.54), 4, beat), + alienSlide(116.54, beat), alienSlide(233.08, beat), + alienSlide(73.42, beat), padHold(minor(146.83), 4, beat), + alienSlide(146.83, beat), alienSlide(293.66, beat), + ) + wbeat := 0.316 // 190 BPM + wmel := concat( + alienSlide(138.59, wbeat), alienSlide(277.18, wbeat), + alienSlide(554.37, wbeat), alienSlide(1108.73, wbeat), + ) + s.Ambient.Normal = ambientPreset{ + Gain: 0.032, BPM: 150, Wave: "sawtooth", + DroneFreqs: []float64{69.30, 110.00, 138.59}, Attack: 0.02, Release: 0.08, + CutoffMin: 1200, CutoffMax: 5500, Drums: drumOrganic, Melody: mel, + } + s.Ambient.Wild = ambientPreset{ + Gain: 0.075, BPM: 190, Wave: "sawtooth", + DroneFreqs: []float64{69.30, 138.59, 220.00, 277.18}, Attack: 0.02, Release: 0.04, + CutoffMin: 2400, CutoffMax: 7500, DetuneCents: 22, Drums: drumOrganic, Melody: wmel, + } + return s +} +// ════════════════════════════════════════════════════════════════════ +// NUKEM – action-hero hard rock, E minor, Grabbag-inspired power riffs +// ════════════════════════════════════════════════════════════════════ +func soundsNukem() themeSounds { + var s themeSounds + s.Splash.Freqs = []float64{164.81, 329.63, 440.00, 659.25} + s.Splash.Spacing, s.Splash.Gain, s.Splash.Wave = 0.06, 0.1, "sawtooth" + s.Nav.Freq, s.Nav.Wave, s.Nav.Dur, s.Nav.Gain = 440, "square", 0.05, 0.12 + s.Open.Wave, s.Open.Start, s.Open.End, s.Open.Dur, s.Open.Gain = "sawtooth", 329.63, 659.25, 0.14, 0.11 + s.Close.Wave, s.Close.Start, s.Close.End, s.Close.Dur, s.Close.Gain = "square", 659.25, 164.81, 0.16, 0.1 + s.Bounce.Wave, s.Bounce.Start, s.Bounce.End, s.Bounce.Dur, s.Bounce.Gain = "sawtooth", 220, 110, 0.1, 0.1 + + // Duke's action-hero theme — aggressive E-minor power riffs with + // fanfare stabs for the heroic hook. Heavy palm-muted chugging bass, + // driving rock drums, distorted sawtooth edge. + beat := 0.429 // 140 BPM hard rock + const ( + E2, B2 = 82.41, 123.47 + E3, G3, A3 = 164.81, 196.00, 220.00 + B3 = 246.94 + E4, G4, A4 = 329.63, 392.00, 440.00 + B4, D5, E5 = 493.88, 587.33, 659.25 + ) + mel := concat( + palmMute(E2, beat), fanfareStab(minor(E4), 2, beat), + hook(beat, E4, 0.5, E4, 0.5, G4, 0.5, A4, 0.5, + B4, 0.5, A4, 0.5, G4, 0.5, E4, 0.5), + palmMute(B2, beat), fanfareStab(major(B3), 2, beat), + hook(beat, B4, 0.5, D5, 0.5, E5, 0.5, D5, 0.5, + B4, 0.5, A4, 0.5, G4, 0.5, A4, 0.5), + palmMute(E2, beat), padHold(minor(E3), 4, beat), + hook(beat, E5, 1.0, D5, 0.5, B4, 0.5, + A4, 0.5, G4, 0.5, E4, 1.0), + ) + wbeat := 0.333 // 180 BPM thrash + wmel := concat( + palmMute(E3, wbeat), + hook(wbeat, E4*2, 0.25, E4*2, 0.25, G4*2, 0.25, A4*2, 0.25, + B4*2, 0.25, A4*2, 0.25, G4*2, 0.25, E4*2, 0.25, + B4*2, 0.25, D5*2, 0.25, E5*2, 0.25, D5*2, 0.25, + B4*2, 0.25, A4*2, 0.25, G4*2, 0.25, E4*2, 0.25), + ) s.Ambient.Normal = ambientPreset{ - Gain: 0.03, BPM: 160, Wave: "square", - DroneFreqs: []float64{69.30, 110.00, 138.59}, - Attack: 0.02, Release: 0.12, CutoffMin: 1200, CutoffMax: 5000, - Drums: pat("kick", "_", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "_", "hat", "snare", "kick", "_", "hat", "clap"), - Melody: normalMel, + Gain: 0.035, BPM: 140, Wave: "sawtooth", + DroneFreqs: []float64{82.41, 164.81, 246.94}, Attack: 0.01, Release: 0.08, + CutoffMin: 1400, CutoffMax: 6000, Drums: drumRock, Melody: mel, } s.Ambient.Wild = ambientPreset{ - Gain: 0.06, BPM: 240, Wave: "square", - DroneFreqs: []float64{69.30, 138.59, 220.00, 277.18}, - Attack: 0.02, Release: 0.04, CutoffMin: 2000, CutoffMax: 7000, DetuneCents: 18, - Drums: pat("kick", "kick", "hat", "kick", "snare", "kick", "hat", "kick", "kick", "kick", "hat", "snare", "kick", "kick", "hat", "clap"), - Melody: wildMel, + Gain: 0.075, BPM: 180, Wave: "sawtooth", + DroneFreqs: []float64{82.41, 164.81, 329.63, 440.00}, Attack: 0.01, Release: 0.04, + CutoffMin: 2800, CutoffMax: 8500, DetuneCents: 14, Drums: drumRockWild, Melody: wmel, } return s } +// ── public entry points ─────────────────────────────────────────── + func defaultSounds() themeSounds { return soundsNeon() } @@ -1119,4 +1256,5 @@ var themeSoundPresets = map[string]themeSounds{ "cathedral": soundsCathedral(), "surveillance": soundsSurveillance(), "biomech": soundsBiomech(), + "nukem": soundsNukem(), } |
