2012年9月15日 星期六

BASSMIDI 讓DOSBox發出更棒的MIDI音樂!

某次在 http://www.gamebase.com.tw/forum/30032骨灰集散地上面看到安裝外部MIDI Driver可以讓Dosbox模擬 Ronald MT-32,拜讀之後我很興奮的趕快去嘗試,遊戲的聲音真的不一樣了,這是聲霸卡所不能比擬的好聲音啊~~~聽到美少女夢工廠悠揚的音樂,銀河英雄傳說3高昂壯闊的交響樂,深深改變了玩Game感覺,這個Driver甚至連以前的FC上面的音樂也變得格外好聽。

 但是奇怪怎麼還是有些 Midi 沒有聲音啊~~~~ 就心血來潮在網路上找看看有沒有其他的 Midi Driver,就發現了一個萬用型MIDI模擬器BASSMIDI,已掛載不同SoundFont模擬不同MIDI音源器的效果.網址在下面,網站裡面有提供不同MIDI音效卡的SoundFont,其實我不知道如何確切描述SoundFont是甚麼東西,不過它應該是一個紀錄不同樂器所發出的聲音的檔案吧~

Bassmidi 的網址如下 http://www.mudlord.info/bassmididrv/BASSMIDI_Driver_Installation_and_Configuration.htm

Bassmidi的安裝方式
1. 下載 Bassmidi 的安裝檔案並解開安裝 http://www.mudlord.info/bassmididrv/bassmididrv.exe

2. 下載 SoundFont ,並且解開放到適當的位置 在此推薦幾個不錯的

SoundFont "Roland SC-55 v1.1 http://www.mediafire.com/?a6qn1tc811b2ce1

OPL-3 FM 128M" Sound Blaster 16 FM Synthesis SoundFont http://woolyss.com/chipmusic/chipmusic-soundfonts/OPL-3_FM_128M.zip

Gravis Ultrasound Classic Patch Set v1.6b http://www.rarek.ceron.pl/gus.htm

3. 重新開機,然後啟動 Bassmidi 的控制台 BASSMIDI Driver Configuration Utility 4

. 新增 SoundFont file,注意一下最底層的SoundFont會被優先使用喔!,然後就打開你的Dosbox好好享受提供Midi音樂的遊戲吧

附註:

對於在Windows上面模擬 Ronald MT-32有興趣的玩家可以參考下面這個網址: http://www.dearhoney.idv.tw/?p=243
MT-32的ROM可以從海盜灣上面抓取, Driver的由下面這個網址去下載http://sourceforge.net/projects/munt

另外再 Windows7上面的玩家,如果要改變系統預設的Midi Driver請到http://akkordwechsel.de/15-windows-vista-und-der-midi-mapper/ 去下載 Putzlowitschs Vista MIDI-Mapper Control-Panel Version 0.93 就可以直更改 系統預設的 Midi Driver

附註:

OPL-3 FM 128M 下載後解開的格式為 sfpack 
sfArk ( sfpack ) 的格式 要利用 sfpack 這隻程式去轉成 sf2 
轉換程式的網址如下

2012年3月13日 星期二

Python Script sample and resample with different x range

#!/usr/bin/python
import random
# by wjy
#define variable
samples_time=5000
samples_start=1
samples_end=1023
samples=[]
samples_count=range(samples_end+1)

resamples_base_q=[0.05,0.1,0.15,0.2,0.25,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1]
resamples_base_count=range(len(resamples_base_q))
resamples_count=range(len(resamples_base_count))
print '__name__ = ', __name__

def generate_samples():
"generate the samples"
count=samples_time
while count > 0 :
tmp=random.normalvariate(samples_end/2, samples_end/6)
samples.append(int(tmp))
#samples.append(int(random.uniform(samples_start,samples_end)))
count=count-1
return;

def generate_statistics():
"count the samples"
print max(samples)
count=0
while count times=samples.count(count)
samples_count[count]=0
if times>0:
samples_count[count]=times
#print count," appear ", times, "times"
count=count+1
return

def func1():
"func1"
return;

def write_sample_counts_to_file():
fo = open ("sample.counts","w")
count=0
while count line="%s\t%s\n" %(count,samples_count[count])
#fo.write(count,"\t",samples_count[count])
fo.write(line)
count=count+1
fo.close()
return

def generate_resamples_count():
"generate resamples count"
count=0
# generate resamples base count
while count resamples_base_count[count]= samples_end* resamples_base_q[count]
resamples_count[count]=0
count=count+1

# generate resamples count
count=0
while count count2=0

while count2 < len(resamples_base_count):
if count < resamples_base_count[count2]:
#print count,"<",resamples_base_count[count2]
resamples_count[count2]=resamples_count[count2]+samples_count[count]
break
count2=count2+1

count=count+1
return

#=======================================================
def write_resamples_counts_to_file():
fo = open ("resamples.counts","w")
fo2 = open ("resamples.counts2","w")
count=0
while count line="%s\t%s\n" %(resamples_base_count[count],resamples_count[count])
#fo.write(count,"\t",samples_count[count])
fo.write(line)
line="%s\t%s\n" %(count,resamples_count[count])
fo2.write(line)
count=count+1
fo.close()
fo2.close()
return
#=======================================================
def main():
generate_samples()
generate_statistics()
write_sample_counts_to_file()
generate_resamples_count()
write_resamples_counts_to_file()
#print samples
#samples_count=range(101)
#samples_count[100]=1
#print samples_count
#print "reample_base",resamples_base_count
#print "reample_count",resamples_count
print "Hello World Python"
return 0

if __name__ == "__main__":
main()

Gnuplot note

Gnuplot note

set xrange[0:12] 設定 x 軸 range
set xrange[0:1024]
set xlabel "x" 設定 label
set ylabel "y" 設定 label
set term x11 0 第一個視窗
plot 在第一個視窗繪圖
set term x11 1 第二個視窗
plot 在第二個視窗繪圖
set term x11 2
plot 在第三個視窗繪圖

1:2 = column 用 white space 隔開
plot "file" using 1:2 title "f1" with boxes / impulses


set multiplot 同一個視窗同時繪圖 很多個檔案

set term x11 0
plot sin(x)
set term x11 1
plot cos(x)