5.0

5.0 | 5 ratings Rate this file 17 Downloads (last 30 days) File Size: 2.7 KB File ID: #11441

PlayTune

by Alan Tan

 

16 Jun 2006 (Updated 21 Jul 2006)

This function plays musical tunes. Write your own musical tune and call the function to play it.

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information
Description

This function plays musical tunes. Write your own musical tune and call the function to play it.

Notation:
[CDEFGAB] keys, 5 full octaves
[12345678] key/rest duration, with the default [1] semiquaver, [2] quaver, [4] crochet and [8] minim
[#] sharp / [b] flat / [.] rest / [^] raise octave / [_] lower octave

The musical scores for Canon in D (Pachelbel), Prelude No 1 (Bach), The Globe Trotter and Fantasie Impromptu (Chopin) are also attached.

Essential files: playtune.m
Accompanying files: canon_in_d.m, prelude_no_1.m, the_globe_trotter.m, fantasie_impromptu.m

MATLAB release MATLAB 5.3.1 (R11.1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
28 Jun 2006 John D'Errico

Superb.

I do wish the author had included a bit more help with playtune. For example, the notation is described in the website description, but not in the help for playtune. (Please fix this!) I've rated it a 5 anyway.

29 Jun 2006 Alan Tan

Hi John, I've taken your advice and added some examples and included the notation (above) in the help of playtune.

20 Sep 2006 S Murphy  
18 Apr 2007 Ruoting Yang  
26 Oct 2008 Ameya Deoras  
02 Aug 2011 Chihiro  
Please login to add a comment or rating.
Updates
20 Jun 2006

Edited the function for a more natural sounding tone.

21 Jun 2006

Added residual phase to generating signals.

22 Jun 2006

Added the musical score of Prelude No 1 by Bach.

27 Jun 2006

Enabled customizable tone generator; at the same time, set the lowest note to C(-2), i.e., two octaves below the middle C of the piano. Also added a new musical score "The Globe Trotter" which plays both right and left hands.

27 Jun 2006

Tidied up the codes.

28 Jun 2006

Edited description.

29 Jun 2006

Added additional help and examples in playtune.

21 Jul 2006

Added Fantasie Impromptu (plays both hands), one of my favorite pieces by Chopin.

Tag Activity for this File
Tag Applied By Date/Time
sound Alan Tan 22 Oct 2008 08:29:48
tunes Alan Tan 22 Oct 2008 08:29:48
utilities Alan Tan 22 Oct 2008 08:29:48
musical Alan Tan 22 Oct 2008 08:29:48

Contact us at files@mathworks.com