Skip to content

Commit

Permalink
Merge pull request supercollider#92 from dotinspace/topic/fix-old-hel…
Browse files Browse the repository at this point in the history
…p-to-SCDoc

JoshUgens: help: update to SCDoc
  • Loading branch information
Nathan Ho authored Jun 13, 2016
2 parents 1b153f7 + 197191e commit ada235e
Show file tree
Hide file tree
Showing 19 changed files with 1,487 additions and 21 deletions.
82 changes: 82 additions & 0 deletions source/JoshUGens/sc/HelpSource/Classes/AtsAmp.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
TITLE:: AtsAmp
summary:: Use Amp data from a given partial
categories:: Libraries>JoshUGens, Classes, UGens>Analysis:Synthesis
related:: Classes/AtsFile, Classes/AtsFreq, Classes/AtsParInfo
keyword:: JoshUGens

DESCRIPTION::
Returns amplitude information for a given partial.
note::For resynthesis purposes, an ATS file needs to be loaded into a buffer. When loading an ATS file, you need to supply a buffer number to store ATS data in.::

CLASSMETHODS::

METHOD:: kr

ARGUMENT:: atsbuffer
link::Classes/AtsFile:: buffer number.

ARGUMENT:: partialNum
The number of the partial to return frequency data for. Partial 0 is the first partial.

ARGUMENT:: filePointer
A float between 0 and 1 pointing to location in buffer.

ARGUMENT:: mul

ARGUMENT:: add


METHOD:: ar

ARGUMENT:: atsbuffer
AtsFile buffer number.

ARGUMENT:: partialNum
The number of the partial to return frequency data for. Partial 0 is the first partial.

ARGUMENT:: filePointer
A float between 0 and 1 pointing to location in buffer.

ARGUMENT:: mul

ARGUMENT:: add



INSTANCEMETHODS::


EXAMPLES::

code::
s.boot;

a = AtsFile.new(Platform.resourceDir +/+ "sounds/a11wlk01.ats").load;

( //use freq and amp information for a filter ugen (just the first 30 partials)
{
var noise, freqs, amps, partials;
partials = Array.series(30, 1, 1);
// outputs an array of 30 freq values;
freqs = AtsFreq.kr(a.bufnum, partials, MouseX.kr(0, 1));
// outputs an array of 30 amp values
amps = AtsAmp.kr(a.bufnum, partials, MouseX.kr(0, 1));
// feed these into a reson filter, mix down to one channel
Mix.ar(Resonz.ar(WhiteNoise.ar(20), freqs, 0.01, amps));
}.play(s);
);

( //use freq and amp information for a filter ugen (just the first 30 partials)
{
var noise, freqs, amps, freqs1, amps1, partials, out;
partials = Array.series(30, 1, 1);
// outputs an array of 30 freq values;
out = AtsParInfo.kr(a.bufnum, partials, MouseX.kr(0, 1));
// need to flop the array output
#amps, freqs = out.flop;
// outputs an array of 30 amp values
// feed these into a reson filter, mix down to one channel
Mix.ar(Resonz.ar(WhiteNoise.ar(20), freqs, 0.01, amps ));
}.play(s);
);
::
34 changes: 34 additions & 0 deletions source/JoshUGens/sc/HelpSource/Classes/AtsBand.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
TITLE:: AtsBand
summary:: (put short description here)
categories:: Undocumented classes, Libraries>JoshUGens, Ugens>Undocumented, UGens>Analysis:Synthesis
related:: Classes/AtsFile
keyword:: JoshUGens

DESCRIPTION::
This class is missing documentation.


CLASSMETHODS::

METHOD:: ar

ARGUMENT:: atsbuffer
The buffer number that contains the AtsFile information.

ARGUMENT:: band

ARGUMENT:: filePointer

ARGUMENT:: mul

ARGUMENT:: add


INSTANCEMETHODS::


EXAMPLES::

code::
(some example code)
::
234 changes: 234 additions & 0 deletions source/JoshUGens/sc/HelpSource/Classes/AtsFile.schelp
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
TITLE:: AtsFile
summary:: For working with ATS file data
categories:: Libraries>JoshUGens, Classes
related:: Classes/AtsAmp, Classes/AtsFreq, Classes/AtsParInfo
keyword:: JoshUGens

DESCRIPTION::
ATS (Analysis-Transformation-Synthesis) files are analysis files created using Oscar DeLiscia, Juan Pampin and Pete Moss's atsa command-line analysis tool (available at http://www.dxarts.washington.edu/ats). The analysis of the sound first attemps to track and record frequency data into sinusoidal partials. Then, any sound that couldn't be analyzed into partial information is analyzed as noise information. The information can then be tranformed and resynthesized using this information.

Once installed, type atsa at the command line to see flag options and usage.

An example from within the SuperCollider_f directory:

teletype::
atsa sounds/a11wlk01.wav sounds/a11wlk01.ats -H5000
::

-H5000 limits the analysis to frequencies below 5kHz.


CLASSMETHODS::

METHOD:: new
Load an ATS file into memory at path with buffer number bufnum. server defaults to Server.default.

ARGUMENT:: path
Path to the ats file.

ARGUMENT:: server
Server.


METHOD:: load
Loads the information of the ATS file into a buffer for use by the AtsSynth UGens. If buffer is nil, one will be allocated for you. Only for real-time usage.

ARGUMENT:: path

ARGUMENT:: server


INSTANCEMETHODS::

METHOD:: data


METHOD:: load
Loads the information of the ATS file into a buffer for use by the AtsSynth UGens. If buffer is nil, one will be allocated for you. Only for real-time usage.

ARGUMENT:: buffer
Buffer to use for loading the ATS file.


METHOD:: frameSize


METHOD:: saveForSC
Save the ATS file as an AIFF that can be loaded into a buffer (for NRT and fast loading file data in real-time)

ARGUMENT:: path
Path to the saved file.


METHOD:: save

ARGUMENT:: path


METHOD:: readData


METHOD:: freqMax


METHOD:: removeZeroFreqs


METHOD:: freeBuffer
Releases the ATS buffer.

METHOD:: getBandNoi


ARGUMENT:: band




METHOD:: asControlInput




METHOD:: path




METHOD:: init


ARGUMENT:: argpath


ARGUMENT:: argserver




METHOD:: getParTime


ARGUMENT:: par



METHOD:: getParFreq


ARGUMENT:: par


returns:: An array of frequencies of partial number par (starting with 0) per frame of analysis.

METHOD:: ampMax



METHOD:: header



METHOD:: sndDur



METHOD:: getFrameAmp


ARGUMENT:: frame


returns:: An array of amps for a given frame (starting with 0).

METHOD:: getParPhase


ARGUMENT:: par



METHOD:: getParAmp


ARGUMENT:: par
Partial number.


returns:: An array of amplitudes of partial number par (starting with 0) per frame of analysis.

METHOD:: getFramePhase


ARGUMENT:: frame



METHOD:: winSize



METHOD:: checkMN



METHOD:: getFrameNoi


ARGUMENT:: frame



METHOD:: numPartials



METHOD:: buffer



METHOD:: asUGenInput



METHOD:: atsType



METHOD:: numFrames



METHOD:: bufnum



METHOD:: sr



METHOD:: readHeader



METHOD:: loadToBuffer


ARGUMENT:: buffer



METHOD:: getFrameFreq


ARGUMENT:: frame
Frame number.

returns:: An array of frequencies for a given frame (starting with 0).


EXAMPLES::

code::
a = AtsFile.new("path/to/ats/file");
::
Loading

0 comments on commit ada235e

Please sign in to comment.