SoftwarePractice.org: Home | Courseware | Wiki | Archive

Digital music sampler

From SoftwarePractice.org

This articles describes a digital music "sampler" project. It is suitable for a second-year object-oriented design and programming class.

The project

The project is to design a digital music sampler program, and implement it in Java. A "sampler" is the term used to describe a devices that digitally records ("samples") a musical instrument or other sound source, and then allowed those recorded sounds to be played back like a regular instrument. Typically although not always, playback is controlled by an electronic (piano-like) keyboard.

The user interface will include a graphical representation of a piano keyboard, spanning at least two octaves (15 white keys and ten black keys). Different stored "voices" can be selected for playback. Pressing a key with the mouse plays back a sound at the corresponding pitch. By default, the middle key corresponds to "middle C," but the pitch of the whole keyboard can also be raised and lowered by one, two, or three octaves.

Each note, when it is played, plays until the note stops sounding naturally. In other words, there is no "key off" as there would be with a normal electronic keyboard. However, if a second, third, or fourth note is played while the first note is still sounding, the currently sounding note will continue to sound. In other words, several notes could be sounding at the same time.

The program must never emit pops or clicks. When played through amplification, this can damage loudspeakers.

There is also a recording interface, to enable musical sounds to be recorded. To record a sound, the pitch being recorded will be selected from the keyboard. After recording, the user interface will enable "trimming" of the sound to remove silence from the start and end of the recorded sound. When satisfactory, the recorded sound can be saved as a new "voice."

The program will automatically generate different pitches for playback. How exactly this is accomplished is up to the development team.

External links

Personal tools