transposeSound - %specified length. Be sure to index using...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function vecamp = transposeSound(amp,sf,half,newdur) %Write a function, transposeSound, that takes in an amplitude vector and %sampling frequency from wavread, the number of half steps to transpose %the note, and the new duration of the note. This function should %transpose the note using round(linspace(. ..)). After it is transposed, %it should either be truncated or zero-filled so that the note is the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %specified length. Be sure to index using an integer; round if %necessary. amp = amp(round(linspace(1,end,(end/2.^(half./12))))); duration2 = round(length(amp)./sf); if newdur > duration2 change = (newdur - duration2).*sf; newlength = zeros(change,1); vec = [amp;newlength]; else change = newdur end end...
View Full Document

This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Tech.

Ask a homework question - tutors are online