ADSR envelope: Digital synthesizer
33 ビュー (過去 30 日間)
A = linspace(0, 0.9, (length(y)*0.10)); %rise 35% of signal
D = linspace(0.9, 0.7,(length(y)*0.05)); %drop of 5% of signal
S = linspace(0.7, 0.7,(length(y)*0.40)); %delay of 40% of signal
R = linspace(0.7, 0,(length(y)*0.20)); %drop of 25% of signal
ADSR = [A D S R] ;
x = zeros(size(y));
x(1:length(ADSR)) = ADSR;
I wrote this codes it successfully run but i want to assign notes to keys to each musical notes for my digital synthesizer project. Like in computer keyboard if user press A key its plays note_do etc. Can you help me this part i am new to matlab?
回答 (1 件)
Maadhav Akula 2020 年 11 月 4 日
I believe you want to play note_do when user clicks on key A on their computer keyboard, in that case you can utilize the callback functions to capture the key pressed data from the user and write conditional statements using if-else statements or switch cases in your callback as per your requirements.
Have a look at this answer:
Hope this helps!