DOC PREVIEW
Berkeley COMPSCI 150 - Project Checkpoint 7: Velocity and Loudness

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

University of California at BerkeleyCollege of EngineeringEECS150 J. WawrzynekSpring 2002 E. CaspiProject Checkpoint 7: Velocity and LoudnessUniversity of California at BerkeleyCollege of EngineeringDepartment of Electrical Engineering and Computer SciencesEECS150 J. WawrzynekSpring 2002 E. CaspiProject Checkpoint 7: Velocity and LoudnessWe will use velocity information from a MIDI note-on command to control the perceivedloudness of a sound. In practice, we must scale the corresponding physical quantity, the waveform’s amplitude. To scale the amplitude of a waveform we simply scale each individual sample before sending it to the DAC. The relationship between signal amplitude and the perceived loudness of a sound is complex. Fortunately, the ear is far less sensitive to amplitude changes than to other musical qualities of a sound such as pitch. Thanks to this insensitivity we can use any of several approximations for controlling the loudness of a sound without detrimental effects. Perceived loudness is proportional to signal amplitude, but it is not directly proportional. Specifically, to increase the loudness of a sound by a factor of 2 we need toincrease its amplitude by a factor of 2.8. Likewise, to decrease the loudness of a sound by a factor of 2 we must decrease its amplitude by a factor of 2.8. This relationship is expressed by the formula:AMP = (2.8)log2LOUDNESSUsing this formula, our synthesizer can convert a desired loudness value (taken directly from velocity) into an amplitude scaling factor. The synthesizer must multiply the output samples by the scaling factor AMP to obtain the desired amplitude. The samples stored in the EPROM templates are all at maximum amplitude. These sample values will thus be scaled on their way to the DAC by a factor: 0≤AMP≤1.Described below are two schemes for scaling the amplitude of the waveform that will give satisfactory results. Consider these schemes and implement one of them as part of your synthesizer.1. Table of Multipliers.Approximate the amplitude scaling function using a table-lookup operation. To be perfectly accurate, the table would be indexed by velocity (a 7-bit number) and wouldcontain 128 entries for all possible velocities/amplitudes. A table of such size is probably overkill for this application. Ignoring some low-order bits of velocity allows the table to be smaller, at the cost of lower accuracy. A table of 16 entries (indexed by the 4 most-significant bits of velocity) will give satisfactory results. The width of the table determines the accuracy of the approximation of the above function. Again, 4-bits is sufficient. In this scheme you will need a 16x4 ROM to store the table, as well as a multiplier circuit that takes a 4-bit multiplier (positiveonly) and a 16-bit multiplicand (2's complement). This multiplier circuit is slightly different from the one we discussed in lecture, because all the values stored in the table are less than 1. The binary point is assumed to be just to the left of the MSB. This modification is simple. Try a few cases by hand, and you will see.2. Table of Shift Amounts.We can make a further approximation to the amplitude scaling function by using a shifter instead of a multiplier circuit. A multiplication by scaling factor 0≤AMP≤1 is approximated by a right-shift.Below are listed some table values (4-bits each) that you can use for the above schemes. If you do not like the results obtained with the following numbers, you may change them as you like. The project spec requires that velocity scaling be implemented with a lookuptable, but the table contents are up to you.ROM Address Scheme 1:MultiplierScheme 2:Shift Amount0 1 61 1 42 1 33 2 34 3 25 3 26 4 17 5 18 6 19 7 110 9 011 10 012 11 013 12 014 14 015 15


View Full Document

Berkeley COMPSCI 150 - Project Checkpoint 7: Velocity and Loudness

Documents in this Course
Lab 2

Lab 2

9 pages

Debugging

Debugging

28 pages

Lab 1

Lab 1

15 pages

Memory

Memory

13 pages

Lecture 7

Lecture 7

11 pages

SPDIF

SPDIF

18 pages

Memory

Memory

27 pages

Exam III

Exam III

15 pages

Quiz

Quiz

6 pages

Problem

Problem

3 pages

Memory

Memory

26 pages

Lab 1

Lab 1

9 pages

Memory

Memory

5 pages

Load more
Download Project Checkpoint 7: Velocity and Loudness
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Project Checkpoint 7: Velocity and Loudness and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Project Checkpoint 7: Velocity and Loudness 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?