Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {js:(()=>{
- var code = []
- for(let i = 0; i < discord.variables.__args.length; i++) {
- const note = discord.variables.__args[i].split(" ")
- if(note.length == 2) {
- 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`)
- } else {
- // Chord
- const pitches = note.slice(1);
- 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`)
- }
- }
- discord.variables.code = `load {av}
- ffmpeg -stream_loop -1 -i $FILE_1 -t ${Math.max(...discord.variables.__args.map(x => x.split(" ")[0]))} tonic.ts
- ${code.join("\n")}
- ffmpeg -i "concat:${discord.variables.__args.map((x,i) => i+ ".ts").join("|")}" ./output/custom_music.mp4
- `
- })()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement