Ydm Active Member Licensed User Longtime User Jul 14, 2016 #1 I'm trying to play the musical notes. I use soundpool and timer. However, sometimes distorted because the period of time. Phone ram and it's elongation and contraction depending on the processor state. Is there another method would you recommend? I can give a priority to the CPU and RAM to their application? Is there a way to do that?
I'm trying to play the musical notes. I use soundpool and timer. However, sometimes distorted because the period of time. Phone ram and it's elongation and contraction depending on the processor state. Is there another method would you recommend? I can give a priority to the CPU and RAM to their application? Is there a way to do that?
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2016 #2 Ydm said: I can give a priority to the CPU and RAM to their application? Click to expand... No. Are you testing it in Release mode? Upvote 0
Ydm said: I can give a priority to the CPU and RAM to their application? Click to expand... No. Are you testing it in Release mode?
Ydm Active Member Licensed User Longtime User Jul 14, 2016 #3 Yes. Time is not working fine. notes at the same time sometimes long, sometimes short plays. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2016 #4 Can you upload this project? Upvote 0
Ydm Active Member Licensed User Longtime User Jul 14, 2016 #5 There are currently very complicated case. Receiving data via MySQL. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2016 #6 Ydm said: Receiving data via MySQL. Click to expand... How is it done? Upvote 0
Ydm Active Member Licensed User Longtime User Jul 14, 2016 #7 I can play MusicXML files. I get all the data from the MySQL database. The problem is: For example, there are 10 notes. Each time 1 second. I sometimes use the timer each time going 1 second. Sometimes they go shortening occurs. Code: Sub tmrPlay1_Tick Dim mp As Map mp.Initialize mp=lstTmr1.Get(nIndex1) pGitar = SP.Play(sGitar, 1, 1, 1, 1,mp.Get("notarate")) nIndex1=nIndex1+1 mp=lstTmr1.Get(nIndex1) tmrPlay1.Initialize("tmrPlay1",mp.Get("notaduration")) tmrPlay1.Enabled=True End Sub I define the duration of the timer in the next note Ticker. Upvote 0
I can play MusicXML files. I get all the data from the MySQL database. The problem is: For example, there are 10 notes. Each time 1 second. I sometimes use the timer each time going 1 second. Sometimes they go shortening occurs. Code: Sub tmrPlay1_Tick Dim mp As Map mp.Initialize mp=lstTmr1.Get(nIndex1) pGitar = SP.Play(sGitar, 1, 1, 1, 1,mp.Get("notarate")) nIndex1=nIndex1+1 mp=lstTmr1.Get(nIndex1) tmrPlay1.Initialize("tmrPlay1",mp.Get("notaduration")) tmrPlay1.Enabled=True End Sub I define the duration of the timer in the next note Ticker.
Erel B4X founder Staff member Licensed User Longtime User Jul 15, 2016 #8 Your code is wrong. 1. You are creating a new timer every tick event. You shouldn't initialize the timer again. 2. You are creating a new map every tick_event (remove the mp.Initialize line). Though this is not the real problem. Upvote 0
Your code is wrong. 1. You are creating a new timer every tick event. You shouldn't initialize the timer again. 2. You are creating a new map every tick_event (remove the mp.Initialize line). Though this is not the real problem.
Ydm Active Member Licensed User Longtime User Jul 15, 2016 #9 Thanks... 1- Code: tmrPlay1.Initialize("tmrPlay1",mp.Get("notaduration")) tmrPlay1.Enabled=True Timer, I start with the code above. How should I start? 2-I identify and try again in Globals. Somewhere from the thread mentioned. Do I need to use something like this? Upvote 0
Thanks... 1- Code: tmrPlay1.Initialize("tmrPlay1",mp.Get("notaduration")) tmrPlay1.Enabled=True Timer, I start with the code above. How should I start? 2-I identify and try again in Globals. Somewhere from the thread mentioned. Do I need to use something like this?
Erel B4X founder Staff member Licensed User Longtime User Jul 17, 2016 #10 The timer should be a process global object and should be initialized exactly once. You should start it by setting the Enabled property to True. You can change its interval with the Interval property. Upvote 0
The timer should be a process global object and should be initialized exactly once. You should start it by setting the Enabled property to True. You can change its interval with the Interval property.
Ydm Active Member Licensed User Longtime User Jul 18, 2016 #11 I tried that. Play again not true. Probably not the right idea timer. Is there an example you know about this application? Upvote 0
I tried that. Play again not true. Probably not the right idea timer. Is there an example you know about this application?
Erel B4X founder Staff member Licensed User Longtime User Jul 19, 2016 #12 There are many example that use SoundPool. Not sure whether one of them is identical to your app or not. Upvote 0
There are many example that use SoundPool. Not sure whether one of them is identical to your app or not.
Ydm Active Member Licensed User Longtime User Jul 19, 2016 #13 OK. One last question. Is that what the length of a sound with Soundpool not possible to determine whether or stolen? Code: p = SP.Play(s, 1, 1,1, 1,1) p = SP.Play(s, 1, 1,1, 1,0.5) p = SP.Play(s, 1, 1,1, 1,1) p = SP.Play(s, 1, 1,1, 1,0.4) You mean, I have no chance to set the tone for a song I sort of ringing in this way? Upvote 0
OK. One last question. Is that what the length of a sound with Soundpool not possible to determine whether or stolen? Code: p = SP.Play(s, 1, 1,1, 1,1) p = SP.Play(s, 1, 1,1, 1,0.5) p = SP.Play(s, 1, 1,1, 1,1) p = SP.Play(s, 1, 1,1, 1,0.4) You mean, I have no chance to set the tone for a song I sort of ringing in this way?
Erel B4X founder Staff member Licensed User Longtime User Jul 19, 2016 #14 Not sure that I understand the question. Do you want to find the sound duration? It is not available from SoundPool. You can use MediaPlayer to find it. Upvote 0
Not sure that I understand the question. Do you want to find the sound duration? It is not available from SoundPool. You can use MediaPlayer to find it.
Ydm Active Member Licensed User Longtime User Jul 19, 2016 #15 A-B-C-D-E-F-G music notes. I am using Playback rate properties of soundpool. This way I can find all the notes in one voice. p = SP.Play(s, 1, 1,1, 1,0.5) ----- 0.5 note voice. p = SP.Play(s, 1, 1,1, 1,0.4)------ 0.4 note voice. Also note that the length of the (duration) required. For example 1.notes last 1 second. The second half-second notes. Third note ........ 1.5 seconds If few notes of a song .... That's my only problem now. That note lengths. (DURATIONs) Let's say there are 200 notes, each at different times. I want to play them repeatedly. (I explain difficult because of Google translate. Sorry...) Upvote 0
A-B-C-D-E-F-G music notes. I am using Playback rate properties of soundpool. This way I can find all the notes in one voice. p = SP.Play(s, 1, 1,1, 1,0.5) ----- 0.5 note voice. p = SP.Play(s, 1, 1,1, 1,0.4)------ 0.4 note voice. Also note that the length of the (duration) required. For example 1.notes last 1 second. The second half-second notes. Third note ........ 1.5 seconds If few notes of a song .... That's my only problem now. That note lengths. (DURATIONs) Let's say there are 200 notes, each at different times. I want to play them repeatedly. (I explain difficult because of Google translate. Sorry...)
Erel B4X founder Staff member Licensed User Longtime User Jul 20, 2016 #16 Find their duration with MediaPlayer and use a timer to control SoundPool. Upvote 0