WHAT IS MELODY?
Melody is a music module to help you play, queue, loop a playlist, and manage music easily.
This is my first module and devforum post so if you have any suggestions please let me know
WHY WOULD I USE THIS?
This module allows the user to make a looped playlist of songs using just 2 lines of code and has a lot more features.
HOW TO USE IT
Melody is made simple to use.
first insert melody to your game, then put it in replicated storage.
for a basic setup do the following in a localscript:
Melody = require(game.ReplicatedStorage.Melody).new({"some id"--[[ add as many ids as you want --]]}, workspace--[[parent --]])
Melody:Play()
let’s say you want to add/remove a song from the queue
Melody:AddSoundIdToQueue("id") -- adds the soundId to the queue
Melody:RemoveSoundIdFromQueue("id") -- removes the specified soundId from the queue
Melody:RemoveCurrentSoundIdFromQueue() --removes the current playing soundId from the queue
some other functions
Melody:GetQueue() --returns the queue
Melody:SkipCurrentSong() --skips the current playing song
Melody:Pause() -- pauses the song
Melody:Stop() --stops the song completely
Melody:Destroy() --destroys the sound instance and removes the queue
Melody:GetSoundId() --returns the current soundId
Melody:GetSoundIndex() --returns the current index of the queue
Melody:GetSound() --returns the instance of the sound
Quite simple isn’t it?
If you find any errors/bugs or if you have a suggestion please let me know.
The module itself is good, You did a great job on it. But…
Not trying to be that guy, But what are the perks/advantages of using this module? It would be better if you used OOP (Oriented Object Programming) instead of just adding all the Songs inside a single table. It seems like the module is just a wrapper for Creating Sounds, Getting Properties (Which could be easily done by doing Sound.TimePosition, Sound.TimeLength, etc)
Of course, That’s just a suggestion for you! I understand that this is your first Module, But despiting all that stuff i mentioned above, You did a great job on it!
If they were to add OOP, I might use it, but it its current state, it seems hard to use, and I can always make my own OOP module for my game that is a better fit for my game than this.
I personally find this module redundant and useless, as you can just use a regular script and a sound and it would be just fine. But, I do think that the structure of your code is nice.
all you did was play the same sound 2 times, which you can just do by setting looped to true , that isn’t what this module does, did you even understand what the module does in the first place?