# How to draw input signal's waveforms?

**URL:** <https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665>\
**Category:** General JUCE discussion\
**Created:** [May 31, 2019, 7:11am UTC](https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665 "2019-05-31T07:11:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![caoleiwe](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@caoleiwe](https://forum.juce.com/u/caoleiwe)\
**Post date:** [May 31, 2019, 7:11am UTC](https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665/1 "2019-05-31T07:11:29Z")

</div>

Hi,

The tutorial: “Tutorial: Draw audio waveforms” teach me how to draw waveforms of sound files.  
How could draw waveforms of input signal from input channel in real time?

---

<div class="post-metadata">

**Author:** ![PluginPenguin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pluginpenguin/32/10203_2.png) [@PluginPenguin](https://forum.juce.com/u/PluginPenguin)\
**Post date:** [May 31, 2019, 7:59am UTC](https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665/2 "2019-05-31T07:59:04Z")

</div>

Are you thinking of a continuously growing coarse Waveform like you see in most DAWs while recording a track or of something like an oscilloscope? In any case, drawing realtime data needs some work to make sure that the realtime thread is never locked up by drawing actions. There is a simple [AudioVisualizerComponent](https://docs.juce.com/master/classAudioVisualiserComponent.html), but for an oscilloscope there is nothing coming with JUCE that does all this out of the box, however multiple people out there have solved this task and have published their solutions.

If you need an oscilloscope type and you are not targeting a plugin but a standalone application you might find [this juce module](https://github.com/JanosGit/OpenGLRealtimeVisualization4JUCE) which I published under a MIT license helpful, it contains an oscilloscope and spectral analyzer component, both accelerated by the GPU with the help of OpenGL under the hood. However, there might be more straightforward, simpler solutions available out there.

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [May 31, 2019, 8:32am UTC](https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665/3 "2019-05-31T08:32:40Z")

</div>

> [@PluginPenguin](#):
>
> There is nothing coming with JUCE that does all this out of the box

There is AudioVisualiserComponent in the current version of Juce, which can be used to display a scrolling waveform.

---

<div class="post-metadata">

**Author:** ![PluginPenguin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pluginpenguin/32/10203_2.png) [@PluginPenguin](https://forum.juce.com/u/PluginPenguin)\
**Post date:** [May 31, 2019, 8:36am UTC](https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665/4 "2019-05-31T08:36:13Z")

</div>

Oh good point, you are right. I was thinking of an oscilloscope when I wrote those lines – I will edit my post…

---

<div class="post-metadata">

**Author:** ![xenakios](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/xenakios/32/4047_2.png) [@xenakios](https://forum.juce.com/u/xenakios)\
**Post date:** [May 31, 2019, 8:38am UTC](https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665/5 "2019-05-31T08:38:36Z")

</div>

AudioThumbNail also works by adding audio buffers into it instead of setting it to use an audio file. It can get tricky to get a visually pleasing result that way, though…There may also be thread safety/memory allocation issues with it if you insert the data into it from the audio thread.

---

<div class="post-metadata">

**Author:** ![caoleiwe](https://avatars.discourse-cdn.com/v4/letter/c/cab0a1/32.png) [@caoleiwe](https://forum.juce.com/u/caoleiwe)\
**Post date:** [June 3, 2019, 3:03am UTC](https://forum.juce.com/t/how-to-draw-input-signals-waveforms/33665/6 "2019-06-03T03:03:18Z")

</div>

Thank you!  
Furthrer, I want to know how to draw a signal’s Spectrogram.Should I apply a FFT on that signal first? Then, what is the next?  
@PluginPenguin
