PlayTune

版本 2.0 (3.0 KB) 作者: Alan Tan
This function plays musical tunes. Write your own musical tune and call the function to play it.
8.9K 次下载
更新时间 2018/7/21

查看许可证

编者注: This file was a File Exchange Pick of the Week

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 algorithm is based on the Karplus-Strong string synthesis methods:
[1] Karplus & Strong, "Digital synthesis of plucked string and drum timbres", Computer Music Journal, vol. 7, no. 2, pp. 43-55, 1983.
[2] Jaffe & Smith, "Extensions of the Karplus-Strong plucked-string algorithm", Computer Music Journal, vol. 7, no. 2, pp. 56-69, 1983.

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

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

引用格式

Alan Tan (2024). PlayTune (https://www.mathworks.com/matlabcentral/fileexchange/11441-playtune), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R11.1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Audio and Video Data 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
2.0

Switched the algorithm to the Karplus-Strong string synthesis method

1.1

Edited the version information

1.0.0.0

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