Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Starting with Project 3, you will create an application for composing and playing music. Your application will include a composition panel into which the user

image text in transcribedimage text in transcribed

Starting with Project 3, you will create an application for composing and playing music. Your application will include a "composition" panel into which the user can place horizontal rectangles representing notes. The vertical position of each rectangle indicates the pitch, the horizontal position indicates when the sound is to be played, and the horizontal length of the rectangle indicates the duration. When the "Play" menu item is chosen, a note is played for every rectangle displayed in the composition panel. Furthermore, during play, a vertical red line moves to the right indicating the progression of time. Watch a demonstration video narrated by Dale Skrien of Colby College, who designed this project. Functional requirements The composition panel should be 1280 pixels high and 2000 pixels wide. It should have horizontal and vertical scroll bars. The composition panel should display 127 thin (1-pixel) gray horizontal lines spaced 10 pixels apart vertically, representing 128 distinct pitches (0-127). Lines that appear higher on the screen should, in general, represent higher pitches. (Strange things may happen at very low or high pitches.) Each time the user clicks in the composition panel, a new rectangle should appear, representing a sound. The rectangle should be positioned horizontally so that the left edge of the rectangle lines up with the point that was clicked. It should have a width of 100 pixels. It should be positioned vertically to sit in between two of the horizontal lines. It should be blue with a thin black outline. The horizontal position of each rectangle indicates when its sound should be played. Therefore if there are two rectangles overlapping horizontally, two sounds should be played at the same time. Assume a fixed horizontal time scale of 100 ticks per beat with 1 beat per second, where each tick is displayed as one pixel horizontally. There should be a menu bar at the top of the window with two menus: A File menu with an Exit menu item that behaves as in Project 1, and an Action menu with a Play menu item and a Stop menu item. The horizontal position of each rectangle indicates when its sound should be played. Therefore if there are two rectangles overlapping horizontally, two sounds should be played at the same time. Assume a fixed horizontal time scale of 100 ticks per beat with 1 beat per second, where each tick is displayed as one pixel horizontally. There should be a menu bar at the top of the window with two menus: A File menu with an Exit menu item that behaves as in Project 1, and an Action menu with a Play menu item and a Stop menu item. When the Play menu item is selected, the sounds corresponding to all the rectangles are played with the appropriate pitch, duration, and starting time. As the composition plays, a vertical red line should move across the composition panel from left to right, indicating the progression of time. It should just hit the left edge of a rectangle when the sound associated with that rectangle begins playing and should hit the right edge of that rectangle just as the sound stops. When it reaches the last right edge of the last rectangle, the vertical rectangle should disappear. When the Stop menu item is selected, the sounds currently playing and the sounds yet to be played are immediately stopped and the red line disappears. If the user chooses the Play menu item while sounds are being played, the current sounds should stop playing and the red line should disappear and the program should start over playing the sounds at the beginning with a new red line. All menu items should have keyboard shortcuts. In particular, give Play the shortcut Ctrl-P, which means holding down the Control (Ctrl) key and pressing the "P" key. Similarly, use Ctrl-S for Stop and Ctrl-Q for Exit. If you want, you can use the Command (Cmd) key instead and so use Cmd-P. Cmd-S and Cmd-O. Starting with Project 3, you will create an application for composing and playing music. Your application will include a "composition" panel into which the user can place horizontal rectangles representing notes. The vertical position of each rectangle indicates the pitch, the horizontal position indicates when the sound is to be played, and the horizontal length of the rectangle indicates the duration. When the "Play" menu item is chosen, a note is played for every rectangle displayed in the composition panel. Furthermore, during play, a vertical red line moves to the right indicating the progression of time. Watch a demonstration video narrated by Dale Skrien of Colby College, who designed this project. Functional requirements The composition panel should be 1280 pixels high and 2000 pixels wide. It should have horizontal and vertical scroll bars. The composition panel should display 127 thin (1-pixel) gray horizontal lines spaced 10 pixels apart vertically, representing 128 distinct pitches (0-127). Lines that appear higher on the screen should, in general, represent higher pitches. (Strange things may happen at very low or high pitches.) Each time the user clicks in the composition panel, a new rectangle should appear, representing a sound. The rectangle should be positioned horizontally so that the left edge of the rectangle lines up with the point that was clicked. It should have a width of 100 pixels. It should be positioned vertically to sit in between two of the horizontal lines. It should be blue with a thin black outline. The horizontal position of each rectangle indicates when its sound should be played. Therefore if there are two rectangles overlapping horizontally, two sounds should be played at the same time. Assume a fixed horizontal time scale of 100 ticks per beat with 1 beat per second, where each tick is displayed as one pixel horizontally. There should be a menu bar at the top of the window with two menus: A File menu with an Exit menu item that behaves as in Project 1, and an Action menu with a Play menu item and a Stop menu item. The horizontal position of each rectangle indicates when its sound should be played. Therefore if there are two rectangles overlapping horizontally, two sounds should be played at the same time. Assume a fixed horizontal time scale of 100 ticks per beat with 1 beat per second, where each tick is displayed as one pixel horizontally. There should be a menu bar at the top of the window with two menus: A File menu with an Exit menu item that behaves as in Project 1, and an Action menu with a Play menu item and a Stop menu item. When the Play menu item is selected, the sounds corresponding to all the rectangles are played with the appropriate pitch, duration, and starting time. As the composition plays, a vertical red line should move across the composition panel from left to right, indicating the progression of time. It should just hit the left edge of a rectangle when the sound associated with that rectangle begins playing and should hit the right edge of that rectangle just as the sound stops. When it reaches the last right edge of the last rectangle, the vertical rectangle should disappear. When the Stop menu item is selected, the sounds currently playing and the sounds yet to be played are immediately stopped and the red line disappears. If the user chooses the Play menu item while sounds are being played, the current sounds should stop playing and the red line should disappear and the program should start over playing the sounds at the beginning with a new red line. All menu items should have keyboard shortcuts. In particular, give Play the shortcut Ctrl-P, which means holding down the Control (Ctrl) key and pressing the "P" key. Similarly, use Ctrl-S for Stop and Ctrl-Q for Exit. If you want, you can use the Command (Cmd) key instead and so use Cmd-P. Cmd-S and Cmd-O

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Explain the forces that influence how people handle conflict

Answered: 1 week ago