Kodi Community Forum
.CDG Karaoke-files support for music - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: .CDG Karaoke-files support for music (/showthread.php?tid=4654)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28


.CDG Karaoke-files support for music - stcogoli - 2004-07-15

greetings,
i have just written a visualisation for displaying karaoke .cdg
files on the xbox. i recently posted a patch for this on sourceforge but gamester17 suggested that i also post here to attract more developper's attention. the bulk work is done but i am looking for xbmc coders to polish this up. :help:

for those that are interested, you have to
1.) download the patch at sourceforge
2.) recompile xbmc with the source changes
3.) copy xaraoke.vis, xaraokelogo.bmp and xaraoke.xml
to the visualisations folder
4.) select the xaraoke visualisation from the music settings
5.) put "song.cdg" in the same folder as "song.mp3"
6.) play the music file "song.mp3"

the visualisation will then kick in as soon as the file is played
and it will look for "song.cdg" in the same folder as "song.mp3". if the cdg file is not found, it displays a splash screen stating this. if the cdg file is found, it is parsed on the screen at a frequency specified in the settings file xaraoke.xml. you have to tweak this parsing period if the graphics are out of sync with the audio. the theoretical value is 3.3333 ms but this has to be lowered to correct for overhead (i wasn't able to take this overhead automatically into account). note that the overhead is more important when debugging so the parsing period has to be
lowered when running in debug mode. anyways, just play with this value until the sync is good ; once the right value
is found, you shouldn't have to adjust it anymore.

note also that this visualisation is not a standalone plugin so you have to recompile xbmc to use it. i tried to write it as a plugin at first but gave that up because:
1.) it has a lot of functionality (thread functions etc...) that had to be added to the dllloader so a recompile was necessary anyways.
2.)i also think that voice support should be added and it will surely be a hassle to do this in a windows dll.
3.) it doesn't behave exactly as a visualisation because
a.) the visualisation has to start automatically when the file
is played to assure synchronicity.
b.) xbmc must pass the whole music file path to this visualisation (not just the file name) in order for the vis
to be able to find the .cdg file in the same folder.

at last, here is what remains to be done

todo:
-------
1.) fix a mem leak which is visible in debug mode when many cdg files are successively played.
2.) integrate the visualisation more elegantly in the base code if possible.
3.) add voice support for singing through the communicator headset (for now, a separate mixer is needed for singing along). maybe it could be possible to use voice masks and sound like mr roboto!
4.)maybe add a popup osd like the one for movie playback, with buttons for adjusting the volume, parsing period and other settings.

if we get this karaoke machine on track, maybe it can help
with xbox sales in japan :d


- mknight - 2004-07-15

any possibility of making it song.mp3 and song.wma? i have lots of wma/cdg combos that currently work with xbx media mixer, would be cool if they don't need to be converted to mp3s.


- Gamester17 - 2004-07-16

for devs reference; stcogoli's cdg source code patch can be found on sourceforge.net here: "cdg (karaoke) support patch for mp3 (link)".

ps! my suggestion for todo #2 is to integrate the code into xbmc so toggle enable/disable for cdg with same button as subs for video(?),
then always/only look for .cdg if "cdg karaoke support" is enabled in settings for music, + like mknight asked use for mp3/wma/wav, ...etc.


- stcogoli - 2004-07-16

Quote:any possibility of making it song.mp3 and song.wma?  i have lots of wma/cdg combos that currently work with xbx media mixer, would be cool if they don't need to be converted to mp3s.

sure, it works with any music file that xbmc can play ;
i just used song.mp3 as an example. it also works over
the network and i assume from the dvd but i haven't tested
the latter.

Quote:ps! my suggestion for todo #2 is to integrate the code into xbmc so toggle enable/disable for cdg with same button as subs for video(?),
then always/only look for .cdg if "cdg karaoke support" is enabled in settings for music,
yes, that's a good idea because there is functionality in cdg for alpha transparency so that way, you could also start a video clip and overlay the lyrics with a transparent background on top. i didn't do it that way because i would have had to modify much more base code and i basically wanted to modify as little as possible so that a real xbmc dev could do the integration elegantly. however, the lyrics also have to kick in whenever a music file is played and this can't be achieved through the video osd so i think this vis should have its own popup video-like osd.


