window.MusicUI=(()=>{ const e=v=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); async function api(path,data){const r=await fetch('/api/v1/'+path,data===undefined?{}:{method:'POST',headers:{'Content-Type':'application/json','X-Athena-Deck':'1'},body:JSON.stringify(data)});const x=await r.json();if(!r.ok)throw Error(x.error||'Musikanfrage fehlgeschlagen');return x;} function html(){return '

Musik ausprobieren

YuE2 über audio.cpp oder ACE-Step XL-SFT mit 1.7B-Musik-Sprachmodell. Parameter richten sich nach dem gewählten Profil.

Bis etwa 16 Sekunden · 400 semantische Tokens. YuE2 verwendet hier ungefähr 25 Tokens pro Sekunde.

Erweiterte Testparameter
YuE2 Audio Remix

Audio analysieren, den Musikplan bearbeiten und mit neuem Stil erzeugen. Keine Kopie der Originalaufnahme.

RTX 5080 bevorzugt. Deck-Aufträge werden koordiniert. Das gewählte Modell bleibt zwischen Songs geladen, bis du die Betriebsart wechselst. Text und Stil werden nicht dauerhaft gespeichert.

';} function bind(){const root=document.querySelector('#music-test'),el=id=>root.querySelector('#'+id);let ready=false,busy=false,resultId=null,profiles=[],ace=false; async function poll(){if(!root.isConnected)return;try{const s=await api('music');if(!root.isConnected)return;const remix=await api('music-remix');el('music-remix-state').textContent=remix.job?.state==='running'?remix.job.phase:remix.installed?'Audio-Remix bereit':'SheetSage2 und MERT noch nicht eingerichtet';el('music-remix-install').disabled=remix.installed||remix.job?.state==='running';el('music-remix-analyze').disabled=busy||remix.active||!remix.installed||s.mode!=='music';const j=s.job,running=j?.state==='running';el('music-state').textContent=(s.mode!=='music'?'Bitte in der Übersicht auf Musik umschalten.':j?.phase||'Profil wählen und Musikstil sowie Songtext eingeben.')+(running?' · '+Math.round((Date.now()/1000)-j.started_at)+' s':'');el('music-progress').innerHTML=running?'':'';el('music-start').disabled=busy||running||!ready||s.mode!=='music';el('music-load').disabled=busy||running||!ready||s.mode!=='music';el('music-cancel').disabled=!running;if(!busy&&j?.state==='complete'&&j.id!==resultId){resultId=j.id;el('music-result').innerHTML=`

Ergebnis · ${e(j.duration_seconds)} Sekunden

WAV herunterladen

`;}if(j?.state==='failed')el('music-error').textContent=j.phase;}catch(x){if(root.isConnected)el('music-error').textContent=x.message;}if(root.isConnected)setTimeout(poll,1500);} function updateLength(fromTokens=false){if(ace){el('music-length-hint').textContent='Zieldauer in Sekunden · ACE-Step XL-SFT: 50 Schritte und Guidance 7 als Ausgangspunkt.';return;}const tokens=fromTokens?Number(el('music-tokens').value):Math.round(Number(el('music-duration').value)*25);if(!fromTokens)el('music-tokens').value=tokens;else el('music-duration').value=(tokens/25).toFixed(2);el('music-length-hint').textContent=`Bis etwa ${(tokens/25).toFixed(2)} Sekunden · ${tokens} semantische Tokens. Das Modell kann früher enden.`;} el('music-duration').step='0.04';el('music-duration').min='1.28';el('music-duration').oninput=()=>updateLength();el('music-tokens').oninput=()=>updateLength(true); api('profiles').then(s=>{if(!root.isConnected)return;profiles=s.profiles.filter(p=>p.kind==='music'&&p.runnable);ready=profiles.length>0;el('music-profile').innerHTML=profiles.map(p=>``).join('')||'';selectFamily();}).catch(x=>el('music-error').textContent=x.message); function selectFamily(){ace=profiles.find(p=>p.id===el('music-profile').value)?.model?.repo==='ACE-Step/acestep-v15-xl-sft';el('music-ace-options').hidden=!ace;el('music-remix-controls').hidden=ace;el('music-tokens').parentElement.hidden=ace;el('music-steps-label').textContent=ace?'Diffusionsschritte':'NAR-Schritte';el('music-steps').max=ace?200:32;el('music-steps').value=ace?50:8;el('music-duration').min=ace?10:1.28;el('music-duration').max=ace?600:360;el('music-duration').step=ace?1:.04;el('music-duration').value=ace?30:16;el('music-lyrics').required=!ace;updateLength();} el('music-remix-install').onclick=()=>api('music-remix/install',{}).catch(x=>el('music-error').textContent=x.message); el('music-remix-analyze').onclick=async()=>{const file=el('music-remix-file').files[0];if(!file){el('music-error').textContent='Audiodatei auswählen.';return;}busy=true;el('music-error').textContent='';try{const body=new FormData();body.append('file',file);body.append('melody_only',el('music-cot').value==='full'?'false':'true');const r=await fetch('/api/v1/music-remix/transcribe',{method:'POST',headers:{'X-Athena-Deck':'1'},body});const d=await r.json();if(!r.ok)throw Error(d.error||'Analyse fehlgeschlagen');el('music-abc').value=d.abc;el('music-cot').value=d.melody_only?'melody':'full';}catch(x){el('music-error').textContent=x.message;}finally{busy=false;}}; el('music-profile').onchange=selectFamily; el('music-load').onclick=()=>api('music/load',{profile_id:el('music-profile').value}).catch(x=>el('music-error').textContent=x.message);el('music-form').onsubmit=async event=>{event.preventDefault();busy=true;el('music-start').disabled=true;el('music-error').textContent='';el('music-result').replaceChildren();resultId=null;try{await api('music/start',{profile_id:el('music-profile').value,lyrics:el('music-lyrics').value,style:el('music-style').value,seed:Number(el('music-seed').value),max_tokens:Number(el('music-tokens').value),steps:Number(el('music-steps').value),...(ace?{duration_seconds:Number(el('music-duration').value),guidance:Number(el('music-guidance').value),thinking:el('music-thinking').checked,instrumental:el('music-instrumental').checked,bpm:el('music-bpm').value?Number(el('music-bpm').value):null,language:el('music-language').value}:(el('music-abc').value&&el('music-cot').value!=='off'?{abc:el('music-abc').value,cot:el('music-cot').value}:{}))});}catch(x){el('music-error').textContent=x.message;}finally{busy=false;}};el('music-cancel').onclick=()=>api('music/cancel',{}).catch(x=>el('music-error').textContent=x.message);poll();} return {html,bind}; })();