Alternate soundfont for midify command

This commit is contained in:
loicbersier 2020-04-09 16:28:10 +02:00
parent e8de270df1
commit 462538d3e1
7 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1 @@
# You Will need to edit the config files to includes absolute path

View file

@ -0,0 +1 @@
soundfont /restricted/hahayes/hahaTest/asset/timidity/sf/MCNBS_3_3_4.sf2

View file

@ -0,0 +1 @@
soundfont /restricted/hahayes/hahaTest/asset/timidity/sf/E3Kay_s_Epic_Soundfont.sf2

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,6 @@
# Credits
MCNBS_3_3_4.sf2 - (Creative Commons Attribution 4.0 International)[https://creativecommons.org/licenses/by/4.0/deed.en] Author: Stuff by David
E3Kay's Epic Soundfont - (Creative Commons Attribution 3.0 Unported)[http://creativecommons.org/licenses/by-3/4.0/deed.en] Author: E3Kay

View file

@ -18,11 +18,22 @@ class midifyCommand extends Command {
{ {
id: 'link', id: 'link',
type: 'string', type: 'string',
match: 'rest'
}, },
{ {
id: 'raw', id: 'raw',
type: 'flag', match: 'flag',
flag: '--raw' flag: ['--raw']
},
{
id: 'noteblock',
match: 'flag',
flag: ['--noteblock']
},
{
id: 'voice',
match: 'flag',
flag: ['--voice']
} }
], ],
description: { description: {
@ -102,8 +113,16 @@ class midifyCommand extends Command {
}); });
} }
let option;
if (args.noteblock) {
option = '-c ./asset/timidity/config/noteblock.cfg';
} else if (args.voice) {
option = '-c ./asset/timidity/config/voice.cfg';
}
// midi to mp3 so we can listen from discord // midi to mp3 so we can listen from discord
exec(`timidity ${output} -Ow -o - | ffmpeg -i - -acodec libmp3lame -ab 64k ${output2}`) exec(`timidity ${output} ${option} -Ow -o - | ffmpeg -i - -acodec libmp3lame -ab 64k ${output2}`)
.then(() => { .then(() => {
loadingmsg.delete(); loadingmsg.delete();
return message.channel.send({files: [output2]}) return message.channel.send({files: [output2]})