Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Exemple : "Twinkle Twinkle Little Star" (domaine public)
- -- Adaptez "left" Γ la face oΓΉ est branchΓ© le Iron Note Block
- local noteblock = peripheral.wrap("left")
- -- Instrument possible : 0..6 ou "harp","bass","basedrum","snare","hat","guitar","flute"
- -- Notes possibles : 0..24 (12 = do central, 24 = do octave au-dessus)
- local musique = {
- {note=12, duree=0.4}, -- C
- {note=12, duree=0.4}, -- C
- {note=19, duree=0.4}, -- G
- {note=19, duree=0.4}, -- G
- {note=21, duree=0.4}, -- A
- {note=21, duree=0.4}, -- A
- {note=19, duree=0.8}, -- G
- {note=17, duree=0.4}, -- F
- {note=17, duree=0.4}, -- F
- {note=16, duree=0.4}, -- E
- {note=16, duree=0.4}, -- E
- {note=14, duree=0.4}, -- D
- {note=14, duree=0.4}, -- D
- {note=12, duree=0.8}, -- C
- }
- while true do
- for _, noteData in ipairs(musique) do
- noteblock.playNote("harp", noteData.note)
- sleep(noteData.duree)
- end
- -- Petite pause avant de rejouer
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement