User Tag List

Results 1 to 10 of 10

Thread: Inconsistent timing on smartphone (metronome principle)

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Inconsistent timing on smartphone (metronome principle)

    I tried to make something through coding before I moved to Fusion.. A simple program that strings together samples of music to make a bigger whole. Unfortunately, the timing was always slightly off, causing a disturbingly flawed rhythm.

    Now I'm trying it again with Fusion. I thought I finally had it when it sounded perfectly in Windows runtime. But when I built the app to my phone (Galaxy S Advance), I had exactly the same issue. The beats followed each other much slower than in Windows runtime.

    I am now convinced that this is a performance problem I need to resolve. This is what I have tried so far. None if it seemed to make any difference.

    • Tried different formats (mp3, wav, ogg)
    • Compressed sound before building the apk
    • Artificially sped up the beat in order to compensate the delay. Didn't solve the issue, because the rhythm isn't just slower, but also very inconsistent (too fast, then too slow again)
    • Set OpenGL as required hardware in the Android Options
    • Ticked "require GPU" under Android Options
    • Ticked "compress sounds" under Settings


    I have such a fun and creative idea for an app but have been struggling with this problem for almost a year now. I hope I'm not trying something impossible here. Does anyone have a solution in mind?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2006
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could try playing ALL the beats on a muted channel at the start of the frame so all the samples are loaded in to memory.

    It sounds like a loading delay per each sound effect but that is just a guess.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you are absolutely right.

    The last time I used any Clickteam product was almost 20 years ago with Klik & Play, so it will take a while before I figure out how to properly make sounds load with Fusion. I did create a short test though.

    I made a counter add 1 every 1 millisecond, and every 4th second the counter resets and a text shows where it ended. It was pretty consistent. However, when I played sound every 4th second, the counter was much slower until it recovered itself (when the music was probably loaded). This seems to hint that you could be correct.

    Thank you, I'll try to work this out!

    >

    This seems odd though, because all sounds are set as "preload" already when I look them up in Data Elements.

  4. #4
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,083
    Mentioned
    138 Post(s)
    Tagged
    3 Thread(s)
    opposite idea, use play from disk instead.

    so it will not load any sound and start play from disk
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Egh.. Thanks you both. I've worked some hours and tried different things (preloading and "play from disk" included), but the problem remains The next sample comes either too soon or too late; only spot-on by coincidence. I've listened carefully to see if I can find a pattern in it, but it seems completely random.

    The next sample is supposed to play when a counter reaches 270 (adds 1 every 1 millisecond). This does trigger at exactly 270, but I think the ticks of the timer just have small inconsistencies.

    I'm really starting to believe that this is a hardware related problem and nothing you can solve through Fusion.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    Lacey, WA
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I made a simple Nine Inch Nails inspired step sequencer during the early days of Android Beta testing (search Google Play for Echoplex Drum Simulator), and ran into this same issue. Unfortunate that we still don't have a fix for this :/

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried your app and tried to do what your intention probably was (the beat from Closer, I recognized the sound of the drums). I heard the same problem I'm having.

    I hope it's not impossible to get it right with the timer. Maybe any sound format is too heavy to be handled in this manner. Except probably MIDI, but that is so limited.

    What I'm going to try now, is make a soundless MIDI file with the length of one beat. Then I'll make an event that triggers when that MIDI has finished.

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    make a soundless MIDI file with the length of one beat. Then I'll make an event that triggers when that MIDI has finished.
    No luck with that either.. It works in runtime, but building to Android converts MIDI to a non-numeric audio format, so MIDI-related events also don't work at all.

  9. #9
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)
    Literswater's Avatar
    Join Date
    Apr 2014
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure there are more people out there with this problem, so I'll post what I did what finally solved it (yay!)

    I discovered in fact two issues:

    1) When an Android app plays no sound for a while, the device disconnects its audio feed until it makes sound again. I discovered this by repeatedly changing the volume while a sample was played. Shortly after it finished, the volume switched from "media volume" to "call volume". When it connects its audio feed again to play the next sound, it comes slightly delayed and with a mild (but annoying) pop.

    2) Ticks are inconsistent and therefore not reliable for punctious timing, so by using the simple "every"-timer events, you will notice a very clumsy rhythm.

    I solved these problems by creating two mute sound files:

    1) I made a long low-quality audio file called mute.mp3, with absolutely no sound. As long as no sound is played in the app, mute.mp3 plays. No more audio auto on/off problems.

    2) I made mute2.mp3 and used that as the timer, so I no longer have to rely on ticks. It is exactly as long as I want a beat to be, and it starts playing when a beat starts (with all the samples that are supposed to play). I create an event "mute2.mp3 no longer playing", that triggers mute2.mp3 to play again and the new beat starts.

    This removed roughly 85% of my problem. Rarely can you still hear it. It sucks because I want things to be perfect, but it's quite alright. Only a few people (usually musicians) notice it.

    I hope this post can help other people out too . It got really frustrating.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    Lacey, WA
    Posts
    755
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I initially tried that with my app, but I also wanted to have the option to change BPM, so unless I wanted to limit what BPMs people could use, and have a long set of mute[bpm].mp3 files, I couldn't use this option :/

Similar Threads

  1. Replies: 28
    Last Post: 25th August 2017, 08:36 AM
  2. Drag screen (Smartphone style)
    By Popcorn in forum File Archive
    Replies: 2
    Last Post: 15th July 2012, 11:36 PM
  3. Metronome Timing Issues
    By greasemonkey89 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd May 2011, 08:00 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
  •