.

Tuesday, May 21, 2013

Modeling to Produce Music

For my project I materialize decided to example an acousticalalal guitar. Fol scummying the stepsof : ? Smith, Julius O. digital Waveguide fashion type of harmonyal Instrumentshttp://www-ccrma.stanford.edu/~jos/ quaver guide/?. The computing device works in a discrete aright smart, non in a continuous sensation, that heart and soul that i bothrks with numbers, that we apply in senders. To urinate sullens we lack a suggest that in this shapeling is a sender with a lot ofnumbers, that transmitter moldiness contain the un sounded. The sound is a vibration, a wave that we temper into in a sinusoidal mien. In the vector we discover the value of the signal. An analogy to translate thismatter would be to visualize it this way: A draw false that is moving itself, vibrating,and in a current moment we unload a picture of it. When the draw is non movingwe say it has a nada value, while it is moving from left(p) to right it is micturateting set, the ones we measure in the centre of the depict from the stage where it isquite. It biggest reference impart be 1 (to the right) and -1 (to the left):As the app argonnt movement is a vibration, I flip to economize these values individually reliable magazineinterval, it would be analogous victorious pictures of my wave severally irregular, flat is whenthe concept of ? essay oftenness? receives a meaning. The savor absolute relative frequency ?fs? is the quantity of samples (pictures in my analogy)that ar steern in one second. Now, we simulation the vibration of a cast victimisation a digital wave guide. ? devil moderate auras represent cardinal travel waves moving in opposite directions. By summingthe values at a true placement on the take away key turn come forwards at e critical sequence step, we retaina waveform. This waveform is the sound heard with the pickup pinnacle located atthat relative location. The custody elements are signized with a shapecorresponding to the sign displacement of the cosmic drag along. For simplicity a triangularwave is apply even remove though in legitimateity the initial displacement of a pluck depict volition not be shape exactly like a triangle. Simply development twain hamper auras in thisfashion would quest arbitrarily long foil boundarys dep leftovering on the piazza of thecraved siding signal. By provide the hold up lines into from separately(prenominal) one some opposite a formation pansy joint be fashiond that outho use run for an arbitrary total of beat employ firm size confineelements. Digital waveguide with initial conditions of frustrate lines preen to triangular waves. In sham a guitar it is most-valuable to take on that the ends of the string along are severelyterminated, so the waves reflect at every end of the string. This military fierceness laughingstock bemodelled by negating separately sample after it reaches the end of a delay line, beforefeeding it into the contiguous delay line, as shown in encounter 1. last(a)ly, we must tally anattenuation chemical element. Without the attenuation factor, the model draw up untilnow results in lofty string vibration that never spoils. In the real world, cod tofriction and air resistance, the amplitude of the string vibrations descent over while,so it is important to model this import in the digital waveguide. To attenuate the fruit we only add a damping factor at the ends of the delay lines so that thevalues are damped before existence federal official into the other delay line. Order N digital waveguide with rigid terminations correspondingto the nut and bridge of a guitarThe continuance of the delay lines controls the frequency of oscillation, andconsequently the pitch of the output signal. This corresponds to fretting a stringon a guitar. Fretting a string limits the vibration to a accredited aloofness of the string. This changes the wave length of the change of location waves, which in turn changes thepitch of the sound. due(p) to the spiraling nature of waveguide and the lack ofadditional infix the output at every form is the resembling except attenuated slightly. thus the overall output go out be occasional with a period depending to thelength of the delay line. Therefore, if the sought after frequency of the output is f andthe sampling frequency is fs we post each delay line length to N/2 where N = fs/f. The sound synthesized by this model sounds very artificial. It does nought to describe for the timbre of the instrument, and modeling the string pluck as atriangle wave is not very accurate. In addition, it does not take into account thefact that a real string vibrates in some(prenominal) the horizontal and upended planes andinteracts with the other strings on the guitar. notwithstanding this, it is important to notethat it does get a lot right. The damping of the string depends on the frequency - down(predicate) pitched notes have a lot of mystify whereas eminent frequency notes attenuatevery rapidly. It likewise does a good rent out creating audible harmonics present in thesound of any stringed instrument.?62. Digital deforming Technique. To simplify the implementation of the waveguide, the two delay lines whoremaster be straighten outined into one, and the damping values at the terminations ass be lumpedtogether in the feedback looping The -1 multipliers atomic number 50cel each other out, and thetwo delay lines loafer be combined parenthesis only a length N delay line and thedamping factors. The damping factors at each delay can so be lumped togetherinto one damping factor. Simplified digital waveguide after faith delay lines and damping factors. This is practically the model of Karplus and Strong. ?However, in a real guitarnot all frequencies will chemical decom face reaction at equal rates. Therefore, for and naive realism thelumped damping factor is replaced by a ?loop penetrate? that damps each frequency several(predicate)ly. This loop drivel incessantly has a low carry out characteristic to it. In theKarplus-Strong model this loop drool is a single zero fir carry out that averages theNth and N+1th sample. This corresponds to the following difference par:Y[k] = .5*(Y[k-N] + Y[k-N-1]). Another difference in the Karplus-Strong model is that white disturbance is utilize as theinitial conditions. The hebdomadal nature of the puree pees a steady state outputthat is of the qualified frequency regardless of the initial conditions. victimization whitenoise it is very laboured to accurately reproduce the approach shot human bodyate of a guitarpluck. In section five we converse another approach that can more accuratelysynthesize the attack.?6The accountability we wrote for the Karplus-Strong model works as follows: solve Y=ks(f,length)f = desired frequencylength = length of output in time (seconds)The code is:The Lagrange tense dowery:A4 Note genereated using Karplus-Strong modelTo take on the pluck position on the instrument using the change model, wecan feed the input into an order M comb get through before feeding it into the Karplus-Strong waveguide. The order M is a mass of N, where N is the length of thedelay line, and it determines where the string hullabaloo is apply along thedelay line. 3. Loop Filter DesignTo accurately model an acoustic guitar, it is requisite to create a loop riddle thatdamps the different harmonics of the cardinal frequency in the same way areal guitar would. This accounts for the magnetic core of the guitar body on the tweakstring sound and begins to give the model a timbre uniform to that of a realinstrument. We followed the procedure presented by Karjalainen, Valimaki andJanosy to create a loop filter based on the enter of a guitar. The algorithmconsists of competent a straight line to the temporal role envelopes of a number of primalharmonics then using the slopes of the lines to estimate the attenuation factorsfor those harmonics. STFT of betimes harmonics of recorded guitar soundTemporal envelopes of early harmonics. Slopes of time decay of early harmonics. The resulting design of the filter has the following enthral bring:0.8995 0.1087z^-1Hl(z) = -------------------1 + 0.0136z^-1Magnitude and frequency reaction of the above loop filter. As expected, it has a low descend response so thehigh frequency harmonics decay accelerated than the heavy frequency and the lower frequencyharmonics. 4. Final filter: pig out diagram of the final filter knowing to synthesize an acoustic guitar:One can arrest the length N delay line from the genuine Karplus-Strong digitalwaveguide model. The Lagrange interposition filter (L(Z)) feeds into the delayline for proper tuning. It overly has an improved loop filter (HL(Z)) based onrecordings from an actual guitar. A comb filter has been placed at the input (theleft-hand portion of the block diagram) to simulate the effect of pluckingposition on guitar. The input to the frame is an excitation signal (e[k]) obtainedthrough antonym filtering of a guitar recording. The code for this filter can be run aground in kspluck.m. It can be used as follows:kspluck(f, length, fs, excitation, B, A, p)f = frequencylength = length of note (seconds)fs = sampling freqencyexcitation = string excitation signalB = numerator coefficients of loop filterA = denominator coefficients of loop filterp = pluck position along waveguide (0 < p< 1 - fraction ofwaveguide length)5. Playing some vociferations:These are some arrays designated for the different notes with their associatedfrequencies:notes.m:I have searched for the notes of two known shouts in internet as:Jingle Bells (Very distinguish for this time of the year):EEE EEE EGCDE FFFFF EEE EDDEDGEEE EEE EGCDE FFFFF EEE GGFDCAnd this is the final code we have to implement in Matlab to obtain the .wav accuseof the song that we?re face for:First we preventive the buck with the notes and it different frequencies (?notes.m?) ,then we use the function e=wavread(?wav bear down.wav?) which fundamentally reads aWAVE file specified by the string, locomote the sampled data in the vector e . The .wav extension is appended if no extension is attached. bounteousness valuesare in the range [-1,+1]. We?ve taken the excited-picked-nodamp.wav which isfinger pull string excitation signal without initial damping. We define the sample frequency = 44100 Hz. The numerator and denominator of our designed filter in the vectors A and B. We lastly define the octave, note duration and pluck position.
Ordercustompaper.com is a professional essay writing service at which you can buy essays on any topics and disciplines! All custom essays are written by professional writers!
And in the vector ?L? is where we define the unit of measurement song we hope to listen, so inthis case of jangle bells it would be:L=[ L = [ kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p)kspluck(E(o), 2*nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o),nd, fs, e, B, A, p) kspluck(E(o), 2*nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B,A, p) kspluck(G(o), nd, fs, e, B, A, p) kspluck(C(o), nd, fs, e, B, A, p)kspluck(D(o), nd, fs, e, B, A, p) kspluck(E(o), 4*nd, fs, e, B, A, p) kspluck(F(o),nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A,p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(E(o),nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A,p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(D(o), nd, fs, e, B, A, p)kspluck(D(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(D(o),nd, fs, e, B, A, p) kspluck(G(o), 4*nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B,A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o), 2*nd, fs, e, B, A, p)kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o),2*nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(G(o), nd, fs, e, B,A, p) kspluck(C(o), nd, fs, e, B, A, p) kspluck(D(o), nd, fs, e, B, A, p)kspluck(E(o), 4*nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(F(o),nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A,p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o),nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(G(o), nd, fs, e, B, A,p) kspluck(G(o), nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(D(o),nd, fs, e, B, A, p) kspluck(C(o), 4*nd, fs, e, B, A, p)];I make the notes oversize multiplying ?nd? with an even number. in the long run the program, with the function ?wavwrite? will create the function?jingle.wav? that can be heard with the windows wav program. The other song that I created is: When the saints go marching inCEFG CEFG CEFG E C E DEEDC CE GGF EEFG E C D CFollowing the same procedure, the vector L should be:L = [ kspluck(C(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p)kspluck(F(o), nd, fs, e, B, A, p) kspluck(G(o), 4*nd, fs, e, B, A, p) kspluck(C(o),nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A,p) kspluck(G(o), 4*nd, fs, e, B, A, p) kspluck(C(o), nd, fs, e, B, A, p)kspluck(E(o), nd, fs, e, B, A, p) kspluck(F(o), nd, fs, e, B, A, p) kspluck(G(o),2*nd, fs, e, B, A, p) kspluck(E(o), 2*nd, fs, e, B, A, p) kspluck(C(o), 2*nd, fs, e,B, A, p) kspluck(E(o), 2*nd, fs, e, B, A, p) kspluck(D(o), 4*nd, fs, e, B, A, p)kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(D(o),nd, fs, e, B, A, p) kspluck(C(o), 2*nd, fs, e, B, A, p) kspluck(C(o), nd, fs, e, B,A, p) kspluck(E(o), 2*nd, fs, e, B, A, p) kspluck(G(o), 2*nd, fs, e, B, A, p)kspluck(G(o), nd, fs, e, B, A, p) kspluck(F(o), 4*nd, fs, e, B, A, p)kspluck(E(o), nd, fs, e, B, A, p) kspluck(E(o), nd, fs, e, B, A, p) kspluck(F(o),nd, fs, e, B, A, p) kspluck(G(o), 2*nd, fs, e, B, A, p) kspluck(E(o), 2*nd, fs, e, B,A, p) kspluck(C(o), 2*nd, fs, e, B, A, p) kspluck(D(o), 2*nd, fs, e, B, A, p)kspluck(C(o), 4*nd, fs, e, B, A, p) ];6. echo effectI have used the code given in the CD of the declare: digital SIGNALPROCESSING (A computer ground set out by Sanjit K. Mitra). Reverberation: Reverberation is the persistence of sound in a particular spaceafter the fender sound is removed. A reverberation, or reverb, is created when asound is produced in an enclosed space causing a large number of echoes to upbuild up and then slowly decay as the sound is absorbed by the walls and air. This is most broad when the sound source stops simply the reflections continue,decreasing in amplitude, until they can no longer be heard. This is a commonly used time-domain carrying out carried on musical soundsignals, in this operation the canonic twist block is a delay. It is make up ofdensely packed echoes. Digital filtering can be employed to interchange the soundrecorded in an sloppy studio into a natural-sounding one by artificially creating theechoes and adding them to the original signal. It has been discovered that approximately 1000 echoes per second are prerequisite tocreate a reverberation that sounds free of flutter. We will use an allpassstructure:This is the function provided by the textbook:We will need the functions ?alpas? also provided by the book and that we use tospecify the delay and the coefficient of the filter:RRzH z z1( )And the function ?multiechoes? with it, we assert the number of echoesdesired for our sound. Finally we can for example use this values to create the reverberation effect tothe jingle bells song:>> a = [0.6 0.4 0.2 0.1 0.7 0.6 0.8];>>R = [700 900 600 400 450 390];>>[x,fs,nbits] = wavread(jingle.wav);>>y = reverb(x,R,a);>> wavwrite(y,fs,jinglerev.wav);So we in conclusion can see the desired effect that will be recorded at the file?jinglerev.wav?7. References1. Smith, Julius O. Digital Waveguide molding of melodyal Instruments,Center for computer look into in medical specialty and Acoustics (CCRMA),Stanford University, 2003-12-10. meshing published at http://wwwccrma. stanford.edu/~jos/waveguide/2. K.􀀀Karplus and A.􀀀Strong, ?Digital synthesis of plucked string anddrum timbres,? reckoner Music Journal, vol.􀀀7, no.􀀀2, pp. 43-55,1983, Reprinted in [4]. 3. D.A. Jaffe and J.O. Smith, ?Extensions of the Karplus-Strong pluckedstring algorithm,? calculator Music Journal, vol.􀀀7, no.􀀀2, pp. 56-69,1983, Reprinted in [4]. 4. C.Roads, ed., The Music Machine,Cambridge, MA: MIT Press, 1989. 5. M. Karjalainen, V. V􀀀lim􀀀ki, and Z. J􀀀nosy, ?Towards high-qualitysound synthesis of the guitar and string instruments,? in Proceedings ofthe 1993 internationalistic Computer Music Conference, Tokyo, pp. 56-63,Computer Music Association, Sept. 10-15 1993, available online athttp://www.acoustics.hut.fi/~vpv/publications/icmc93-guitar.htm. 6. Synthesizing a Guitar Using physiological Modeling Techniques (StevenSanders and Ron Weiss) http://www.ee.columbia.edu/~ronw/dsp/. 7. Wikipedia. www.wikipedia.org. If you want to get a near essay, order it on our website: Ordercustompaper.com

If you want to get a full essay, wisit our page: write my paper

No comments:

Post a Comment