Semifunctional App

Added helper functions for scalability. App functions is 80 percent complete. Requires Pitch Envelope and LFO to fully complete testing.
This commit is contained in:
Darell Chua Yun Da 2021-12-05 15:14:12 +08:00
parent 757c11d2b8
commit e7fdfda8e3
4 changed files with 17 additions and 2 deletions

Binary file not shown.

8
src/AmpEnvelopeSelect.m Normal file
View File

@ -0,0 +1,8 @@
function output = AmpEnvelopeSelect(input, Fs, attack,decay,sustain,release,number)
if(number == "Option 1")
output = DarellAmplitudeEnvelope(input, Fs, attack,decay,sustain,release);
else
output = input;
end
end

View File

@ -3,7 +3,7 @@ function output_y = DarellbandpassFilter(y,Fs,LOW,MED,HIGH)
F = Fs * (-Len/2 : (Len/2 - 1))/Len ; F = Fs * (-Len/2 : (Len/2 - 1))/Len ;
Mod_Freq = fftshift(fft(y)); Mod_Freq = fftshift(fft(y));
lenf = length(F); lenf = length(F);
output = 0 .* Mod_Freq; % zero array of len f output = zeros([1,lenf]); % zero array of size Mod_freq
for n = 1:lenf for n = 1:lenf
if ((LOW < abs(F(n))) && HIGH > abs(F(n))) if ((LOW < abs(F(n))) && HIGH > abs(F(n)))
@ -14,7 +14,6 @@ function output_y = DarellbandpassFilter(y,Fs,LOW,MED,HIGH)
end end
filtered_Mod_Freq = fftshift(Mod_Freq .* output); filtered_Mod_Freq = fftshift(Mod_Freq .* output);
output_y = real(ifft(filtered_Mod_Freq)); output_y = real(ifft(filtered_Mod_Freq));
end end

View File

@ -0,0 +1,8 @@
function output = PitchEnvelopeSelect(input, Fs, attack,decay,sustain,release,number)
if(number == "Option 1")
output = DarellAmplitudeEnvelope(input, Fs, attack,decay,sustain,release);
else
output = input;
end
end