(New page: delta = .0001; h=0:delta:1; %half note q=0:delta:.5; %quarter note dq=0:delta:.75; %dotted quarter note e=0:delta:.25; %eight note Ee = sin(2*pi*329.63*E); %eighth note E Eq = sin(...) |
|||
Line 1: | Line 1: | ||
− | |||
delta = .0001; | delta = .0001; | ||
+ | %define note lengths | ||
h=0:delta:1; %half note | h=0:delta:1; %half note | ||
− | |||
q=0:delta:.5; %quarter note | q=0:delta:.5; %quarter note | ||
− | |||
dq=0:delta:.75; %dotted quarter note | dq=0:delta:.75; %dotted quarter note | ||
− | |||
e=0:delta:.25; %eight note | e=0:delta:.25; %eight note | ||
+ | %define tones with lengths | ||
Ee = sin(2*pi*329.63*E); %eighth note E | Ee = sin(2*pi*329.63*E); %eighth note E | ||
− | |||
Eq = sin(2*pi*329.63*Q); %quarter note E | Eq = sin(2*pi*329.63*Q); %quarter note E | ||
− | |||
E3dq = sin(2*pi*164.81*dQ); %dotted quarter note E3 | E3dq = sin(2*pi*164.81*dQ); %dotted quarter note E3 | ||
− | |||
Ce = sin(2*pi*326.63*Q); %eighth note C | Ce = sin(2*pi*326.63*Q); %eighth note C | ||
− | |||
Cdq = sin(2*pi*326.63*dQ); %dotted quarter note C | Cdq = sin(2*pi*326.63*dQ); %dotted quarter note C | ||
− | |||
Gh = sin(2*pi*392*H); %half note G | Gh = sin(2*pi*392*H); %half note G | ||
− | |||
G3dq = sin(2*pi*196*dQ); %dotted quarter note G3 | G3dq = sin(2*pi*196*dQ); %dotted quarter note G3 | ||
− | |||
G3h = sin(2*pi*196*H); %half note G3 | G3h = sin(2*pi*196*H); %half note G3 | ||
− | |||
A3q = sin(2*pi*220*Q); %quarter note A3 | A3q = sin(2*pi*220*Q); %quarter note A3 | ||
− | |||
B3q = sin(2*pi*246.94*Q); %quarter note B3 | B3q = sin(2*pi*246.94*Q); %quarter note B3 | ||
− | |||
Bb3e = sin(2*pi*233.08*E); %eighth note Asharp3 | Bb3e = sin(2*pi*233.08*E); %eighth note Asharp3 | ||
+ | %Combine notes into a phrase | ||
notes = [Ee Eq Eq Ce Eq Gh G3h Cdq G3dq E3dq A3q B3q Bb3e A3q]; | notes = [Ee Eq Eq Ce Eq Gh G3h Cdq G3dq E3dq A3q B3q Bb3e A3q]; | ||
sound (notes,1/delta); | sound (notes,1/delta); |
Latest revision as of 02:55, 25 June 2009
delta = .0001;
%define note lengths h=0:delta:1; %half note q=0:delta:.5; %quarter note dq=0:delta:.75; %dotted quarter note e=0:delta:.25; %eight note
%define tones with lengths Ee = sin(2*pi*329.63*E); %eighth note E Eq = sin(2*pi*329.63*Q); %quarter note E E3dq = sin(2*pi*164.81*dQ); %dotted quarter note E3 Ce = sin(2*pi*326.63*Q); %eighth note C Cdq = sin(2*pi*326.63*dQ); %dotted quarter note C Gh = sin(2*pi*392*H); %half note G G3dq = sin(2*pi*196*dQ); %dotted quarter note G3 G3h = sin(2*pi*196*H); %half note G3 A3q = sin(2*pi*220*Q); %quarter note A3 B3q = sin(2*pi*246.94*Q); %quarter note B3 Bb3e = sin(2*pi*233.08*E); %eighth note Asharp3
%Combine notes into a phrase notes = [Ee Eq Eq Ce Eq Gh G3h Cdq G3dq E3dq A3q B3q Bb3e A3q];
sound (notes,1/delta);