2021-12-01 23:55:54 +00:00
|
|
|
# ECE45-project
|
2021-12-01 23:43:48 +00:00
|
|
|
|
2021-12-01 23:55:54 +00:00
|
|
|
Audio synthesizer project created by ECE 45 students, written using the MATLAB language and MATLAB GUI
|
|
|
|
|
2021-12-04 04:27:38 +00:00
|
|
|
## Contributors
|
2021-12-01 23:55:54 +00:00
|
|
|
Will add member names shortly
|
|
|
|
|
2021-12-02 00:07:46 +00:00
|
|
|
## Function Prototypes
|
2021-12-04 04:27:38 +00:00
|
|
|
Templates to create your own functions.
|
|
|
|
|
|
|
|
### Wave generating function
|
|
|
|
```
|
|
|
|
function x = generate_WAVENAME(amplitude, frequency, phase, fs, duration, duty)
|
|
|
|
% GENERATE_WAVENAME: returns a matrix of sampled WAVENAME wave
|
|
|
|
|
|
|
|
% CONTRIBUTORS:
|
|
|
|
% Person1: how you contributed
|
|
|
|
% Person2: how you contributed
|
|
|
|
% etc
|
|
|
|
|
|
|
|
% DOCUMENTATION:
|
|
|
|
% phase shift is in number of periods
|
|
|
|
% fs is the sampling frequency: how many sample points per second
|
|
|
|
% duration is time in seconds
|
|
|
|
% duty is a number between 0 and 1
|
|
|
|
|
|
|
|
% initialize local variables from input arguments
|
|
|
|
n = fs * duration; % number of samples (length of matrix)
|
|
|
|
dt = 1 / fs; % sampling period: time between two sample points
|
|
|
|
|
|
|
|
% initialize a one dimensional zero matrix to be populated
|
|
|
|
x = zeros(1, n);
|
|
|
|
|
|
|
|
% populate the matrix
|
|
|
|
for i = 1:n
|
|
|
|
YOUR CODE HERE
|
|
|
|
end
|
|
|
|
end
|
|
|
|
```
|
|
|
|
NOTE: duty does not apply to some functions (such as sinusoids)
|
|
|
|
|
|
|
|
### Envelope function
|
|
|
|
```
|
|
|
|
function x = envelope(input, fs, period, attack , decay, sustain, release)
|
|
|
|
```
|
2021-12-02 06:34:01 +00:00
|
|
|
where attack, decay, release are percentages between 0 to 1 of the period
|
|
|
|
sustain is the percentage of the amplitude it should sustain for
|
|
|
|
**envelope can be pitch or amplitude envelope**
|
2021-12-01 23:43:48 +00:00
|
|
|
|
2021-12-04 04:27:38 +00:00
|
|
|
|
|
|
|
### Filter function
|
|
|
|
```
|
2021-12-01 23:58:05 +00:00
|
|
|
function output_timedomain = Filter(input_soundin_timedomain, Fs, LOW, MED, HIGH)
|
2021-12-04 04:27:38 +00:00
|
|
|
```
|
2021-12-02 06:34:01 +00:00
|
|
|
where LOW, MED, HIGH are user-selected variables of any value.
|
|
|
|
**output should be in time domain for all functions (new sound)**
|
2021-12-02 00:07:46 +00:00
|
|
|
|
2021-12-01 23:55:54 +00:00
|
|
|
## Useful websites
|
|
|
|
|
|
|
|
- https://learningsynths.ableton.com
|
|
|
|
- https://learningsynths.ableton.com/en/playground
|
|
|
|
- https://blog.demofox.org/diy-synthesizer/
|
|
|
|
- http://portaudio.com/
|
|
|
|
- https://ccrma.stanford.edu/software/stk/
|
|
|
|
- https://cycling74.com/products/max
|
2021-12-02 00:10:19 +00:00
|
|
|
- http://msp.ucsd.edu/software.html
|