Add midi soundbank functionality.
Load soundbanks with --soundbank filename.ext supports AD, OP2, OPL, SF2, SF3, SFO, TMB, WOPL formats.
This commit is contained in:
parent
6a1e77c240
commit
74edf59ecb
1 changed files with 15 additions and 0 deletions
15
cimp.bas
15
cimp.bas
|
|
@ -37,6 +37,8 @@ if ipc_status = 0 then
|
||||||
dim cmd_msg as string
|
dim cmd_msg as string
|
||||||
|
|
||||||
Select Case command$(1)
|
Select Case command$(1)
|
||||||
|
Case "--soundbank"
|
||||||
|
cmd_msg = "SOUNDBANK:" + command$(2)
|
||||||
Case "--next"
|
Case "--next"
|
||||||
cmd_msg = "NEXT"
|
cmd_msg = "NEXT"
|
||||||
|
|
||||||
|
|
@ -182,6 +184,13 @@ for i=1 to _commandcount
|
||||||
nooutput=-1
|
nooutput=-1
|
||||||
case "-N","--nyan"
|
case "-N","--nyan"
|
||||||
nyan=-1
|
nyan=-1
|
||||||
|
case "-b","--soundbank"
|
||||||
|
if _commandcount>i and _fileexists(command$(i+1)) then
|
||||||
|
loadsoundbank command$(i+1)
|
||||||
|
else
|
||||||
|
print "error loading soundbank"
|
||||||
|
system
|
||||||
|
end if
|
||||||
case else
|
case else
|
||||||
if _fileexists(command$(i)) then
|
if _fileexists(command$(i)) then
|
||||||
if lcase$(right$(command$(i),4))=".m3u"then
|
if lcase$(right$(command$(i),4))=".m3u"then
|
||||||
|
|
@ -238,6 +247,8 @@ while keyin<>27
|
||||||
keyin=asc("s")
|
keyin=asc("s")
|
||||||
elseif client_cmd = "NYAN" then
|
elseif client_cmd = "NYAN" then
|
||||||
nyan = not nyan
|
nyan = not nyan
|
||||||
|
elseif left$(client_cmd, 10) = "SOUNDBANK:" then
|
||||||
|
loadsoundbank mid$(client_cmd,11)
|
||||||
elseif left$(client_cmd, 4) = "VOL:" then
|
elseif left$(client_cmd, 4) = "VOL:" then
|
||||||
volume = val(mid$(client_cmd, 5)) / 100
|
volume = val(mid$(client_cmd, 5)) / 100
|
||||||
if volume > 1 then volume = 1
|
if volume > 1 then volume = 1
|
||||||
|
|
@ -676,3 +687,7 @@ function getcodepoint& (utf8char$)
|
||||||
getcodepoint&=(b1 and &h07)*262144+(b2 and &h3f)*4096+(b3 and &h3f)*64+(b4 and &h3f)
|
getcodepoint&=(b1 and &h07)*262144+(b2 and &h3f)*4096+(b3 and &h3f)*64+(b4 and &h3f)
|
||||||
end select
|
end select
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
sub loadsoundbank (filename as string)
|
||||||
|
_midisoundbank filename
|
||||||
|
end sub
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue