- Sheet music: http://www.mariopiano.com/mario-sheet-music-overworld-main-theme.html - This person details how to make a speaker --- includes pictures of schematics! http://archive.fabacademy.org/2017/fablabsantiago/students/59/010assignment.html - Past project making synth: http://fab.academany.org/2018/labs/fablabulb/students/nicolas-decoster/?page=assignment&assignment=11#AvailableSongs - Extracting levels, not music: xhttps://matthewearl.github.io/2018/06/28/smb-level-extractor/ - Simulate ATTiny chips/programs on the computer https://github.com/buserror/simavr * Circuits 1. You can make dual use of the programming pins (The ones connected to the ISP via SCK MISO MOSI) on your ATTiny. This is so that when you're not using the pins to receive new code, you can use them for whatever other purposes you want. 2. If you are pulling a lot of current (which happens if the ATTiny is connected to something like a speaker or an LED but not a low-resistance load like a switch) you should use a transistor (called "MOSFET" in the fab inventory) to protect the pin of your ATTiny while still enabling the ATTiny to switch the element on or off. 3. Speaker's just a four-junction footprint on your board, apparently. See Neil's example. ** Questions 1. How do/should you power a board if you don't need the FTDI cable for serial communication with the computer? 2. Does the ATTiny's architecture expect that the ISP will be connected to specific ports? * Synthesis Software - https://www.nayuki.io/page/transcription-of-pokemon-game-boy-music - https://gist.github.com/1wErt3r/4048722 # https://gist.github.com/1wErt3r/4048722 #+BEGIN_SRC ;music headers ;header format is as follows: ;1 byte - length byte offset ;2 bytes - music data address ;1 byte - triangle data offset ;1 byte - square 1 data offset ;1 byte - noise data offset (not used by secondary music) TimeRunningOutHdr: .db $08, TimeRunOutMusData, $27, $18 Star_CloudHdr: .db $20, Star_CloudMData, $2e, $1a, $40 EndOfLevelMusHdr: .db $20, WinLevelMusData, $3d, $21 ResidualHeaderData: .db $20, $c4, $fc, $3f, $1d UndergroundMusHdr: .db $18, UndergroundMusData, $00, $00 SilenceHdr: .db $08, SilenceData, $00 CastleMusHdr: .db $00, CastleMusData, $93, $62 VictoryMusHdr: .db $10, VictoryMusData, $24, $14 GameOverMusHdr: .db $18, GameOverMusData, $1e, $14 WaterMusHdr: .db $08, WaterMusData, $a0, $70, $68 WinCastleMusHdr: .db $08, EndOfCastleMusData, $4c, $24 GroundLevelPart1Hdr: .db $18, GroundM_P1Data, $2d, $1c, $b8 GroundLevelPart2AHdr: .db $18, GroundM_P2AData, $20, $12, $70 GroundLevelPart2BHdr: .db $18, GroundM_P2BData, $1b, $10, $44 GroundLevelPart2CHdr: .db $18, GroundM_P2CData, $11, $0a, $1c GroundLevelPart3AHdr: .db $18, GroundM_P3AData, $2d, $10, $58 GroundLevelPart3BHdr: .db $18, GroundM_P3BData, $14, $0d, $3f GroundLevelLeadInHdr: .db $18, GroundMLdInData, $15, $0d, $21 GroundLevelPart4AHdr: .db $18, GroundM_P4AData, $18, $10, $7a GroundLevelPart4BHdr: .db $18, GroundM_P4BData, $19, $0f, $54 GroundLevelPart4CHdr: .db $18, GroundM_P4CData, $1e, $12, $2b DeathMusHdr: .db $18, DeathMusData, $1e, $0f, $2d :------------------------- ;MUSIC DATA ;square 2/triangle format ;d7 - length byte flag (0-note, 1-length) ;if d7 is set to 0 and d6-d0 is nonzero: ;d6-d0 - note offset in frequency look-up table (must be even) ;if d7 is set to 1: ;d6-d3 - unused ;d2-d0 - length offset in length look-up table ;value of $00 in square 2 data is used as null terminator, affects all sound channels ;value of $00 in triangle data causes routine to skip note ;square 1 format ;d7-d6, d0 - length offset in length look-up table (bit order is d0,d7,d6) ;d5-d1 - note offset in frequency look-up table ;value of $00 in square 1 data is flag alternate control reg data to be loaded ;noise format ;d7-d6, d0 - length offset in length look-up table (bit order is d0,d7,d6) ;d5-d4 - beat type (0 - rest, 1 - short, 2 - strong, 3 - long) ;d3-d1 - unused ;value of $00 in noise data is used as null terminator, affects only noise ;all music data is organized into sections (unless otherwise stated): ;square 2, square 1, triangle, noise ;;; ---- ProcessLengthData: and #%00000111 ;clear all but the three LSBs clc adc $f0 ;add offset loaded from first header byte adc NoteLengthTblAdder ;add extra if time running out music tay lda MusicLengthLookupTbl,y ;load length rts ;; ------ FreqRegLookupTbl: .db $00, $88, $00, $2f, $00, $00 .db $02, $a6, $02, $80, $02, $5c, $02, $3a .db $02, $1a, $01, $df, $01, $c4, $01, $ab .db $01, $93, $01, $7c, $01, $67, $01, $53 .db $01, $40, $01, $2e, $01, $1d, $01, $0d .db $00, $fe, $00, $ef, $00, $e2, $00, $d5 .db $00, $c9, $00, $be, $00, $b3, $00, $a9 .db $00, $a0, $00, $97, $00, $8e, $00, $86 .db $00, $77, $00, $7e, $00, $71, $00, $54 .db $00, $64, $00, $5f, $00, $59, $00, $50 .db $00, $47, $00, $43, $00, $3b, $00, $35 .db $00, $2a, $00, $23, $04, $75, $03, $57 .db $02, $f9, $02, $cf, $01, $fc, $00, $6a MusicLengthLookupTbl: .db $05, $0a, $14, $28, $50, $1e, $3c, $02 .db $04, $08, $10, $20, $40, $18, $30, $0c .db $03, $06, $0c, $18, $30, $12, $24, $08 .db $36, $03, $09, $06, $12, $1b, $24, $0c .db $24, $02, $06, $04, $0c, $12, $18, $08 .db $12, $01, $03, $02, $06, $09, $0c, $04 #+END_SRC * Mario notes from the table