You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add more Waveform analysis examples and class documentation #26
With the addition of the Waveform analysis class (see #21 and #22) it would be nice to add another example or two with the same simply waveform visualisation but of different inputs, for example an "OscillatorWaveform" example that's parallel to the "OscillatorSpectrum' one, and also an "AudioInputWaveform" one parallel to the existing "AudioInput" one.
changed the title [-]Add more Waveform analysis examples and class documentation to processing-docs[/-][+]Add more Waveform analysis examples and class documentation[/+]on Mar 18, 2019
I'm not to familiar with the architecture of processing-docs, but is this just a case of pulling in a file Waveform.xml with the content
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>Waveform</name>
<category>Sound</category>
<subcategory>Analyzer</subcategory>
<usage>Application</usage>
<example>
<image></image>
<code><![CDATA[import processing.sound.*;SoundFile sample;Waveform waveform;int samples = 100;public void setup(){ size(640, 360); background(255); sample = new SoundFile(this, "beat.aiff"); sample.loop(); waveform = new Waveform(this, samples); waveform.input(sample);}public void draw(){ background(0); stroke(255); strokeWeight(2); noFill(); waveform.analyze(); beginShape(); for(int i = 0; i < samples; i++) { vertex( map(i, 0, samples, 0, width), map(waveform.data[i], -1, 1, 0, height) ); } endShape();}]]></code>
</example>
<description><![CDATA[ This is a Waveform analyzer. It returns the waveform of the of an audio stream the moment it is queried with the analyze() method.]]></description>
<syntax>
</syntax>
<parameters>
</parameters>
<method>
<mname>input()</mname>
<mdescription>Define the audio input for the analyzer</mdescription>
</method>
<method>
<mname>analyze()</mname>
<mdescription>Gets the content of the current audiobuffer from the input source, writes it
into this Waveform's `data` array, and returns it.</mdescription>
</method>
<method>
<mname>stop()</mname>
<mdescription>Stop the analyzer</mdescription>
</method>
<method>
<mname>data</mname>
<mdescription>`float[]` of sample amplitudes between `-1` and `1`</mdescription>
</method>
<constructor>
Waveform(<c>parent</c>)
</constructor>
<cparameter>
<clabel>parent</clabel>
<cdescription>PApplet: typically use "this"</cdescription>
</cparameter>
<returns></returns>
<related>
</related>
<availability>1.0</availability>
<type>Object</type>
<partof>Library</partof>
</root>
That looks great, thanks! Yeah this file should go into processing-docs, and then also just the Java code bit in the examples folder of this repository. I'm working on the next release of the library, so I'll make sure they are included!
Seems weird for me to have put .data in <method> tags though.
<method>
<mname>data</mname>
<mdescription>`float[]` of sample amplitudes between `-1` and `1`</mdescription>
</method>
I couldn't find another instance of a class that has documentation of a member variable / class property, not in the format of the sound library xml files that is.
Added the XML documentation with processing/processing-docs@bdd2a02, just waiting for one of the regular Processing docs rebuilds then it should be online...
Hmm not sure why the Waveform page never showed up in the docs, but anyhow the new Processing website (whose documentation is built straight from the JavaDoc instead of the XML files) should be coming out any week now, so not much point fiddling with it now. In the meantime the latest raw JavaDoc documentation for the library is available here: https://processing.github.io/processing-sound/processing/sound/Waveform.html
Activity
[-]Add more Waveform analysis examples and class documentation to processing-docs[/-][+]Add more Waveform analysis examples and class documentation[/+]mhamilt commentedon Nov 8, 2019
I'm not to familiar with the architecture of processing-docs, but is this just a case of pulling in a file
Waveform.xmlwith the contentkevinstadler commentedon Nov 15, 2019
That looks great, thanks! Yeah this file should go into
processing-docs, and then also just the Java code bit in theexamplesfolder of this repository. I'm working on the next release of the library, so I'll make sure they are included!mhamilt commentedon Nov 18, 2019
great!
Seems weird for me to have put
.datain<method>tags though.I couldn't find another instance of a class that has documentation of a member variable / class property, not in the format of the sound library xml files that is.
dhowe commentedon Apr 16, 2020
Any progress on this? I still don't see don't see any entry for Waveform in the docs or the javadocs...
see also #21
kevinstadler commentedon Apr 17, 2020
Added the XML documentation with processing/processing-docs@bdd2a02, just waiting for one of the regular Processing docs rebuilds then it should be online...
smarbos commentedon Jul 27, 2021
Why is this still missing in the documentation?
Can I help somehow?
Thanks!
kevinstadler commentedon Jul 28, 2021
Hmm not sure why the Waveform page never showed up in the docs, but anyhow the new Processing website (whose documentation is built straight from the JavaDoc instead of the XML files) should be coming out any week now, so not much point fiddling with it now. In the meantime the latest raw JavaDoc documentation for the library is available here: https://processing.github.io/processing-sound/processing/sound/Waveform.html
smarbos commentedon Jul 28, 2021
Thanks a lot @kevinstadler !!