Mac OS Accelerate in Shell

I have an XOJO program which uses the Discrete Cosine Transform (simple FFT for real samples), which I have coded in XOJO. Now I want to convert my program to employ the MAC built-in processor Transform(s) contained in the Accelerate Framework. Does anyone know how to access the functions in Accelerate from XOJO? I have tried using a Shell, but I am having difficulty accessing the advanced Accelerate functions, like “vDSP.DCT” for setup and the transform. I would appreciate any guidance. I have Adminstrator privileges. Thank you.

No Shell necessary. You should use declares on Memoryblocks. I have an old implementation of Accelerate somewhere; will search it and send you some pieces.

Here’s a WeTransfer link valid one week where I put an early, unfinished project into. I guess it will have some similarities to what you go for and also includes an updated version of Roger Meier’s DataPlot classes that takes a MemoryBlock instead of an array of doubles as input.
MemoryBlock because all Accelerate Functions are designed to run on simple C arrays which translate to Memoryblocks in Xojo. You’ll find some other macOS declares as well.
To fill a memory block with a specified double value, you’ll find in AccelerateAddition

Public Sub FillWithDouble(extends mb as MemoryBlock, FillValue as double, count as uinteger = 0, stride as integer = 1)
  
  #If TargetMacOS
    If count = 0 Then count = mb.Size / 8
    Dim s As Double = fillvalue
    vDSP_vfillD(s, mb, stride, count)
  #Else
    #Pragma Unused mb
    #Pragma Unused Startvalue
    #Pragma Unused increment
  #EndIf
End Sub

And a lot of other methods, including FFT, are available too. For detailed usage refer to Apple’s docs. Let me know if you find issues (Like this one having wrong ignore pragmas, as I see now :D) or need more help. And yes, you could extend the Platform pragma to include iOS as well.

Thanks, Ulrich, for the example code and the link to WeTransfer and Data Plot, which I will investigate. I will be very happy if my XOJO app can access the Accelerate functions directly as you suggest. The memory Block makes sense, too. In the meantime, please don’t hold your breath! Thanks again.