ขอต้อนรับ ผู้มาเยือน กรุณา ล็อกอิน หรือ สมัครสมาชิก

ล็อกอินด้วยชื่อผู้ใช้ รหัสผ่่าน และระยะเวลาใช้งาน

 
Advanced search

41359 Posts in 6208 Topics- by 8794 Members - Latest Member: rroutt
mPEC Forumบทเรียนการใช้โปรแกรม Mathematica (Moderator: psaipetc)ลองให้ Mathematica เล่นเพลงมหาจุฬาลงกรณ์
Pages: 1   Go Down
Print
Author Topic: ลองให้ Mathematica เล่นเพลงมหาจุฬาลงกรณ์  (Read 3559 times)
0 Members and 1 Guest are viewing this topic.
Bright
neutrino
*
Offline Offline

Posts: 212

เราเป็นอย่างไร สังคมเป็นอย่างนั้น


« on: April 27, 2012, 05:03:46 PM »

ลองให้ Mathematica เล่นเพลงมหาจุฬาลงกรณ์ครับ  Smiley
คำสั่งที่ใช้คือ SoundNote กับ Sound

โน้ตเพลงที่ผมได้มานี้อาจไม่ถูกครับ แต่มีคนบอกว่ามันใกล้เคียง

notes = {"C2", "A", "C2", "E", "A", "G", "G", "C2", "A", "E", "A",
   "G", "D", "D", "E", "D", "E", "A2", "C", "D", "C", "D", "E", "G",
   "C2", "A", "C2", "E", "A", "G", "G", "C2", "A", "E", "A", "G", "D",
    "D", "G", "E", "G", "D", "E", "G", "G2", "A2", "D", "C", "A", "G",
    "A", "E", "A", "G", "E", "D", "E", "D", "E", "A2", "C", "D", "E",
   "D", "E", "G2", "A2", "C", "C2", "A", "C2", "E", "A", "G", "G",
   "C2", "A", "E", "A", "G", "D", "D", "G", "E", "G", "D", "E", "G",
   "G2", "A2", "D", "C", "A", "G", "A", "E", "A", "G", "E", "D", "E",
   "D", "E", "A2", "C", "D", "E", "D", "E", "G2", "A2", "C", "C2",
   "A", "C2", "E", "A", "G", "G", "C2", "A", "E", "A", "G", "D", "D",
   "G", "E", "G", "D", "E", "G", "G", "A", "C2", "C2"};

culength = {3, 3, 3, 3, 3, 3, 18, 3, 3, 3, 3, 3, 3, 18, 3, 3, 3, 6, 6,
    18, 6, 9, 3, 18, 3, 3, 3, 3, 3, 3, 18, 3, 3, 3, 3, 3, 3, 18, 3, 3,
    3, 6, 6, 15, 6, 9, 3, 18, 6, 9, 3, 18, 6, 9, 3, 18, 3, 3, 3, 6, 6,
    18, 3, 3, 3, 6, 6, 18, 3, 3, 3, 3, 3, 3, 18, 3, 3, 3, 3, 3, 3, 18,
    3, 3, 3, 6, 6, 15, 6, 9, 3, 18, 6, 9, 3, 18, 6, 9, 3, 18, 3, 3, 3,
    6, 6, 18, 3, 3, 3, 6, 6, 18, 3, 3, 3, 3, 3, 3, 18, 3, 3, 3, 3, 3,
   3, 18, 3, 3, 3, 6, 6, 15, 6, 9, 3, 18};

cusong = Table[SoundNote[notes[[ i]], culength[[ i]], "Guitar"], {i, 1, Length@notes}];
Sound[cusong, 60]

 Smiley
« Last Edit: April 27, 2012, 05:11:38 PM by Bright » Logged
Pages: 1   Go Up
Print
Jump to: