1 / 30

Programmable Music Box

Programmable Music Box. Team 18 Abhinav Todi , Danqi Ye, Sharaf Nazaar TA: Michelle Ansai. Introduction: Traditional Music Box. Sound derived from plucking of comb. Protrusions on drum encode song. One melody per box. Objective. Programmable Music Box MIDI compatible with:

serena
Download Presentation

Programmable Music Box

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programmable Music Box Team 18 AbhinavTodi, Danqi Ye, SharafNazaar TA: Michelle Ansai

  2. Introduction: Traditional Music Box • Sound derived from plucking of comb. • Protrusions on drum encode song. • One melody per box

  3. Objective • Programmable Music Box • MIDI compatible with: • Real time with keyboard • MIDI files on SD card • MIDI protocols from PC

  4. WHY MIDI? • MIDI stands for Musical Instrument Digital Interface • MIDI is a technical standard • MIDI formatting is well documented • Files use up very little space • Versatility in manipulation and choice of instrument

  5. High Level Block Diagram Power Supply Music Box Interface (Servos) External Memory (SD/Flash) Microcontroller Unit Peripheral Hardware (Keyboard/PC) Keypad for Mode Selection Liquid Crystal Display Legend: Power MIDI PWM Digital I/O

  6. Original Mechanical Design

  7. High Level Flow Diagram Decode note number Corresponding servo control moves servo Initialize serial communication Load MIDI callback function Yes Initialize Servo Controls, LCD, keypad No NoteOn? Mode? Load Music Callback Function Real Time Yes Event? Real Time Routine while() loop SD card routing No

  8. Design Considerations • Power Supply: • Conversion between 5V and 3.3V • MIDI I/O: • 5 Pin DIN connector • Current loop isolated from circuit

  9. Design Considerations • Microcontroller Unit: • Memory available • Baud synchronization with MIDI • I/O Pins available

  10. Design Considerations • SD Card: • Variable length parsing • Meta-events/Channel Events • Servo: • Play chords • Size and Calibration (Our biggest headache)

  11. Power Supply

  12. MIDI Interface

  13. MIDI Interface • UART communication protocol • Pin 12/13 for RX/TX pins (Pin conflict management) • Callback function for interrupt driven input Data 1 Data 2 Status 1000nnnn 0kkkkkkk 0vvvvvvv The ‘Note On’ channel event is what we are most concerned with.

  14. Microcontroller Original Idea: Final Decision: + 74F675A Shift Reg

  15. LCD and Keypad • LCD/Keypad Design Functions: • Keypad selects 2 modes of operation • LCD displays mode selected

  16. SD Card Interface • SPI communication protocol (different from real-time MIDI interface) • Uses pins 50 – 53

  17. SD Card Interface Flow-Diagram Open midi file Extract Information from Header Chunk Yes Infinite while loop eof? No Read next track chunk 00ff 2f00 Parse delta time Parse event info Decode note on/ Set Tempo Event Note on/ set tempo

  18. SD Card Interface Functions • Extract relevant info from header/track chunk: • No. of tracks • Length of tracks • Time base • Tempo

  19. Header Chunk MIDI File Format Track Chunk End of Track Chunk

  20. SD Card Interface Functions • Read variable length delta-time • Recognize event of relevance:

  21. MIDI File Delta Time Calculation • Delta time is stored as number of ticks • For default tempo of 120 bpm:

  22. Servo Interface

  23. Servo Specs • Runs on 5V power supply • 20.2mm x 8.5mm x 20.2mm • Torque: 0.03 Nm (Fairly weak)

  24. Software For Testing • For real time testing: • ‘ChucK’ is used to sequence melody. See http://chuck.cs.princeton.edu/ • Servos flick in sync with sound card output. • SD card requires larger memory for sequencing • MIDI events stored on temp file and played back

  25. The Final Product • PCB of an Arduino Shield • Mechanical box consisting of 3 combs, 6 servos

  26. Limitations • Mechanical Limitation: • Calibration • Servo torque strength (size vs. strength) Size Matters!

  27. Future Improvements • Increased musical range • Recording Mode • USB interface • Decreased Cost with Uno and Shift Register • More precise mechanical design • That, or synthesize the sound.

  28. Special Thanks • Professor Haken for lending equipment and advice on MIDI interface. • SkotWiedmann for advice and help on circuit design.

  29. Questions?

More Related