Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MAIN:
- local track = require("Tracks")
- local flute = require("Flute")
- _G.trackCounter = 1 --<< instantiate a global track counter
- _G.soundDir = Track.instanceTable[_G.trackCounter].soundDir --<< This will result in: Track.instanceTable[1].soundDir
- -- TRACK:
- Track = {}
- Track.instanceTable = {
- [1] = { soundDir = "/Piano" } --<< I stripped all the code so its easier to read
- }
- --FLUTE:
- require("Tracks")
- local COver --<< Here goes the image file
- COver.snd = audio.loadSound( "Sound" .. _G.soundDir .. "/flPinCOver-hd.mp3", { channel=3, volume=100 } )
- function Flute:changeSound()
- COver.snd = audio.loadSound( "Sound" .. _G.soundDir .. "/flPinCOver-hd.mp3", { channel=3, volume=100 } )
- COver.name = "flPinCOver-hd.mp3"
- --This will, in the simulator, return the path and soundfile: Sound/Guitar/flPinCOver-hd.mp3
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment