開發紀錄 Week3
UI Screenshot
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
UI details
Combobox
- 藉由Combobox來選擇欲呈現的波型
- 將各種波型加入ComboBox中
- 利用
addAndMakeVisible(synthChoose);
將按鈕加入UI
- 最後記得resize combobox的位置
synthChoose.setBounds(x, y + 50, sliderWidth, sliderHeight);
AudioProcessorValueTreeState
- 將Combobox接收到的數值,送至這個Tree中儲存
- 之後在Processer端利用getRawParameterValue()做接收
Generate Wave Value
Square wave
- 藉由sin(currentAngle)判斷當前象限,若為一二象限為+1,否則為-1
Sawtooth wave
- 想法是先算出currentAngle在twoPi中的比例(藉由將currentAngle+Pi調整起始位置)
Triangle wave
- 和鋸齒波想法相似,一樣是先將比例算出(藉由將currentAngle+halfPi調整起始位置)
- 但三角波有兩條不一樣的線,所以分別在 0~0.5 用一斜率 0.5~1 用另一斜率,再將value調整至1~-1