Advertisement
Salagata

Fake Musescore

May 30th, 2025 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {js:(()=>{
  2. var code = []
  3. for(let i = 0; i < discord.variables.__args.length; i++) {
  4.   const note = discord.variables.__args[i].split(" ")
  5.  
  6.   if(note.length == 2) {
  7.     code.push(`ffmpeg -i tonic.ts -af ${Number(note[0]) > 0 ? `"rubberband=pitch=2^(${note[1]}/12)"` : '"volume=0"'},atrim=0.02 -t ${Math.abs(+note[0])+0.02} ${i}.ts`)
  8.   } else {
  9. // Chord
  10.     const pitches = note.slice(1);
  11.     code.push(`ffmpeg -i $FILE_1 -filter_complex "${pitches.map((p,i) => `[0:a]rubberband=pitch=2^(${p}/12)[a${i}]`).join(";")};${pitches.map((x,i) => `[a${i}]`).join("")}amix=${pitches.length},volume=${pitches.length},atrim=0.02[outa]" -map 0:v -map "[outa]" -t ${Math.abs(+note[0])+0.02} ./output/chord.mp4`)
  12. }
  13. }
  14. discord.variables.code = `load {av}
  15. ffmpeg -stream_loop -1 -i $FILE_1 -t ${Math.max(...discord.variables.__args.map(x => x.split(" ")[0]))} tonic.ts
  16. ${code.join("\n")}
  17. ffmpeg -i "concat:${discord.variables.__args.map((x,i) => i+ ".ts").join("|")}" ./output/custom_music.mp4
  18. `
  19. })()
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement