# Creating an Oscilloscope in C#

**URL:** <https://qa.fmod.com/t/creating-an-oscilloscope-in-c/21501>\
**Category:** FMOD Engine\
**Tags:** csharp\
**Created:** [April 15, 2024, 7:37pm UTC](https://qa.fmod.com/t/creating-an-oscilloscope-in-c/21501 "2024-04-15T19:37:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PianoBoy](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@PianoBoy](https://qa.fmod.com/u/PianoBoy)\
**Post date:** [April 15, 2024, 7:37pm UTC](https://qa.fmod.com/t/creating-an-oscilloscope-in-c/21501/1 "2024-04-15T19:37:49Z")

</div>

I’ve been wanting to create an oscilloscope by getting spectrum data from the FFT dsp, although I’m not sure if that’s possible or not. I can’t use Unity for this and I can’t use any external software or equipment, just Visual Studio, FMOD, and whatever libraries are available to use.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [April 17, 2024, 5:09am UTC](https://qa.fmod.com/t/creating-an-oscilloscope-in-c/21501/2 "2024-04-17T05:09:03Z")

</div>

I can’t help on you the rendering part of an Oscilloscope, but FMOD should be able to give you access to info that you need regarding an audio signal.

If it’s purely the waveform display that you want for an oscilloscope, then all you’ll need to do is grab the sample data from the FMOD System as it plays. While it is a Unity example, I would recommend taking a look at our [DSP Capture scripting example](https://www.fmod.com/docs/2.02/unity/examples-dsp-capture.html), which shows how to retrieve sample data from a DSP using DSP\_READ\_CALLBACK.

As for spectral data from the FFT DSP, our Unity [Spectrum Analysis scripting example](https://www.fmod.com/docs/2.02/unity/examples-spectrum-analysis.html) shows how to create an FFT DSP, place it on a ChannelGroup belonging to a bus, and then retrieve the FFT data from the DSP.

If you’re not using the Studio API, just the Core API, the process for the above is largely the same - you simply don’t need to navigate to the Core API objects via the Studio API.

Apart from this, you’re unsure on the process of creating and initializing an FMOD System in general, I would recommend taking a look at the Studio/Core API (depending on which you’re using) examples included with the [FMOD Engine installer](https://www.fmod.com/download#fmodengine) at `./api/core/examples` and `./api/studio/examples`. If you’re unfamiliar with C++, you can approximately read it using the following guidelines:

- Ignore any `*`
- Replace `&` with `out`
- Replace `::` or `->` with a `.` operator
- Replace `nullptr` with `IntPtr.Zero`

The [Studio API Guide](https://www.fmod.com/docs/2.02/api/studio-guide.html) is also a helpful resource for any general interaction with the FMOD System.

---

<div class="post-metadata">

**Author:** ![PianoBoy](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@PianoBoy](https://qa.fmod.com/u/PianoBoy)\
**Post date:** [April 18, 2024, 6:21pm UTC](https://qa.fmod.com/t/creating-an-oscilloscope-in-c/21501/3 "2024-04-18T18:21:28Z")

</div>

Thank you so much! I think the read callback thing is what I’m looking for. I’m having trouble figuring out understanding the scripting example. This is what I have right now:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/8/86221e90e8c2555edfc0d9c641fd403f4ab7375e.png)  
I wasn’t able to use all of the first method from the scripting example because I couldn’t find a reference to ScriptUsageDspCapture.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/190ca877d73e2414656231fd1ab9c54b322466cf.png)

---

<div class="post-metadata">

**Author:** ![PianoBoy](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@PianoBoy](https://qa.fmod.com/u/PianoBoy)\
**Post date:** [April 18, 2024, 6:33pm UTC](https://qa.fmod.com/t/creating-an-oscilloscope-in-c/21501/4 "2024-04-18T18:33:04Z")

</div>

Nevermind, I feel quite embarrassed now 😅

---

<div class="post-metadata">

**Author:** ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)\
**Post date:** [April 19, 2024, 12:55am UTC](https://qa.fmod.com/t/creating-an-oscilloscope-in-c/21501/5 "2024-04-19T00:55:25Z")

</div>

No problem, happy to hear that you figured it out.
