I’ve been trying to get the scope to work but it wont!
I followed Paranoid Android’s example but all I get is a
goofy looking scope. I tried to do every thing the same,
but all I get is a wave form that looks blocky and stupid. 😡
If you can help I would be greatful!
- nci asked 15 years ago
hmmm, I’m stumped, no matter what i do to your program it doesn’t display the scope well at all. Most of the time it crashes on me while a song is playing, and when I press debug I find that it crashed because the current value of the scope that its trying to display is something like 340,000,000,000,000,000,000,000,000,000,000,000. So, thats the reason why it crashes, and the only possible reason behind that would be how you get the scope data. One thing I did notice was that you only have a function to get the scope from an FPU mixer, it might not be displaying properly if the mixer was set to a non-fpu mixer. I know it has something to do with your scope array, because when I comment out that section of your code it runs fine with no crashes, but of course with no scope output. Another thing I noticed was that the default buffersize when your OCX calls FSOUND_Init is 1000ms, which is pretty high, and caused some skipping in the audio. That wouldn’t really cause any problems except for audio clearity. So, I’m unsure of what the problem could be. I don’t know if this has helped you or not, hehe. But I hope the problem gets resolved because it’s a pretty nice piece of code.
Wow!!! All I had to do was set the mixer type as FSOUND_MIXER_QUALITY_FPU!!!! It works!!!!
Before I was using auto detect. I noticed only one difference
when using FPU and INT. FPU multiplies the number of values by 4
while INT multiplies by 2. would FSOUND_MIXER_QUALITY_FPU work
on all computers?
The only thing I changed in my code was the line:
FMODInitialize 100, 44100, 16, 1 Or 2 Or 4, 2, 0, 0
FMODInitialize 100, 44100, 16, 1 Or 2 Or 4, 2, 5, 0
Try changing this and see what it does for you.
oh, and what buffersize would you recommend?
Thanks so much!!!
I looked at your OCX code but for some reason whenever I ran it VB crashed on me. Could you tell me how you would start it up properly so that I can see if Im doing it right? hehe.
I’d have to say that my favorite Radiohead song is Paranoid Android, hence the name, hehe, but some other favorites of mine are: Karma police, Polyethylene 1 & 2, Life in a glass house, Pyramid song, Idioteque, 2+2=5, A wolf at the door, and others but I dont want to list them all, hehe.
[quote:2u0k7lai] Anonymous wrote:
do you play guitar?
Do you know much about scales? Either way, would you like to take a look at a paper i’m working on… i found a cool pattern behind it and i wanna see if people know of it
- coolbeans answered 14 years ago
I’m still learning to play the guitar, but yeah I can play scales. I’ve only been playing for a couple years. What pattern? There are a few patterns I know of, A, G, E, D, and C, which are all scale forms made from those chords, then you have the major and minor pentatonic 5 note scale, and the major and minor 7 note scales.
Ok, Here it is:
Public Sub SpectrumEnable(blnValue As Boolean)
'Set up the Scope ReDim sngScopeData(0 To FSOUND_DSP_GetBufferLength) As Single lngScopeUnit = FSOUND_DSP_Create(AddressOf ScopeCallback, FSOUND_DSP_DEFAULTPRIORITY_USER + 3, 0) FSOUND_DSP_SetActive FSOUND_DSP_GetFFTUnit, blnValue FSOUND_DSP_SetActive lngScopeUnit, blnValue blnSpectrumOn = blnValue 'Reset the display SpectrumClear
‘The scope callback:
Public Function ScopeCallback(ByVal originalbuffer As Long, ByVal newbuffer As Long, ByVal length As Long, ByVal param As Long) As Long
lngScopeBuffer = newbuffer ScopeCallback = newbuffer
Public Function GetScopeFPU(ByRef Scope() As Single)
On Error Resume Next
Dim nrOfVals As Long
If UBound(Scope) > 1023 Then nrOfVals = 1024 Else nrOfVals = UBound(Scope) + 1 CopyMemory Scope(0), ByVal lngScopeBuffer, nrOfVals * 4
Dim point As PointAPI SpectrumClear True MoveToEx picSpec.hdc, 0, (picSpec.Height / 2), point picSpec.ForeColor = vbRed Call GetScopeFPU(sngScopeData) For intX = 0 To FSOUND_DSP_GetBufferLength / 16 LineTo picSpec.hdc, intX * (picSpec.ScaleWidth / (FSOUND_DSP_GetBufferLength / 16)), (picSpec.ScaleHeight / 2) + (sngScopeData(intX * 16) * (picSpec.ScaleHeight / 100000)) Next intX picSpec.Refresh
Hmm. I have the same problems.
Setting the mixer to an FPU based mixer->Everything runs fine and I can see my scope, but when I change it to an MMX based mixer it doesn’t look well at all
I have tried to add some handling in the scope callback so that if an MMX mixer is used, I put the scope data into an interger buffer instead of a single buffer, but that doesn’t works neither.
Any tips somone?
(I’m using Delphi btw.)
Thanks in advance,
Please login first to submit.