Upload
gunjan-gupta
View
70
Download
0
Embed Size (px)
DESCRIPTION
How to generate Music with help of Programming ?
Citation preview
The MUSICAL CPUGUNJAN GUPTA
The “musical CPU” uses three carefully designed instruction formats to literally describe the sounds and flow of music by mapping various constructs of music (notes, tempo, etc.) into corresponding specially designed assembly language instructions that encode the desired musical effect.
Two Common Approaches :
Hardware Based Software Based
Similarities between Music and CPU
Designing a musical CPU requires mapping various constructs of music into corresponding specially designed assembly language instructions that encode the desired musical effect.
What is the structure of MUSIC ???
Notes and Tones Note Duration, Tempo, and Control Flow
INSTRUCTION SET DESIGN
Three music constructs Play Note, Set Tempo, and Jump requires only a 2 bit opcode
Play Note instruction needs three additional fields: the note’s tone, the duration, and the octave.
Set Tempo instruction needs only one additional field: the value of the tempo specified in some units .
Jump instruction needs, at a minimum, a field used to determine the destination address.
Example :
Note A, Note B, Note C, Note D, Note B
Note A, Note B, Note C, Note D, Note B
Note A, Note B, Note C, Note A, Note B, Note B
Implementation Technique :
:BEGIN
Play Note A
Play Note B
Play Note C
Jump to ENDING2 after a count of 2
(maxCnt=2, count=2)
Play Note D
Play Note B
Jump to BEGIN after a count of 0
(maxCnt=0, count=0)
:ENDING2
Play Note A
Play Note B
Play Note B
Instruction Format
Play Note (opcode 00)
op duration tone octave
2 bits
8 bits 4 bits 2 bits
Set Tempo (opcode 01)
op tempo unu sed
2 bits
8 bits 6 b its
Jump ( opcode 10)
op absolute destination address
maxCnt count
2 bits
8 bits 3 bits 3 bits
Summary
Use Of Numerous Design Principles From
Digital Logic
Theory Of Computation
Computer Organization
Structured Programming
Dealing With The Many Details Related To Designing And Implementing A Device Such As The Musical CPU Represents Issues Not Only From Digital Logic Design, But Also From Computer Science As A Whole, And From The Fine Arts Discipline Of Music.
Thank YOU