Xaudio2 won't play music sequencer samples

This forum is currently in read-only mode.
From the Asset Store
Get instant inspiration with this drum sample pack!
  • Hi, I'm trying to create a basic music sequencer that can later be expanded into a game or some other kind of application. I am having issues with the Xaudio2 plugin, as it won't play the samples assigned to the beats when the marker passes over them.

    I'm not sure if this is because it's used in other layouts with other sounds or what, but I would think that shouldn't interfere with these.

    I also have other questions about how to make this as I am not mathematically minded at all nor do I have a solid grasp on the logic of how to set up events. I'm assuming my events are extremely inefficient for what I'm trying to do. If someone could provide some info or show me a better way that isn't too math heavy through events on how to do the following I would greatly appreciate it. If not I just need to solve the sound playing issue for now however.

    • Have different samples assigned to each channel and have them play when the marker passes over a colored beat
    • Have the marker wrap back around to the other side without it causing any pause in between to maintain smooth loop
    • Have an object respond to the peak levels of only part of the sound (like the kick drum) rather than all of the sounds playing at once.

    http://dl.dropbox.com/u/15972778/beat.cap

    Thank you in advance!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The reason the the sound isn't playing is there is no XAudio2 instance on "Layout 3", even though the XAudio2 object is on "Layout 1" and has global enabled. Global doesn't mean it will exist on all layouts, it means that after an instance is created it will still exist when layouts are changed at runtime.

    A simple fix would be to create an XAudio2 object at the start of "Layout 3". It is also a good idea to check if there are any XAudio2 instances before you create another to prevent distortion caused by multiple instances.

    + System: Start of layout
    + System: CountMatching("XAudio2") Equal to 0
    -> System: Create object XAudio2 on layer 1 at (0, 0)
    [/code:3ldjpl9m]
  • If your still having problems with the audio object, this might help ?

    <img src="http://dl.dropbox.com/u/15858089/X2audio%20solution.png">

    I use this method on my beatbox project.

    The first line activates the red line which moves fron left to right.

    When it collides a blue object, a sound is played.

    I only use one X2Auduio object (global)

    Hope it helps

    regards

    chrisbrobs

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)