- Gamester17 - 2004-07-16

(stcogoli @ july 16 2004,14:19 Wrote:
Quote:ps! my suggestion for todo #2 is to integrate the code into xbmc so toggle enable/disable for cdg with same button as subs for video(?),
then always/only look for .cdg if "cdg karaoke support" is enabled in settings for music
yes, that's a good idea because there is functionality in cdg for alpha transparency so that way, you could also start a video clip and overlay the lyrics with a transparent background on top. i didn't do it that way because i would have had to modify much more base code and i basically wanted to modify as little as possible so that a real xbmc dev could do the integration elegantly. however, the lyrics also have to kick in whenever a music file is played and this can't be achieved through the video osd so i think this vis should have its own popup video-like osd.
that is actually what i meant, (not use same video-osd, but just similar to it), have own music-osd (so could bring up cdg on any vis too).

to clearify; i think it be best if added new osd on black-screen and/or existing vis when play music audio-files. as an option so only look for and load .cdg if "cdg karaoke support" is enabled in settings for music. then one could toogle on/off with button during vis


- stcogoli - 2004-07-16

Quote:to clearify; i think it be best if added new osd on black-screen and/or existing vis when play music audio-files. as an option so only look for and load .cdg if "cdg karaoke support" is enabled in settings for music.
i agree.
Quote:(so could bring up cdg on any vis too).
if the cdg file has transparent background, then the lyrics will display on top of the existing vis but most cdg files are not transp. and they will thus simply override the current vis
so i'm not sure if it should be treated as a new vis or as a property for other existing vis.

ultimately, it should probably be integrated in a broader music popup osd. isn't it strange that there isn't an osd for music like there is one for video?

ps: the vis is not limited to mp3 so maybe the thread title should be changed to reflect that.


- lion2 - 2004-07-16

so has any dev decided to add this to the official xbmc build?


- BoomDivX - 2004-07-18

i hope it will soon! i'm a big fan of karaoke and i support you!! good work! any chance to see it in the next cvs? xd


- pitfall - 2004-07-20

(boomdivx @ july 18 2004,21:36 Wrote:i hope it will soon! i'm a big fan of karaoke and i support you!! good work! any chance to see it in the next cvs? xd
oh yea! that would own! :o

wohoo!!!! :bowdown:


- stcogoli - 2004-07-26

about the mem leak: if i run a song, then stop it and restart doing this continuously, the displayed freemem eventually drops. however, i have just noticed that this also occurs for the other visualisations too! can anybody enlighten me on this? is it normal for the freemem to drop or is this some unfixed leak in the xbmc code?


- lion2 - 2004-07-29

just curious, does your plugin have support for the xbox music mixer microphone?


- stcogoli - 2004-07-30

in my todo list, #3 is add voice support so no it doesn't support any microphone for now. however, if the music mixer mike functions like an xblive communicator, then it will probably work when that feature will be added.


- stcogoli - 2004-07-30

i also realized maybe voice support should be integrated more broadly into xbmc. one could add a settings screen for up to four mikes with their own volume settings. this would allow for backing vocals and duettes and since it would not be limited to the karaoke vis, you could also play a movie with its volume turned down and lipsync to it. i remember me and friends used to have a lot of fun lipsyncing improvised stupidities over old eddie murphy movies. (i know there's an official name for this activity but i can't remember what it's called...)  :lookaround:

so in the settings screen, you could set the mikes in uncompressed loopback speaker mode for lipsyncing or in compressed networking mode and have a list of remote contacts you could voice chat with, just like in a xblive game. hmmm this project is getting a bit ambitious for my skills...


- stcogoli - 2004-08-04

update on the todo list.
#1.) i am now 100% sure the mem leak is not in my code but in mplayer. see the bugs thread for more. so this is solved (kinda...).
#2.) i have just changed the sync code for xaraoke to truly behave like a vis, i.e. you can now start the display in the middle of a song with the x button and it should show up in sync (if it doesn't, you can tweak a new av delay parameter in xaraoke.xml). this allowed me to eliminate the previous source changes to application.cpp. the changes to xbmc core files are now very minimal and limited to the visualisations folder so imo i consider the integration problem to be solved.
#3.) i have ordered a communicator from ebay and will start working on this as soon as i get it.
#4.) this is actually just bells and whistles and can be dealt with later.

the only thing i see that could be better is the sync code. right now, it's a bit hacked up and will probably necessitate users to tweak the settings in xaraoke.xml to get good sync.
the values currently in xaraoke.xml work in release mode on my machine but i would like to know if the sync is also good
for everybody else...


- lion2 - 2004-08-06

im trying to compile using the latest(8/6/04) cvs source code. compiling goes through just fine but, im getting some linking errors. below is what i get. anyone have any ideas?

xbmc error lnk2001: unresolved external symbol "public: cdecl cfancontroller::instance(void)" (?instance@cfancontroller@@sapav1@xz)
xbmc error lnk2001: unresolved external symbol "public: static class cfancontroller * cdecl cfancontroller::instance(void)" (?instance@cfancontroller@@sapav1@xz)
xbmc error lnk2001: unresolved external symbol "public: void thiscall cfancontroller:Confusedtart(int)" (?start@cfancontroller@@qaexh@z)
xbmc error lnk2001: unresolved external symbol "public: void thiscall cguidialogvolumebar::cguidialogvolumebar(void)" (??0cguidialogvolumebar@@qae@xz) referenced in function "public: thiscall cguiwindowpointer::cguiwindowpointer(void)" (??0cguiwindowpointer@@qae@xz) referenced in function "public: thiscall cguiwindowsettingsprofile::cguiwindowsettingsprofile(void)" (??0cguiwindowsettingsprofile@@qae@xz) referenced in function "public: thiscall cprofile::~cprofile(void)" (??1cprofile@@qae@xz) referenced in function "public: void * thiscall cprofile::cprofile(void)" (??0cprofile@@qae@xz) referenced in function "protected: bool thiscall directory::cdaapdirectory::cdaapdirectory(void)" (??0cdaapdirectory@directory@@qae@xz) referenced in function "public: void thiscall xfile::cfiledaap::cfiledaap(void)" (??0cfiledaap@xfile@@qae@xz) referenced in function "public: class xfile::ifile * thiscall cfancontroller::getcputemp(void)" (?getcputemp@cfancontroller@@qaemxz) referenced in function "protected: void thiscall cfancontroller::getgputemp(void)" (?getgputemp@cfancontroller@@qaemxz) referenced in function "protected: void thiscall cfancontroller::getfanspeed(void)" (?getfanspeed@cfancontroller@@qaehxz) referenced in function "protected: void thiscall cfancontroller::getfanspeed(void)" (?getfanspeed@cfancontroller@@qaehxz) referenced in function $l74920
xbmc error lnk2019: unresolved external symbol "public: static class cfancontroller * thiscall capplication:Confusedtartservices(void)" (?startservices@capplication@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: virtual thiscall capplication::~capplication(void)" (??1capplication@@uae@xz)
xbmc error lnk2019: unresolved external symbol "public: virtual thiscall capplication::~capplication(void)" (??1capplication@@uae@xz)
xbmc error lnk2019: unresolved external symbol "public: virtual thiscall capplication::~capplication(void)" (??1capplication@@uae@xz)
xbmc error lnk2019: unresolved external symbol "public: virtual void thiscall cguiwindowfullscreen::renderfullscreen(void)" (?renderfullscreen@cguiwindowfullscreen@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: virtual void thiscall cguiwindowfullscreen::renderfullscreen(void)" (?renderfullscreen@cguiwindowfullscreen@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: void thiscall cguiwindowsettingssystem::onmessage(class cguimessage &)" (?onmessage@cguiwindowsettingssystem@@uae_naavcguimessage@@@z)
xbmc error lnk2019: unresolved external symbol "public: void thiscall capplication:Confusedtartservices(void)" (?startservices@capplication@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: void thiscall cguiwindowsettingssystem::onmessage(class cguimessage &)" (?onmessage@cguiwindowsettingssystem@@uae_naavcguimessage@@@z)
xbmc error lnk2019: unresolved external symbol "public: void thiscall capplication:Confusedtartservices(void)" (?startservices@capplication@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: void thiscall capplication:Confusedtopservices(void)" (?stopservices@capplication@@qaexxz)
xbmc fatal error lnk1120: 21 unresolved externals