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.
Thank you in advance!
Develop games in your browser. Powerful, performant & highly capable.
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)
If your still having problems with the audio object, this might help ?
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