User Tag List

Results 1 to 4 of 4

Thread: Midi support for exporting old games

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Marcello's Avatar
    Join Date
    Jul 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Midi support for exporting old games

    Hello!

    I'm trying to use the HTML exporter to make some old K&P games playable on the web, as you can see here: https://klikjs.now.sh

    I noticed that midi playback doesn't seem to work and when I dug into the code it seems like there is no logic to play them (although it exports the file).

    Would it be realistic to add support into the HTML exporter? Or can I hack it in somehow? There are a couple open source JavaScript libraries that I can use to play midi files through WebAudio: https://github.com/feross/timidity and https://www.midijs.net

    Any help would be appreciated!

    Marcello

    p.s. I found that sound wouldn't play on any of my exports, but I seemed to have gotten around it by running the "new Runtime(…)" code inside a click event handler.

  2. #2
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Marcello's Avatar
    Join Date
    Jul 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, I did a bit of digging into the source code of the HTML5 runtime and was able to add the logic*I think I need to get midi files loading and ready to play, but I'm stuck because it appears that music related actions such as ACT_PLAYMUSIC ((2 << 16) | 0xFFFE) are not included in the generated .cch/.cc1 files.

    I tested by adding three actions on frame start: play sample, play music, and play sample (again), and CAct.create is only called for the play sample actions.

    You can see my WIP here: https://github.com/marcello3d/klikjs/pull/1/files — Obviously this is not an ideal fix, but maybe it'll inspire @Francois to take a peek

  3. #3
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,692
    Mentioned
    235 Post(s)
    Tagged
    3 Thread(s)
    Are you THE Marcello? Wow long time I'm going to take a look.

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Marcello's Avatar
    Join Date
    Jul 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Yves in the flesh. if this works out I might port some of my extensions to html5 so that I can export more oldies.

    I spent a little more time last night digging into the two libraries. I’d need to do a little more work to package up timidity so that it is easy to bundle into the final app. The main downside is the total set of MIDI samples appears to be ~24MB (though it only downloads what’s needed for a given midi file).

    A better solution might be to pre-convert to MP3 but I’m guessing that’s not worth the effort.

Similar Threads

  1. midi songs in android games?
    By burresnurre in forum Android Export Module Version 2.0
    Replies: 5
    Last Post: 30th July 2013, 10:00 PM
  2. Midi Support
    By jasonorme in forum SWF/Flash Export Module Version 2.0
    Replies: 4
    Last Post: 24th March 2010, 11:44 PM
  3. Support for MIDI controllers found
    By Ben in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th February 2009, 10:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •