Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
PlayTune
Last Revision: | Version 1.1, 2006-05-11 Cleaned up code, updated for new Java and QTJava API, and cleaned up project layout. (Full Revision History) |
Build Requirements: | XCode 2.2, or Java 2 SDK for Windows, and QuickTime 7 |
Runtime Requirements: | Java 1.5 and QuickTime 7, or later, recommended |
The user is shown a small window with a button on it - click the button to play the tune.
NoteChannels are constructed and given to the TunePlayer to play the tune with. The tune is then constructed using the static methods of the MusicData class to stuff the desired notes/rests/etc. into the data format that the TunePlayer expects.
An AtomicInstrument is used as the instrument for the second part of the tune. It uses a Sin Wave at 440KHz stored in an AIFF file as the sample data.
The sample also shows you how to make a Movie from the Tune that has been constructed.
Copyright © 2006 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2006-05-11