From de9b4ce93dc17534e9d6962da9f85c6a9d705e73 Mon Sep 17 00:00:00 2001 From: ChrisTorng Date: Wed, 12 Aug 2020 14:12:59 +0800 Subject: [PATCH 1/4] README.md in 3 languages, with links --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b90dad0..d07a1ed 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,45 @@ -# piano-visualizer +# PianoVisualizer + Minimal piano keyboard visualizer for your videos and livestreams! How to use: -1. Install Processing 3 -1. Install The MidiBus Library -1. Open PianoVisualizer.pde in Processing 3 -1. Edit source code to select MIDI input port -1. Enjoy! + +1. Install [Processing 3](https://processing.org/) +2. Install [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) Library +3. Open [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) in Processing 3 +4. Edit source code to select MIDI input port +5. Enjoy! + +[NiceChord](http://nicechord.com/) has a instruction video [我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM) + +--- + +## 繁體中文 + +在您的影片及串流中顯示精簡鋼琴鍵盤! + +如何使用: + +1. 安裝 [Processing 3](https://processing.org/) +2. 安裝 [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) 函式庫 +3. 在 Processing 3 中開啟 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) +4. 修改程式碼以選擇 MIDI 輸入埠 +5. 開始使用! + +[NiceChord 好和弦](http://nicechord.com/)提供了[我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM)影片。 + +--- + +## 简体中文 + +在您的影片及串流中显示精简钢琴键盘! + +如何使用: + +1. 安装 [Processing 3](https://processing.org/) +2. 安装 [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) 函式库 +3. 在 Processing 3 中开启 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) +4. 修改程式码以选择 MIDI 输入埠 +5. 开始使用! + +[NiceChord 好和弦](http://nicechord.com/)提供了[我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM)影片。 \ No newline at end of file From 32af1e4120b957a4639ceb13ae273c85248f53be Mon Sep 17 00:00:00 2001 From: ChrisTorng Date: Thu, 13 Aug 2020 08:20:52 +0800 Subject: [PATCH 2/4] README.md fix --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d07a1ed..c9a9ffd 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ How to use: 4. Edit source code to select MIDI input port 5. Enjoy! -[NiceChord](http://nicechord.com/) has a instruction video [我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM) +[NiceChord](http://nicechord.com/) has an instruction video [我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM) --- ## 繁體中文 -在您的影片及串流中顯示精簡鋼琴鍵盤! +在您的影片及直播中顯示精簡鋼琴鍵盤! 如何使用: @@ -32,7 +32,7 @@ How to use: ## 简体中文 -在您的影片及串流中显示精简钢琴键盘! +在您的影片及直播中显示精简钢琴键盘! 如何使用: From 302455b0046f4a1a05fbc69f59e1ce8e81289568 Mon Sep 17 00:00:00 2001 From: ChrisTorng Date: Thu, 13 Aug 2020 09:54:12 +0800 Subject: [PATCH 3/4] Add detailed instructions in README.md. Update pde's MIDI Input device name. --- PianoVisualizer.pde | 286 ++++++++++++++++++++++---------------------- README.md | 78 +++++++++--- 2 files changed, 206 insertions(+), 158 deletions(-) diff --git a/PianoVisualizer.pde b/PianoVisualizer.pde index efdbd68..5b53ca0 100644 --- a/PianoVisualizer.pde +++ b/PianoVisualizer.pde @@ -1,143 +1,143 @@ -import themidibus.*; //Import the midibus library -MidiBus myBus; // The MidiBus - -boolean nowPedaling = false; // is it pedaling?(不要動) -int[] isKeyOn = new int[128]; // what notes are being pressed (1 or 0)(不要動) -float[] isFilled = new float[128]; // not used (yet)(不要動) -int[] isPedaled = new int[128]; // what notes are pedaled (1 or 0)(不要動) -color keyOnColor; // set it in setup() -color pedaledColor; // set it in setup() - -int[] isBlack = {0, 11, 0, 13, 0, 0, 11, 0, 12, 0, 13, 0}; // 是黑鍵嗎?是的話,相對左方的白鍵位移多少?(default: {0, 11, 0, 13, 0, 0, 11, 0, 12, 0, 13, 0}) -int border = 3; // 左方留空幾個畫素?(default: 3) -int whiteKeyWidth = 20; // 白鍵多寬?(default: 20) -int whiteKeySpace = 1; // 白鍵間的縫隙多寬?(default: 1) -int blackKeyWidth = 17; // 黑鍵多寬?(default: 17) -int blackKeyHeight = 45; // 黑鍵多高?(default: 45) -int radius = 5; // 白鍵圓角(default: 5) -int bRadius = 4; // 黑鍵圓角(default: 4) -int keyAreaY = 3; // 白鍵從 Y 軸座標多少開始?(default: 3) -int keyAreaHeight = 70; // 白鍵多高?(default: 70) -boolean rainbowMode = false; // 彩虹模式 (default: false) - -void setup() { - int winWidth = (whiteKeyWidth+whiteKeySpace)*52 + (border*2); // recommended window width - int winHeight = keyAreaHeight + (keyAreaY*2); // recommended window width - println("Recommended window size: ", winWidth, winHeight); // 建議的視窗大小(顯示於 Console) - size(1098, 76, FX2D); // 視窗大小 (default: 1098, 76) - colorMode(HSB, 360, 100, 100, 100); - keyOnColor = color(326, 100, 100, 100); // <---- 編輯這裡換「按下時」的顏色![HSB Color Mode] - pedaledColor = color(326, 70, 60, 100); // <---- 編輯這裡換「踏板踩住」的顏色![HSB Color Mode] - smooth(2); - frameRate(60); - initKeys(); - MidiBus.list(); // 啟動時會列出 MIDI 輸入/輸出 設備,記下你想用的 MIDI 輸入編號,設定在下一行。 - myBus = new MidiBus(this, 4, -1); // 編輯「this 後面那個數字」選擇 MIDI 輸入設備。 -} - -void draw() { - background(0, 0, 30, 100); - drawWhiteKeys(); - drawBlackKeys(); -} - -void initKeys() { - for (int i = 0; i<128; i++) { - isKeyOn[i] = 0; - isFilled[i] = 0.0; - isPedaled[i] = 0; - } -} - -void drawWhiteKeys() { - int wIndex = 0; // white key index - stroke(0, 0, 0); - strokeWeight(1); - for (int i = 21; i < 109; i++) { - if (isBlack[i % 12] == 0) { - // it's a white key - if (isKeyOn[i] == 1 && !rainbowMode) { - fill(keyOnColor); // keypressed - } else if (isKeyOn[i] == 1 && rainbowMode) { - fill(map(i, 21, 108, 0, 1080)%360, 100, 100, 100); // rainbowMode - } else if (isPedaled[i] == 1 && !rainbowMode) { - fill(pedaledColor); // pedaled - } else if (isPedaled[i] == 1 && rainbowMode) { - fill(map(i, 21, 108, 0, 1080)%360, 100, 70, 100); // pedaled rainbowMode - } else { - fill(0, 0, 100); // white key - } - int thisX = border + wIndex*(whiteKeyWidth+whiteKeySpace); - rect(thisX, keyAreaY, whiteKeyWidth, keyAreaHeight, radius); - // println(wIndex); - wIndex++; - } - } -} - -void drawBlackKeys() { - int wIndex = 0; // white key index - stroke(0, 0, 0); - - strokeWeight(1.5); - - for (int i = 21; i < 109; i++) { - if (isBlack[i % 12] == 0) { - // it's a white key - wIndex++; - } - - if (isBlack[i % 12] > 0) { - // it's a black key - if (isKeyOn[i] == 1 && !rainbowMode) { - fill(keyOnColor); // keypressed - } else if (isKeyOn[i] == 1 && rainbowMode) { - fill(map(i, 21, 108, 0, 1080)%360, 100, 100, 100); // rainbowMode - } else if (isPedaled[i] == 1 && !rainbowMode) { - fill(pedaledColor); // pedaled - } else if (isPedaled[i] == 1 && rainbowMode) { - fill(map(i, 21, 108, 0, 1080)%360, 100, 70, 100); // pedaled rainbowMode - } else { - fill(0, 0, 0); // white key - } - - - int thisX = border + (wIndex-1)*(whiteKeyWidth+whiteKeySpace) + isBlack[i % 12]; - rect(thisX, keyAreaY-1, blackKeyWidth, blackKeyHeight, bRadius); - } - } -} - -void noteOn(int channel, int pitch, int velocity) { - // Receive a noteOn - isKeyOn[pitch] = 1; - isFilled[pitch] = 100; - if (nowPedaling) { - isPedaled[pitch] = 1; - } -} - -void noteOff(int channel, int pitch, int velocity) { - // Receive a noteOff - isKeyOn[pitch] = 0; - isFilled[pitch] = 0; -} - -void controllerChange(int channel, int number, int value) { - // Receive a controllerChange - if (number == 64 && value >= 64) { - nowPedaling = true; - for (int i = 0; i<128; i++) { - // copy key on to pedal - isPedaled[i] = isKeyOn[i]; - } - } - - if (number == 64 && value < 64) { - nowPedaling = false; - for (int i = 0; i<128; i++) { - // reset isPedaledlin - isPedaled[i] = 0; - } - } -} +import themidibus.*; //Import the midibus library +MidiBus myBus; // The MidiBus + +boolean nowPedaling = false; // is it pedaling?(不要動) +int[] isKeyOn = new int[128]; // what notes are being pressed (1 or 0)(不要動) +float[] isFilled = new float[128]; // not used (yet)(不要動) +int[] isPedaled = new int[128]; // what notes are pedaled (1 or 0)(不要動) +color keyOnColor; // set it in setup() +color pedaledColor; // set it in setup() + +int[] isBlack = {0, 11, 0, 13, 0, 0, 11, 0, 12, 0, 13, 0}; // 是黑鍵嗎?是的話,相對左方的白鍵位移多少?(default: {0, 11, 0, 13, 0, 0, 11, 0, 12, 0, 13, 0}) +int border = 3; // 左方留空幾個畫素?(default: 3) +int whiteKeyWidth = 20; // 白鍵多寬?(default: 20) +int whiteKeySpace = 1; // 白鍵間的縫隙多寬?(default: 1) +int blackKeyWidth = 17; // 黑鍵多寬?(default: 17) +int blackKeyHeight = 45; // 黑鍵多高?(default: 45) +int radius = 5; // 白鍵圓角(default: 5) +int bRadius = 4; // 黑鍵圓角(default: 4) +int keyAreaY = 3; // 白鍵從 Y 軸座標多少開始?(default: 3) +int keyAreaHeight = 70; // 白鍵多高?(default: 70) +boolean rainbowMode = false; // 彩虹模式 (default: false) + +void setup() { + int winWidth = (whiteKeyWidth+whiteKeySpace)*52 + (border*2); // recommended window width + int winHeight = keyAreaHeight + (keyAreaY*2); // recommended window width + println("Recommended window size: ", winWidth, winHeight); // 建議的視窗大小(顯示於 Console) + size(1098, 76, FX2D); // 視窗大小 (default: 1098, 76) + colorMode(HSB, 360, 100, 100, 100); + keyOnColor = color(326, 100, 100, 100); // <---- 編輯這裡換「按下時」的顏色![HSB Color Mode] + pedaledColor = color(326, 70, 60, 100); // <---- 編輯這裡換「踏板踩住」的顏色![HSB Color Mode] + smooth(2); + frameRate(60); + initKeys(); + MidiBus.list(); // 啟動時會列出 MIDI Input/Output 裝置,記下你想用的 MIDI Input 裝置名稱,設定在下一行。 + myBus = new MidiBus(this, "MIDI Input device name", -1); // 將「MIDI Input device name」代換成你的 MIDI Input 裝置。 +} + +void draw() { + background(0, 0, 30, 100); + drawWhiteKeys(); + drawBlackKeys(); +} + +void initKeys() { + for (int i = 0; i<128; i++) { + isKeyOn[i] = 0; + isFilled[i] = 0.0; + isPedaled[i] = 0; + } +} + +void drawWhiteKeys() { + int wIndex = 0; // white key index + stroke(0, 0, 0); + strokeWeight(1); + for (int i = 21; i < 109; i++) { + if (isBlack[i % 12] == 0) { + // it's a white key + if (isKeyOn[i] == 1 && !rainbowMode) { + fill(keyOnColor); // keypressed + } else if (isKeyOn[i] == 1 && rainbowMode) { + fill(map(i, 21, 108, 0, 1080)%360, 100, 100, 100); // rainbowMode + } else if (isPedaled[i] == 1 && !rainbowMode) { + fill(pedaledColor); // pedaled + } else if (isPedaled[i] == 1 && rainbowMode) { + fill(map(i, 21, 108, 0, 1080)%360, 100, 70, 100); // pedaled rainbowMode + } else { + fill(0, 0, 100); // white key + } + int thisX = border + wIndex*(whiteKeyWidth+whiteKeySpace); + rect(thisX, keyAreaY, whiteKeyWidth, keyAreaHeight, radius); + // println(wIndex); + wIndex++; + } + } +} + +void drawBlackKeys() { + int wIndex = 0; // white key index + stroke(0, 0, 0); + + strokeWeight(1.5); + + for (int i = 21; i < 109; i++) { + if (isBlack[i % 12] == 0) { + // it's a white key + wIndex++; + } + + if (isBlack[i % 12] > 0) { + // it's a black key + if (isKeyOn[i] == 1 && !rainbowMode) { + fill(keyOnColor); // keypressed + } else if (isKeyOn[i] == 1 && rainbowMode) { + fill(map(i, 21, 108, 0, 1080)%360, 100, 100, 100); // rainbowMode + } else if (isPedaled[i] == 1 && !rainbowMode) { + fill(pedaledColor); // pedaled + } else if (isPedaled[i] == 1 && rainbowMode) { + fill(map(i, 21, 108, 0, 1080)%360, 100, 70, 100); // pedaled rainbowMode + } else { + fill(0, 0, 0); // white key + } + + + int thisX = border + (wIndex-1)*(whiteKeyWidth+whiteKeySpace) + isBlack[i % 12]; + rect(thisX, keyAreaY-1, blackKeyWidth, blackKeyHeight, bRadius); + } + } +} + +void noteOn(int channel, int pitch, int velocity) { + // Receive a noteOn + isKeyOn[pitch] = 1; + isFilled[pitch] = 100; + if (nowPedaling) { + isPedaled[pitch] = 1; + } +} + +void noteOff(int channel, int pitch, int velocity) { + // Receive a noteOff + isKeyOn[pitch] = 0; + isFilled[pitch] = 0; +} + +void controllerChange(int channel, int number, int value) { + // Receive a controllerChange + if (number == 64 && value >= 64) { + nowPedaling = true; + for (int i = 0; i<128; i++) { + // copy key on to pedal + isPedaled[i] = isKeyOn[i]; + } + } + + if (number == 64 && value < 64) { + nowPedaling = false; + for (int i = 0; i<128; i++) { + // reset isPedaledlin + isPedaled[i] = 0; + } + } +} diff --git a/README.md b/README.md index c9a9ffd..13c97a9 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,27 @@ Minimal piano keyboard visualizer for your videos and livestreams! How to use: -1. Install [Processing 3](https://processing.org/) -2. Install [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) Library -3. Open [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) in Processing 3 -4. Edit source code to select MIDI input port -5. Enjoy! +1. **Install [Processing 3](https://processing.org/)** + + [Download](https://processing.org/download/) a right OS version for you. Extract it, execute the `process` program. + +2. **Install [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) Library** + + In `Sketch` - `Import Library` - `Add Library`, keyin `midi` in `Filter` field, select `The MidiBus` and click `Install` button. + +3. **Open [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) in Processing 3** + + Download [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) and save it under a `PianoVisualizer` folder. Open it by `File` - `Open`. + + If you see garbled text on Windows, that's Chinese text. You can fix it by `File` - `Preferences`, choose a Chinese font on `Editor and Console font` field. + +4. **Edit source code to select MIDI Input device** + + Run it by `Sketch` - `Run` then close the `PianoVisualizer` window. Look for `Available MIDI Devices` - `Input` in the `Console` panel under the editor. Copy the name of your MIDI Input device. Replace `"MIDI Input device name"` into your MIDI Input device name in the editor. Run it again. + +5. **Enjoy!** + + You can `File` - `Export Application` to make a standalone app for later to run (under the `PianoVisualizer` folder). [NiceChord](http://nicechord.com/) has an instruction video [我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM) @@ -20,11 +36,27 @@ How to use: 如何使用: -1. 安裝 [Processing 3](https://processing.org/) -2. 安裝 [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) 函式庫 -3. 在 Processing 3 中開啟 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) -4. 修改程式碼以選擇 MIDI 輸入埠 -5. 開始使用! +1. **安裝 [Processing 3](https://processing.org/)** + + [下載](https://processing.org/download/)符合你作業系統的版本,解壓縮並執行 `process` 程式。(若想使用簡體中文介面,可在 `File` - `Preferences` - `Language` 中選擇`中文`,並重開程式生效) + +2. **安裝 [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) 函式庫** + + 在 `Sketch/速写本` - `Import Library/引用库文件` - `Add Library/添加库文件`中,於 `Filter` 欄位輸入 `midi`,選擇 `The MidiBus` 再按 `Install` 鈕。 + +3. **在 Processing 3 中開啟 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde)** + + 下載 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) 並儲存於 `PianoVisualizer` 資料夾下。由 `File/文件` - `Open/打开` 中開啟該檔。 + + 如果你在 Windows 中看到亂碼,那是中文。你可以在 `File/文件` - `Preferences/偏好设定`中,於 `Editor and Console font/编辑器和控制台字体`中選擇一個中文字體如 `MingLiU` (細明體)。 + +4. **修改程式碼以選擇 MIDI 輸入埠** + + 於 `Sketch/速写本` - `Run/运行` 執行,再關掉 `PianoVisualizer` 視窗。在編輯器下方之 `Console` 面板中,找到 `Available MIDI Devices` - `Input` 項目。複製你的 MIDI 輸入裝置名稱。在編輯器中找到 `"MIDI Input device name"` 並換成你的 MIDI 輸入裝置名稱。再一次執行程式。 + +5. **開始使用!** + + 你可以用 `File/文件` - `Export Application/输出程序`功能,建立獨立應用程式 (於 `PianoVisualizer` 資料夾),以供以後直接執行使用。 [NiceChord 好和弦](http://nicechord.com/)提供了[我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM)影片。 @@ -36,10 +68,26 @@ How to use: 如何使用: -1. 安装 [Processing 3](https://processing.org/) -2. 安装 [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) 函式库 -3. 在 Processing 3 中开启 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) -4. 修改程式码以选择 MIDI 输入埠 -5. 开始使用! +1. **安装 [Processing 3](https://processing.org/)** + + [下载](https://processing.org/download/)符合你作业系统的版本,解压缩并执行 `process` 程式。 (若想使用简体中文介面,可在 `File` - `Preferences` - `Language` 中选择`中文`,并重开程式生效) + +2. **安装 [The MidiBus](http://www.smallbutdigital.com/projects/themidibus/) 库文件** + + 在 `Sketch/速写本` - `Import Library/引用库文件` - `Add Library/添加库文件`中,于 `Filter` 栏位输入 `midi`,选择 `The MidiBus` 再按 `Install` 钮。 + +3. **在 Processing 3 中开启 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde)** + + 下载 [PianoVisualizer.pde](https://raw.githubusercontent.com/wiwikuan/PianoVisualizer/master/PianoVisualizer.pde) 并储存于 `PianoVisualizer` 资料夹下。由 `File/文件` - `Open/打开` 中打开该文件。 + + 如果你在 Windows 中看到乱码,那是中文。你可以在 `File/文件` - `Preferences/偏好设定`中,于 `Editor and Console font/编辑器和控制台字体`中选择一个中文字体如 `SimSun` (中易宋体)。 + +4. **修改程式码以选择 MIDI 输入埠** + + 于 `Sketch/速写本` - `Run/运行` 执行,再关掉 `PianoVisualizer` 视窗。在编辑器下方之 `Console` 面板中,找到 `Available MIDI Devices` - `Input` 项目。复制你的 MIDI 输入装置名称。在编辑器中找到 `"MIDI Input device name"` 并换成你的 MIDI 输入装置名称。再一次执行程式。 + +5. **开始使用!** + + 你可以用 `File/文件` - `Export Application/输出程序`功能,建立独立应用程式 (于 `PianoVisualizer` 资料夹),以供以后直接执行使用。 [NiceChord 好和弦](http://nicechord.com/)提供了[我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM)影片。 \ No newline at end of file From 058267646b380c2b68791e25b32887225695ae1d Mon Sep 17 00:00:00 2001 From: ChrisTorng Date: Fri, 14 Aug 2020 14:12:46 +0800 Subject: [PATCH 4/4] README.md adds Windows sharing MIDI instruction --- README.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13c97a9..09194ff 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,38 @@ How to use: [NiceChord](http://nicechord.com/) has an instruction video [我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM) +### Windows + +If you need to use PianoVirtualizer with other MIDI app like DAW together, you can share the MIDI Input device by this way: + +1. **Connect MIDI Input device** + + Close MIDI app and PianoVirtualizer. Then connect your MIDI Input device. + +2. **Create 2 virtual MIDI ports** + + Install [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html) and run it. Press `+(Add Port)` button twice to create `loopMIDI Port` and `loopMIDI Port 1`. + +3. **Route MIDI Input device to 2 virtual ports** + + 1. Install [MIDI Patchbay](https://soundigy.com/midipatchbay.php) and run it as Administrator (default at `%ProgramFiles%\Soundigy\MIDI Patchbay\MIDIPatchbay.exe`). + + 2. Open `Options` - `Map MIDI Ins/Outs`. Select your MIDI Input device in `IN 1`. Then `OUT 1` as `loopMIDI Port`, and `OUT 2` as `loopMIDI Port 1`, click `OK` to close. + + 3. Click `INPUT`'s `1` button, then click `OUTPUT`'s `1` and `2` buttons from main UI to route `IN 1` to `OUT 1` and `OUT 2`. + +4. **Setup MIDI app to receive input from first virtual port** + + Open your MIDI app. Setup it's MIDI Input device as `loopMIDI Port`. And stop receiving from your MIDI Input device directly. + +5. **Setup PianoVirtualizer to receive input from second virtual port** + + Use `"loopMIDI Port 1"` as `"MIDI Input device name"` in `PianoVirtualizer.pde` then run it. + +6. **Enjoy!** + + Now start playing! Your MIDI app and PianoVirtualizer should work together. You can `Save` current config in `MIDI Patchbay`. Next time you don't need to run it as Administrator. + --- ## 繁體中文 @@ -60,6 +92,38 @@ How to use: [NiceChord 好和弦](http://nicechord.com/)提供了[我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM)影片。 +### Windows + +如果你需要讓 PianoVirtualizer 與其他 MIDI 程式如 DAW 一起運作,你可以用下述方法共用 MIDI Input 裝置: + +1. **連接 MIDI Input 裝置** + + 關閉 MIDI 程式及 PianoVirtualizer,再連接你的 MIDI Input 裝置。 + +2. **建立兩個虛擬 MIDI 埠** + + 安裝 [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html) 並執行。按 `+(Add Port)` 按鈕兩次以建立 `loopMIDI Port` 及 `loopMIDI Port 1`。 + +3. **將 MIDI Input 裝置重導向至兩個虛擬埠** + + 1. 安裝 [MIDI Patchbay](https://soundigy.com/midipatchbay.php) 並以系統管理員權限執行。(預設在 `%ProgramFiles%\Soundigy\MIDI Patchbay\MIDIPatchbay.exe`) + + 2. 開啟 `Options` - `Map MIDI Ins/Outs`。在 `IN 1` 選擇你的 MIDI Input 裝置。然後 `OUT 1` 選擇`loopMIDI Port`,以及 `OUT 2` 選擇 `loopMIDI Port 1`,點選 `OK` 關閉。 + + 3. 在主視窗中點 `INPUT` 的 `1` 按鈕,然後點 `OUTPUT` 的 `1` 及 `2` 按鈕,以將 `IN 1` 重導向至 `OUT 1` 及 `OUT 2`。 + +4. **設定 MIDI 程式接收第一個虛擬埠的輸入** + + 開啟你的 MIDI 程式。設定 MIDI Input 裝置為 `loopMIDI Port`。並停止直接接收 MIDI Input 裝置訊號。 + +5. **設定 PianoVirtualizer 接收第二個虛擬埠的輸入** + + 在 `PianoVirtualizer.pde` 中以 `"loopMIDI Port 1"` 為 `"MIDI Input device name"` 的值,並執行它。 + +6. **開始使用!** + + 現在開始彈奏! 你的 MIDI 程式及 PianoVirtualizer 應該可以一起運作了。你可以點 `MIDI Patchbay` 中的 `Save` 按鈕將目前設定儲存起來。下次你不再需要以系統管理員權限執行它。 + --- ## 简体中文 @@ -90,4 +154,36 @@ How to use: 你可以用 `File/文件` - `Export Application/输出程序`功能,建立独立应用程式 (于 `PianoVisualizer` 资料夹),以供以后直接执行使用。 -[NiceChord 好和弦](http://nicechord.com/)提供了[我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM)影片。 \ No newline at end of file +[NiceChord 好和弦](http://nicechord.com/)提供了[我寫了一個「鋼琴鍵盤顯示app」,免費送給大家 + 使用教學!](https://www.youtube.com/watch?v=37MvNiNqaCM)影片。 + +### Windows + +如果你需要让 PianoVirtualizer 与其他 MIDI 程式如 DAW 一起运作,你可以用下述方法共用 MIDI Input 装置: + +1. **连接 MIDI Input 装置** + + 关闭 MIDI 程式及 PianoVirtualizer,再连接你的 MIDI Input 装置。 + +2. **建立两个虚拟 MIDI 埠** + + 安装 [loopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html) 并执行。按 `+(Add Port)` 按钮两次以建立 `loopMIDI Port` 及 `loopMIDI Port 1`。 + +3. **将 MIDI Input 装置重导向至两个虚拟埠** + + 1. 安装 [MIDI Patchbay](https://soundigy.com/midipatchbay.php) 并以系统管理员权限执行。 (预设在 `%ProgramFiles%\Soundigy\MIDI Patchbay\MIDIPatchbay.exe`) + + 2. 开启 `Options` - `Map MIDI Ins/Outs`。在 `IN 1` 选择你的 MIDI Input 装置。然后 `OUT 1` 选择`loopMIDI Port`,以及 `OUT 2` 选择 `loopMIDI Port 1`,点选 `OK` 关闭。 + + 3. 在主视窗中点 `INPUT` 的 `1` 按钮,然后点 `OUTPUT` 的 `1` 及 `2` 按钮,以将 `IN 1` 重导向至 `OUT 1` 及 `OUT 2`。 + +4. **设定 MIDI 程式接收第一个虚拟埠的输入** + + 开启你的 MIDI 程式。设定 MIDI Input 装置为 `loopMIDI Port`。并停止直接接收 MIDI Input 装置讯号。 + +5. **设定 PianoVirtualizer 接收第二个虚拟埠的输入** + + 在 `PianoVirtualizer.pde` 中以 `"loopMIDI Port 1"` 为 `"MIDI Input device name"` 的值,并执行它。 + +6. **开始使用!** + + 现在开始弹奏! 你的 MIDI 程式及 PianoVirtualizer 应该可以一起运作了。你可以点 `MIDI Patchbay` 中的 `Save` 按钮将目前设定储存起来。下次你不再需要以系统管理员权限执行它。 \ No newline at end of file