Browse Source

Add protoplug

master
falkTX 10 years ago
parent
commit
aed02c1b70
100 changed files with 20942 additions and 0 deletions
  1. +3
    -0
      Makefile
  2. +8
    -0
      ports/Makefile
  3. +24
    -0
      ports/protoplug/LV2-fx/premake.lua
  4. +24
    -0
      ports/protoplug/LV2-gen/premake.lua
  5. +469
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.AffineTransform.html
  6. +389
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.AudioFormatReader.html
  7. +381
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Colour.html
  8. +371
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.ColourGradient.html
  9. +249
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Component.html
  10. +315
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.FillType.html
  11. +203
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Font.html
  12. +2220
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Graphics.html
  13. +260
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Image.html
  14. +214
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Justification.html
  15. +180
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.LagrangeInterpolator.html
  16. +284
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Line.html
  17. +2076
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Path.html
  18. +226
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Point.html
  19. +194
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.RectanglePlacement.html
  20. +386
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Rectangle_float.html
  21. +386
    -0
      ports/protoplug/ProtoplugFiles/doc/classes/juce.Rectangle_int.html
  22. +168
    -0
      ports/protoplug/ProtoplugFiles/doc/examples/classic-filter.lua.html
  23. +142
    -0
      ports/protoplug/ProtoplugFiles/doc/examples/midi-chordify.lua.html
  24. +138
    -0
      ports/protoplug/ProtoplugFiles/doc/examples/sine-organ.lua.html
  25. +140
    -0
      ports/protoplug/ProtoplugFiles/doc/examples/sinemouse-demo.lua.html
  26. +132
    -0
      ports/protoplug/ProtoplugFiles/doc/examples/soundfile-test.lua.html
  27. +212
    -0
      ports/protoplug/ProtoplugFiles/doc/index.html
  28. +333
    -0
      ports/protoplug/ProtoplugFiles/doc/ldoc.css
  29. +677
    -0
      ports/protoplug/ProtoplugFiles/doc/modules/gui.html
  30. +865
    -0
      ports/protoplug/ProtoplugFiles/doc/modules/midi.html
  31. +792
    -0
      ports/protoplug/ProtoplugFiles/doc/modules/plugin.html
  32. +378
    -0
      ports/protoplug/ProtoplugFiles/doc/modules/polyGen.html
  33. +304
    -0
      ports/protoplug/ProtoplugFiles/doc/modules/script.html
  34. +204
    -0
      ports/protoplug/ProtoplugFiles/doc/modules/stereoFx.html
  35. BIN
      ports/protoplug/ProtoplugFiles/doc/osar-121.png
  36. +3
    -0
      ports/protoplug/ProtoplugFiles/doc/src/build protoplug docs.bat
  37. +77
    -0
      ports/protoplug/ProtoplugFiles/doc/src/config.ld
  38. +333
    -0
      ports/protoplug/ProtoplugFiles/doc/src/ldoc.css
  39. +340
    -0
      ports/protoplug/ProtoplugFiles/doc/src/ldoc.ltp
  40. +74
    -0
      ports/protoplug/ProtoplugFiles/effects/classic-filter.lua
  41. +3
    -0
      ports/protoplug/ProtoplugFiles/effects/default.lua
  42. +59
    -0
      ports/protoplug/ProtoplugFiles/effects/delay line.lua
  43. +37
    -0
      ports/protoplug/ProtoplugFiles/effects/distortion - power.lua
  44. +189
    -0
      ports/protoplug/ProtoplugFiles/effects/pitch distort.lua
  45. +157
    -0
      ports/protoplug/ProtoplugFiles/effects/pitch shift - bernsee algo.lua
  46. +135
    -0
      ports/protoplug/ProtoplugFiles/effects/spectral filter.lua
  47. +3
    -0
      ports/protoplug/ProtoplugFiles/generators/default.lua
  48. +111
    -0
      ports/protoplug/ProtoplugFiles/generators/fft sweeper.lua
  49. +61
    -0
      ports/protoplug/ProtoplugFiles/generators/midi nonstop atonal V.lua
  50. +49
    -0
      ports/protoplug/ProtoplugFiles/generators/midi-chordify.lua
  51. +45
    -0
      ports/protoplug/ProtoplugFiles/generators/sine-organ.lua
  52. +47
    -0
      ports/protoplug/ProtoplugFiles/generators/sinemouse-demo.lua
  53. +39
    -0
      ports/protoplug/ProtoplugFiles/generators/soundfile-test.lua
  54. +88
    -0
      ports/protoplug/ProtoplugFiles/include/Pickle.lua
  55. +268
    -0
      ports/protoplug/ProtoplugFiles/include/core/gui.lua
  56. +162
    -0
      ports/protoplug/ProtoplugFiles/include/core/manageparams.lua
  57. +379
    -0
      ports/protoplug/ProtoplugFiles/include/core/midi.lua
  58. +273
    -0
      ports/protoplug/ProtoplugFiles/include/core/plugin.lua
  59. +177
    -0
      ports/protoplug/ProtoplugFiles/include/core/polygen.lua
  60. +136
    -0
      ports/protoplug/ProtoplugFiles/include/core/script.lua
  61. +69
    -0
      ports/protoplug/ProtoplugFiles/include/core/stereofx.lua
  62. +250
    -0
      ports/protoplug/ProtoplugFiles/include/iluaembed.lua
  63. +29
    -0
      ports/protoplug/ProtoplugFiles/include/luautil.lua
  64. +111
    -0
      ports/protoplug/ProtoplugFiles/include/pac/cookbook filters float.lua
  65. +108
    -0
      ports/protoplug/ProtoplugFiles/include/pac/cookbook filters.lua
  66. +38
    -0
      ports/protoplug/ProtoplugFiles/include/pac/delay line.lua
  67. +259
    -0
      ports/protoplug/ProtoplugFiles/include/pac/freqgraph.lua
  68. +65
    -0
      ports/protoplug/ProtoplugFiles/include/pac/harmograph.lua
  69. +31
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce.lua
  70. +120
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/affinetransform.lua
  71. +147
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/audioformatreader.lua
  72. +247
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/cdef/graphics.h
  73. +163
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/cdef/path.h
  74. +133
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/cdef/typedefs.h
  75. +70
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/colour.lua
  76. +101
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/colourgradient.lua
  77. +73
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/component.lua
  78. +74
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/filltype.lua
  79. +43
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/font.lua
  80. +140
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/generate memo.txt
  81. +777
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/graphics.lua
  82. +74
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/image.lua
  83. +26
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/justification.lua
  84. +41
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/lagrangeinterpolator.lua
  85. +50
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/line.lua
  86. +586
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/path.lua
  87. +37
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/point.lua
  88. +89
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/rectangle_float.lua
  89. +89
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/rectangle_int.lua
  90. +22
    -0
      ports/protoplug/ProtoplugFiles/include/protojuce/rectangleplacement.lua
  91. +19
    -0
      ports/protoplug/ProtoplugFiles/include/protoplug.lua
  92. +38
    -0
      ports/protoplug/ProtoplugFiles/prefs.default.xml
  93. +22
    -0
      ports/protoplug/ProtoplugFiles/themes/SciTE black mod.xml
  94. +21
    -0
      ports/protoplug/ProtoplugFiles/themes/juce default.xml
  95. +22
    -0
      ports/protoplug/ProtoplugFiles/themes/npp blackboard.xml
  96. +22
    -0
      ports/protoplug/ProtoplugFiles/themes/npp default.xml
  97. +22
    -0
      ports/protoplug/ProtoplugFiles/themes/npp hello kitty.xml
  98. +22
    -0
      ports/protoplug/ProtoplugFiles/themes/npp mono industrial.xml
  99. +71
    -0
      ports/protoplug/Source/BinaryData.cpp
  100. +29
    -0
      ports/protoplug/Source/BinaryData.h

+ 3
- 0
Makefile View File

@@ -38,6 +38,9 @@ ifneq (,$(wildcard $(CURDIR)/bin/vst/cabbage-Additive.so))
cp -r bin/vst/* $(DESTDIR)$(PREFIX)/lib/vst/ cp -r bin/vst/* $(DESTDIR)$(PREFIX)/lib/vst/
endif endif


# install protoplug files
cp -r ports/protoplug/ProtoplugFiles $(DESTDIR)$(PREFIX)/share/

# ----------------------------------------- # -----------------------------------------
# clean # clean




+ 8
- 0
ports/Makefile View File

@@ -14,6 +14,8 @@ lv2:
$(MAKE) -C cabbage/LV2-fx $(MAKE) -C cabbage/LV2-fx
$(MAKE) -C cabbage/LV2-ins $(MAKE) -C cabbage/LV2-ins
$(MAKE) -C cabbage/LV2-midi $(MAKE) -C cabbage/LV2-midi
$(MAKE) -C protoplug/LV2-fx
$(MAKE) -C protoplug/LV2-gen


# ----------------------------------------- # -----------------------------------------
# vst # vst
@@ -24,6 +26,8 @@ vst:
$(MAKE) -C cabbage/VST-fx $(MAKE) -C cabbage/VST-fx
$(MAKE) -C cabbage/VST-ins $(MAKE) -C cabbage/VST-ins
$(MAKE) -C cabbage/VST-midi $(MAKE) -C cabbage/VST-midi
$(MAKE) -C protoplug/VST-fx
$(MAKE) -C protoplug/VST-gen


# ----------------------------------------- # -----------------------------------------
# clean # clean
@@ -34,12 +38,16 @@ clean:
$(MAKE) clean -C cabbage/LV2-fx $(MAKE) clean -C cabbage/LV2-fx
$(MAKE) clean -C cabbage/LV2-ins $(MAKE) clean -C cabbage/LV2-ins
$(MAKE) clean -C cabbage/LV2-midi $(MAKE) clean -C cabbage/LV2-midi
$(MAKE) clean -C protoplug/LV2-fx
$(MAKE) clean -C protoplug/LV2-gen


# VST # VST
$(MAKE) clean -C argotlunar/VST $(MAKE) clean -C argotlunar/VST
$(MAKE) clean -C cabbage/VST-fx $(MAKE) clean -C cabbage/VST-fx
$(MAKE) clean -C cabbage/VST-ins $(MAKE) clean -C cabbage/VST-ins
$(MAKE) clean -C cabbage/VST-midi $(MAKE) clean -C cabbage/VST-midi
$(MAKE) clean -C protoplug/VST-fx
$(MAKE) clean -C protoplug/VST-gen


rm -rf */LV2/intermediate rm -rf */LV2/intermediate
rm -rf */VST/intermediate rm -rf */VST/intermediate


+ 24
- 0
ports/protoplug/LV2-fx/premake.lua View File

@@ -0,0 +1,24 @@
dofile("../../../scripts/make-project.lua")
package = make_juce_lv2_project("protoplug-fx")
package.defines = {
package.defines,
"PROTOPLUGFX=1"
}
package.includepaths = {
package.includepaths,
"../Source",
"../JuceLibraryCode"
}
package.files = {
matchfiles (
"../Source/*.cpp",
"../Source/guiclasses/*.cpp",
"../Source/vflib/*.cpp",
"../../../libs/juce-plugin/JucePluginMain.cpp"
)
}

+ 24
- 0
ports/protoplug/LV2-gen/premake.lua View File

@@ -0,0 +1,24 @@
dofile("../../../scripts/make-project.lua")
package = make_juce_lv2_project("protoplug-gen")
package.defines = {
package.defines,
"PROTOPLUGFX=0"
}
package.includepaths = {
package.includepaths,
"../Source",
"../JuceLibraryCode"
}
package.files = {
matchfiles (
"../Source/*.cpp",
"../Source/guiclasses/*.cpp",
"../Source/vflib/*.cpp",
"../../../libs/juce-plugin/JucePluginMain.cpp"
)
}

+ 469
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.AffineTransform.html View File

@@ -0,0 +1,469 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.AffineTransform</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Fields">Fields</a></li>
<li><a href="#Predefined_values">Predefined values</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><strong>juce.AffineTransform</strong></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.AffineTransform</code></h1>
<p>A geometric transformation.</p>
<p>

<p> Is converted to a <a href="http://www.juce.com/api/classAffineTransform.html">JUCE AffineTransform</a>.</p>

<p> The default constructor makes an <a href="../classes/juce.AffineTransform.html#juce.AffineTransform.identity">identity</a> transform, so all kinds of
transformations can be created as follows :</p>
<pre><code>rot180 = juce.AffineTransform():rotated(math.pi)
chainey = juce.AffineTransform():scaled(2.5):translated(140,140)
</code></pre>
</p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.AffineTransform"><span class="proto_prefix">juce</span>.AffineTransform (mat00, mat01, mat02, mat10, mat11, mat12)</a></td>
<td class="summary">Constuctor.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform:translated"><span class="proto_prefix">juce.AffineTransform</span>:translated (dx, dy)</a></td>
<td class="summary">Translated.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform:rotated"><span class="proto_prefix">juce.AffineTransform</span>:rotated (rad)</a></td>
<td class="summary">Rotated.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform:scaled"><span class="proto_prefix">juce.AffineTransform</span>:scaled (scaleX[, scaleY=scaleX])</a></td>
<td class="summary">Scaled.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform:followedBy"><span class="proto_prefix">juce.AffineTransform</span>:followedBy (other)</a></td>
<td class="summary">Followed by.</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.mat00"><span class="proto_prefix">juce.AffineTransform</span>.mat00</a></td>
<td class="summary">Matrix [0] [0]</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.mat01"><span class="proto_prefix">juce.AffineTransform</span>.mat01</a></td>
<td class="summary">Matrix [0] [1]</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.mat02"><span class="proto_prefix">juce.AffineTransform</span>.mat02</a></td>
<td class="summary">Matrix [0] [2]</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.mat10"><span class="proto_prefix">juce.AffineTransform</span>.mat10</a></td>
<td class="summary">Matrix [1] [0]</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.mat11"><span class="proto_prefix">juce.AffineTransform</span>.mat11</a></td>
<td class="summary">Matrix [1] [1]</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.mat12"><span class="proto_prefix">juce.AffineTransform</span>.mat12</a></td>
<td class="summary">Matrix [1] [2]</td>
</tr>
</table>
<h2><a href="#Predefined_values">Predefined values</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.AffineTransform.identity"><span class="proto_prefix">juce.AffineTransform</span>.identity</a></td>
<td class="summary">Identity.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.AffineTransform.AffineTransform"></a>
<strong><span class="proto_prefix">juce</span>.AffineTransform (mat00, mat01, mat02, mat10, mat11, mat12)</strong>
</dt>
<dd>

<p>Constuctor.
parameters thusly define a transformation matrix :</p>

<pre><code>(mat00 mat01 mat02)
(mat10 mat11 mat12)
(0 0 1)
</code></pre>


</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">mat00</span>



</li>
<li><span class="parameter">mat01</span>



</li>
<li><span class="parameter">mat02</span>



</li>
<li><span class="parameter">mat10</span>



</li>
<li><span class="parameter">mat11</span>



</li>
<li><span class="parameter">mat12</span>



</li>
</ul>





</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.AffineTransform:translated"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>:translated (dx, dy)</strong>
</dt>
<dd>
Translated.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">dx</span>
the horizontal offset
</li>
<li><span class="parameter">dy</span>
the vertical offset
</li>
</ul>

<h3>Returns:</h3>
<ol>

a translated version of this transform
</ol>




</dd>
<dt>
<a name = "juce.AffineTransform:rotated"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>:rotated (rad)</strong>
</dt>
<dd>
Rotated.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rad</span>
the degree of rotation in radians
</li>
</ul>

<h3>Returns:</h3>
<ol>

a rotated version of this transform
</ol>




</dd>
<dt>
<a name = "juce.AffineTransform:scaled"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>:scaled (scaleX[, scaleY=scaleX])</strong>
</dt>
<dd>
Scaled.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">scaleX</span>



</li>
<li><span class="parameter">scaleY</span>



(<em>default</em> scaleX)
</li>
</ul>

<h3>Returns:</h3>
<ol>

a scaled version of this transform
</ol>




</dd>
<dt>
<a name = "juce.AffineTransform:followedBy"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>:followedBy (other)</strong>
</dt>
<dd>
Followed by.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">other</span>



</li>
</ul>

<h3>Returns:</h3>
<ol>

a version of this transform followed by another
</ol>




</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "juce.AffineTransform.mat00"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>.mat00</strong>
</dt>
<dd>
Matrix [0] [0]

</ul>






</dd>
<dt>
<a name = "juce.AffineTransform.mat01"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>.mat01</strong>
</dt>
<dd>
Matrix [0] [1]

</ul>






</dd>
<dt>
<a name = "juce.AffineTransform.mat02"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>.mat02</strong>
</dt>
<dd>
Matrix [0] [2]

</ul>






</dd>
<dt>
<a name = "juce.AffineTransform.mat10"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>.mat10</strong>
</dt>
<dd>
Matrix [1] [0]

</ul>






</dd>
<dt>
<a name = "juce.AffineTransform.mat11"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>.mat11</strong>
</dt>
<dd>
Matrix [1] [1]

</ul>






</dd>
<dt>
<a name = "juce.AffineTransform.mat12"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>.mat12</strong>
</dt>
<dd>
Matrix [1] [2]

</ul>






</dd>
</dl>
<h2><a name="Predefined_values"></a>Predefined values</h2>
<dl class="function">
<dt>
<a name = "juce.AffineTransform.identity"></a>
<strong><span class="proto_prefix">juce.AffineTransform</span>.identity</strong>
</dt>
<dd>
Identity.
The non-transform.

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 389
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.AudioFormatReader.html View File

@@ -0,0 +1,389 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.AudioFormatReader</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><strong>juce.AudioFormatReader</strong></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.AudioFormatReader</code></h1>
<p>Class to read audio files.</p>
<p> Example usage: <a href="../examples/soundfile-test.lua.html#">soundfile-test.lua</a>.</p>

<p> Reads the formats that JUCE supports, namely: WAV, AIFF, Flac, Ogg-Vorbis, Windows Media codecs,
CoreAudio codecs, MP3. </p>

<p> Is a pointer to a <a href="http://www.juce.com/api/classAudioFormatReader.html">JUCE AudioFormatReader</a>,
and wraps some <a href="http://www.juce.com/api/classAudioFormatManager.html">AudioFormatManager</a>
functionality. </p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader.AudioFormatReader"><span class="proto_prefix">juce</span>.AudioFormatReader (filename)</a></td>
<td class="summary">Load a sound file as an AudioFormatReader.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader:read"><span class="wrapman"><span class="proto_prefix">juce.AudioFormatReader</span>:read<br> (destSamples, numDestChannels, startSampleInSource, numSamplesToRead[, fillLeftoverChannelsWithCopies=true])</span></a></td>
<td class="summary">Read samples.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader:readToFloat"><span class="proto_prefix">juce.AudioFormatReader</span>:readToFloat<br> ([nChannels=2[, resample=true]])</a></td>
<td class="summary">Read entire wave to float array.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader:readToDouble"><span class="proto_prefix">juce.AudioFormatReader</span>:readToDouble<br> ([nChannels=2[, resample=true]])</a></td>
<td class="summary">Read entire wave to double array.</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader.sampleRate"><span class="proto_prefix">juce.AudioFormatReader</span>.sampleRate</a></td>
<td class="summary">Sample rate</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader.bitsPerSample"><span class="proto_prefix">juce.AudioFormatReader</span>.bitsPerSample</a></td>
<td class="summary">Bits per sample</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader.lengthInSamples"><span class="proto_prefix">juce.AudioFormatReader</span>.lengthInSamples</a></td>
<td class="summary">Length in samples</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader.numChannels"><span class="proto_prefix">juce.AudioFormatReader</span>.numChannels</a></td>
<td class="summary">Number of channels</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.AudioFormatReader.usesFloatingPointData"><span class="proto_prefix">juce.AudioFormatReader</span>.usesFloatingPointData</a></td>
<td class="summary">Uses floating point data (boolean)</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.AudioFormatReader.AudioFormatReader"></a>
<strong><span class="proto_prefix">juce</span>.AudioFormatReader (filename)</strong>
</dt>
<dd>
Load a sound file as an AudioFormatReader.
The path can be absolute or relative to the protoplug directory.
Returns <code>nil</code> if unsuccessful. The file will remain open until the
AudioFormatReader is unset or otherwise garbage-collected.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">filename</span>



</li>
</ul>





</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.AudioFormatReader:read"></a>
<strong><span class="wrapman"><span class="proto_prefix">juce.AudioFormatReader</span>:read<br> (destSamples, numDestChannels, startSampleInSource, numSamplesToRead[, fillLeftoverChannelsWithCopies=true])</span></strong>
</dt>
<dd>
Read samples. <br/>
Copies a number of samples from the file into the provided array.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">destSamples</span>
a cdata array of pointers to buffers for each channel (<code>int * const *</code>)
</li>
<li><span class="parameter">numDestChannels</span>
the number of elements in <code>destSamples</code>
</li>
<li><span class="parameter">startSampleInSource</span>



</li>
<li><span class="parameter">numSamplesToRead</span>



</li>
<li><span class="parameter">fillLeftoverChannelsWithCopies</span>
<span class="types"><span class="type">boolean</span></span>
used if <code>destSamples</code> has more channels than the source.
(<em>default</em> true)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
success
</ol>




</dd>
<dt>
<a name = "juce.AudioFormatReader:readToFloat"></a>
<strong><span class="proto_prefix">juce.AudioFormatReader</span>:readToFloat<br> ([nChannels=2[, resample=true]])</strong>
</dt>
<dd>
Read entire wave to float array. <br/>
A simplified wrapper function for <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader:read">read</a>

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">nChannels</span>
number of channels to be returned
(<em>default</em> 2)
</li>
<li><span class="parameter">resample</span>
whether to perform samplerate conversion to match the host's sample rate.
If <code>true</code>, the length of the returned array may not be the wave's original <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader.lengthInSamples">lengthInSamples</a> .
It will be given by the second returned value.
(<em>default</em> true)
</li>
</ul>

<h3>Returns:</h3>
<ol>
<li>
a two-dimensional cdata array of channels containing samples (<code>float [nChannels][nSamples]</code>)</li>
<li>
the number of samples in each channel of the returned array</li>
</ol>




</dd>
<dt>
<a name = "juce.AudioFormatReader:readToDouble"></a>
<strong><span class="proto_prefix">juce.AudioFormatReader</span>:readToDouble<br> ([nChannels=2[, resample=true]])</strong>
</dt>
<dd>
Read entire wave to double array. <br/>
This wraps <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader:readToFloat">readToFloat</a> and returns an array containing <code>double</code>-precision numbers.
This takes twice as much space, but it may be faster to use, as this is the native Lua type.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">nChannels</span>
number of channels to be returned
(<em>default</em> 2)
</li>
<li><span class="parameter">resample</span>
whether to perform samplerate conversion to match the host's sample rate.
If <code>true</code>, the length of the returned array may not be the wave's original <a href="../classes/juce.AudioFormatReader.html#juce.AudioFormatReader.lengthInSamples">lengthInSamples</a> .
It will be given by the second returned value.
(<em>default</em> true)
</li>
</ul>

<h3>Returns:</h3>
<ol>
<li>
a two-dimensional cdata array of channels containing samples (<code>double [nChannels][nSamples]</code>)</li>
<li>
the number of samples in each channel of the returned array</li>
</ol>




</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "juce.AudioFormatReader.sampleRate"></a>
<strong><span class="proto_prefix">juce.AudioFormatReader</span>.sampleRate</strong>
</dt>
<dd>
Sample rate

</ul>






</dd>
<dt>
<a name = "juce.AudioFormatReader.bitsPerSample"></a>
<strong><span class="proto_prefix">juce.AudioFormatReader</span>.bitsPerSample</strong>
</dt>
<dd>
Bits per sample

</ul>






</dd>
<dt>
<a name = "juce.AudioFormatReader.lengthInSamples"></a>
<strong><span class="proto_prefix">juce.AudioFormatReader</span>.lengthInSamples</strong>
</dt>
<dd>
Length in samples

</ul>






</dd>
<dt>
<a name = "juce.AudioFormatReader.numChannels"></a>
<strong><span class="proto_prefix">juce.AudioFormatReader</span>.numChannels</strong>
</dt>
<dd>
Number of channels

</ul>






</dd>
<dt>
<a name = "juce.AudioFormatReader.usesFloatingPointData"></a>
<strong><span class="proto_prefix">juce.AudioFormatReader</span>.usesFloatingPointData</strong>
</dt>
<dd>
Uses floating point data (boolean)

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 381
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Colour.html View File

@@ -0,0 +1,381 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Colour</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Fields">Fields</a></li>
<li><a href="#Predefined_values">Predefined values</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><strong>juce.Colour</strong></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Colour</code></h1>
<p>A simple colour class.</p>
<p> Is converted to a <a href="http://www.juce.com/api/classColour.html">JUCE Colour</a></p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Colour.Colour"><span class="proto_prefix">juce</span>.Colour (r, g, b[, a])</a></td>
<td class="summary">Constuctor with classical arguments.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.Colour"><span class="proto_prefix">juce</span>.Colour (args)</a></td>
<td class="summary">Constuctor with named arguments.</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Colour.r"><span class="proto_prefix">juce.Colour</span>.r</a></td>
<td class="summary">Red (0-255)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.g"><span class="proto_prefix">juce.Colour</span>.g</a></td>
<td class="summary">Green (0-255)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.b"><span class="proto_prefix">juce.Colour</span>.b</a></td>
<td class="summary">Blue (0-255)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.a"><span class="proto_prefix">juce.Colour</span>.a</a></td>
<td class="summary">Alpha (0-255)</td>
</tr>
</table>
<h2><a href="#Predefined_values">Predefined values</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Colour.black"><span class="proto_prefix">juce.Colour</span>.black</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.white"><span class="proto_prefix">juce.Colour</span>.white</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.red"><span class="proto_prefix">juce.Colour</span>.red</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.green"><span class="proto_prefix">juce.Colour</span>.green</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Colour.blue"><span class="proto_prefix">juce.Colour</span>.blue</a></td>
<td class="summary">

</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.Colour.Colour"></a>
<strong><span class="proto_prefix">juce</span>.Colour (r, g, b[, a])</strong>
</dt>
<dd>
Constuctor with classical arguments.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">r</span>
red
</li>
<li><span class="parameter">g</span>
green
</li>
<li><span class="parameter">b</span>
blue
</li>
<li><span class="parameter">a</span>
alpha
</li>
</ul>





</dd>
<dt>
<a name = "juce.Colour.Colour"></a>
<strong><span class="proto_prefix">juce</span>.Colour (args)</strong>
</dt>
<dd>
Constuctor with named arguments.
Every field is optional.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">args</span>


<ul>
<li><span class="parameter">r</span>
red
</li>
<li><span class="parameter">g</span>
green
</li>
<li><span class="parameter">b</span>
blue,
</li>
<li><span class="parameter">a</span>
alpha
</li>
</li></ul>
</ul>





</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "juce.Colour.r"></a>
<strong><span class="proto_prefix">juce.Colour</span>.r</strong>
</dt>
<dd>
Red (0-255)

</ul>






</dd>
<dt>
<a name = "juce.Colour.g"></a>
<strong><span class="proto_prefix">juce.Colour</span>.g</strong>
</dt>
<dd>
Green (0-255)

</ul>






</dd>
<dt>
<a name = "juce.Colour.b"></a>
<strong><span class="proto_prefix">juce.Colour</span>.b</strong>
</dt>
<dd>
Blue (0-255)

</ul>






</dd>
<dt>
<a name = "juce.Colour.a"></a>
<strong><span class="proto_prefix">juce.Colour</span>.a</strong>
</dt>
<dd>
Alpha (0-255)

</ul>






</dd>
</dl>
<h2><a name="Predefined_values"></a>Predefined values</h2>
<dl class="function">
<dt>
<a name = "juce.Colour.black"></a>
<strong><span class="proto_prefix">juce.Colour</span>.black</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.Colour.white"></a>
<strong><span class="proto_prefix">juce.Colour</span>.white</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.Colour.red"></a>
<strong><span class="proto_prefix">juce.Colour</span>.red</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.Colour.green"></a>
<strong><span class="proto_prefix">juce.Colour</span>.green</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.Colour.blue"></a>
<strong><span class="proto_prefix">juce.Colour</span>.blue</strong>
</dt>
<dd>


</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 371
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.ColourGradient.html View File

@@ -0,0 +1,371 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.ColourGradient</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><strong>juce.ColourGradient</strong></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.ColourGradient</code></h1>
<p>Colour Gradient.</p>
<p> Is a pointer to a <a href="http://www.juce.com/api/classColourGradient.html">JUCE ColourGradient</a></p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient.Colour"><span class="proto_prefix">juce</span>.ColourGradient (colour1, x1, y1, colour2, x2, y2, isRadial)</a></td>
<td class="summary">Constuctor.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient:addColour"><span class="proto_prefix">juce.ColourGradient</span>:addColour<br> (proportionAlongGradient, colour)</a></td>
<td class="summary">Add colour.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient:removeColour"><span class="proto_prefix">juce.ColourGradient</span>:removeColour (index)</a></td>
<td class="summary">Remove colour.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient:multiplyOpacity"><span class="proto_prefix">juce.ColourGradient</span>:multiplyOpacity (multiplier)</a></td>
<td class="summary">Multiply opacity.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient:getNumColours"><span class="proto_prefix">juce.ColourGradient</span>:getNumColours ()</a></td>
<td class="summary">Get number colour.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient:getColour"><span class="proto_prefix">juce.ColourGradient</span>:getColour (index)</a></td>
<td class="summary">Get colour.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient:setColour"><span class="proto_prefix">juce.ColourGradient</span>:setColour (index, newColour)</a></td>
<td class="summary">Get colour.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.ColourGradient:getColourAtPosition"><span class="proto_prefix">juce.ColourGradient</span>:getColourAtPosition (position)</a></td>
<td class="summary">Get interpolated colour</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.ColourGradient.Colour"></a>
<strong><span class="proto_prefix">juce</span>.ColourGradient (colour1, x1, y1, colour2, x2, y2, isRadial)</strong>
</dt>
<dd>
Constuctor.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">colour1</span>
<span class="types"><a class="type" href="../classes/juce.Colour.html#">juce.Colour</a></span>
colour at the beginning of the gradient
</li>
<li><span class="parameter">x1</span>
coordinates of colour1
</li>
<li><span class="parameter">y1</span>
coordinates of colour1
</li>
<li><span class="parameter">colour2</span>
<span class="types"><a class="type" href="../classes/juce.Colour.html#">juce.Colour</a></span>
colour at the end of the gradient
</li>
<li><span class="parameter">x2</span>
coordinates of colour2
</li>
<li><span class="parameter">y2</span>
coordinates of colour2
</li>
<li><span class="parameter">isRadial</span>
<span class="types"><span class="type">boolean</span></span>
whether the gradient should be linear or radial
</li>
</ul>





</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.ColourGradient:addColour"></a>
<strong><span class="proto_prefix">juce.ColourGradient</span>:addColour<br> (proportionAlongGradient, colour)</strong>
</dt>
<dd>
Add colour.
Any number of colours can be added between the start and end of the gradient.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">proportionAlongGradient</span>



</li>
<li><span class="parameter">colour</span>
<span class="types"><a class="type" href="../classes/juce.Colour.html#">juce.Colour</a></span>



</li>
</ul>

<h3>Returns:</h3>
<ol>

the new colour's index
</ol>




</dd>
<dt>
<a name = "juce.ColourGradient:removeColour"></a>
<strong><span class="proto_prefix">juce.ColourGradient</span>:removeColour (index)</strong>
</dt>
<dd>
Remove colour.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
colour index between 0 and getNumColours() - 1
</li>
</ul>





</dd>
<dt>
<a name = "juce.ColourGradient:multiplyOpacity"></a>
<strong><span class="proto_prefix">juce.ColourGradient</span>:multiplyOpacity (multiplier)</strong>
</dt>
<dd>
Multiply opacity.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">multiplier</span>
factor to multiply the alpha values by
</li>
</ul>





</dd>
<dt>
<a name = "juce.ColourGradient:getNumColours"></a>
<strong><span class="proto_prefix">juce.ColourGradient</span>:getNumColours ()</strong>
</dt>
<dd>
Get number colour.

</ul>


<h3>Returns:</h3>
<ol>

the number of colours
</ol>




</dd>
<dt>
<a name = "juce.ColourGradient:getColour"></a>
<strong><span class="proto_prefix">juce.ColourGradient</span>:getColour (index)</strong>
</dt>
<dd>
Get colour.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
colour index between 0 and getNumColours() - 1
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../classes/juce.Colour.html#">juce.Colour</a></span>
the coulour at the specified index
</ol>




</dd>
<dt>
<a name = "juce.ColourGradient:setColour"></a>
<strong><span class="proto_prefix">juce.ColourGradient</span>:setColour (index, newColour)</strong>
</dt>
<dd>
Get colour.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
colour index between 0 and getNumColours() - 1
</li>
<li><span class="parameter">newColour</span>
<span class="types"><a class="type" href="../classes/juce.Colour.html#">juce.Colour</a></span>



</li>
</ul>





</dd>
<dt>
<a name = "juce.ColourGradient:getColourAtPosition"></a>
<strong><span class="proto_prefix">juce.ColourGradient</span>:getColourAtPosition (position)</strong>
</dt>
<dd>
Get interpolated colour

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">position</span>
the position between 0 and 1
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../classes/juce.Colour.html#">juce.Colour</a></span>
the interpolated colour at the specified position
</ol>




</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 249
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Component.html View File

@@ -0,0 +1,249 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Component</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Methods">Methods</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><strong>juce.Component</strong></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Component</code></h1>
<p>JUCE Component.</p>
<p> Is a pointer to a <a href="http://www.juce.com/api/classComponent.html">JUCE Component</a></p>

<p> As of now, components can't be created by protoplug scripts. This is mainly
for accessing the custom GUI component using <a href="../modules/gui.html#getComponent">gui.getComponent</a>.</p>


<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Component:repaint"><span class="proto_prefix">juce.Component</span>:repaint ()</a></td>
<td class="summary">Request total repaint.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Component:repaint"><span class="proto_prefix">juce.Component</span>:repaint (area)</a></td>
<td class="summary">Request partial repaint.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Component:repaint"><span class="proto_prefix">juce.Component</span>:repaint (x, y, width, height)</a></td>
<td class="summary">Request partial repaint.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Component:createComponentSnapshot"><span class="wrapman"><span class="proto_prefix">juce.Component</span>:createComponentSnapshot<br> (areaToGrab[, clipImageToComponentBounds=true[, scaleFactor=1]])</span></a></td>
<td class="summary">Create component snapshot.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.Component:repaint"></a>
<strong><span class="proto_prefix">juce.Component</span>:repaint ()</strong>
</dt>
<dd>
Request total repaint.
Tell the operating system that the component is "dirty" and needs to be redrawn.
The component's paint method will be called asynchronously (<a href="../modules/gui.html#paint">gui.paint</a>)

</ul>






</dd>
<dt>
<a name = "juce.Component:repaint"></a>
<strong><span class="proto_prefix">juce.Component</span>:repaint (area)</strong>
</dt>
<dd>
Request partial repaint.
Tell the operating system that a portion of the component is "dirty" and needs to be redrawn.
The component's paint method will be called asynchronously (<a href="../modules/gui.html#paint">gui.paint</a>). The dirty region will be accessible
with Graphics.getClipBounds().

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">area</span>
<span class="types"><span class="type">juce.Rectangle_int</span></span>
the region needing the be redrawn
</li>
</ul>





</dd>
<dt>
<a name = "juce.Component:repaint"></a>
<strong><span class="proto_prefix">juce.Component</span>:repaint (x, y, width, height)</strong>
</dt>
<dd>
Request partial repaint.
Tell the operating system that a portion of the component is "dirty" and needs to be redrawn.
The component's paint method will be called asynchronously (<a href="../modules/gui.html#paint">gui.paint</a>). The dirty region will be accessible
with Graphics.getClipBounds().

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">x</span>
the region needing the be redrawn
</li>
<li><span class="parameter">y</span>
the region needing the be redrawn
</li>
<li><span class="parameter">width</span>
the region needing the be redrawn
</li>
<li><span class="parameter">height</span>
the region needing the be redrawn
</li>
</ul>





</dd>
<dt>
<a name = "juce.Component:createComponentSnapshot"></a>
<strong><span class="wrapman"><span class="proto_prefix">juce.Component</span>:createComponentSnapshot<br> (areaToGrab[, clipImageToComponentBounds=true[, scaleFactor=1]])</span></strong>
</dt>
<dd>
Create component snapshot.
Paint the component into a virtual buffer and return it as an image.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">areaToGrab</span>
<span class="types"><span class="type">juce.Rectangle_int</span></span>
the region to the be drawn
</li>
<li><span class="parameter">clipImageToComponentBounds</span>



(<em>default</em> true)
</li>
<li><span class="parameter">scaleFactor</span>



(<em>default</em> 1)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../classes/juce.Image.html#">juce.Image</a></span>



</ol>




</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 315
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.FillType.html View File

@@ -0,0 +1,315 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.FillType</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Predefined_values">Predefined values</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><strong>juce.FillType</strong></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.FillType</code></h1>
<p>Fill Type.</p>
<p> Is a pointer to a <a href="http://www.juce.com/api/classFillType.html">JUCE FillType</a>.
Can be used by <a href="../classes/juce.Graphics.html#">juce.Graphics</a> for fill operations.</p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.FillType.FillType"><span class="proto_prefix">juce</span>.FillType (Colour)</a></td>
<td class="summary">Constuct from a <a href="../classes/juce.Colour.html#">juce.Colour</a>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.FillType.FillType"><span class="proto_prefix">juce</span>.FillType (Gradient)</a></td>
<td class="summary">Constuct from a <a href="../classes/juce.ColourGradient.html#">juce.ColourGradient</a>.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.FillType:setOpacity"><span class="proto_prefix">juce.FillType</span>:setOpacity (newOpacity)</a></td>
<td class="summary">Set Overall Opacity.</td>
</tr>
</table>
<h2><a href="#Predefined_values">Predefined values</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.FillType.black"><span class="proto_prefix">juce.FillType</span>.black</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.FillType.white"><span class="proto_prefix">juce.FillType</span>.white</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.FillType.red"><span class="proto_prefix">juce.FillType</span>.red</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.FillType.green"><span class="proto_prefix">juce.FillType</span>.green</a></td>
<td class="summary">

</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.FillType.blue"><span class="proto_prefix">juce.FillType</span>.blue</a></td>
<td class="summary">

</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.FillType.FillType"></a>
<strong><span class="proto_prefix">juce</span>.FillType (Colour)</strong>
</dt>
<dd>
Constuct from a <a href="../classes/juce.Colour.html#">juce.Colour</a>.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Colour</span>
<span class="types"><a class="type" href="../classes/juce.Colour.html#">juce.Colour</a></span>



</li>
</ul>





</dd>
<dt>
<a name = "juce.FillType.FillType"></a>
<strong><span class="proto_prefix">juce</span>.FillType (Gradient)</strong>
</dt>
<dd>
Constuct from a <a href="../classes/juce.ColourGradient.html#">juce.ColourGradient</a>.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Gradient</span>
<span class="types"><a class="type" href="../classes/juce.ColourGradient.html#">juce.ColourGradient</a></span>



</li>
</ul>





</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.FillType:setOpacity"></a>
<strong><span class="proto_prefix">juce.FillType</span>:setOpacity (newOpacity)</strong>
</dt>
<dd>
Set Overall Opacity.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">newOpacity</span>



</li>
</ul>





</dd>
</dl>
<h2><a name="Predefined_values"></a>Predefined values</h2>
<dl class="function">
<dt>
<a name = "juce.FillType.black"></a>
<strong><span class="proto_prefix">juce.FillType</span>.black</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.FillType.white"></a>
<strong><span class="proto_prefix">juce.FillType</span>.white</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.FillType.red"></a>
<strong><span class="proto_prefix">juce.FillType</span>.red</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.FillType.green"></a>
<strong><span class="proto_prefix">juce.FillType</span>.green</strong>
</dt>
<dd>


</ul>






</dd>
<dt>
<a name = "juce.FillType.blue"></a>
<strong><span class="proto_prefix">juce.FillType</span>.blue</strong>
</dt>
<dd>


</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 203
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Font.html View File

@@ -0,0 +1,203 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Font</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><strong>juce.Font</strong></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Font</code></h1>
<p>Font.</p>
<p> Is a pointer to a <a href="http://www.juce.com/api/classFont.html">JUCE Font</a>.
Can be used by <a href="../classes/juce.Graphics.html#">juce.Graphics</a> for text operations.</p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Font.Font"><span class="proto_prefix">juce</span>.Font (typefaceName, fontHeight[, styleFlags=0[, hinted=false]])</a></td>
<td class="summary">Constuctor.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Font.styles"><span class="proto_prefix">juce.Font</span>.styles</a></td>
<td class="summary">Font styles.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.Font.Font"></a>
<strong><span class="proto_prefix">juce</span>.Font (typefaceName, fontHeight[, styleFlags=0[, hinted=false]])</strong>
</dt>
<dd>
Constuctor.
Caveat : on OSX and Linux, hinting only works for protoplug's
built-in hinted fonts (<code>DejaVu Sans Mono</code> and <code>Source Code Pro</code>). On
Windows it's available for every font. Cross-platform hinting is on the be
todo list.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">typefaceName</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



</li>
<li><span class="parameter">fontHeight</span>
<span class="types"><span class="type">number</span></span>



</li>
<li><span class="parameter">styleFlags</span>
any combination of <a href="../classes/juce.Font.html#juce.Font.styles">styles</a>
(<em>default</em> 0)
</li>
<li><span class="parameter">hinted</span>
<span class="types"><span class="type">bool</span></span>



(<em>default</em> false)
</li>
</ul>





</dd>
</dl>
<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "juce.Font.styles"></a>
<strong><span class="proto_prefix">juce.Font</span>.styles</strong>
</dt>
<dd>
Font styles.

</ul>

<h3>Fields:</h3>
<ul>
<li><span class="parameter">plain</span>
<code>0</code>
</li>
<li><span class="parameter">bold</span>
<code>1</code>
</li>
<li><span class="parameter">italic</span>
<code>2</code>
</li>
<li><span class="parameter">underlined</span>
<code>4</code>
</li>
</ul>





</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 2220
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Graphics.html
File diff suppressed because it is too large
View File


+ 260
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Image.html View File

@@ -0,0 +1,260 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Image</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Tables">Tables</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><strong>juce.Image</strong></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Image</code></h1>
<p>Image.</p>
<p> Images can be loaded from a file, or created as temporary graphics targets.</p>

<p> Is a pointer to a <a href="http://www.juce.com/api/classImage.html">JUCE Image</a>,
and wraps some <a href="http://www.juce.com/api/classImageFileFormat.html">JUCE ImageFileFormat</a>
functionality.</p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Image.Image"><span class="proto_prefix">juce</span>.Image (filename)</a></td>
<td class="summary">Load an image from a file.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Image.Image"><span class="proto_prefix">juce</span>.Image (pixelFormat, imageWidth, imageHeight, clearImage)</a></td>
<td class="summary">Create a temporary in-memory image.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Image:isValid"><span class="proto_prefix">juce.Image</span>:isValid ()</a></td>
<td class="summary">Check Image validity.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Image.PixelFormat"><span class="proto_prefix">juce.Image</span>.PixelFormat</a></td>
<td class="summary">Pixel formats.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.Image.Image"></a>
<strong><span class="proto_prefix">juce</span>.Image (filename)</strong>
</dt>
<dd>
Load an image from a file.
The path can be absolute or relative to the protoplug directory.
To check if the file was loaded successfully, use <a href="../classes/juce.Image.html#juce.Image:isValid">isValid</a>.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">filename</span>



</li>
</ul>





</dd>
<dt>
<a name = "juce.Image.Image"></a>
<strong><span class="proto_prefix">juce</span>.Image (pixelFormat, imageWidth, imageHeight, clearImage)</strong>
</dt>
<dd>
Create a temporary in-memory image.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">pixelFormat</span>
<span class="types"><a class="type" href="../classes/juce.Image.html#juce.Image.PixelFormat">juce.Image.PixelFormat</a></span>



</li>
<li><span class="parameter">imageWidth</span>



</li>
<li><span class="parameter">imageHeight</span>



</li>
<li><span class="parameter">clearImage</span>
<span class="types"><span class="type">boolean</span></span>
fill the image with black
</li>
</ul>





</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.Image:isValid"></a>
<strong><span class="proto_prefix">juce.Image</span>:isValid ()</strong>
</dt>
<dd>
Check Image validity.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
whether the image is valid and can be used.
</ol>




</dd>
</dl>
<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "juce.Image.PixelFormat"></a>
<strong><span class="proto_prefix">juce.Image</span>.PixelFormat</strong>
</dt>
<dd>
Pixel formats.

</ul>

<h3>Fields:</h3>
<ul>
<li><span class="parameter">UnknownFormat</span>
0
</li>
<li><span class="parameter">RGB</span>
1
</li>
<li><span class="parameter">ARGB</span>
2
</li>
<li><span class="parameter">SingleChannel</span>
3
</li>
</ul>





</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 214
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Justification.html View File

@@ -0,0 +1,214 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Justification</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Tables">Tables</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><strong>juce.Justification</strong></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Justification</code></h1>
<p>Justification.</p>
<p> Is converted to a <a href="http://www.juce.com/api/Justification.html">JUCE Justification</a></p>


<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Justification"><span class="proto_prefix">juce</span>.Justification</a></td>
<td class="summary">Justification Constants.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "juce.Justification"></a>
<strong><span class="proto_prefix">juce</span>.Justification</strong>
</dt>
<dd>
Justification Constants.

</ul>

<h3>Fields:</h3>
<ul>
<li><span class="parameter">left</span>



</li>
<li><span class="parameter">right</span>



</li>
<li><span class="parameter">horizontallyCentred</span>



</li>
<li><span class="parameter">top</span>



</li>
<li><span class="parameter">bottom</span>



</li>
<li><span class="parameter">verticallyCentred</span>



</li>
<li><span class="parameter">horizontallyJustified</span>



</li>
<li><span class="parameter">centred</span>



</li>
<li><span class="parameter">centredLeft</span>



</li>
<li><span class="parameter">centredRight</span>



</li>
<li><span class="parameter">centredTop</span>



</li>
<li><span class="parameter">centredBottom</span>



</li>
<li><span class="parameter">topLeft</span>



</li>
<li><span class="parameter">topRight</span>



</li>
<li><span class="parameter">bottomLeft</span>



</li>
<li><span class="parameter">bottomRight</span>



</li>
</ul>





</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 180
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.LagrangeInterpolator.html View File

@@ -0,0 +1,180 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.LagrangeInterpolator</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><strong>juce.LagrangeInterpolator</strong></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.LagrangeInterpolator</code></h1>
<p>Lagrange Interpolator.</p>
<p> Is converted to a <a href="http://www.juce.com/api/classLagrangeInterpolator.html">JUCE LagrangeInterpolator</a></p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.LagrangeInterpolator.LagrangeInterpolator"><span class="proto_prefix">juce</span>.LagrangeInterpolator ()</a></td>
<td class="summary">Constuctor.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.LagrangeInterpolator:process"><span class="wrapman"><span class="proto_prefix">juce.LagrangeInterpolator</span>:process<br> (speedRatio, inputSamples, outputSamples, numOutputSamplesToProduce)</span></a></td>
<td class="summary">Interpolate.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.LagrangeInterpolator.LagrangeInterpolator"></a>
<strong><span class="proto_prefix">juce</span>.LagrangeInterpolator ()</strong>
</dt>
<dd>
Constuctor.

</ul>






</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.LagrangeInterpolator:process"></a>
<strong><span class="wrapman"><span class="proto_prefix">juce.LagrangeInterpolator</span>:process<br> (speedRatio, inputSamples, outputSamples, numOutputSamplesToProduce)</span></strong>
</dt>
<dd>
Interpolate.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">speedRatio</span>
number of input samples per output sample (input/output)
</li>
<li><span class="parameter">inputSamples</span>
pointer to a cdata <code>float</code> array
</li>
<li><span class="parameter">outputSamples</span>
pointer to a cdata <code>float</code> array
</li>
<li><span class="parameter">numOutputSamplesToProduce</span>



</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">number</span></span>
number of input samples that were processed
</ol>




</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 284
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Line.html View File

@@ -0,0 +1,284 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Line</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><strong>juce.Line</strong></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Line</code></h1>
<p>Line.</p>
<p> Is converted to a <a href="http://www.juce.com/api/classLine.html">JUCE Line</a></p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Line.Line"><span class="proto_prefix">juce</span>.Line (x1, y1, x2, y2)</a></td>
<td class="summary">Constuctor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Line.Line"><span class="proto_prefix">juce</span>.Line (args)</a></td>
<td class="summary">Constuctor</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Line.x1"><span class="proto_prefix">juce.Line</span>.x1</a></td>
<td class="summary">Point 1 X position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Line.y1"><span class="proto_prefix">juce.Line</span>.y1</a></td>
<td class="summary">Point 1 Y position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Line.x2"><span class="proto_prefix">juce.Line</span>.x2</a></td>
<td class="summary">Point 2 X position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Line.y2"><span class="proto_prefix">juce.Line</span>.y2</a></td>
<td class="summary">Point 2 Y position</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.Line.Line"></a>
<strong><span class="proto_prefix">juce</span>.Line (x1, y1, x2, y2)</strong>
</dt>
<dd>
Constuctor

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">x1</span>



</li>
<li><span class="parameter">y1</span>



</li>
<li><span class="parameter">x2</span>



</li>
<li><span class="parameter">y2</span>



</li>
</ul>





</dd>
<dt>
<a name = "juce.Line.Line"></a>
<strong><span class="proto_prefix">juce</span>.Line (args)</strong>
</dt>
<dd>
Constuctor

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">args</span>


<ul>
<li><span class="parameter">x1</span>



</li>
<li><span class="parameter">y1</span>



</li>
<li><span class="parameter">x2</span>



</li>
<li><span class="parameter">y2</span>



</li>
</li></ul>
</ul>





</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "juce.Line.x1"></a>
<strong><span class="proto_prefix">juce.Line</span>.x1</strong>
</dt>
<dd>
Point 1 X position

</ul>






</dd>
<dt>
<a name = "juce.Line.y1"></a>
<strong><span class="proto_prefix">juce.Line</span>.y1</strong>
</dt>
<dd>
Point 1 Y position

</ul>






</dd>
<dt>
<a name = "juce.Line.x2"></a>
<strong><span class="proto_prefix">juce.Line</span>.x2</strong>
</dt>
<dd>
Point 2 X position

</ul>






</dd>
<dt>
<a name = "juce.Line.y2"></a>
<strong><span class="proto_prefix">juce.Line</span>.y2</strong>
</dt>
<dd>
Point 2 Y position

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 2076
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Path.html
File diff suppressed because it is too large
View File


+ 226
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Point.html View File

@@ -0,0 +1,226 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Point</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><strong>juce.Point</strong></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Point</code></h1>
<p>Point.</p>
<p> Is converted to a <a href="http://www.juce.com/api/classPoint.html">JUCE Point</a></p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Point.Point"><span class="proto_prefix">juce</span>.Point (x, y)</a></td>
<td class="summary">Constuctor</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Point.Point"><span class="proto_prefix">juce</span>.Point (args)</a></td>
<td class="summary">Constuctor</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Point.x"><span class="proto_prefix">juce.Point</span>.x</a></td>
<td class="summary">Point X position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Point.y"><span class="proto_prefix">juce.Point</span>.y</a></td>
<td class="summary">Point Y position</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.Point.Point"></a>
<strong><span class="proto_prefix">juce</span>.Point (x, y)</strong>
</dt>
<dd>
Constuctor

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">x</span>



</li>
<li><span class="parameter">y</span>



</li>
</ul>





</dd>
<dt>
<a name = "juce.Point.Point"></a>
<strong><span class="proto_prefix">juce</span>.Point (args)</strong>
</dt>
<dd>
Constuctor

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">args</span>


<ul>
<li><span class="parameter">x</span>



</li>
<li><span class="parameter">y</span>



</li>
</li></ul>
</ul>





</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "juce.Point.x"></a>
<strong><span class="proto_prefix">juce.Point</span>.x</strong>
</dt>
<dd>
Point X position

</ul>






</dd>
<dt>
<a name = "juce.Point.y"></a>
<strong><span class="proto_prefix">juce.Point</span>.y</strong>
</dt>
<dd>
Point Y position

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 194
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.RectanglePlacement.html View File

@@ -0,0 +1,194 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.RectanglePlacement</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Tables">Tables</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><strong>juce.RectanglePlacement</strong></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.RectanglePlacement</code></h1>
<p>Rectangle Placement.</p>
<p> Is converted to a <a href="http://www.juce.com/api/RectanglePlacement.html">JUCE RectanglePlacement</a></p>


<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.RectanglePlacement"><span class="proto_prefix">juce</span>.RectanglePlacement</a></td>
<td class="summary">Rectangle Placement Constants.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "juce.RectanglePlacement"></a>
<strong><span class="proto_prefix">juce</span>.RectanglePlacement</strong>
</dt>
<dd>
Rectangle Placement Constants.

</ul>

<h3>Fields:</h3>
<ul>
<li><span class="parameter">xLeft</span>



</li>
<li><span class="parameter">xRight</span>



</li>
<li><span class="parameter">xMid</span>



</li>
<li><span class="parameter">yTop</span>



</li>
<li><span class="parameter">yBottom</span>



</li>
<li><span class="parameter">yMid</span>



</li>
<li><span class="parameter">stretchToFit</span>



</li>
<li><span class="parameter">fillDestination</span>



</li>
<li><span class="parameter">onlyReduceInSize</span>



</li>
<li><span class="parameter">onlyIncreaseInSize</span>



</li>
<li><span class="parameter">doNotResize</span>



</li>
<li><span class="parameter">centred</span>



</li>
</ul>





</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 386
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Rectangle_float.html View File

@@ -0,0 +1,386 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Rectangle_float</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><strong>juce.Rectangle_float</strong></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Rectangle_float</code></h1>
<p>A floating-point (sub-pixel) rectangle.</p>
<p> Is converted to a <a href="http://www.juce.com/api/classRectangle.html">JUCE Rectangle</a></p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float.Rectangle_float"><span class="proto_prefix">juce</span>.Rectangle_float (x, y, w, h)</a></td>
<td class="summary">Constuctor with classical arguments.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float.Rectangle_float"><span class="proto_prefix">juce</span>.Rectangle_float (args)</a></td>
<td class="summary">Constuctor with named arguments.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float:toInt"><span class="proto_prefix">juce.Rectangle_float</span>:toInt ()</a></td>
<td class="summary">To int.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float:contains"><span class="proto_prefix">juce.Rectangle_float</span>:contains (point)</a></td>
<td class="summary">Contains.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float:getR"><span class="proto_prefix">juce.Rectangle_float</span>:getR ()</a></td>
<td class="summary">Get right.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float:getB"><span class="proto_prefix">juce.Rectangle_float</span>:getB ()</a></td>
<td class="summary">Get bottom.</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float.x"><span class="proto_prefix">juce.Rectangle_float</span>.x</a></td>
<td class="summary">Left position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float.y"><span class="proto_prefix">juce.Rectangle_float</span>.y</a></td>
<td class="summary">Top position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float.w"><span class="proto_prefix">juce.Rectangle_float</span>.w</a></td>
<td class="summary">Width</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_float.h"><span class="proto_prefix">juce.Rectangle_float</span>.h</a></td>
<td class="summary">Height</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.Rectangle_float.Rectangle_float"></a>
<strong><span class="proto_prefix">juce</span>.Rectangle_float (x, y, w, h)</strong>
</dt>
<dd>
Constuctor with classical arguments.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">x</span>
left position
</li>
<li><span class="parameter">y</span>
top position
</li>
<li><span class="parameter">w</span>
width
</li>
<li><span class="parameter">h</span>
height
</li>
</ul>





</dd>
<dt>
<a name = "juce.Rectangle_float.Rectangle_float"></a>
<strong><span class="proto_prefix">juce</span>.Rectangle_float (args)</strong>
</dt>
<dd>
Constuctor with named arguments.
Every field is optional.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">args</span>


<ul>
<li><span class="parameter">x</span>
left position
</li>
<li><span class="parameter">y</span>
top position
</li>
<li><span class="parameter">w</span>
width
</li>
<li><span class="parameter">h</span>
height
</li>
</li></ul>
</ul>





</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.Rectangle_float:toInt"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>:toInt ()</strong>
</dt>
<dd>
To int.
Convert to a pixel-aligned rectangle

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">juce.Rectangle_int</span></span>



</ol>




</dd>
<dt>
<a name = "juce.Rectangle_float:contains"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>:contains (point)</strong>
</dt>
<dd>
Contains.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">point</span>
<span class="types"><a class="type" href="../classes/juce.Point.html#">juce.Point</a></span>



</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
whether the rectangle contains the point
</ol>




</dd>
<dt>
<a name = "juce.Rectangle_float:getR"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>:getR ()</strong>
</dt>
<dd>
Get right.

</ul>


<h3>Returns:</h3>
<ol>

the rectangle's right position on the X axis
</ol>




</dd>
<dt>
<a name = "juce.Rectangle_float:getB"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>:getB ()</strong>
</dt>
<dd>
Get bottom.

</ul>


<h3>Returns:</h3>
<ol>

the rectangle's bottom position on the Y axis
</ol>




</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "juce.Rectangle_float.x"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>.x</strong>
</dt>
<dd>
Left position

</ul>






</dd>
<dt>
<a name = "juce.Rectangle_float.y"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>.y</strong>
</dt>
<dd>
Top position

</ul>






</dd>
<dt>
<a name = "juce.Rectangle_float.w"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>.w</strong>
</dt>
<dd>
Width

</ul>






</dd>
<dt>
<a name = "juce.Rectangle_float.h"></a>
<strong><span class="proto_prefix">juce.Rectangle_float</span>.h</strong>
</dt>
<dd>
Height

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 386
- 0
ports/protoplug/ProtoplugFiles/doc/classes/juce.Rectangle_int.html View File

@@ -0,0 +1,386 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Class juce.Rectangle_int</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Constructors">Constructors</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><strong>juce.Rectangle_int</strong></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Class <code>juce.Rectangle_int</code></h1>
<p>An integer (pixel-aligned) rectangle.</p>
<p> Is converted to a <a href="http://www.juce.com/api/classRectangle.html">JUCE Rectangle</a></p>


<h2><a href="#Constructors">Constructors</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int.Rectangle_int"><span class="proto_prefix">juce</span>.Rectangle_int (x, y, w, h)</a></td>
<td class="summary">Constuctor with classical arguments.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int.Rectangle_int"><span class="proto_prefix">juce</span>.Rectangle_int (args)</a></td>
<td class="summary">Constuctor with named arguments.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int:toFloat"><span class="proto_prefix">juce.Rectangle_int</span>:toFloat ()</a></td>
<td class="summary">To float.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int:contains"><span class="proto_prefix">juce.Rectangle_int</span>:contains (point)</a></td>
<td class="summary">Contains.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int:getR"><span class="proto_prefix">juce.Rectangle_int</span>:getR ()</a></td>
<td class="summary">Get right.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int:getB"><span class="proto_prefix">juce.Rectangle_int</span>:getB ()</a></td>
<td class="summary">Get bottom.</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int.x"><span class="proto_prefix">juce.Rectangle_int</span>.x</a></td>
<td class="summary">Left position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int.y"><span class="proto_prefix">juce.Rectangle_int</span>.y</a></td>
<td class="summary">Top position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int.w"><span class="proto_prefix">juce.Rectangle_int</span>.w</a></td>
<td class="summary">Width</td>
</tr>
<tr>
<td class="name" nowrap><a href="#juce.Rectangle_int.h"><span class="proto_prefix">juce.Rectangle_int</span>.h</a></td>
<td class="summary">Height</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Constructors"></a>Constructors</h2>
<dl class="function">
<dt>
<a name = "juce.Rectangle_int.Rectangle_int"></a>
<strong><span class="proto_prefix">juce</span>.Rectangle_int (x, y, w, h)</strong>
</dt>
<dd>
Constuctor with classical arguments.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">x</span>
left position
</li>
<li><span class="parameter">y</span>
top position
</li>
<li><span class="parameter">w</span>
width
</li>
<li><span class="parameter">h</span>
height
</li>
</ul>





</dd>
<dt>
<a name = "juce.Rectangle_int.Rectangle_int"></a>
<strong><span class="proto_prefix">juce</span>.Rectangle_int (args)</strong>
</dt>
<dd>
Constuctor with named arguments.
Every field is optional.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">args</span>


<ul>
<li><span class="parameter">x</span>
left position
</li>
<li><span class="parameter">y</span>
top position
</li>
<li><span class="parameter">w</span>
width
</li>
<li><span class="parameter">h</span>
height
</li>
</li></ul>
</ul>





</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "juce.Rectangle_int:toFloat"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>:toFloat ()</strong>
</dt>
<dd>
To float.
Convert to a sub-pixel rectangle

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">juce.Rectangle_float</span></span>



</ol>




</dd>
<dt>
<a name = "juce.Rectangle_int:contains"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>:contains (point)</strong>
</dt>
<dd>
Contains.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">point</span>
<span class="types"><a class="type" href="../classes/juce.Point.html#">juce.Point</a></span>



</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
whether the rectangle contains the point
</ol>




</dd>
<dt>
<a name = "juce.Rectangle_int:getR"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>:getR ()</strong>
</dt>
<dd>
Get right.

</ul>


<h3>Returns:</h3>
<ol>

the rectangle's right position on the X axis
</ol>




</dd>
<dt>
<a name = "juce.Rectangle_int:getB"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>:getB ()</strong>
</dt>
<dd>
Get bottom.

</ul>


<h3>Returns:</h3>
<ol>

the rectangle's bottom position on the Y axis
</ol>




</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "juce.Rectangle_int.x"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>.x</strong>
</dt>
<dd>
Left position

</ul>






</dd>
<dt>
<a name = "juce.Rectangle_int.y"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>.y</strong>
</dt>
<dd>
Top position

</ul>






</dd>
<dt>
<a name = "juce.Rectangle_int.w"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>.w</strong>
</dt>
<dd>
Width

</ul>






</dd>
<dt>
<a name = "juce.Rectangle_int.h"></a>
<strong><span class="proto_prefix">juce.Rectangle_int</span>.h</strong>
</dt>
<dd>
Height

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 168
- 0
ports/protoplug/ProtoplugFiles/doc/examples/classic-filter.lua.html View File

@@ -0,0 +1,168 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Example classic-filter.lua</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>



<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><strong>classic-filter.lua</strong></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>

</div>

<div id="content">

<pre>
<span class="comment">--[[
name: Classic Filter
description: &gt;
Straightforward application of RBJ's cookbook filters. Formulae by
Robert Bristow-Johnson, implementation from Worp by Ico Doornekamp.
author: osar.fr
--]]</span>

<span class="global">require</span> <span class="string">"include/protoplug"</span>
<span class="keyword">local</span> cbFilter = <span class="global">require</span> <span class="string">"include/pac/cookbook filters"</span>
<span class="keyword">local</span> filters = {}

stereoFx.init()

<span class="keyword">function</span> stereoFx.Channel:init()
<span class="comment">-- create per-channel fields (filters)
</span> self.filter = cbFilter
{
<span class="comment">-- initialize filters with current param values
</span> <span class="global">type</span> = params[<span class="number">1</span>].getValue();
f = params[<span class="number">2</span>].getValue()/<span class="number">2</span>;
gain = params[<span class="number">3</span>].getValue();
Q = params[<span class="number">4</span>].getValue();
}
<span class="global">table</span>.insert(filters, self.filter)
<span class="keyword">end</span>

<span class="keyword">function</span> stereoFx.Channel:processBlock(s, smax)
<span class="keyword">for</span> i = <span class="number">0</span>,smax <span class="keyword">do</span>
s[i] = self.filter.process(s[i])
<span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">local</span> <span class="keyword">function</span> updateFilters(args)
<span class="keyword">for</span> _, f <span class="keyword">in</span> <span class="global">pairs</span>(filters) <span class="keyword">do</span>
f.update(args)
<span class="keyword">end</span>
<span class="keyword">end</span>

params = plugin.manageParams {
<span class="comment">-- automatable VST/AU parameters
</span> <span class="comment">-- note the new 1.3 way of declaring them
</span> {
name = <span class="string">"Type"</span>;
<span class="global">type</span> = <span class="string">"list"</span>;
values = {<span class="string">"hp"</span>; <span class="string">"lp"</span>; <span class="string">"bp"</span>; <span class="string">"bs"</span>; <span class="string">"ls"</span>; <span class="string">"hs"</span>; <span class="string">"ap"</span>; <span class="string">"eq"</span>};
default = <span class="string">"hp"</span>;
changed = <span class="keyword">function</span>(val) updateFilters{<span class="global">type</span>=val} <span class="keyword">end</span>;
};
{
name = <span class="string">"Frequency"</span>;
min = <span class="number">10</span>;
max = <span class="number">20000</span>;
default = <span class="number">440</span>;
changed = <span class="keyword">function</span>(val) updateFilters{f=val} <span class="keyword">end</span>;
};
{
name = <span class="string">"Gain"</span>;
min = -<span class="number">30</span>;
max = <span class="number">30</span>;
default = <span class="number">0</span>;
changed = <span class="keyword">function</span>(val) updateFilters{gain=val} <span class="keyword">end</span>;
};
{
name = <span class="string">"Resonance"</span>;
min = <span class="number">0.1</span>;
max = <span class="number">30</span>;
default = <span class="number">1</span>;
changed = <span class="keyword">function</span>(val) updateFilters{Q=val} <span class="keyword">end</span>;
};
}

<span class="comment">-- Reset the plugin parameters like this :
</span><span class="comment">-- params.resetToDefaults()
</span></pre>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 142
- 0
ports/protoplug/ProtoplugFiles/doc/examples/midi-chordify.lua.html View File

@@ -0,0 +1,142 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Example midi-chordify.lua</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>



<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><strong>midi-chordify.lua</strong></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>

</div>

<div id="content">

<pre>
<span class="comment">--[[
name: midi chordify
description: MIDI processor VST/AU. Notes go in, chords come out.
author: osar.fr
--]]</span>

<span class="global">require</span> <span class="string">"include/protoplug"</span>

<span class="comment">-- what kind of chord ?
</span><span class="keyword">local</span> chordStructure = {<span class="number">0</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">7</span>, <span class="number">11</span>}
<span class="keyword">local</span> blockEvents = {}

<span class="keyword">function</span> plugin.processBlock(samples, smax, midiBuf)
blockEvents = {}
<span class="comment">-- analyse midi buffer and prepare a chord for each note
</span> <span class="keyword">for</span> ev <span class="keyword">in</span> midiBuf:eachEvent() <span class="keyword">do</span>
<span class="keyword">if</span> ev:isNoteOn() <span class="keyword">then</span>
chordOn(ev)
<span class="keyword">elseif</span> ev:isNoteOff() <span class="keyword">then</span>
chordOff(ev)
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="comment">-- fill midi buffer with prepared notes
</span> midiBuf:clear()
<span class="keyword">if</span> #blockEvents&gt;<span class="number">0</span> <span class="keyword">then</span>
<span class="keyword">for</span> _,e <span class="keyword">in</span> <span class="global">ipairs</span>(blockEvents) <span class="keyword">do</span>
midiBuf:addEvent(e)
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">function</span> chordOn(root)
<span class="keyword">for</span> _, offset <span class="keyword">in</span> <span class="global">ipairs</span>(chordStructure) <span class="keyword">do</span>
<span class="keyword">local</span> newEv = midi.Event.noteOn(
root:getChannel(),
root:getNote()+offset,
root:getVel())
<span class="global">table</span>.insert(blockEvents, newEv)
<span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">function</span> chordOff(root)
<span class="keyword">for</span> _, offset <span class="keyword">in</span> <span class="global">ipairs</span>(chordStructure) <span class="keyword">do</span>
<span class="keyword">local</span> newEv = midi.Event.noteOff(
root:getChannel(),
root:getNote()+offset)
<span class="global">table</span>.insert(blockEvents, newEv)
<span class="keyword">end</span>
<span class="keyword">end</span></pre>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 138
- 0
ports/protoplug/ProtoplugFiles/doc/examples/sine-organ.lua.html View File

@@ -0,0 +1,138 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Example sine-organ.lua</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>



<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><strong>sine-organ.lua</strong></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>

</div>

<div id="content">

<pre>
<span class="comment">--[[
name: sine organ
description: A simple organ-like sinewave VST/AU.
author: osar.fr
--]]</span>

<span class="global">require</span> <span class="string">"include/protoplug"</span>

<span class="keyword">local</span> release = <span class="number">10000</span>
<span class="keyword">local</span> decayRate = <span class="number">1</span>/release

polyGen.initTracks(<span class="number">8</span>)

<span class="keyword">function</span> polyGen.VTrack:init()
<span class="comment">-- create per-track fields here
</span> self.phase = <span class="number">0</span>
self.releasePos = release
<span class="keyword">end</span>

<span class="keyword">function</span> polyGen.VTrack:addProcessBlock(samples, smax)
<span class="keyword">local</span> amp = <span class="number">1</span>
<span class="keyword">for</span> i = <span class="number">0</span>,smax <span class="keyword">do</span>
<span class="keyword">if</span> <span class="keyword">not</span> self.noteIsOn <span class="keyword">then</span>
<span class="comment">-- release is finished : idle track
</span> <span class="keyword">if</span> self.releasePos&gt;=release <span class="keyword">then</span> <span class="keyword">break</span> <span class="keyword">end</span>
<span class="comment">-- release is under way
</span> amp = <span class="number">1</span>-self.releasePos*decayRate
self.releasePos = self.releasePos+<span class="number">1</span>
<span class="keyword">end</span>
self.phase = self.phase + (self.noteFreq*<span class="global">math</span>.pi*<span class="number">2</span>)
<span class="comment">-- math.sin is slow but once per sample is no tragedy
</span> <span class="keyword">local</span> trackSample = <span class="global">math</span>.sin(self.phase)*amp*<span class="number">0.3</span>
samples[<span class="number">0</span>][i] = samples[<span class="number">0</span>][i] + trackSample <span class="comment">-- left
</span> samples[<span class="number">1</span>][i] = samples[<span class="number">1</span>][i] + trackSample <span class="comment">-- right
</span> <span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">function</span> polyGen.VTrack:noteOff(note, ev)
self.releasePos = <span class="number">0</span>
<span class="keyword">end</span>

<span class="keyword">function</span> polyGen.VTrack:noteOn(note, vel, ev)
<span class="comment">-- start the sinewave at 0 for a clickless attack
</span> self.phase = <span class="number">0</span>
<span class="keyword">end</span></pre>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 140
- 0
ports/protoplug/ProtoplugFiles/doc/examples/sinemouse-demo.lua.html View File

@@ -0,0 +1,140 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Example sinemouse-demo.lua</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>



<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><strong>sinemouse-demo.lua</strong></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>

</div>

<div id="content">

<pre>
<span class="comment">--[[
name: sinemouse demo
description: &gt;
Custom GUI demonstration : Drag your mouse around in the
frame to control the sine wave's amplitude and frequency.
author: osar.fr
--]]</span>

<span class="global">require</span> <span class="string">"include/protoplug"</span>

<span class="keyword">local</span> freq,amp = <span class="number">440</span>, <span class="number">0</span>
<span class="keyword">local</span> delta, phase = <span class="number">0.06</span>, <span class="number">0</span>

<span class="keyword">function</span> plugin.processBlock(samples, smax)
<span class="keyword">for</span> i=<span class="number">0</span>,smax <span class="keyword">do</span>
<span class="keyword">local</span> s = <span class="global">math</span>.sin(phase)*amp
samples[<span class="number">0</span>][i] = s <span class="comment">-- left
</span> samples[<span class="number">1</span>][i] = s <span class="comment">-- right
</span> phase = phase + delta
<span class="keyword">end</span>
<span class="keyword">end</span>

<span class="keyword">local</span> J = juce
<span class="keyword">local</span> frame = J.Rectangle_int(<span class="number">20</span>,<span class="number">20</span>,<span class="number">400</span>,<span class="number">300</span>)
<span class="keyword">local</span> sideways = J.AffineTransform():rotated(<span class="global">math</span>.pi*<span class="number">0.5</span>)

<span class="keyword">function</span> gui.paint(g)
g:fillAll()
g:setColour(J.Colour.green)
g:drawRect(frame)
g:drawText(<span class="string">"Frequency"</span>, <span class="number">20</span>, <span class="number">320</span>, <span class="number">400</span>, <span class="number">20</span>, J.Justification.centred)
g:addTransform(sideways)
g:drawText(<span class="string">"amplitude"</span>, <span class="number">20</span>, -<span class="number">440</span>, <span class="number">300</span>, <span class="number">20</span>, J.Justification.centred)
<span class="keyword">end</span>

<span class="keyword">local</span> <span class="keyword">function</span> mouseHandler(event)
<span class="keyword">if</span> <span class="keyword">not</span> frame:contains(J.Point(event.x,event.y)) <span class="keyword">then</span>
<span class="keyword">return</span>
<span class="keyword">end</span>
freq = event.x + <span class="number">80</span>
amp = (<span class="number">320</span>-event.y)/<span class="number">300</span>
<span class="keyword">local</span> sr = plugin.isSampleRateKnown() <span class="keyword">and</span> plugin.getSampleRate() <span class="keyword">or</span> <span class="number">44100</span>
delta = <span class="number">2</span>*<span class="global">math</span>.pi*freq/sr
<span class="keyword">end</span>

gui.addHandler(<span class="string">"mouseDrag"</span>, mouseHandler)
gui.addHandler(<span class="string">"mouseDown"</span>, mouseHandler)</pre>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 132
- 0
ports/protoplug/ProtoplugFiles/doc/examples/soundfile-test.lua.html View File

@@ -0,0 +1,132 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Example soundfile-test.lua</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>



<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><strong>soundfile-test.lua</strong></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>

</div>

<div id="content">

<pre>
<span class="comment">--[[
name: soundfile test
description: A simple demo that plays an audio file.
author: osar.fr
--]]</span>

<span class="global">require</span> <span class="string">"include/protoplug"</span>

<span class="keyword">local</span> path = <span class="string">"C:\\temp\\pluck44.wav"</span>
<span class="keyword">local</span> wave, len

<span class="comment">-- 'prepareToPlay' will be triggered when the host sample rate is known,
</span><span class="comment">-- so we can load sound files with automatic sample rate conversion:
</span>plugin.addHandler(<span class="string">'prepareToPlay'</span>, <span class="keyword">function</span>()
<span class="keyword">local</span> readr = juce.AudioFormatReader(path)
<span class="keyword">if</span> readr==<span class="keyword">nil</span> <span class="keyword">then</span> error (<span class="string">"can't open wave: "</span>..path) <span class="keyword">end</span>
wave, len = readr:readToFloat(<span class="number">2</span>) <span class="comment">-- require 2 channels
</span><span class="keyword">end</span>)

polyGen.initTracks(<span class="number">8</span>)

<span class="keyword">function</span> polyGen.VTrack:noteOn(note, vel, ev)
self.playing = <span class="keyword">true</span>
self.wavepos = <span class="number">0</span>
<span class="keyword">end</span>

<span class="keyword">function</span> polyGen.VTrack:noteOff(note, ev)
self.playing = <span class="keyword">false</span>
<span class="keyword">end</span>

<span class="keyword">function</span> polyGen.VTrack:addProcessBlock(samples, smax)
<span class="keyword">for</span> i = <span class="number">0</span>,smax <span class="keyword">do</span>
<span class="keyword">if</span> self.playing <span class="keyword">and</span> self.wavepos &lt; len <span class="keyword">then</span>
self.wavepos = self.wavepos + <span class="number">1</span>
samples[<span class="number">0</span>][i] = samples[<span class="number">0</span>][i] + wave[<span class="number">0</span>][self.wavepos] <span class="comment">-- left
</span> samples[<span class="number">1</span>][i] = samples[<span class="number">1</span>][i] + wave[<span class="number">1</span>][self.wavepos] <span class="comment">-- right
</span> <span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span></pre>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 212
- 0
ports/protoplug/ProtoplugFiles/doc/index.html View File

@@ -0,0 +1,212 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Protoplug Lua API Reference</title>
<link rel="stylesheet" href="ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>




<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="modules/plugin.html">plugin</a></li>
<li><a href="modules/script.html">script</a></li>
<li><a href="modules/midi.html">midi</a></li>
<li><a href="modules/gui.html">gui</a></li>
<li><a href="modules/polyGen.html">polyGen</a></li>
<li><a href="modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="classes/juce.Component.html">juce.Component</a></li>
<li><a href="classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="classes/juce.Font.html">juce.Font</a></li>
<li><a href="classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="classes/juce.Image.html">juce.Image</a></li>
<li><a href="classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="classes/juce.Line.html">juce.Line</a></li>
<li><a href="classes/juce.Path.html">juce.Path</a></li>
<li><a href="classes/juce.Point.html">juce.Point</a></li>
<li><a href="classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">


<h2>Protoplug Lua API Reference</h2>

<h2>Modules</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="modules/plugin.html">plugin</a></td>
<td class="summary">Use <a href="modules/plugin.html#">plugin</a> to define the AU/VST audio plugin's behaviour.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/script.html">script</a></td>
<td class="summary">Use <a href="modules/script.html#">script</a> to handle script events, libraries and files.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/midi.html">midi</a></td>
<td class="summary"><a href="modules/midi.html#">midi</a> contains MIDI-related classes and functions.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/gui.html">gui</a></td>
<td class="summary">Use <a href="modules/gui.html#">gui</a> to define your script's custom graphical user interface.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/polyGen.html">polyGen</a></td>
<td class="summary">Use this module to create a polyphonic generator with virtual tracks.</td>
</tr>
<tr>
<td class="name" nowrap><a href="modules/stereoFx.html">stereoFx</a></td>
<td class="summary">Use this module to create a stereo effect.</td>
</tr>
</table>
<h2>Classes</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="classes/juce.AffineTransform.html">juce.AffineTransform</a></td>
<td class="summary">A geometric transformation.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></td>
<td class="summary">Class to read audio files.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Colour.html">juce.Colour</a></td>
<td class="summary">A simple colour class.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.ColourGradient.html">juce.ColourGradient</a></td>
<td class="summary">Colour Gradient.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Component.html">juce.Component</a></td>
<td class="summary">JUCE Component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.FillType.html">juce.FillType</a></td>
<td class="summary">Fill Type.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Font.html">juce.Font</a></td>
<td class="summary">Font.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Graphics.html">juce.Graphics</a></td>
<td class="summary">Graphics drawing target.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Image.html">juce.Image</a></td>
<td class="summary">Image.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Justification.html">juce.Justification</a></td>
<td class="summary">Justification.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></td>
<td class="summary">Lagrange Interpolator.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Line.html">juce.Line</a></td>
<td class="summary">Line.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Path.html">juce.Path</a></td>
<td class="summary">Path.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Point.html">juce.Point</a></td>
<td class="summary">Point.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></td>
<td class="summary">Rectangle Placement.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Rectangle_float.html">juce.Rectangle_float</a></td>
<td class="summary">A floating-point (sub-pixel) rectangle.</td>
</tr>
<tr>
<td class="name" nowrap><a href="classes/juce.Rectangle_int.html">juce.Rectangle_int</a></td>
<td class="summary">An integer (pixel-aligned) rectangle.</td>
</tr>
</table>
<h2>Examples</h2>
<table class="module_list">
<tr>
<td class="name" nowrap><a href="examples/classic-filter.lua.html">classic-filter.lua</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="examples/sine-organ.lua.html">sine-organ.lua</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="examples/midi-chordify.lua.html">midi-chordify.lua</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></td>
<td class="summary"></td>
</tr>
<tr>
<td class="name" nowrap><a href="examples/soundfile-test.lua.html">soundfile-test.lua</a></td>
<td class="summary"></td>
</tr>
</table>

</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 333
- 0
ports/protoplug/ProtoplugFiles/doc/ldoc.css View File

@@ -0,0 +1,333 @@
/* BEGIN RESET

Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.8.2r1
*/
html {
color: #000;
background: #FFF;
}
body {
text-align: center;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,img {
border: 0;
}
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
font-style: inherit;
font-weight: inherit;
}
del,ins {
text-decoration: none;
}
li {
list-style: bullet;
margin-left: 20px;
}
caption,th {
text-align: left;
}
h1,h2,h3,h4,h5,h6 {
font-size: 100%;
font-weight: bold;
}
q:before,q:after {
content: '';
}
abbr,acronym {
border: 0;
font-variant: normal;
}
sup {
vertical-align: baseline;
}
sub {
vertical-align: baseline;
}
legend {
color: #000;
}
input,button,textarea,select,optgroup,option {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
}
input,button,textarea,select {*font-size:100%;
}
/* END RESET */

body {
margin-left: 1em;
margin-right: 1em;
font-family: arial, helvetica, geneva, sans-serif;
background-color: #ffffff; margin: 0px;
}

code, tt { font-family: monospace; }
span.parameter { font-family:monospace; }
span.parameter:after { content:":"; }
span.types:before { content:"("; }
span.types:after { content:")"; }
.type { font-weight: bold; font-style:italic }

body, p, td, th { font-size: .95em; line-height: 1.2em;}

p, ul { margin: 10px 0 0 0px;}

strong { font-weight: bold;}

em { font-style: italic;}

h1 {
font-size: 1.5em;
margin: 10px 0 20px 0;
}
h2, h3, h4 { margin: 15px 0 10px 0; }
h2 {
border-bottom: 2px solid #ccc;
font-size: 1.25em;
margin: 19px 0 12px;
}
h3 { font-size: 1.15em; }
h4 { font-size: 1.06em; }

a:link { font-weight: bold; color: #004080; text-decoration: none; }
a:visited { font-weight: bold; color: #006699; text-decoration: none; }
a:link:hover { text-decoration: underline; }

hr {
color:#cccccc;
background: #00007f;
height: 1px;
}

blockquote { margin-left: 3em; }

ul { list-style-type: disc; }

p.name {
font-family: Consolas, monaco, monospace;
padding-top: 1em;
}

pre.example {
background-color: rgb(245, 245, 245);
border: 1px solid silver;
padding: 10px;
margin: 10px 0 10px 0;
font-family: Consolas, monaco, monospace;
font-size: .85em;
}

pre {
background-color: rgb(245,245,255);
border: 1px solid #cccccc;
padding: 10px;
margin: 10px 0 10px 0;
overflow: auto;
font-family: Consolas, monaco, monospace;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
font-size: 14px;
}


table.index { border: 1px #00007f; }
table.index td { text-align: left; vertical-align: top; }

#container {
/*margin-left: 1em;
margin-right: 1em;
background-color: #f4f4ff;*/
display: inline-block;
margin: 0 auto;
text-align: left;
}

#product {
text-align: center;
border-bottom: 1px solid #cccccc;
background-color: #ffffff;
}

#product big {
font-size: 2em;
}

#main {
background-color:#FFFFFF;
/*border-left: 2px solid #cccccc;*/
}

#navigation {
float: left;
width: 14em;
vertical-align: top;
background-color:#FFFFFF;
overflow: visible;
}

#navigation h2 {
background-color:#FFFFFF;
font-size:1.1em;
color:#000000;
text-align: left;
padding:0.2em;
/*border-top:1px solid #dddddd;*/
border-bottom:1px solid #dddddd;
}

#navigation ul
{
font-size:1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
}

#navigation li {
text-indent: -1em;
display: block;
margin: 3px 0px 0px 22px;
word-wrap: break-word;
}

#navigation li li a {
margin: 0px 3px 0px -1em;
}

#content {
margin-left: 14em;
padding: 1em;
width: 700px;
border-left: 2px solid #cccccc;
/*border-right: 2px solid #cccccc;*/
background-color: #ffffff;
}

#about {
clear: both;
padding: 5px;
border-top: 2px solid #cccccc;
background-color: #ffffff;
}

@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a { font-weight: bold; color: #004080; text-decoration: underline; }

#main {
background-color: #ffffff;
border-left: 0px;
}

#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}

#content {
padding: 1em;
background-color: #ffffff;
}

#navigation {
display: none;
}
pre.example {
font-family: Consolas, monaco, monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}

table.module_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.module_list td.name { background-color: #f4f4ff; ; min-width: 200px; }
table.module_list td.summary { width: 100%; }

table.function_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.function_list td.name { background-color: #f6f6ff; ; min-width: 200px; padding: 7px 5px; }
table.function_list td.summary { width: 100%; }

dl.table dt, dl.function dt {
background-color: #f4f4ff;
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
padding: 0.7em 0 0.5em 1em;
}
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
dl.table h3, dl.function h3 {font-size: .95em;}

ul.nowrap {
overflow:auto;
whitespace:nowrap;
}

/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }

/* styles for prettification of source */
pre .comment { color: #558817; }
pre .constant { color: #a8660d; }
pre .escape { color: #844631; }
pre .keyword { color: #2239a8; font-weight: bold; }
pre .library { color: #0e7c6b; }
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
pre .string { color: #a8660d; }
pre .number { color: #f8660d; }
pre .operator { color: #2239a8; font-weight: bold; }
pre .preprocessor, pre .prepro { color: #a33243; }
pre .global { color: #800080; }
pre .prompt { color: #558817; }
pre .url { color: #272fc2; text-decoration: underline; }

.wrapman { display: inline-block; white-space: normal; min-width: 460px; }
.proto_subtitle {color: #888; position: relative; top: -12px;}
.function_list .proto_prefix {color: #789;}
.osarlogo {
display: block;
width: 132px;
height: 121px;
background: url("osar-121.png") no-repeat scroll 0 0 transparent;
margin: 0 auto;
}

+ 677
- 0
ports/protoplug/ProtoplugFiles/doc/modules/gui.html View File

@@ -0,0 +1,677 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Module gui</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Class_gui_MouseEvent">Class gui.MouseEvent </a></li>
<li><a href="#Class_gui_MouseWheelDetails">Class gui.MouseWheelDetails </a></li>
<li><a href="#Class_gui_KeyPress">Class gui.KeyPress </a></li>
</ul>


<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><strong>gui</strong></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>gui</code></h1>
<p>Use <a href="../modules/gui.html#">gui</a> to define your script's custom graphical user interface.</p>
<p>

<p> Custom GUI example : <a href="../examples/sinemouse-demo.lua.html#">sinemouse-demo.lua</a></p>

<p> The <a href="../modules/gui.html#">gui</a> global is available to every protoplug script after including the
main protoplug header :</p>
<pre><code>require "include/protoplug"
</code></pre>
</p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#addHandler"><span class="proto_prefix">gui</span>.addHandler (event, handler)</a></td>
<td class="summary">Add a handler for a GUI event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#paint"><span class="proto_prefix">gui</span>.paint (g)</a></td>
<td class="summary">Override to paint a custom GUI.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getComponent"><span class="proto_prefix">gui</span>.getComponent ()</a></td>
<td class="summary">Get GUI Component.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#FocusCause"><span class="proto_prefix">gui</span>.FocusCause</a></td>
<td class="summary">Focus change causes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ModifierKeys"><span class="proto_prefix">gui</span>.ModifierKeys</a></td>
<td class="summary">Keyboard and mouse modifiers.</td>
</tr>
</table>
<h2><a href="#Class_gui_MouseEvent">Class gui.MouseEvent </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#MouseEvent.x"><span class="proto_prefix">gui.MouseEvent</span>.x</a></td>
<td class="summary">X.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.y"><span class="proto_prefix">gui.MouseEvent</span>.y</a></td>
<td class="summary">Y.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.mods"><span class="proto_prefix">gui.MouseEvent</span>.mods</a></td>
<td class="summary">Modifier keys.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.eventComponent"><span class="proto_prefix">gui.MouseEvent</span>.eventComponent</a></td>
<td class="summary">Event component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.originalComponent"><span class="proto_prefix">gui.MouseEvent</span>.originalComponent</a></td>
<td class="summary">Original component.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.eventTime"><span class="proto_prefix">gui.MouseEvent</span>.eventTime</a></td>
<td class="summary">Time.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.mouseDownTime"><span class="proto_prefix">gui.MouseEvent</span>.mouseDownTime</a></td>
<td class="summary">Mouse down time.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.mouseDownPos"><span class="proto_prefix">gui.MouseEvent</span>.mouseDownPos</a></td>
<td class="summary">Mouse down position.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.numberOfClicks"><span class="proto_prefix">gui.MouseEvent</span>.numberOfClicks</a></td>
<td class="summary">Number of clicks.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseEvent.wasMovedSinceMouseDown"><span class="proto_prefix">gui.MouseEvent</span>.wasMovedSinceMouseDown</a></td>
<td class="summary">Was moved since mouse down.</td>
</tr>
</table>
<h2><a href="#Class_gui_MouseWheelDetails">Class gui.MouseWheelDetails </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#MouseWheelDetails.deltaX"><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaX</a></td>
<td class="summary">X delta.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseWheelDetails.deltaY"><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaY</a></td>
<td class="summary">Y delta.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseWheelDetails.isReversed"><span class="proto_prefix">gui.MouseWheelDetails</span>.isReversed</a></td>
<td class="summary">Is reversed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MouseWheelDetails.isSmooth"><span class="proto_prefix">gui.MouseWheelDetails</span>.isSmooth</a></td>
<td class="summary">Is smooth.</td>
</tr>
</table>
<h2><a href="#Class_gui_KeyPress">Class gui.KeyPress </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#KeyPress.keyCode"><span class="proto_prefix">gui.KeyPress</span>.keyCode</a></td>
<td class="summary">Key code.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#KeyPress.mods"><span class="proto_prefix">gui.KeyPress</span>.mods</a></td>
<td class="summary">Modifier Keys.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#KeyPress.textCharacter"><span class="proto_prefix">gui.KeyPress</span>.textCharacter</a></td>
<td class="summary">Text character.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "addHandler"></a>
<strong><span class="proto_prefix">gui</span>.addHandler (event, handler)</strong>
</dt>
<dd>
Add a handler for a GUI event. </p>

<p>Here's a list of the events and their parameters, showing how they
should be received :</p>
<pre><code>gui.addHandler("resized", function() ... end)
gui.addHandler("focusGained", function(focusCause) ... end)
gui.addHandler("focusLost", function(focusCause) ... end)
gui.addHandler("modifierKeysChanged", function(modifierKeys) ... end)
gui.addHandler("mouseMove", function(mouseEvent) ... end)
gui.addHandler("mouseEnter", function(mouseEvent) ... end)
gui.addHandler("mouseExit", function(mouseEvent) ... end)
gui.addHandler("mouseDown", function(mouseEvent) ... end)
gui.addHandler("mouseDrag", function(mouseEvent) ... end)
gui.addHandler("mouseUp", function(mouseEvent) ... end)
gui.addHandler("mouseDoubleClick", function(mouseEvent) ... end)
gui.addHandler("mouseWheelMove", function(mouseEvent, mouseWheelDetails) ... end)
gui.addHandler("keyPressed", function(keyPress, srcComponent) ... end)
gui.addHandler("keyStateChanged", function(keyPress, srcComponent) ... end)
</code></pre>
<p>Parameters received by the event handlers are of
type <a href="../modules/gui.html#FocusCause">FocusCause</a>, <a href="../modules/gui.html#ModifierKeys">ModifierKeys</a>, <a href="../modules/gui.html#gui.MouseEvent">MouseEvent</a>, <a href="../modules/gui.html#gui.MouseWheelDetails">MouseWheelDetails</a>,
and <a href="../modules/gui.html#gui.KeyPress">KeyPress</a>.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the event to handle
</li>
<li><span class="parameter">handler</span>
<span class="types"><span class="type">function</span></span>
a function to add the event's handlers
</li>
</ul>



<h3>See also:</h3>
<ul>
<li><a href="../modules/script.html#addHandler">script.addHandler</a></li>
<li><a href="../modules/plugin.html#addHandler">plugin.addHandler</a></li>
</ul>


</dd>
<dt>
<a name = "paint"></a>
<strong><span class="proto_prefix">gui</span>.paint (g)</strong>
</dt>
<dd>
Override to paint a custom GUI.
Define this function to paint something in the custom GUI space.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">g</span>
<span class="types"><a class="type" href="../classes/juce.Graphics.html#">juce.Graphics</a></span>
a JUCE graphics target
</li>
</ul>





</dd>
<dt>
<a name = "getComponent"></a>
<strong><span class="proto_prefix">gui</span>.getComponent ()</strong>
</dt>
<dd>
Get GUI Component.

</ul>


<h3>Returns:</h3>
<ol>

the current GUI component, or <code>nil</code> if the GUI
has not been opened yet.
</ol>




</dd>
</dl>
<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "FocusCause"></a>
<strong><span class="proto_prefix">gui</span>.FocusCause</strong>
</dt>
<dd>
Focus change causes.
Values received by the <code>focusGained</code> and <code>focusLost</code> handlers.

</ul>

<h3>Fields:</h3>
<ul>
<li><span class="parameter">focusChangedByMouseClick</span>
0
</li>
<li><span class="parameter">focusChangedByTabKey</span>
1
</li>
<li><span class="parameter">focusChangedDirectly</span>
2
</li>
</ul>



<h3>See also:</h3>
<ul>
<a href="../modules/gui.html#addHandler">gui.addHandler</a>
</ul>


</dd>
<dt>
<a name = "ModifierKeys"></a>
<strong><span class="proto_prefix">gui</span>.ModifierKeys</strong>
</dt>
<dd>
Keyboard and mouse modifiers.
Contained in every <a href="../modules/gui.html#gui.MouseEvent">gui.MouseEvent</a> and received by the
<code>modifierKeysChanged</code> handler.

</ul>

<h3>Fields:</h3>
<ul>
<li><span class="parameter">noModifiers</span>
0
</li>
<li><span class="parameter">shiftModifier</span>
1
</li>
<li><span class="parameter">ctrlModifier</span>
2
</li>
<li><span class="parameter">altModifier</span>
4
</li>
<li><span class="parameter">leftButtonModifier</span>
16
</li>
<li><span class="parameter">rightButtonModifier</span>
32
</li>
<li><span class="parameter">middleButtonModifier</span>
64
</li>
<li><span class="parameter">commandModifier</span>
8
</li>
<li><span class="parameter">ctrlAltCommandModifiers</span>
14
</li>
</ul>





</dd>
</dl>
<h2><a name="Class_gui_MouseEvent"></a>Class gui.MouseEvent </h2>

A mouse event as received by GUI handlers (see <a href="../modules/gui.html#addHandler">gui.addHandler</a>)
<br><br>
<dl class="function">
<dt>
<a name = "MouseEvent.x"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.x</strong>
</dt>
<dd>
X.

</ul>






</dd>
<dt>
<a name = "MouseEvent.y"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.y</strong>
</dt>
<dd>
Y.

</ul>






</dd>
<dt>
<a name = "MouseEvent.mods"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.mods</strong>
</dt>
<dd>
Modifier keys.
Values defined in <a href="../modules/gui.html#ModifierKeys">gui.ModifierKeys</a>

</ul>






</dd>
<dt>
<a name = "MouseEvent.eventComponent"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.eventComponent</strong>
</dt>
<dd>
Event component.

</ul>






</dd>
<dt>
<a name = "MouseEvent.originalComponent"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.originalComponent</strong>
</dt>
<dd>
Original component.

</ul>






</dd>
<dt>
<a name = "MouseEvent.eventTime"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.eventTime</strong>
</dt>
<dd>
Time.

</ul>






</dd>
<dt>
<a name = "MouseEvent.mouseDownTime"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.mouseDownTime</strong>
</dt>
<dd>
Mouse down time.

</ul>






</dd>
<dt>
<a name = "MouseEvent.mouseDownPos"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.mouseDownPos</strong>
</dt>
<dd>
Mouse down position.

</ul>






</dd>
<dt>
<a name = "MouseEvent.numberOfClicks"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.numberOfClicks</strong>
</dt>
<dd>
Number of clicks.

</ul>






</dd>
<dt>
<a name = "MouseEvent.wasMovedSinceMouseDown"></a>
<strong><span class="proto_prefix">gui.MouseEvent</span>.wasMovedSinceMouseDown</strong>
</dt>
<dd>
Was moved since mouse down.

</ul>






</dd>
</dl>
<h2><a name="Class_gui_MouseWheelDetails"></a>Class gui.MouseWheelDetails </h2>

As received by the <code>mouseWheelMove</code> handler (see <a href="../modules/gui.html#addHandler">gui.addHandler</a>)
<br><br>
<dl class="function">
<dt>
<a name = "MouseWheelDetails.deltaX"></a>
<strong><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaX</strong>
</dt>
<dd>
X delta.

</ul>






</dd>
<dt>
<a name = "MouseWheelDetails.deltaY"></a>
<strong><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaY</strong>
</dt>
<dd>
Y delta.

</ul>






</dd>
<dt>
<a name = "MouseWheelDetails.isReversed"></a>
<strong><span class="proto_prefix">gui.MouseWheelDetails</span>.isReversed</strong>
</dt>
<dd>
Is reversed.

</ul>






</dd>
<dt>
<a name = "MouseWheelDetails.isSmooth"></a>
<strong><span class="proto_prefix">gui.MouseWheelDetails</span>.isSmooth</strong>
</dt>
<dd>
Is smooth.

</ul>






</dd>
</dl>
<h2><a name="Class_gui_KeyPress"></a>Class gui.KeyPress </h2>

As received by the <code>keyPressed</code> and <code>keyStateChanged</code> handlers (see <a href="../modules/gui.html#addHandler">gui.addHandler</a>)
<br><br>
<dl class="function">
<dt>
<a name = "KeyPress.keyCode"></a>
<strong><span class="proto_prefix">gui.KeyPress</span>.keyCode</strong>
</dt>
<dd>
Key code.
(undecipherable for now)

</ul>






</dd>
<dt>
<a name = "KeyPress.mods"></a>
<strong><span class="proto_prefix">gui.KeyPress</span>.mods</strong>
</dt>
<dd>
Modifier Keys.

</ul>






</dd>
<dt>
<a name = "KeyPress.textCharacter"></a>
<strong><span class="proto_prefix">gui.KeyPress</span>.textCharacter</strong>
</dt>
<dd>
Text character.

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 865
- 0
ports/protoplug/ProtoplugFiles/doc/modules/midi.html View File

@@ -0,0 +1,865 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Module midi</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Class_midi_Buffer">Class midi.Buffer </a></li>
<li><a href="#Class_midi_Event">Class midi.Event </a></li>
</ul>


<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><strong>midi</strong></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>midi</code></h1>
<p><a href="../modules/midi.html#">midi</a> contains MIDI-related classes and functions.</p>
<p>

<p> Example of receiving MIDI input : <a href="../examples/sine-organ.lua.html#">sine-organ.lua</a>.</p>

<p> Example of producing MIDI output : <a href="../examples/midi-chordify.lua.html#">midi-chordify.lua</a>.</p>

<p> The <a href="../modules/midi.html#">midi</a> global is available to every protoplug script after including the
main protoplug header :</p>
<pre><code>require "include/protoplug"
</code></pre>
</p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#noteToFreq"><span class="proto_prefix">midi</span>.noteToFreq (note)</a></td>
<td class="summary">Convert a MIDI note number to frequency.</td>
</tr>
</table>
<h2><a href="#Class_midi_Buffer">Class midi.Buffer </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Buffer:eachEvent"><span class="proto_prefix">midi.Buffer</span>:eachEvent ()</a></td>
<td class="summary">Iterate over each <a href="../modules/midi.html#midi.Event">midi.Event</a> in the buffer.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Buffer:clear"><span class="proto_prefix">midi.Buffer</span>:clear ()</a></td>
<td class="summary">Remove all MIDI events from the buffer.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Buffer:addEvent"><span class="proto_prefix">midi.Buffer</span>:addEvent (event)</a></td>
<td class="summary">Add a MIDI event.</td>
</tr>
</table>
<h2><a href="#Class_midi_Event">Class midi.Event </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#midi.Event:Event"><span class="proto_prefix">midi</span>.Event (other)</a></td>
<td class="summary">Constructor : copy another event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#midi.Event:Event"><span class="proto_prefix">midi</span>.Event (time, dataSize[, data])</a></td>
<td class="summary">Constructor : create a custom event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event.noteOn"><span class="proto_prefix">midi.Event</span>.noteOn (channel, note, vel[, pos=0])</a></td>
<td class="summary">Constructor : note on.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event.noteOff"><span class="proto_prefix">midi.Event</span>.noteOff (channel, note[, vel=0[, pos=0]])</a></td>
<td class="summary">Constructor : note off.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event.pitchBend"><span class="proto_prefix">midi.Event</span>.pitchBend (channel, pitch[, pos=0])</a></td>
<td class="summary">Constructor : pitch bend.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event.control"><span class="proto_prefix">midi.Event</span>.control (channel, number, value[, pos=0])</a></td>
<td class="summary">Constructor : Control change.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:getChannel"><span class="proto_prefix">midi.Event</span>:getChannel ()</a></td>
<td class="summary">Get channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:setChannel"><span class="proto_prefix">midi.Event</span>:setChannel (channel)</a></td>
<td class="summary">Set channel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:isNoteOn"><span class="proto_prefix">midi.Event</span>:isNoteOn ()</a></td>
<td class="summary">Is a note on event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:isNoteOff"><span class="proto_prefix">midi.Event</span>:isNoteOff ()</a></td>
<td class="summary">Is a note off event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:getNote"><span class="proto_prefix">midi.Event</span>:getNote ()</a></td>
<td class="summary">Get note.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:setNote"><span class="proto_prefix">midi.Event</span>:setNote (note)</a></td>
<td class="summary">Set note.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:getVel"><span class="proto_prefix">midi.Event</span>:getVel ()</a></td>
<td class="summary">Get velocity.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:setVel"><span class="proto_prefix">midi.Event</span>:setVel (vel)</a></td>
<td class="summary">Set velocity.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:isPitchBend"><span class="proto_prefix">midi.Event</span>:isPitchBend ()</a></td>
<td class="summary">Is a pitch bend event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:getPitchBendValue"><span class="proto_prefix">midi.Event</span>:getPitchBendValue ()</a></td>
<td class="summary">Get pitch bend value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:isControl"><span class="proto_prefix">midi.Event</span>:isControl ()</a></td>
<td class="summary">Is a Control Change event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:getControlNumber"><span class="proto_prefix">midi.Event</span>:getControlNumber ()</a></td>
<td class="summary">Get control number.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event:getControlValue"><span class="proto_prefix">midi.Event</span>:getControlValue ()</a></td>
<td class="summary">Get control value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event.time"><span class="proto_prefix">midi.Event</span>.time</a></td>
<td class="summary">Sample position relatively to the start of the block.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event.dataSize"><span class="proto_prefix">midi.Event</span>.dataSize</a></td>
<td class="summary">Size of the MIDI message in bytes</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Event.data"><span class="proto_prefix">midi.Event</span>.data</a></td>
<td class="summary">The raw MIDI message
(<code>const uint8_t*</code> cdata)</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "noteToFreq"></a>
<strong><span class="proto_prefix">midi</span>.noteToFreq (note)</strong>
</dt>
<dd>
Convert a MIDI note number to frequency.
Call this function to get a note's frequency.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">note</span>
the MIDI note (0-127)
</li>
</ul>

<h3>Returns:</h3>
<ol>

the frequency in samples^-1
</ol>




</dd>
</dl>
<h2><a name="Class_midi_Buffer"></a>Class midi.Buffer </h2>

A buffer containing midi events, as received by <a href="../modules/plugin.html#processBlock">plugin.processBlock</a>
<br><br>
<dl class="function">
<dt>
<a name = "Buffer:eachEvent"></a>
<strong><span class="proto_prefix">midi.Buffer</span>:eachEvent ()</strong>
</dt>
<dd>
Iterate over each <a href="../modules/midi.html#midi.Event">midi.Event</a> in the buffer.

</ul>





<h3>Usage:</h3>
<ul>
<pre class="example"><span class="keyword">for</span> ev <span class="keyword">in</span> myBuffer:eachEvent() <span class="keyword">do</span> <span class="global">print</span>(ev:getNote()) <span class="keyword">end</span></pre>
</ul>

</dd>
<dt>
<a name = "Buffer:clear"></a>
<strong><span class="proto_prefix">midi.Buffer</span>:clear ()</strong>
</dt>
<dd>
Remove all MIDI events from the buffer.

</ul>






</dd>
<dt>
<a name = "Buffer:addEvent"></a>
<strong><span class="proto_prefix">midi.Buffer</span>:addEvent (event)</strong>
</dt>
<dd>
Add a MIDI event.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><a class="type" href="../modules/midi.html#midi.Event">midi.Event</a></span>



</li>
</ul>





</dd>
</dl>
<h2><a name="Class_midi_Event"></a>Class midi.Event </h2>

A single midi event as returned by <a href="../modules/midi.html#Buffer:eachEvent">Buffer:eachEvent</a>
<br><br>
<dl class="function">
<dt>
<a name = "midi.Event:Event"></a>
<strong><span class="proto_prefix">midi</span>.Event (other)</strong>
</dt>
<dd>
Constructor : copy another event.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">other</span>
<span class="types"><a class="type" href="../modules/midi.html#midi.Event">midi.Event</a></span>



</li>
</ul>





</dd>
<dt>
<a name = "midi.Event:Event"></a>
<strong><span class="proto_prefix">midi</span>.Event (time, dataSize[, data])</strong>
</dt>
<dd>
Constructor : create a custom event.
Create an event from given bytes (or zeros if not supplied)

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">time</span>



</li>
<li><span class="parameter">dataSize</span>



</li>
<li><span class="parameter">data</span>



</li>
</ul>




<h3>Usage:</h3>
<ul>
<pre class="example">myEv = midi.Event(<span class="number">0</span>, <span class="number">3</span>, {<span class="number">0x90</span>, <span class="number">0x30</span>, <span class="number">0x7f</span>}) -- note on</pre>
</ul>

</dd>
<dt>
<a name = "Event.noteOn"></a>
<strong><span class="proto_prefix">midi.Event</span>.noteOn (channel, note, vel[, pos=0])</strong>
</dt>
<dd>
Constructor : note on.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">channel</span>
(1-16)
</li>
<li><span class="parameter">note</span>
(0-127)
</li>
<li><span class="parameter">vel</span>
(1-127)
</li>
<li><span class="parameter">pos</span>
sample offset
(<em>default</em> 0)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../modules/midi.html#midi.Event">midi.Event</a></span>



</ol>




</dd>
<dt>
<a name = "Event.noteOff"></a>
<strong><span class="proto_prefix">midi.Event</span>.noteOff (channel, note[, vel=0[, pos=0]])</strong>
</dt>
<dd>
Constructor : note off.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">channel</span>
(1-16)
</li>
<li><span class="parameter">note</span>
(0-127)
</li>
<li><span class="parameter">vel</span>
(0-127)
(<em>default</em> 0)
</li>
<li><span class="parameter">pos</span>
sample offset
(<em>default</em> 0)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../modules/midi.html#midi.Event">midi.Event</a></span>



</ol>




</dd>
<dt>
<a name = "Event.pitchBend"></a>
<strong><span class="proto_prefix">midi.Event</span>.pitchBend (channel, pitch[, pos=0])</strong>
</dt>
<dd>
Constructor : pitch bend.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">channel</span>
(1-16)
</li>
<li><span class="parameter">pitch</span>
bend value (0-16383)
</li>
<li><span class="parameter">pos</span>
sample offset
(<em>default</em> 0)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../modules/midi.html#midi.Event">midi.Event</a></span>



</ol>




</dd>
<dt>
<a name = "Event.control"></a>
<strong><span class="proto_prefix">midi.Event</span>.control (channel, number, value[, pos=0])</strong>
</dt>
<dd>
Constructor : Control change.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">channel</span>
(1-16)
</li>
<li><span class="parameter">number</span>
control number (0-247)
</li>
<li><span class="parameter">value</span>
control value (0-127)
</li>
<li><span class="parameter">pos</span>
sample offset
(<em>default</em> 0)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../modules/midi.html#midi.Event">midi.Event</a></span>



</ol>




</dd>
<dt>
<a name = "Event:getChannel"></a>
<strong><span class="proto_prefix">midi.Event</span>:getChannel ()</strong>
</dt>
<dd>
Get channel.

</ul>


<h3>Returns:</h3>
<ol>

the MIDI channel (1-16)
</ol>




</dd>
<dt>
<a name = "Event:setChannel"></a>
<strong><span class="proto_prefix">midi.Event</span>:setChannel (channel)</strong>
</dt>
<dd>
Set channel.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">channel</span>
the MIDI channel (1-16)
</li>
</ul>





</dd>
<dt>
<a name = "Event:isNoteOn"></a>
<strong><span class="proto_prefix">midi.Event</span>:isNoteOn ()</strong>
</dt>
<dd>
Is a note on event.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
whether event is a note on.
</ol>




</dd>
<dt>
<a name = "Event:isNoteOff"></a>
<strong><span class="proto_prefix">midi.Event</span>:isNoteOff ()</strong>
</dt>
<dd>
Is a note off event.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
whether event is a note off.
</ol>




</dd>
<dt>
<a name = "Event:getNote"></a>
<strong><span class="proto_prefix">midi.Event</span>:getNote ()</strong>
</dt>
<dd>
Get note.

</ul>


<h3>Returns:</h3>
<ol>

the MIDI note number (0-127)
</ol>




</dd>
<dt>
<a name = "Event:setNote"></a>
<strong><span class="proto_prefix">midi.Event</span>:setNote (note)</strong>
</dt>
<dd>
Set note.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">note</span>
the MIDI note number (0-127)
</li>
</ul>





</dd>
<dt>
<a name = "Event:getVel"></a>
<strong><span class="proto_prefix">midi.Event</span>:getVel ()</strong>
</dt>
<dd>
Get velocity.

</ul>


<h3>Returns:</h3>
<ol>

the MIDI velocity (1-127)
</ol>




</dd>
<dt>
<a name = "Event:setVel"></a>
<strong><span class="proto_prefix">midi.Event</span>:setVel (vel)</strong>
</dt>
<dd>
Set velocity.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">vel</span>
the MIDI velocity (1-127)
</li>
</ul>





</dd>
<dt>
<a name = "Event:isPitchBend"></a>
<strong><span class="proto_prefix">midi.Event</span>:isPitchBend ()</strong>
</dt>
<dd>
Is a pitch bend event.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
whether event is a pitch bend on.
</ol>




</dd>
<dt>
<a name = "Event:getPitchBendValue"></a>
<strong><span class="proto_prefix">midi.Event</span>:getPitchBendValue ()</strong>
</dt>
<dd>
Get pitch bend value.

</ul>


<h3>Returns:</h3>
<ol>

pitch bend value (0-16383).
</ol>




</dd>
<dt>
<a name = "Event:isControl"></a>
<strong><span class="proto_prefix">midi.Event</span>:isControl ()</strong>
</dt>
<dd>
Is a Control Change event.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>
whether event is a control change.
</ol>




</dd>
<dt>
<a name = "Event:getControlNumber"></a>
<strong><span class="proto_prefix">midi.Event</span>:getControlNumber ()</strong>
</dt>
<dd>
Get control number.

</ul>


<h3>Returns:</h3>
<ol>

control number (0-247).
</ol>




</dd>
<dt>
<a name = "Event:getControlValue"></a>
<strong><span class="proto_prefix">midi.Event</span>:getControlValue ()</strong>
</dt>
<dd>
Get control value.

</ul>


<h3>Returns:</h3>
<ol>

control value (0-127).
</ol>




</dd>
<dt>
<a name = "Event.time"></a>
<strong><span class="proto_prefix">midi.Event</span>.time</strong>
</dt>
<dd>
Sample position relatively to the start of the block.
This value is often 0 because most hosts call <a href="../modules/plugin.html#processBlock">plugin.processBlock</a> at the
beginning of beats and beat divisions. It is never higher than the
current <a href="../modules/plugin.html#processBlock">plugin.processBlock</a>'s <code>smax</code> and any events created by the script
should respect this rule.

</ul>






</dd>
<dt>
<a name = "Event.dataSize"></a>
<strong><span class="proto_prefix">midi.Event</span>.dataSize</strong>
</dt>
<dd>
Size of the MIDI message in bytes

</ul>






</dd>
<dt>
<a name = "Event.data"></a>
<strong><span class="proto_prefix">midi.Event</span>.data</strong>
</dt>
<dd>
The raw MIDI message
(<code>const uint8_t*</code> cdata)

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 792
- 0
ports/protoplug/ProtoplugFiles/doc/modules/plugin.html View File

@@ -0,0 +1,792 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Module plugin</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Callback_functions">Callback functions </a></li>
<li><a href="#Override_functions">Override functions </a></li>
<li><a href="#Class_plugin_PositionInfo">Class plugin.PositionInfo </a></li>
</ul>


<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><strong>plugin</strong></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>plugin</code></h1>
<p>Use <a href="../modules/plugin.html#">plugin</a> to define the AU/VST audio plugin's behaviour.</p>
<p>

<p> The <a href="../modules/plugin.html#">plugin</a> global is available to every protoplug script after including the
main protoplug header :</p>
<pre><code>require "include/protoplug"
</code></pre>
</p>


<h2><a href="#Callback_functions">Callback functions </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#manageParams"><span class="proto_prefix">plugin</span>.manageParams (paramList)</a></td>
<td class="summary">Automatically set up a list of parameters.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#setParameter"><span class="proto_prefix">plugin</span>.setParameter (index, value)</a></td>
<td class="summary">Set (automate) a parameter's value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getParameter"><span class="proto_prefix">plugin</span>.getParameter (index)</a></td>
<td class="summary">Get a parameter's value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getCurrentPosition"><span class="proto_prefix">plugin</span>.getCurrentPosition ()</a></td>
<td class="summary">Get host position info, if available.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getSampleRate"><span class="proto_prefix">plugin</span>.getSampleRate ()</a></td>
<td class="summary">Get host samplerate.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#isSampleRateKnown"><span class="proto_prefix">plugin</span>.isSampleRateKnown ()</a></td>
<td class="summary">Check if the samplerate is known.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#addHandler"><span class="proto_prefix">plugin</span>.addHandler (event, handler)</a></td>
<td class="summary">Add a handler for a VST/AU event.</td>
</tr>
</table>
<h2><a href="#Override_functions">Override functions </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#processBlock"><span class="proto_prefix">plugin</span>.processBlock (samples, smax, midiBuf)</a></td>
<td class="summary">Process Audio Block.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getParameterName"><span class="proto_prefix">plugin</span>.getParameterName (index)</a></td>
<td class="summary">Return the name of a parameter.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getParameterText"><span class="proto_prefix">plugin</span>.getParameterText (index)</a></td>
<td class="summary">Return the representation of a parameter's value.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#paramChanged"><span class="proto_prefix">plugin</span>.paramChanged (index)</a></td>
<td class="summary">Handle parameter changes.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#getTailLengthSeconds"><span class="proto_prefix">plugin</span>.getTailLengthSeconds ()</a></td>
<td class="summary">Return the tail length in seconds (effects only).</td>
</tr>
</table>
<h2><a href="#Class_plugin_PositionInfo">Class plugin.PositionInfo </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#PositionInfo.bpm"><span class="proto_prefix">plugin.PositionInfo</span>.bpm</a></td>
<td class="summary">Host tempo (beats per minute)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.timeSigNumerator"><span class="proto_prefix">plugin.PositionInfo</span>.timeSigNumerator</a></td>
<td class="summary">Time signature numerator ie.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.timeSigDenominator"><span class="proto_prefix">plugin.PositionInfo</span>.timeSigDenominator</a></td>
<td class="summary">Time signature denominator ie.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.timeInSamples"><span class="proto_prefix">plugin.PositionInfo</span>.timeInSamples</a></td>
<td class="summary">Current position on the host's timeline (samples)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.timeInSeconds"><span class="proto_prefix">plugin.PositionInfo</span>.timeInSeconds</a></td>
<td class="summary">Current position on the host's timeline (seconds)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.editOriginTime"><span class="proto_prefix">plugin.PositionInfo</span>.editOriginTime</a></td>
<td class="summary">Position of the start of the edit region on the host's timeline</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.ppqPosition"><span class="proto_prefix">plugin.PositionInfo</span>.ppqPosition</a></td>
<td class="summary">Current position on the host's timeline (pulses-per-quarter-note)</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.ppqPositionOfLastBarStart"><span class="proto_prefix">plugin.PositionInfo</span>.ppqPositionOfLastBarStart</a></td>
<td class="summary">Position of the last bar start (pulses-per-quarter-note).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.frameRate"><span class="proto_prefix">plugin.PositionInfo</span>.frameRate</a></td>
<td class="summary">Video frame rate</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.isPlaying"><span class="proto_prefix">plugin.PositionInfo</span>.isPlaying</a></td>
<td class="summary">Is playing</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.isRecording"><span class="proto_prefix">plugin.PositionInfo</span>.isRecording</a></td>
<td class="summary">Is recording</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.ppqLoopStart"><span class="proto_prefix">plugin.PositionInfo</span>.ppqLoopStart</a></td>
<td class="summary">Position of the loop start (pulses-per-quarter-note).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.ppqLoopEnd"><span class="proto_prefix">plugin.PositionInfo</span>.ppqLoopEnd</a></td>
<td class="summary">Position of the loop end (pulses-per-quarter-note).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#PositionInfo.isLooping"><span class="proto_prefix">plugin.PositionInfo</span>.isLooping</a></td>
<td class="summary">Is looping</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Callback_functions"></a>Callback functions </h2>

Functions that your script can call.
<br><br>
<dl class="function">
<dt>
<a name = "manageParams"></a>
<strong><span class="proto_prefix">plugin</span>.manageParams (paramList)</strong>
</dt>
<dd>
Automatically set up a list of parameters.
Call this function with a table containing parameter definitions as argument, and
it will perform the repetitive task of defining all the parameter-related overrides.</p>

<p> The format of the parameter list is demonstrated in <a href="../examples/classic-filter.lua.html#">classic-filter.lua</a>

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">paramList</span>
a table with parameter definitions (see example)
</li>
</ul>





</dd>
<dt>
<a name = "setParameter"></a>
<strong><span class="proto_prefix">plugin</span>.setParameter (index, value)</strong>
</dt>
<dd>
Set (automate) a parameter's value.
The value must be normalized to be between 0 and 1.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
parameter index (0-126)
</li>
<li><span class="parameter">value</span>
parameter value (0-1)
</li>
</ul>





</dd>
<dt>
<a name = "getParameter"></a>
<strong><span class="proto_prefix">plugin</span>.getParameter (index)</strong>
</dt>
<dd>
Get a parameter's value.
The values are between 0 and 1, but different minimums and maximums can
be easily simulated using <a href="../modules/plugin.html#manageParams">plugin.manageParams</a>.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
parameter index (0-126)
</li>
</ul>





</dd>
<dt>
<a name = "getCurrentPosition"></a>
<strong><span class="proto_prefix">plugin</span>.getCurrentPosition ()</strong>
</dt>
<dd>
Get host position info, if available.
Only call this from within <a href="../modules/plugin.html#processBlock">processBlock</a>.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="../modules/plugin.html#plugin.PositionInfo">plugin.PositionInfo</a></span>
current position info, or <code>nil</code> depending on the host.
</ol>




</dd>
<dt>
<a name = "getSampleRate"></a>
<strong><span class="proto_prefix">plugin</span>.getSampleRate ()</strong>
</dt>
<dd>
Get host samplerate.
The value is unknown until the plugin <code>prepareToPlay</code> event has been emitted.
The value is always known in <a href="../modules/plugin.html#processBlock">processBlock</a>. An error is caused if an
attempt is made to access the sample rate prematurely.

</ul>


<h3>Returns:</h3>
<ol>

current samplerate.
</ol>


<h3>See also:</h3>
<ul>
<a href="../modules/plugin.html#addHandler">plugin.addHandler</a>
</ul>


</dd>
<dt>
<a name = "isSampleRateKnown"></a>
<strong><span class="proto_prefix">plugin</span>.isSampleRateKnown ()</strong>
</dt>
<dd>
Check if the samplerate is known.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><span class="type">boolean</span></span>



</ol>




</dd>
<dt>
<a name = "addHandler"></a>
<strong><span class="proto_prefix">plugin</span>.addHandler (event, handler)</strong>
</dt>
<dd>

<p>Add a handler for a VST/AU event.
The following events are available :</p>

<ul>
<li><code>"prepareToPlay"</code> - Emitted before the first call to <a href="../modules/plugin.html#processBlock">processBlock</a>, when the samplerate is known.</li>
</ul>


</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the event to handle
</li>
<li><span class="parameter">handler</span>
<span class="types"><span class="type">function</span></span>
a function to add the event's handlers
</li>
</ul>



<h3>See also:</h3>
<ul>
<li><a href="../modules/script.html#addHandler">script.addHandler</a></li>
<li><a href="../modules/gui.html#addHandler">gui.addHandler</a></li>
</ul>


</dd>
</dl>
<h2><a name="Override_functions"></a>Override functions </h2>

Define these functions and the host will call them.
<br><br>
<dl class="function">
<dt>
<a name = "processBlock"></a>
<strong><span class="proto_prefix">plugin</span>.processBlock (samples, smax, midiBuf)</strong>
</dt>
<dd>
Process Audio Block.
Override this function to input and output audio and MIDI data.</p>

<p> This override is handled automatically if <a href="../modules/stereoFx.html#">stereoFx</a> or <a href="../modules/polyGen.html#">polyGen</a> are used.
Use this function to handle the raw data instead.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">samples</span>
a C float** pointing to two channels of samples, serving as input and output
</li>
<li><span class="parameter">smax</span>
the maximum sample index (nSamples - 1)
</li>
<li><span class="parameter">midiBuf</span>
<span class="types"><a class="type" href="../modules/midi.html#midi.Buffer">midi.Buffer</a></span>
the MIDI data for this block, serving as input and output
</li>
</ul>




<h3>Usage:</h3>
<ul>
<pre class="example"> <span class="keyword">function</span> plugin.processBlock (samples, smax) <span class="comment">-- let's ignore midi for this example
</span> <span class="keyword">for</span> i = <span class="number">0</span>, smax <span class="keyword">do</span>
samples[<span class="number">0</span>][i] = sin(myTime) <span class="comment">-- left channel
</span> samples[<span class="number">1</span>][i] = sin(myTime) <span class="comment">-- right channel
</span> myTime = myTime + myDelta
<span class="keyword">end</span>
<span class="keyword">end</span></pre>
</ul>

</dd>
<dt>
<a name = "getParameterName"></a>
<strong><span class="proto_prefix">plugin</span>.getParameterName (index)</strong>
</dt>
<dd>
Return the name of a parameter. </p>

<p> This override is handled automatically if <a href="../modules/plugin.html#manageParams">manageParams</a> is used.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
parameter index (0-126)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the parameter's name
</ol>




</dd>
<dt>
<a name = "getParameterText"></a>
<strong><span class="proto_prefix">plugin</span>.getParameterText (index)</strong>
</dt>
<dd>
Return the representation of a parameter's value.
Override this function to choose how each parameter's value should
be displayed by the host. The parameter's current value can be obtained
using <a href="../modules/plugin.html#getParameter">plugin.getParameter</a></p>

<p> This override is handled automatically if <a href="../modules/plugin.html#manageParams">manageParams</a> is used.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
parameter index (0-126)
</li>
</ul>

<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
a string representation of the parameter's current value
</ol>




</dd>
<dt>
<a name = "paramChanged"></a>
<strong><span class="proto_prefix">plugin</span>.paramChanged (index)</strong>
</dt>
<dd>
Handle parameter changes.
Override this function to do something when a parameter changes
The parameter's current value can be obtained using <a href="../modules/plugin.html#getParameter">plugin.getParameter</a></p>

<p> This override is handled automatically if <a href="../modules/plugin.html#manageParams">manageParams</a> is used.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">index</span>
parameter index (0-126)
</li>
</ul>





</dd>
<dt>
<a name = "getTailLengthSeconds"></a>
<strong><span class="proto_prefix">plugin</span>.getTailLengthSeconds ()</strong>
</dt>
<dd>
Return the tail length in seconds (effects only).
Override this function to define the effect's audio tail length.

</ul>


<h3>Returns:</h3>
<ol>

the tail length in seconds
</ol>




</dd>
</dl>
<h2><a name="Class_plugin_PositionInfo"></a>Class plugin.PositionInfo </h2>

A container type for host-related information as returned by <a href="../modules/plugin.html#getCurrentPosition">plugin.getCurrentPosition</a></p>

<p> Is a <a href="http://www.juce.com/api/structAudioPlayHead_1_1CurrentPositionInfo.html">JUCE AudioPlayHead::CurrentPositionInfo</a>
<br><br>
<dl class="function">
<dt>
<a name = "PositionInfo.bpm"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.bpm</strong>
</dt>
<dd>
Host tempo (beats per minute)

</ul>






</dd>
<dt>
<a name = "PositionInfo.timeSigNumerator"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.timeSigNumerator</strong>
</dt>
<dd>
Time signature numerator ie. <em>3</em>/4

</ul>






</dd>
<dt>
<a name = "PositionInfo.timeSigDenominator"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.timeSigDenominator</strong>
</dt>
<dd>
Time signature denominator ie. 3/<em>4</em>

</ul>






</dd>
<dt>
<a name = "PositionInfo.timeInSamples"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.timeInSamples</strong>
</dt>
<dd>
Current position on the host's timeline (samples)

</ul>






</dd>
<dt>
<a name = "PositionInfo.timeInSeconds"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.timeInSeconds</strong>
</dt>
<dd>
Current position on the host's timeline (seconds)

</ul>






</dd>
<dt>
<a name = "PositionInfo.editOriginTime"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.editOriginTime</strong>
</dt>
<dd>
Position of the start of the edit region on the host's timeline

</ul>






</dd>
<dt>
<a name = "PositionInfo.ppqPosition"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.ppqPosition</strong>
</dt>
<dd>
Current position on the host's timeline (pulses-per-quarter-note)

</ul>






</dd>
<dt>
<a name = "PositionInfo.ppqPositionOfLastBarStart"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.ppqPositionOfLastBarStart</strong>
</dt>
<dd>
Position of the last bar start (pulses-per-quarter-note).
(or zero if unavailable.)

</ul>






</dd>
<dt>
<a name = "PositionInfo.frameRate"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.frameRate</strong>
</dt>
<dd>
Video frame rate

</ul>






</dd>
<dt>
<a name = "PositionInfo.isPlaying"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.isPlaying</strong>
</dt>
<dd>
Is playing

</ul>






</dd>
<dt>
<a name = "PositionInfo.isRecording"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.isRecording</strong>
</dt>
<dd>
Is recording

</ul>






</dd>
<dt>
<a name = "PositionInfo.ppqLoopStart"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.ppqLoopStart</strong>
</dt>
<dd>
Position of the loop start (pulses-per-quarter-note).
(or zero if unavailable.)

</ul>






</dd>
<dt>
<a name = "PositionInfo.ppqLoopEnd"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.ppqLoopEnd</strong>
</dt>
<dd>
Position of the loop end (pulses-per-quarter-note).
(or zero if unavailable.)

</ul>






</dd>
<dt>
<a name = "PositionInfo.isLooping"></a>
<strong><span class="proto_prefix">plugin.PositionInfo</span>.isLooping</strong>
</dt>
<dd>
Is looping

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 378
- 0
ports/protoplug/ProtoplugFiles/doc/modules/polyGen.html View File

@@ -0,0 +1,378 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Module polyGen</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Class_polyGen_VTrack">Class polyGen.VTrack </a></li>
</ul>


<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><strong>polyGen</strong></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>polyGen</code></h1>
<p>Use this module to create a polyphonic generator with virtual tracks.</p>
<p>

<p> Example at <a href="../examples/sine-organ.lua.html#">sine-organ.lua</a>.</p>

<p> This module facilitates the creation of polyphonic instruments. It acts
as a layer that covers the <a href="../modules/plugin.html#processBlock">plugin.processBlock</a> function, receives MIDI
notes and dispatches them to virtual tracks. The <a href="../modules/polyGen.html#polyGen.VTrack">polyGen.VTrack</a> prototype
is exposed for you to define audio processing in a simple,
monophonic, per-note fashion. Initialize this module by calling <a href="../modules/polyGen.html#initTracks">polyGen.initTracks</a> .</p>

<p> The <a href="../modules/polyGen.html#">polyGen</a> global is available to every protoplug script after including the
main protoplug header :</p>
<pre><code>require "include/protoplug"
</code></pre>
</p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#initTracks"><span class="proto_prefix">polyGen</span>.initTracks ([n=8])</a></td>
<td class="summary">Set up virtual tracks.</td>
</tr>
</table>
<h2><a href="#Class_polyGen_VTrack">Class polyGen.VTrack </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#VTrack:addProcessBlock"><span class="proto_prefix">polyGen.VTrack</span>:addProcessBlock (samples, smax)</a></td>
<td class="summary">Override to additively process an audio block.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack:noteOn"><span class="proto_prefix">polyGen.VTrack</span>:noteOn (note, vel)</a></td>
<td class="summary">Override to recieve note on.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack:noteOff"><span class="proto_prefix">polyGen.VTrack</span>:noteOff (note)</a></td>
<td class="summary">Override to recieve note off.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack:init"><span class="proto_prefix">polyGen.VTrack</span>:init ()</a></td>
<td class="summary">Override to allow initialisation.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack.i"><span class="proto_prefix">polyGen.VTrack</span>.i</a></td>
<td class="summary">Track number.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack.note"><span class="proto_prefix">polyGen.VTrack</span>.note</a></td>
<td class="summary">Current MIDI note.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack.noteFreq"><span class="proto_prefix">polyGen.VTrack</span>.noteFreq</a></td>
<td class="summary">Current note frequency.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack.notePeriod"><span class="proto_prefix">polyGen.VTrack</span>.notePeriod</a></td>
<td class="summary">Current note period.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#VTrack.noteIsOn"><span class="proto_prefix">polyGen.VTrack</span>.noteIsOn</a></td>
<td class="summary">Note is on.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "initTracks"></a>
<strong><span class="proto_prefix">polyGen</span>.initTracks ([n=8])</strong>
</dt>
<dd>
Set up virtual tracks.
This function must be called by any script that wishes to use this module.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">n</span>
the number of virtual tracks to use (aka. voices or polyphony)
(<em>default</em> 8)
</li>
</ul>





</dd>
</dl>
<h2><a name="Class_polyGen_VTrack"></a>Class polyGen.VTrack </h2>

Virtual track. A monophonic voice that defines the instrument's sound.
<br><br>
<dl class="function">
<dt>
<a name = "VTrack:addProcessBlock"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>:addProcessBlock (samples, smax)</strong>
</dt>
<dd>
Override to additively process an audio block.
Define the output of a virtual track in this method.
Use <code>self.noteIsOn</code>, <code>self.noteFreq</code>, or any fields you defined to
determine current the state of the calling track.</p>

<p> This method is called successively on every track,
which should <em>add</em> their output to <code>samples</code>.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">samples</span>
a C <code>float**</code> pointing to two channels of samples to add to.
</li>
<li><span class="parameter">smax</span>
the maximum sample index (nSamples - 1)
</li>
</ul>



<h3>See also:</h3>
<ul>
<a href="../examples/sine-organ.lua.html#">sine-organ.lua</a>
</ul>


</dd>
<dt>
<a name = "VTrack:noteOn"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>:noteOn (note, vel)</strong>
</dt>
<dd>
Override to recieve note on.
Override this method to handle a note getting dispatched to a virtual track.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">note</span>
the MIDI note number (0-127)
</li>
<li><span class="parameter">vel</span>
the MIDI velocity (0-127)
</li>
</ul>





</dd>
<dt>
<a name = "VTrack:noteOff"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>:noteOff (note)</strong>
</dt>
<dd>
Override to recieve note off.
Override this method to handle a note off on a virtual track.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">note</span>
a reminder of the MIDI note number
</li>
</ul>





</dd>
<dt>
<a name = "VTrack:init"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>:init ()</strong>
</dt>
<dd>
Override to allow initialisation.
Override this method to perform initialisation tasks on each track,
for example to create any per-track fields.

</ul>






</dd>
<dt>
<a name = "VTrack.i"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>.i</strong>
</dt>
<dd>
Track number.
Use <code>self.i</code> to check which virtual track is being called.

</ul>






</dd>
<dt>
<a name = "VTrack.note"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>.note</strong>
</dt>
<dd>
Current MIDI note.
The MIDI note number that is currently being played by this track,
or <code>-1</code> if in note off state.

</ul>






</dd>
<dt>
<a name = "VTrack.noteFreq"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>.noteFreq</strong>
</dt>
<dd>
Current note frequency.
The note frequency that is currently being played by this track.

</ul>






</dd>
<dt>
<a name = "VTrack.notePeriod"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>.notePeriod</strong>
</dt>
<dd>
Current note period.
<code>1/noteFreq</code>

</ul>






</dd>
<dt>
<a name = "VTrack.noteIsOn"></a>
<strong><span class="proto_prefix">polyGen.VTrack</span>.noteIsOn</strong>
</dt>
<dd>
Note is on.
Whether the track is playing a note (<code>boolean</code>).

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 304
- 0
ports/protoplug/ProtoplugFiles/doc/modules/script.html View File

@@ -0,0 +1,304 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Module script</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Predefined_values">Predefined values</a></li>
</ul>


<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><strong>script</strong></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><a href="../modules/stereoFx.html">stereoFx</a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>script</code></h1>
<p>Use <a href="../modules/script.html#">script</a> to handle script events, libraries and files.</p>
<p>

<p> The <a href="../modules/script.html#">script</a> global is available to every protoplug script after including the
main protoplug header :</p>
<pre><code>require "include/protoplug"
</code></pre>
</p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#addHandler"><span class="proto_prefix">script</span>.addHandler (event, handler)</a></td>
<td class="summary">Add a handler for a script event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#saveData"><span class="proto_prefix">script</span>.saveData ()</a></td>
<td class="summary">Save script data.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#loadData"><span class="proto_prefix">script</span>.loadData (data)</a></td>
<td class="summary">Load script data.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#ffiLoad"><span class="proto_prefix">script</span>.ffiLoad (libName[, ...])</a></td>
<td class="summary">Load shared libraries.</td>
</tr>
</table>
<h2><a href="#Predefined_values">Predefined values</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#protoplugDir"><span class="proto_prefix">script</span>.protoplugDir</a></td>
<td class="summary">Current protoplug directory.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "addHandler"></a>
<strong><span class="proto_prefix">script</span>.addHandler (event, handler)</strong>
</dt>
<dd>

<p>Add a handler for a script event.
The following events are available :</p>

<ul>
<li><code>"init"</code> - Emitted after the script has been compiled and run.</li>
<li><code>"preClose"</code> - Emitted before the script state gets destroyed.</li>
</ul>


</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the event to handle
</li>
<li><span class="parameter">handler</span>
<span class="types"><span class="type">function</span></span>
a function to add the event's handlers
</li>
</ul>



<h3>See also:</h3>
<ul>
<li><a href="../modules/plugin.html#addHandler">plugin.addHandler</a></li>
<li><a href="../modules/gui.html#addHandler">gui.addHandler</a></li>
</ul>


</dd>
<dt>
<a name = "saveData"></a>
<strong><span class="proto_prefix">script</span>.saveData ()</strong>
</dt>
<dd>
Save script data.
Override this function to save any custom data.</p>

<p> This gets called :
- when the host saves the plugin's state (eg. when saving a project)
- right before the script is recompiled, to keep custom data across compilations.

</ul>


<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the data to be saved
</ol>




</dd>
<dt>
<a name = "loadData"></a>
<strong><span class="proto_prefix">script</span>.loadData (data)</strong>
</dt>
<dd>
Load script data.
Override this function to load any custom data.
Be warned that the data might originate from another script, so it's a good
idea to start the data with a header confirming the format.</p>

<p> This gets called :
- when the host loads the plugin's state (eg. when loading a project)
- right after the script is recompiled, to keep custom data across compilations.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">data</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
the data to be loaded
</li>
</ul>





</dd>
<dt>
<a name = "ffiLoad"></a>
<strong><span class="proto_prefix">script</span>.ffiLoad (libName[, ...])</strong>
</dt>
<dd>
Load shared libraries.
Protoplug scripts should use this wrapper function instead of LuaJIT's
<a href="http://luajit.org/ext_ffi_api.html#ffi_load">ffi.load</a>.
It has the same behaviour as <code>ffi.load</code>, but it adds <code>protoplug/lib</code> as a
search path, and can accept multiple arguments to test for different
library names. The names are tested from left to right until one load
successfully. If none of them work, an error is raised.</p>
<pre><code>sdl = script.ffiLoad("sdl")
</code></pre>
<p> This looks for <code>libsdl.so</code> or <code>sdl.dll</code> in protoplug's lib folder and
in the system paths. </p>

<pre><code>fftw = script.ffiLoad("libfftw3.so.3", "libfftw3-3.dll")
</code></pre>
<p> This looks for the supplied names in the same locations as above. This is
necessary for libs like FFTW, that have has platform-dependent names.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">libName</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



</li>
<li><span class="parameter">...</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
alternate names for the same library
</li>
</ul>

<h3>Returns:</h3>
<ol>

The library's ffi namespace
</ol>




</dd>
</dl>
<h2><a name="Predefined_values"></a>Predefined values</h2>
<dl class="function">
<dt>
<a name = "protoplugDir"></a>
<strong><span class="proto_prefix">script</span>.protoplugDir</strong>
</dt>
<dd>
Current protoplug directory.
The full path of the <code>protoplug</code> directory currently being used. It should
be alongside the protoplug fx and gen dynamic libraries.

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 204
- 0
ports/protoplug/ProtoplugFiles/doc/modules/stereoFx.html View File

@@ -0,0 +1,204 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>protoplug: Module stereoFx</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>protoplug</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

<ul>
<li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Class_stereoFx_Channel">Class stereoFx.Channel </a></li>
</ul>


<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/plugin.html">plugin</a></li>
<li><a href="../modules/script.html">script</a></li>
<li><a href="../modules/midi.html">midi</a></li>
<li><a href="../modules/gui.html">gui</a></li>
<li><a href="../modules/polyGen.html">polyGen</a></li>
<li><strong>stereoFx</strong></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
<li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
<li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
<li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
<li><a href="../classes/juce.Component.html">juce.Component</a></li>
<li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
<li><a href="../classes/juce.Font.html">juce.Font</a></li>
<li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
<li><a href="../classes/juce.Image.html">juce.Image</a></li>
<li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
<li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
<li><a href="../classes/juce.Line.html">juce.Line</a></li>
<li><a href="../classes/juce.Path.html">juce.Path</a></li>
<li><a href="../classes/juce.Point.html">juce.Point</a></li>
<li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
<li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
<li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
</ul>
<h2>Examples</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
<li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
<li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
<li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
<li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>stereoFx</code></h1>
<p>Use this module to create a stereo effect.</p>
<p>

<p> Example at <a href="../examples/classic-filter.lua.html#">classic-filter.lua</a>.</p>

<p> This module acts as a layer that conceals the <a href="../modules/plugin.html#processBlock">plugin.processBlock</a> function,
manages stereo channels, and exposes the <a href="../modules/stereoFx.html#stereoFx.Channel">stereoFx.Channel</a> prototype for you
define per-channel audio processing. Initialize it by calling <a href="../modules/stereoFx.html#init">stereoFx.init</a> .</p>

<p> The <a href="../modules/stereoFx.html#">stereoFx</a> global is available to every protoplug script after including the
main protoplug header :</p>
<pre><code>require "include/protoplug"
</code></pre>
</p>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#init"><span class="proto_prefix">stereoFx</span>.init ()</a></td>
<td class="summary">Set up channels.</td>
</tr>
</table>
<h2><a href="#Class_stereoFx_Channel">Class stereoFx.Channel </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Channel:processBlock"><span class="proto_prefix">stereoFx.Channel</span>:processBlock (samples, smax)</a></td>
<td class="summary">Override to process a channel's audio block.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Channel:init"><span class="proto_prefix">stereoFx.Channel</span>:init ()</a></td>
<td class="summary">Override to handle initialisation.</td>
</tr>
</table>

<br/>
<br/>


<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "init"></a>
<strong><span class="proto_prefix">stereoFx</span>.init ()</strong>
</dt>
<dd>
Set up channels.
This function must be called by any script that wishes to use this module.

</ul>






</dd>
</dl>
<h2><a name="Class_stereoFx_Channel"></a>Class stereoFx.Channel </h2>

This class represents a channel (ie. left or right).
<br><br>
<dl class="function">
<dt>
<a name = "Channel:processBlock"></a>
<strong><span class="proto_prefix">stereoFx.Channel</span>:processBlock (samples, smax)</strong>
</dt>
<dd>
Override to process a channel's audio block.
Define the audio processing of a single channel in this function.

</ul>

<h3>Parameters:</h3>
<ul>
<li><span class="parameter">samples</span>
a C float* serving as input and output
</li>
<li><span class="parameter">smax</span>
the maximum sample index (nSamples - 1)
</li>
</ul>





</dd>
<dt>
<a name = "Channel:init"></a>
<strong><span class="proto_prefix">stereoFx.Channel</span>:init ()</strong>
</dt>
<dd>
Override to handle initialisation.
Override this method to perform initialisation tasks on each channel,
for example to create any per-channel fields.

</ul>






</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

BIN
ports/protoplug/ProtoplugFiles/doc/osar-121.png View File

Before After
Width: 121  |  Height: 121  |  Size: 23KB

+ 3
- 0
ports/protoplug/ProtoplugFiles/doc/src/build protoplug docs.bat View File

@@ -0,0 +1,3 @@
cd "C:\Users\pac\Documents\Visual Studio 2010\Projects\protoplug\ProtoplugFiles\doc\src"
lua c:\SDKs\ldoc\ldoc.lua -d ../ .
pause

+ 77
- 0
ports/protoplug/ProtoplugFiles/doc/src/config.ld View File

@@ -0,0 +1,77 @@
-- ldoc configuration file
-- works with ldoc 1.4.2 (http://stevedonovan.github.io/ldoc/)

title = "Protoplug Lua API Reference"
project = "protoplug"
description = [[
Protoplug Lua API Reference
]]

local function softenPrefix(s)
if s:find("^%b<>.-[%.:][^%.%:]-$") then
-- already wrapped function : leave wrap outisde
return s:gsub("^(%b<>)(.-)([%.:])([^%.%:]-)%((.-)$", "%1<span class=\"proto_prefix\">%2</span>%3%4%(%5")
elseif s:find("^.-[%.:][^%.%:]-%(.-$") then
-- function : allow for dots in optional parameter values
return s:gsub("^(.-)([%.:])([^%.%:]-)%((.-)$", "<span class=\"proto_prefix\">%1</span>%2%3%(%4")
elseif s:find("[%.:][^%.%:]-$") then
return "<span class=\"proto_prefix\">"..s:gsub("([%.:])([^%.%:]-)$", "</span>%1%2")
else
return s
end
end

local forcePrefix = {"plugin", "script", "gui", "midi", "polyGen", "stereoFx"}
local function formatName(item, default_display_name)
for _, v in ipairs(forcePrefix) do
if item.module.name == v then
-- display the prefix on globals to be more explicit
if item.tags.display then
return item.tags.display[1].." "..item.args
else
return item.module.name.."."..default_display_name(item)
end
end
end
if item.tags.constructor then
-- constructors that are a metatable __call
return item.module.name.." "..item.args
elseif #default_display_name(item) >100 then
-- auto wrap ridiculously long names (it's ugly but better than nothing)
return '<span class="wrapman">'..(item.display_name or item.name)..'<br> '..item.args..'</span>'
elseif #default_display_name(item) >60 then
-- manually wrap slightly long names
return (item.display_name or item.name)..'<br> '..item.args
end
-- mostly class/classmod methods fall into the default display
return default_display_name(item)
end

custom_display_name_handler = function(item, default_display_name)
return softenPrefix(formatName(item, default_display_name))
end

custom_tags = { { "display", hidden = true } }
new_type("simplefield","Fields")
new_type("predefined","Predefined values")

file = {
'../../include/core/plugin.lua';
'../../include/core/script.lua';
'../../include/core/midi.lua';
'../../include/core/gui.lua';
'../../include/core/polygen.lua';
'../../include/core/stereofx.lua';
'../../include/protojuce';
}
examples = {
'../../effects/classic-filter.lua';
'../../generators/sine-organ.lua';
'../../generators/midi-chordify.lua';
'../../generators/sinemouse-demo.lua';
'../../generators/soundfile-test.lua';
}

format = 'markdown'
style = true
template = true

+ 333
- 0
ports/protoplug/ProtoplugFiles/doc/src/ldoc.css View File

@@ -0,0 +1,333 @@
/* BEGIN RESET

Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.8.2r1
*/
html {
color: #000;
background: #FFF;
}
body {
text-align: center;
}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,img {
border: 0;
}
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
font-style: inherit;
font-weight: inherit;
}
del,ins {
text-decoration: none;
}
li {
list-style: bullet;
margin-left: 20px;
}
caption,th {
text-align: left;
}
h1,h2,h3,h4,h5,h6 {
font-size: 100%;
font-weight: bold;
}
q:before,q:after {
content: '';
}
abbr,acronym {
border: 0;
font-variant: normal;
}
sup {
vertical-align: baseline;
}
sub {
vertical-align: baseline;
}
legend {
color: #000;
}
input,button,textarea,select,optgroup,option {
font-family: inherit;
font-size: inherit;
font-style: inherit;
font-weight: inherit;
}
input,button,textarea,select {*font-size:100%;
}
/* END RESET */

body {
margin-left: 1em;
margin-right: 1em;
font-family: arial, helvetica, geneva, sans-serif;
background-color: #ffffff; margin: 0px;
}

code, tt { font-family: monospace; }
span.parameter { font-family:monospace; }
span.parameter:after { content:":"; }
span.types:before { content:"("; }
span.types:after { content:")"; }
.type { font-weight: bold; font-style:italic }

body, p, td, th { font-size: .95em; line-height: 1.2em;}

p, ul { margin: 10px 0 0 0px;}

strong { font-weight: bold;}

em { font-style: italic;}

h1 {
font-size: 1.5em;
margin: 10px 0 20px 0;
}
h2, h3, h4 { margin: 15px 0 10px 0; }
h2 {
border-bottom: 2px solid #ccc;
font-size: 1.25em;
margin: 19px 0 12px;
}
h3 { font-size: 1.15em; }
h4 { font-size: 1.06em; }

a:link { font-weight: bold; color: #004080; text-decoration: none; }
a:visited { font-weight: bold; color: #006699; text-decoration: none; }
a:link:hover { text-decoration: underline; }

hr {
color:#cccccc;
background: #00007f;
height: 1px;
}

blockquote { margin-left: 3em; }

ul { list-style-type: disc; }

p.name {
font-family: Consolas, monaco, monospace;
padding-top: 1em;
}

pre.example {
background-color: rgb(245, 245, 245);
border: 1px solid silver;
padding: 10px;
margin: 10px 0 10px 0;
font-family: Consolas, monaco, monospace;
font-size: .85em;
}

pre {
background-color: rgb(245,245,255);
border: 1px solid #cccccc;
padding: 10px;
margin: 10px 0 10px 0;
overflow: auto;
font-family: Consolas, monaco, monospace;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
font-size: 14px;
}


table.index { border: 1px #00007f; }
table.index td { text-align: left; vertical-align: top; }

#container {
/*margin-left: 1em;
margin-right: 1em;
background-color: #f4f4ff;*/
display: inline-block;
margin: 0 auto;
text-align: left;
}

#product {
text-align: center;
border-bottom: 1px solid #cccccc;
background-color: #ffffff;
}

#product big {
font-size: 2em;
}

#main {
background-color:#FFFFFF;
/*border-left: 2px solid #cccccc;*/
}

#navigation {
float: left;
width: 14em;
vertical-align: top;
background-color:#FFFFFF;
overflow: visible;
}

#navigation h2 {
background-color:#FFFFFF;
font-size:1.1em;
color:#000000;
text-align: left;
padding:0.2em;
/*border-top:1px solid #dddddd;*/
border-bottom:1px solid #dddddd;
}

#navigation ul
{
font-size:1em;
list-style-type: none;
margin: 1px 1px 10px 1px;
}

#navigation li {
text-indent: -1em;
display: block;
margin: 3px 0px 0px 22px;
word-wrap: break-word;
}

#navigation li li a {
margin: 0px 3px 0px -1em;
}

#content {
margin-left: 14em;
padding: 1em;
width: 700px;
border-left: 2px solid #cccccc;
/*border-right: 2px solid #cccccc;*/
background-color: #ffffff;
}

#about {
clear: both;
padding: 5px;
border-top: 2px solid #cccccc;
background-color: #ffffff;
}

@media print {
body {
font: 12pt "Times New Roman", "TimeNR", Times, serif;
}
a { font-weight: bold; color: #004080; text-decoration: underline; }

#main {
background-color: #ffffff;
border-left: 0px;
}

#container {
margin-left: 2%;
margin-right: 2%;
background-color: #ffffff;
}

#content {
padding: 1em;
background-color: #ffffff;
}

#navigation {
display: none;
}
pre.example {
font-family: Consolas, monaco, monospace;
font-size: 10pt;
page-break-inside: avoid;
}
}

table.module_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.module_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.module_list td.name { background-color: #f4f4ff; ; min-width: 200px; }
table.module_list td.summary { width: 100%; }

table.function_list {
border-width: 1px;
border-style: solid;
border-color: #cccccc;
border-collapse: collapse;
}
table.function_list td {
border-width: 1px;
padding: 3px;
border-style: solid;
border-color: #cccccc;
}
table.function_list td.name { background-color: #f6f6ff; ; min-width: 200px; padding: 7px 5px; }
table.function_list td.summary { width: 100%; }

dl.table dt, dl.function dt {
background-color: #f4f4ff;
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
padding: 0.7em 0 0.5em 1em;
}
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
dl.table h3, dl.function h3 {font-size: .95em;}

ul.nowrap {
overflow:auto;
whitespace:nowrap;
}

/* stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }

/* styles for prettification of source */
pre .comment { color: #558817; }
pre .constant { color: #a8660d; }
pre .escape { color: #844631; }
pre .keyword { color: #2239a8; font-weight: bold; }
pre .library { color: #0e7c6b; }
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
pre .string { color: #a8660d; }
pre .number { color: #f8660d; }
pre .operator { color: #2239a8; font-weight: bold; }
pre .preprocessor, pre .prepro { color: #a33243; }
pre .global { color: #800080; }
pre .prompt { color: #558817; }
pre .url { color: #272fc2; text-decoration: underline; }

.wrapman { display: inline-block; white-space: normal; min-width: 460px; }
.proto_subtitle {color: #888; position: relative; top: -12px;}
.function_list .proto_prefix {color: #789;}
.osarlogo {
display: block;
width: 132px;
height: 121px;
background: url("osar-121.png") no-repeat scroll 0 0 transparent;
margin: 0 auto;
}

+ 340
- 0
ports/protoplug/ProtoplugFiles/doc/src/ldoc.ltp View File

@@ -0,0 +1,340 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
# -- pac : fix ldoc ordering issues (?)
# if module then
# local function startsWith(a, b)
# return (a:sub(1, b:len()) == b)
# end
# local finalOrder = {
# "Callback";
# "Override";
# "Constructors";
# "Functions";
# "Methods";
# "Tables";
# "Fields";
# "Predefined";
# "Class";
# "";
# }
# local sorted = {}
# local twodim = {}
# for k, v in ldoc.ipairs(finalOrder) do twodim[k] = {} end
# for kind, items in module.kinds() do
# for k, v in ldoc.ipairs(finalOrder) do
# if startsWith(kind, v) then
# twodim[k][#twodim[k]+1] = {kind, items}
# break
# end
# end
# end
# for k, v in ldoc.ipairs(twodim) do
# for k2, v2 in ldoc.ipairs(v) do
# sorted[#sorted+1] = v2
# end
# end
# function getKinds()
# local i = 0
# return function ()
# i = i + 1
# if sorted[i] then
# return sorted[i][1], sorted[i][2]
# end
# end
# end
# end
<meta http-equiv="Content-Type" content="text/html; charset=$(ldoc.doc_charset)"/>
<head>
# if module then
<title>$(ldoc.project): $(ldoc.module_typename(module)) $(module.name)</title>
# else
<title>$(ldoc.title)</title>
# end
<link rel="stylesheet" href="$(ldoc.css)" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">

# local no_spaces = ldoc.no_spaces
# local use_li = ldoc.use_li
# local display_name = ldoc.display_name
# local iter = ldoc.modules.iter
# local function M(txt,item) return ldoc.markup(txt,item,ldoc.plain) end
# local nowrap = ldoc.wrap and '' or 'nowrap'

<!-- Menu -->

<div id="navigation">
<a href="http://osar.fr">
<div class=osarlogo> </div>
</a>
<br/>
<a href="http://osar.fr/protoplug">
<h1>$(ldoc.project)</h1>
</a>
<span class="proto_subtitle">Lua API reference</span>

# if not ldoc.single and module then -- reference back to project index
<ul>
<li><a href="../$(ldoc.output).html">Index</a></li>
</ul>
# end

# --------- contents of module -------------
# if module and not ldoc.no_summary and #module.items > 0 then
<h2>Contents</h2>
<ul>
# for kind, items in getKinds() do
<li><a href="#$(no_spaces(kind))">$(kind)</a></li>
# end
</ul>
# end


# if ldoc.no_summary and module and not ldoc.one then -- bang out the functions on the side
# for kind, items in getKinds() do
<h2>$(kind)</h2>
<ul class="nowrap">
# for item in items() do
<li><a href="#$(item.name)">$(display_name(item))</a></li>
# end
</ul>
# end
# end
# -------- contents of project ----------
# local this_mod = module and module.name
# for kind, mods, type in ldoc.kinds() do
# if not ldoc.kinds_allowed or ldoc.kinds_allowed[type] then
<h2>$(kind)</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
# for mod in mods() do local name = ldoc.module_name(mod)
# if mod.name == this_mod then
<li><strong>$(name)</strong></li>
# else
<li><a href="$(ldoc.ref_to_module(mod))">$(name)</a></li>
# end
# end
# end
</ul>
# end

</div>

<div id="content">

# if ldoc.body then -- verbatim HTML as contents; 'non-code' entries
$(ldoc.body)
# elseif module then -- module documentation
<h1>$(ldoc.module_typename(module)) <code>$(module.name)</code></h1>
<p>$(M(module.summary,module))</p>
<p>$(M(module.description,module))</p>
# if module.usage then
# local li,il = use_li(module.usage)
<h3>Usage:</h3>
<ul>
# for usage in iter(module.usage) do
$(li)<pre class="example">$(ldoc.escape(usage))</pre>$(il)
# end -- for
</ul>
# end -- if usage
# if module.info then
<h3>Info:</h3>
<ul>
# for tag, value in module.info:iter() do
<li><strong>$(tag)</strong>: $(M(value,module))</li>
# end
</ul>
# end -- if module.info


# if not ldoc.no_summary then
# -- bang out the tables of item types for this module (e.g Functions, Tables, etc)
# for kind, items in getKinds() do
<h2><a href="#$(no_spaces(kind))">$(kind)</a></h2>
<table class="function_list">
# for item in items() do
<tr>
<td class="name" $(nowrap)><a href="#$(item.name)">$(display_name(item))</a></td>
<td class="summary">$(M(item.summary,item))</td>
</tr>
# end -- for items
</table>
#end -- for kinds

<br/>
<br/>

#end -- if not no_summary

# --- currently works for both Functions and Tables. The params field either contains
# --- function parameters or table fields.
# local show_return = not ldoc.no_return_or_parms
# local show_parms = show_return
# for kind, items in getKinds() do
# local kitem = module.kinds:get_item(kind)
<h2><a name="$(no_spaces(kind))"></a>$(kind)</h2>
#-- $(M(module.kinds:get_section_description(kind),nil))
# if kitem then
$(M(ldoc.descript(kitem),kitem))
# if kitem.usage then
<h3>Usage:</h3>
<pre class="example">$(ldoc.prettify(kitem.usage[1]))</pre>
# end
# end
<dl class="function">
# for item in items() do
<dt>
<a name = "$(item.name)"></a>
<strong>$(display_name(item))</strong>
</dt>
<dd>
$(M(ldoc.descript(item),item))

# if ldoc.custom_tags then
# for custom in iter(ldoc.custom_tags) do
# local tag = item.tags[custom[1]]
# if tag and not custom.hidden then
# local li,il = use_li(tag)
<h3>$(custom.title or custom[1]):</h3>
<ul>
# for value in iter(tag) do
$(li)$(custom.format and custom.format(value) or M(value))$(il)
# end -- for
# end -- if tag
</ul>
# end -- iter tags
# end

# if show_parms and item.params and #item.params > 0 then
# local subnames = module.kinds:type_of(item).subnames
# if subnames then
<h3>$(subnames):</h3>
# end
<ul>
# for parm in iter(item.params) do
# local param,sublist = item:subparam(parm)
# if sublist then
<li><span class="parameter">$(sublist)</span>$(M(item.params[sublist],item))
<ul>
# end
# for p in iter(param) do
# local name,tp,def = item:display_name_of(p), ldoc.typename(item:type_of_param(p)), item:default_of_param(p)
<li><span class="parameter">$(name)</span>
# if tp ~= '' then
<span class="types">$(tp)</span>
# end
$(M(item.params[p],item))
# if def then
(<em>default</em> $(def))
# end
# if item:readonly(p) then
<em>readonly</em>
# end
</li>
# end
# if sublist then
</li></ul>
# end
# end -- for
</ul>
# end -- if params

# if show_return and item.retgroups then local groups = item.retgroups
<h3>Returns:</h3>
# for i,group in ldoc.ipairs(groups) do local li,il = use_li(group)
<ol>
# for r in group:iter() do local type, ctypes = item:return_type(r); local rt = ldoc.typename(type)
$(li)
# if rt ~= '' then
<span class="types">$(rt)</span>
# end
$(M(r.text,item))$(il)
# if ctypes then
<ul>
# for c in ctypes:iter() do
<li><span class="parameter">$(c.name)</span>
<span class="types">$(ldoc.typename(c.type))</span>
$(M(c.comment,item))</li>
# end
</ul>
# end -- if ctypes
# end -- for r
</ol>
# if i < #groups then
<h3>Or</h3>
# end
# end -- for group
# end -- if returns

# if show_return and item.raise then
<h3>Raises:</h3>
$(M(item.raise,item))
# end

# if item.see then
# local li,il = use_li(item.see)
<h3>See also:</h3>
<ul>
# for see in iter(item.see) do
$(li)<a href="$(ldoc.href(see))">$(see.label)</a>$(il)
# end -- for
</ul>
# end -- if see

# if item.usage then
# local li,il = use_li(item.usage)
<h3>Usage:</h3>
<ul>
# for usage in iter(item.usage) do
$(li)<pre class="example">$(ldoc.prettify(usage))</pre>$(il)
# end -- for
</ul>
# end -- if usage

</dd>
# end -- for items
</dl>
# end -- for kinds

# else -- if module; project-level contents

# if ldoc.description then
<h2>$(M(ldoc.description,nil))</h2>
# end
# if ldoc.full_description then
<p>$(M(ldoc.full_description,nil))</p>
# end

# for kind, mods in ldoc.kinds() do
<h2>$(kind)</h2>
# kind = kind:lower()
<table class="module_list">
# for m in mods() do
<tr>
<td class="name" $(nowrap)><a href="$(no_spaces(kind))/$(m.name).html">$(m.name)</a></td>
<td class="summary">$(M(m.summary,m))</td>
</tr>
# end -- for modules
</table>
# end -- for kinds
# end -- if module

</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

+ 74
- 0
ports/protoplug/ProtoplugFiles/effects/classic-filter.lua View File

@@ -0,0 +1,74 @@
--[[
name: Classic Filter
description: >
Straightforward application of RBJ's cookbook filters. Formulae by
Robert Bristow-Johnson, implementation from Worp by Ico Doornekamp.
author: osar.fr
--]]

require "include/protoplug"
local cbFilter = require "include/pac/cookbook filters"
local filters = {}

stereoFx.init()

function stereoFx.Channel:init()
-- create per-channel fields (filters)
self.filter = cbFilter
{
-- initialize filters with current param values
type = params[1].getValue();
f = params[2].getValue()/2;
gain = params[3].getValue();
Q = params[4].getValue();
}
table.insert(filters, self.filter)
end

function stereoFx.Channel:processBlock(s, smax)
for i = 0,smax do
s[i] = self.filter.process(s[i])
end
end

local function updateFilters(args)
for _, f in pairs(filters) do
f.update(args)
end
end

params = plugin.manageParams {
-- automatable VST/AU parameters
-- note the new 1.3 way of declaring them
{
name = "Type";
type = "list";
values = {"hp"; "lp"; "bp"; "bs"; "ls"; "hs"; "ap"; "eq"};
default = "hp";
changed = function(val) updateFilters{type=val} end;
};
{
name = "Frequency";
min = 10;
max = 20000;
default = 440;
changed = function(val) updateFilters{f=val} end;
};
{
name = "Gain";
min = -30;
max = 30;
default = 0;
changed = function(val) updateFilters{gain=val} end;
};
{
name = "Resonance";
min = 0.1;
max = 30;
default = 1;
changed = function(val) updateFilters{Q=val} end;
};
}

-- Reset the plugin parameters like this :
-- params.resetToDefaults()

+ 3
- 0
ports/protoplug/ProtoplugFiles/effects/default.lua View File

@@ -0,0 +1,3 @@
require "include/protoplug"

--Welcome to Lua Protoplug effect (version 1.3.0)

+ 59
- 0
ports/protoplug/ProtoplugFiles/effects/delay line.lua View File

@@ -0,0 +1,59 @@
--[[
name: Delay Line
description: Simple delay line effect with DC removal
author: osar.fr
--]]

require "include/protoplug"

local length, feedback

stereoFx.init()

-- everything is per stereo channel
function stereoFx.Channel:init()
self.buf = ffi.new("double[512]")
self.it = 0 -- iterator
self.dc1, self.dc2 = 0,0
end

function stereoFx.Channel:goBack()
local nit = self.it-length
if nit<0 then nit = nit+512 end
local o = self.buf[nit]
nit = nit-1
if nit<0 then nit = nit+512 end
o = o+self.buf[nit]
o = o*0.4992*feedback
return o
end

function stereoFx.Channel:dcRemove(s)
self.dc1 = self.dc1 + (s - self.dc2) * 0.000002
self.dc2 = self.dc2 + self.dc1
self.dc1 = self.dc1 * 0.96
return s-self.dc2
end

function stereoFx.Channel:processBlock(samples, smax)
for i = 0,smax do
samples[i] = samples[i]+self:dcRemove(samples[i]+self:goBack())
self.buf[self.it] = samples[i]
self.it = self.it+1
if self.it>=512 then self.it=0 end
end
end

params = plugin.manageParams {
{
name = "Length";
type = "int";
max = 510;
changed = function(val) length = val end;
};
{
name = "Feedback";
max = 1;
changed = function(val) feedback = val end;
};
}

+ 37
- 0
ports/protoplug/ProtoplugFiles/effects/distortion - power.lua View File

@@ -0,0 +1,37 @@
--[[
name: Badass Distortion
description: The one from the website
author: osar.fr
--]]
require "include/protoplug"
local cbFilter = require "include/pac/cookbook filters"

local power

local function dist (x)
if x<0 then return -1*math.pow (-1*x,power) end
return math.pow (x,power)
end

stereoFx.init ()
function stereoFx.Channel:init ()
-- create per-channel fields (filters)
self.low = cbFilter {type = "lp"; f = 100; gain = 0; Q = 0.3}
self.high = cbFilter {type = "hp"; f = 50; gain = 0; Q = 0.3}
end

function stereoFx.Channel:processBlock (samples, smax)
for i = 0, smax do
local s = dist (self.high.process (samples[i]))
samples[i] = s + self.low.process (samples[i])*2
end
end

params = plugin.manageParams {
{
name = "Power";
min = 1;
max = 0.01;
changed = function (val) power = val end;
};
}

+ 189
- 0
ports/protoplug/ProtoplugFiles/effects/pitch distort.lua View File

@@ -0,0 +1,189 @@
--[[
name: Pitch Distort
description: >
graphical pitch distortion,
shifts each frequency band by a different factor
author: osar.fr
--]]

require "include/protoplug"
require "include/Pickle"

stereoFx.init()

fftlib = script.ffiLoad("libfftw3.so.3", "libfftw3-3")


ffi.cdef[[
typedef double fftw_complex[2];
void *fftw_plan_dft_r2c_1d(int n, double *in, fftw_complex *out, unsigned int flags);
void *fftw_plan_dft_c2r_1d(int n, fftw_complex *in, double *out, unsigned int flags);
void fftw_execute(void *plan);
]]

-- settings
local fftSize = 1024 -- 1024 seems good
local steps = 8 -- 4=low-fi, 16=high cpu
local xPixels = 400
local yPixels = 300

-- useful constants
local lineMax = fftSize
local rescale = 0.5/(fftSize*steps)
local cplxSize = math.floor(fftSize/2+1)
local stepSize = fftSize/steps
local expct = 2*math.pi*stepSize/fftSize;

-- global buffers
local graph = ffi.new ("double[?]", cplxSize)
for i = 0,cplxSize-1 do graph[i] = 0.25 end
local dbuf = ffi.new("double[?]", fftSize)
local spectrum = ffi.new("fftw_complex[?]", cplxSize)
local r2c = fftlib.fftw_plan_dft_r2c_1d(fftSize, dbuf, spectrum, 64)
local c2r = fftlib.fftw_plan_dft_c2r_1d(fftSize, spectrum, dbuf, 64)
local anaMagn = ffi.new("double[?]", cplxSize)
local anaFreq = ffi.new("double[?]", cplxSize)
local synMagn = ffi.new("double[?]", cplxSize)
local synFreq = ffi.new("double[?]", cplxSize)
local hw = ffi.new("double[?]", fftSize) -- Hann window
for i = 0,fftSize-1 do
hw[i] = (1 - math.cos(2*math.pi*i/(fftSize-1)))*rescale
end

local function ApplyWindow (samples)
for i = 0,fftSize-1 do
samples[i] = samples[i] * hw[i]
end
end

-- channel buffers
function stereoFx.Channel:init()
self.inbuf = ffi.new("double[?]", lineMax)
self.outbuf = ffi.new("double[?]", lineMax)
self.bufi = 0
self.inphase = ffi.new("double[?]", cplxSize)
self.outphase = ffi.new("double[?]", cplxSize)
end

-- filter the "spectrum" global given a channel's phases
local function ApplyFilter (inphase, outphase)
-- setup
for i=0,cplxSize-1 do
synMagn[i] = 0
synFreq[i] = 0
end
-- analysis
for i=0,cplxSize-1 do
local real = spectrum[i][0]
local imag = spectrum[i][1]
local magn = 2*math.sqrt(real*real+imag*imag)
local phase = math.atan2(imag, real)
local x = phase - inphase[i]
inphase[i] = phase
x = x - i*expct
x = (x+math.pi)%(math.pi*2)-math.pi
x = steps*x/(2*math.pi)
x = i + x
anaMagn[i] = magn
anaFreq[i] = x
end
-- processing
for i=0,cplxSize-1 do
local shift = graph[i]*2+0.5
local i2 = math.floor(i*shift)
if i2<cplxSize and i2>0 then
synMagn[i2] = anaMagn[i] + synMagn[i2]
synFreq[i2] = anaFreq[i] * shift
end
end
-- resynthesis
for i=0,cplxSize-1 do
local magn = synMagn[i]
x = synFreq[i]
x = x - i
x = 2*math.pi*x/steps
x = x + i*expct
outphase[i] = outphase[i] + x
local phase = outphase[i]
spectrum[i][0] = magn * math.cos(phase)
spectrum[i][1] = magn * math.sin(phase)
end
end

function wrap (i)
return (i>lineMax-1) and i-lineMax or i
end

function stereoFx.Channel:processBlock(s, smax)
for i = 0,smax do
self.inbuf[self.bufi] = s[i]
s[i] = self.outbuf[self.bufi]
self.outbuf[self.bufi] = 0
if self.bufi%stepSize==0 then
for j=0,fftSize-1 do
dbuf[j] = self.inbuf[wrap(self.bufi+j)]
end
-- revive cdata (inexplicably required, todo-narrow down the cause):
tostring(dbuf); tostring(spectrum)
fftlib.fftw_execute(r2c)
ApplyFilter (self.inphase, self.outphase)
fftlib.fftw_execute(c2r)
ApplyWindow(dbuf)
for j=0,fftSize-1 do
self.outbuf[wrap(self.bufi+j)] =
self.outbuf[wrap(self.bufi+j)] + dbuf[j]
end
end
self.bufi = wrap(self.bufi+1)
end
end


-- Graphics --
local Freqgraph = require "include/pac/freqgraph"
local J = require "include/protojuce"

local fg = Freqgraph {
title = "Pitch distortion";
data = graph;
dataSize = cplxSize;
yAxis = {
name = "shift (%)";
values = {
[0] = "50";
[0.25] = "100";
[0.5] = "150";
[1] = "250";
}
}
}

function gui.paint(g)
g:fillAll()
fg:paint(g)
end


-- Save & load --
local header = "pac pitch distort 1"

function script.loadData(data)
-- check data begins with our header
if string.sub(data, 1, string.len(header)) ~= header then return end
data = unpickle(string.sub(data, string.len(header)+1, -1))
-- check string was turned into a table without errors
if data==nil then return end
for i=0,cplxSize-1 do
if data[i] ~= nil then
graph[i] = data[i]
end
end
end

function script.saveData()
local picktable = {}
for i=0,cplxSize-1 do
picktable[i] = graph[i]
end
return header..pickle(picktable)
end

+ 157
- 0
ports/protoplug/ProtoplugFiles/effects/pitch shift - bernsee algo.lua View File

@@ -0,0 +1,157 @@
--[[
name: Pitch Shift - Bernsee Algo
description: "Simple" FFT pitch shifter after S.Bernsee's famous article.
author: osar.fr
--]]

require "include/protoplug"

stereoFx.init()

fftlib = script.ffiLoad("libfftw3.so.3", "libfftw3-3")

-- params
local shift = 1 -- param=0.5 -> shift=1.0 (no shift)

-- settings
local fftSize = 1024 -- 1024 seems good
local steps = 8 -- 4=low-fi, 16=high cpu

-- useful constants
local lineMax = fftSize
local rescale = 1/(fftSize*steps)
local cplxSize = math.floor(fftSize/2+1)
local stepSize = fftSize/steps
local expct = 2*math.pi*stepSize/fftSize;

ffi.cdef[[
typedef double fftw_complex[2];
void *fftw_plan_dft_r2c_1d(int n, double *in, fftw_complex *out, unsigned int flags);
void *fftw_plan_dft_c2r_1d(int n, fftw_complex *in, double *out, unsigned int flags);
void fftw_execute(void *plan);
]]

-- global buffers
local dbuf = ffi.new("double[?]", fftSize)
local spectrum = ffi.new("fftw_complex[?]", cplxSize)
local anaMagn = ffi.new("double[?]", cplxSize)
local anaFreq = ffi.new("double[?]", cplxSize)
local synMagn = ffi.new("double[?]", cplxSize)
local synFreq = ffi.new("double[?]", cplxSize)
local hw = ffi.new("double[?]", fftSize) -- Hann window
for i = 0,fftSize-1 do
hw[i] = (1 - math.cos(2*math.pi*i/(fftSize-1)))*rescale
end

local function applyWindow (samples)
for i = 0,fftSize-1 do
samples[i] = samples[i] * hw[i]
end
end

-- fftw plans
local r2c = fftlib.fftw_plan_dft_r2c_1d(fftSize, dbuf, spectrum, 64)
local c2r = fftlib.fftw_plan_dft_c2r_1d(fftSize, spectrum, dbuf, 64)

-- per-channel buffers
function stereoFx.Channel:init()
self.inbuf = ffi.new("double[?]", lineMax)
self.outbuf = ffi.new("double[?]", lineMax)
self.bufi = 0
self.inphase = ffi.new("double[?]", cplxSize)
self.outphase = ffi.new("double[?]", cplxSize)
end

-- shift data already in the "spectrum" global
local function applyFilter (inphase, outphase)
-- setup
for i=0,cplxSize-1 do
synMagn[i] = 0
synFreq[i] = 0
end
-- analysis
for i=0,cplxSize-1 do
local real = spectrum[i][0]
local imag = spectrum[i][1]
local magn = 2*math.sqrt(real*real+imag*imag)
local phase = math.atan2(imag, real)
local x = phase - inphase[i]
inphase[i] = phase
x = x - i*expct
x = (x+math.pi)%(math.pi*2)-math.pi
x = steps*x/(2*math.pi)
x = i + x
anaMagn[i] = magn
anaFreq[i] = x
end
-- loop-merging optimization, not sure if useful
if shift>=1 then
for i=0,cplxSize-1 do
shiftAndSynth(i, outphase)
end
else
for i=cplxSize-1,0,-1 do
shiftAndSynth(i, outphase)
end
end
end

function shiftAndSynth(i, outphase)
-- processing
local i2 = math.floor(i*shift+0.5) -- bigger
if i2<cplxSize and i2>0 then -- only for backward
synMagn[i2] = anaMagn[i] + synMagn[i2]
synFreq[i2] = anaFreq[i] * shift
end
-- resynthesis
local magn = synMagn[i]
x = synFreq[i]
x = x - i
x = 2*math.pi*x/steps
x = x + i*expct
outphase[i] = outphase[i] + x
local phase = outphase[i]
spectrum[i][0] = magn * math.cos(phase)
spectrum[i][1] = magn * math.sin(phase)
end

function wrap (i)
return (i>lineMax-1) and i-lineMax or i
end

function stereoFx.Channel:processBlock(s, smax)
for i = 0,smax do
self.inbuf[self.bufi] = s[i]
s[i] = self.outbuf[self.bufi]
self.outbuf[self.bufi] = 0
if self.bufi%stepSize==0 then
for j=0,fftSize-1 do
dbuf[j] = self.inbuf[wrap(self.bufi+j)]
end
-- revive cdata (inexplicably required, todo narrow down the cause):
tostring(dbuf); tostring(spectrum)
fftlib.fftw_execute(r2c)
applyFilter (self.inphase, self.outphase)
fftlib.fftw_execute(c2r)
applyWindow(dbuf)
for j=0,fftSize-1 do
self.outbuf[wrap(self.bufi+j)] =
self.outbuf[wrap(self.bufi+j)] + dbuf[j]
end
end
self.bufi = wrap(self.bufi+1)
end
end

plugin.manageParams {
{
name = "Shift";
changed = function(val)
if val<0.5 then
shift = (val+0.1)/0.6
else
shift = val*8-3
end
end;
};
}

+ 135
- 0
ports/protoplug/ProtoplugFiles/effects/spectral filter.lua View File

@@ -0,0 +1,135 @@
--[[
name: Spectral Filter
description: graphical spectral filter using fftw
author: osar.fr
--]]

require "include/protoplug"
require "include/Pickle"

stereoFx.init()

-- settings (change these here)
local fftSize = 512
local xPixels = 400
local yPixels = 300

-- open FFTW and define the stuff we need
fftlib = script.ffiLoad("libfftw3.so.3", "libfftw3-3")

ffi.cdef[[
typedef double fftw_complex[2];
void *fftw_plan_dft_r2c_1d(int n, double *in, fftw_complex *out, unsigned int flags);
void *fftw_plan_dft_c2r_1d(int n, fftw_complex *in, double *out, unsigned int flags);
void fftw_execute(void *plan);
]]

-- useful constants
local stepSize = math.floor(fftSize/2)
local cplxSize = stepSize+1
local rescale = 1/fftSize-- no /2 because we use 200% as max

-- global buffers : actual filter and Hann window
local graph = ffi.new ("double[?]", cplxSize)
for i = 0,cplxSize-2 do graph[i] = 0.5 end
graph[cplxSize-1] = 0 -- no one wants DC
local hw = ffi.new("double[?]", fftSize)
for i = 0,fftSize-1 do
hw[i] = (1 - math.cos(2*math.pi*i/(fftSize-1)))*rescale
end

local function applyFilter (spectrum)
for i=0,cplxSize-1 do
spectrum[i][0] = spectrum[i][0]*graph[i] -- real
spectrum[i][1] = spectrum[i][1]*graph[i] -- imaginary
-- do more interesting stuff here :)
end
end

local function applyWindow (samples)
for i = 0,fftSize-1 do
samples[i] = samples[i] * hw[i]
end
end

-- global working buffers and their fftw plans
local samples = ffi.new("double[?]", fftSize)
local spectrum = ffi.new("fftw_complex[?]", cplxSize)
local r2c = fftlib.fftw_plan_dft_r2c_1d(fftSize, samples, spectrum, 64)
local c2r = fftlib.fftw_plan_dft_c2r_1d(fftSize, spectrum, samples, 64)

-- per-channel buffers
function stereoFx.Channel:init()
self.inbuf = ffi.new("double[?]", fftSize)
self.outbuf = ffi.new("double[?]", fftSize)
self.bufi = 0
end

local function wrap (i)
return (i>fftSize-1) and i-fftSize or i
end

function stereoFx.Channel:processBlock(s, smax)
for i = 0,smax do
self.inbuf[self.bufi] = s[i]
s[i] = self.outbuf[self.bufi]
self.outbuf[self.bufi] = 0
if self.bufi%stepSize==0 then
for j=0,fftSize-1 do
samples[j] = self.inbuf[wrap(self.bufi+j)]
end
-- revive cdata (inexplicably required, todo narrow down the cause):
tostring(samples); tostring(spectrum)
fftlib.fftw_execute(r2c)
applyFilter (spectrum)
fftlib.fftw_execute(c2r)
applyWindow(samples)
for j=0,fftSize-1 do
self.outbuf[wrap(self.bufi+j)] =
self.outbuf[wrap(self.bufi+j)] + samples[j]
end
end
self.bufi = wrap(self.bufi+1)
end
end


-- Graphics --
local Freqgraph = require "include/pac/freqgraph"
local J = require "include/protojuce"

local fg = Freqgraph {
title = "Spectral Filter";
data = graph;
dataSize = cplxSize-1; -- don't touch the last partial (DC)
}

function gui.paint(g)
g:fillAll()
fg:paint(g)
end


-- Save & load --
local header = "pac spectral filter 1"

function script.loadData(data)
-- check data begins with our header
if string.sub(data, 1, string.len(header)) ~= header then return end
data = unpickle(string.sub(data, string.len(header)+1, -1))
-- check string was turned into a table without errors
if data==nil then return end
for i=0,cplxSize-1 do
if data[i] ~= nil then
graph[i] = data[i]
end
end
end

function script.saveData()
local picktable = {}
for i=0,cplxSize-1 do
picktable[i] = graph[i]
end
return header..pickle(picktable)
end

+ 3
- 0
ports/protoplug/ProtoplugFiles/generators/default.lua View File

@@ -0,0 +1,3 @@
require "include/protoplug"

--Welcome to Lua Protoplug generator (version 1.3.0)

+ 111
- 0
ports/protoplug/ProtoplugFiles/generators/fft sweeper.lua View File

@@ -0,0 +1,111 @@
--[[
name: FFT sweeper
description: testing
author: osar.fr
--]]

require "include/protoplug"

fftlib = script.ffiLoad("libfftw3.so.3", "libfftw3-3")

ffi.cdef[[
typedef enum {
FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2,
FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6,
FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10
} fftw_r2r_kind;
void *fftw_plan_r2r_1d(int n, double *in, double *out, fftw_r2r_kind kind, unsigned int flags);
void fftw_execute(void *plan);
]]
fftsz = 1024
winsz = 1000
fd = ffi.new("double[?]", fftsz) -- halfcomplex freq domain
td1 = ffi.new("double[?]", fftsz) -- time domain
td2 = ffi.new("double[?]", fftsz) -- time domain (alternating)
hw = ffi.new("double[?]", fftsz) -- Hann window function
plan1 = fftlib.fftw_plan_r2r_1d(fftsz, fd, td1, 1, 64)
plan2 = fftlib.fftw_plan_r2r_1d(fftsz, fd, td2, 1, 64)

-- prepare Hann window
for i = 0,winsz-1 do
hw[i] = 0.00003 * (1 - math.cos(2*math.pi*i/(winsz-1)));
end
function ApplyWindow (buf)
for i = 0,winsz-1 do
buf[i] = buf[i] * hw[i]
end
end

cphase = 0

gapper = 0

function FillFD (buf)
local center = math.sin(cphase)*10+15
gapper = gapper+1
if gapper > 1 then gapper = 0 end
if gapper > 0 then
--for i = 0,fftsz-1 do
-- buf[i] = 0
--end
--return
center = center*4
end
for i = 0,fftsz-1 do
local sharm = math.sin(i-center)
local x = i/(fftsz*0.0004883)
buf[i] = 10000/((x-center)*(x-center)+10)*sharm*sharm
buf[i] = buf[i] + 33457/((x-center*8)*(x-center*8)+1000)
buf[i] = buf[i] + 34321/((x-center*12)*(x-center*12)+1000)
--buf[i] = buf[i] + 100/((i-center*2)*(i-center*2)+1)
--buf[i] = buf[i] + 10/((i-center*4)*(i-center*4)+1)
--if i<center then buf[i] = 0 end
if i%5==1 then buf[i] = buf[i]*0.1 end
if i%3==1 then buf[i] = buf[i]*-1 end
if buf[i] > 10 then buf[i] = 10 end
end
cphase = cphase + 0.01
end


FillFD(fd)
fftlib.fftw_execute(plan1)
fftlib.fftw_execute(plan2)
ApplyWindow(td1)
ApplyWindow(td2)
tdpos1 = 0
tdpos2 = winsz*0.5
alt1 = false
alt2 = false

function plugin.processBlock(s, smax)
for i = 0,smax do
s[0][i] = td1[tdpos1] + td2[tdpos2]
s[1][i] = td1[tdpos1] + td2[tdpos2]
tdpos1 = tdpos1+1
tdpos2 = tdpos2+1
if tdpos1 >= winsz then
tdpos1 = 0
if alt1 then
alt1 = false
FillFD(fd)
fftlib.fftw_execute(plan1)
ApplyWindow(td1)
else
alt1 = true
end
end
if tdpos2 >= winsz then
tdpos2 = 0
if alt2 then
alt2 = false
FillFD(fd)
fftlib.fftw_execute(plan2)
ApplyWindow(td2)
else
alt2 = true
end
end
end
return 1
end

+ 61
- 0
ports/protoplug/ProtoplugFiles/generators/midi nonstop atonal V.lua View File

@@ -0,0 +1,61 @@
-- outputs a stream of semi-chaotic notes on MIDI channel 1

require "include/protoplug"

--Welcome to Lua Protoplug generator (version 1.0.0)
x=0
function plugin.processBlock(samples, smax, midiBuf)
newEvents = {}
if not interval then updateInterval() end
if not i then i = interval + 1 end
for s=0,smax do
if i>=interval then
local f1,v1 = magic(x)
local f2 = magic(x-5)
if f1 then noteOn(f1, v1) end
if f1 then noteOn(f1-5, v1) end
if f2 then noteOff(f2) end
if f2 then noteOff(f2-5) end
i = 0
x = x + 1
end
i = i + 1
end
midiBuf:clear()
if #newEvents>0 then
for _,e in ipairs(newEvents) do
midiBuf:addEvent(e)
end
end
end

function noteOn(n,v)
if n>100 then return end
table.insert(newEvents, midi.Event.noteOn(1, n, v))
end
function noteOff(n)
table.insert(newEvents, midi.Event.noteOff(1, n, 0))
end

function magic(x)
if ((x%19)%11)%4==0 then
return 40+x%((x/6)%8+2)*8, 20+((x/6)%8+2)*8
end
end

function updateInterval()
local int = params[1].getValue()
bpm = plugin.getCurrentPosition().bpm
interval = math.floor((plugin.getSampleRate()*int)/(bpm))
end

params = plugin.manageParams {
{
name = "Interval";
type = "int";
min = 3;
max = 30;
default = 60;
changed = function(val) interval = nil end;
};
}

+ 49
- 0
ports/protoplug/ProtoplugFiles/generators/midi-chordify.lua View File

@@ -0,0 +1,49 @@
--[[
name: midi chordify
description: MIDI processor VST/AU. Notes go in, chords come out.
author: osar.fr
--]]

require "include/protoplug"

-- what kind of chord ?
local chordStructure = {0, 3, 5, 7, 11}
local blockEvents = {}

function plugin.processBlock(samples, smax, midiBuf)
blockEvents = {}
-- analyse midi buffer and prepare a chord for each note
for ev in midiBuf:eachEvent() do
if ev:isNoteOn() then
chordOn(ev)
elseif ev:isNoteOff() then
chordOff(ev)
end
end
-- fill midi buffer with prepared notes
midiBuf:clear()
if #blockEvents>0 then
for _,e in ipairs(blockEvents) do
midiBuf:addEvent(e)
end
end
end

function chordOn(root)
for _, offset in ipairs(chordStructure) do
local newEv = midi.Event.noteOn(
root:getChannel(),
root:getNote()+offset,
root:getVel())
table.insert(blockEvents, newEv)
end
end

function chordOff(root)
for _, offset in ipairs(chordStructure) do
local newEv = midi.Event.noteOff(
root:getChannel(),
root:getNote()+offset)
table.insert(blockEvents, newEv)
end
end

+ 45
- 0
ports/protoplug/ProtoplugFiles/generators/sine-organ.lua View File

@@ -0,0 +1,45 @@
--[[
name: sine organ
description: A simple organ-like sinewave VST/AU.
author: osar.fr
--]]

require "include/protoplug"

local release = 10000
local decayRate = 1/release

polyGen.initTracks(8)

function polyGen.VTrack:init()
-- create per-track fields here
self.phase = 0
self.releasePos = release
end

function polyGen.VTrack:addProcessBlock(samples, smax)
local amp = 1
for i = 0,smax do
if not self.noteIsOn then
-- release is finished : idle track
if self.releasePos>=release then break end
-- release is under way
amp = 1-self.releasePos*decayRate
self.releasePos = self.releasePos+1
end
self.phase = self.phase + (self.noteFreq*math.pi*2)
-- math.sin is slow but once per sample is no tragedy
local trackSample = math.sin(self.phase)*amp*0.3
samples[0][i] = samples[0][i] + trackSample -- left
samples[1][i] = samples[1][i] + trackSample -- right
end
end

function polyGen.VTrack:noteOff(note, ev)
self.releasePos = 0
end

function polyGen.VTrack:noteOn(note, vel, ev)
-- start the sinewave at 0 for a clickless attack
self.phase = 0
end

+ 47
- 0
ports/protoplug/ProtoplugFiles/generators/sinemouse-demo.lua View File

@@ -0,0 +1,47 @@
--[[
name: sinemouse demo
description: >
Custom GUI demonstration : Drag your mouse around in the
frame to control the sine wave's amplitude and frequency.
author: osar.fr
--]]

require "include/protoplug"

local freq,amp = 440, 0
local delta, phase = 0.06, 0

function plugin.processBlock(samples, smax)
for i=0,smax do
local s = math.sin(phase)*amp
samples[0][i] = s -- left
samples[1][i] = s -- right
phase = phase + delta
end
end

local J = juce
local frame = J.Rectangle_int(20,20,400,300)
local sideways = J.AffineTransform():rotated(math.pi*0.5)

function gui.paint(g)
g:fillAll()
g:setColour(J.Colour.green)
g:drawRect(frame)
g:drawText("Frequency", 20, 320, 400, 20, J.Justification.centred)
g:addTransform(sideways)
g:drawText("amplitude", 20, -440, 300, 20, J.Justification.centred)
end

local function mouseHandler(event)
if not frame:contains(J.Point(event.x,event.y)) then
return
end
freq = event.x + 80
amp = (320-event.y)/300
local sr = plugin.isSampleRateKnown() and plugin.getSampleRate() or 44100
delta = 2*math.pi*freq/sr
end

gui.addHandler("mouseDrag", mouseHandler)
gui.addHandler("mouseDown", mouseHandler)

+ 39
- 0
ports/protoplug/ProtoplugFiles/generators/soundfile-test.lua View File

@@ -0,0 +1,39 @@
--[[
name: soundfile test
description: A simple demo that plays an audio file.
author: osar.fr
--]]

require "include/protoplug"

local path = "C:\\temp\\pluck44.wav"
local wave, len

-- 'prepareToPlay' will be triggered when the host sample rate is known,
-- so we can load sound files with automatic sample rate conversion:
plugin.addHandler('prepareToPlay', function()
local readr = juce.AudioFormatReader(path)
if readr==nil then error ("can't open wave: "..path) end
wave, len = readr:readToFloat(2) -- require 2 channels
end)

polyGen.initTracks(8)

function polyGen.VTrack:noteOn(note, vel, ev)
self.playing = true
self.wavepos = 0
end

function polyGen.VTrack:noteOff(note, ev)
self.playing = false
end

function polyGen.VTrack:addProcessBlock(samples, smax)
for i = 0,smax do
if self.playing and self.wavepos < len then
self.wavepos = self.wavepos + 1
samples[0][i] = samples[0][i] + wave[0][self.wavepos] -- left
samples[1][i] = samples[1][i] + wave[1][self.wavepos] -- right
end
end
end

+ 88
- 0
ports/protoplug/ProtoplugFiles/include/Pickle.lua View File

@@ -0,0 +1,88 @@
----------------------------------------------
-- Pickle.lua
-- A table serialization utility for lua
-- Steve Dekorte, http://www.dekorte.com, Apr 2000
-- Freeware
----------------------------------------------

function pickle(t)
return Pickle:clone():pickle_(t)
end

Pickle = {
clone = function (t)
local nt={};
for i, v in pairs(t) do
nt[i]=v
end
return nt
end
}

function Pickle:pickle_(root)
if type(root) ~= "table" then
error("can only pickle tables, not ".. type(root).."s")
end
self._tableToRef = {}
self._refToTable = {}
local savecount = 0
self:ref_(root)
local s = ""

while table.getn(self._refToTable) > savecount do
savecount = savecount + 1
local t = self._refToTable[savecount]
s = s.."{\n"
for i, v in pairs(t) do
s = string.format("%s[%s]=%s,\n", s, self:value_(i), self:value_(v))
end
s = s.."},\n"
end

return string.format("{%s}", s)
end

function Pickle:value_(v)
local vtype = type(v)
if vtype == "string" then return string.format("%q", v)
elseif vtype == "number" then return v
elseif vtype == "table" then return "{"..self:ref_(v).."}"
else --error("pickle a "..type(v).." is not supported")
end
end

function Pickle:ref_(t)
local ref = self._tableToRef[t]
if not ref then
if t == self then error("can't pickle the pickle class") end
table.insert(self._refToTable, t)
ref = table.getn(self._refToTable)
self._tableToRef[t] = ref
end
return ref
end

----------------------------------------------
-- unpickle
----------------------------------------------

function unpickle(s)
if type(s) ~= "string" then
error("can't unpickle a "..type(s)..", only strings")
end
local gentables = loadstring("return "..s)
local tables = gentables()

for tnum = 1, table.getn(tables) do
local t = tables[tnum]
local tcopy = {}; for i, v in pairs(t) do tcopy[i] = v end
for i, v in pairs(tcopy) do
local ni, nv
if type(i) == "table" then ni = tables[i[1]] else ni = i end
if type(v) == "table" then nv = tables[v[1]] else nv = v end
t[i] = nil
t[ni] = nv
end
end
return tables[1]
end

+ 268
- 0
ports/protoplug/ProtoplugFiles/include/core/gui.lua View File

@@ -0,0 +1,268 @@
--- Use `gui` to define your script's custom graphical user interface.
-- Custom GUI example : @{sinemouse-demo.lua}
--
-- The `gui` global is available to every protoplug script after including the
-- main protoplug header :
-- require "include/protoplug"
-- @module gui

local gui = {}

--- Focus change causes.
-- Values received by the `focusGained` and `focusLost` handlers.
-- @see gui.addHandler
-- @table FocusCause
gui.FocusCause =
{
focusChangedByMouseClick = 0; -- 0
focusChangedByTabKey = 1; -- 1
focusChangedDirectly = 2; -- 2
};

--- Keyboard and mouse modifiers.
-- Contained in every @{gui.MouseEvent} and received by the
-- `modifierKeysChanged` handler.
-- @table ModifierKeys
gui.ModifierKeys =
{
noModifiers = 0; -- 0
shiftModifier = 1; -- 1
ctrlModifier = 2; -- 2
altModifier = 4; -- 4
leftButtonModifier = 16; -- 16
rightButtonModifier = 32; -- 32
middleButtonModifier = 64; -- 64
commandModifier = 8; -- 8
ctrlAltCommandModifiers = 14; -- 14
};

local script = require "include/core/script"

--[[--- Add a handler for a GUI event.

Here's a list of the events and their parameters, showing how they
should be received :
gui.addHandler("resized", function() ... end)
gui.addHandler("focusGained", function(focusCause) ... end)
gui.addHandler("focusLost", function(focusCause) ... end)
gui.addHandler("modifierKeysChanged", function(modifierKeys) ... end)
gui.addHandler("mouseMove", function(mouseEvent) ... end)
gui.addHandler("mouseEnter", function(mouseEvent) ... end)
gui.addHandler("mouseExit", function(mouseEvent) ... end)
gui.addHandler("mouseDown", function(mouseEvent) ... end)
gui.addHandler("mouseDrag", function(mouseEvent) ... end)
gui.addHandler("mouseUp", function(mouseEvent) ... end)
gui.addHandler("mouseDoubleClick", function(mouseEvent) ... end)
gui.addHandler("mouseWheelMove", function(mouseEvent, mouseWheelDetails) ... end)
gui.addHandler("keyPressed", function(keyPress, srcComponent) ... end)
gui.addHandler("keyStateChanged", function(keyPress, srcComponent) ... end)
Parameters received by the event handlers are of
type @{FocusCause}, @{ModifierKeys}, @{MouseEvent}, @{MouseWheelDetails},
and @{KeyPress}.

@see script.addHandler
@see plugin.addHandler
@tparam string event the event to handle
@tparam function handler a function to add the event's handlers
--]]
function gui.addHandler(event, handler)
if not gui[event] then gui[event] = {} end
table.insert(gui[event], handler)
end

-- assumes handler existence already checked
local function gui_emit(event, ...)
for _,v in ipairs(gui[event]) do
v(...)
end
end

-- returns nil if no handler (prevents useless definitions)
local function gui_getEmitter(event)
if not gui[event] then return end
return function (...)
gui_emit(event, ...)
end
end

script.addHandler("init", function ()

--- Override to paint a custom GUI.
-- Define this function to paint something in the custom GUI space.
-- @tparam juce.Graphics g a JUCE graphics target
-- @function gui.paint
if type(gui.paint) == "function" then
function gui_paint(g)
g = ffi.typeof("pGraphics")(g)
gui.paint(g)
end
end
gui_resized = gui_getEmitter("resized")
gui_focusGained = gui_getEmitter("focusGained")
gui_focusLost = gui_getEmitter("focusLost")
gui_modifierKeysChanged = gui_getEmitter("modifierKeysChanged")
-- event overrides with ffi conversion
if gui.mouseMove then
function gui_mouseMove(event)
event = ffi.typeof("MouseEvent*")(event)
gui_emit("mouseMove",event)
end
end
if gui.mouseEnter then
function gui_mouseEnter(event)
event = ffi.typeof("MouseEvent*")(event)
gui_emit("mouseEnter", event)
end
end
if gui.mouseExit then
function gui_mouseExit(event)
event = ffi.typeof("MouseEvent*")(event)
gui_emit("mouseExit", event)
end
end
if gui.mouseDown then
function gui_mouseDown(event)
event = ffi.typeof("MouseEvent*")(event)
gui_emit("mouseDown", event)
end
end
if gui.mouseDrag then
function gui_mouseDrag(event)
event = ffi.typeof("MouseEvent*")(event)
gui_emit("mouseDrag", event)
end
end
if gui.mouseUp then
function gui_mouseUp(event)
event = ffi.typeof("MouseEvent*")(event)
gui_emit("mouseUp", event)
end
end
if gui.mouseDoubleClick then
function gui_mouseDoubleClick(event)
event = ffi.typeof("MouseEvent*")(event)
gui_emit("mouseDoubleClick", event)
end
end
if gui.mouseWheelMove then
function gui_mouseWheelMove(event, wheel)
event = ffi.typeof("MouseEvent*")(event)
wheel = ffi.typeof("MouseWheelDetails*")(wheel)
gui_emit("mouseWheelMove", event, wheel)
end
end
if gui.keyPressed then
function gui_keyPressed(key, component)
key = ffi.typeof("KeyPress*")(key)
component = ffi.typeof("pComponent")(component)
gui_emit("keyPressed", key, component)
return true
end
end
if gui.keyStateChanged then
function gui_keyStateChanged(isKeyDown, component)
component = ffi.typeof("pComponent")(component)
gui_emit("keyStateChanged", isKeyDown, component)
return true
end
end
end)


gui.ppcomponent = ffi.typeof("pComponent*")(gui_component)

--- Get GUI Component.
-- @return the current GUI component, or `nil` if the GUI
-- has not been opened yet.
function gui.getComponent()
if gui.ppcomponent[0].pointer~=nil then
return gui.ppcomponent[0]
end
end


--- Mouse Event.
-- A mouse event as received by GUI handlers (see @{gui.addHandler})
-- <br><br>
-- @type gui.MouseEvent

--- X.
-- @field MouseEvent.x

--- Y.
-- @field MouseEvent.y

--- Modifier keys.
-- Values defined in @{gui.ModifierKeys}
-- @field MouseEvent.mods

--- Event component.
-- @field MouseEvent.eventComponent

--- Original component.
-- @field MouseEvent.originalComponent

--- Time.
-- @field MouseEvent.eventTime

--- Mouse down time.
-- @field MouseEvent.mouseDownTime

--- Mouse down position.
-- @field MouseEvent.mouseDownPos

--- Number of clicks.
-- @field MouseEvent.numberOfClicks

--- Was moved since mouse down.
-- @field MouseEvent.wasMovedSinceMouseDown


--- Mouse Wheel Details.
-- As received by the `mouseWheelMove` handler (see @{gui.addHandler})
-- <br><br>
-- @type gui.MouseWheelDetails

--- X delta.
-- @field MouseWheelDetails.deltaX

--- Y delta.
-- @field MouseWheelDetails.deltaY

--- Is reversed.
-- @field MouseWheelDetails.isReversed

--- Is smooth.
-- @field MouseWheelDetails.isSmooth


--- Key Press.
-- As received by the `keyPressed` and `keyStateChanged` handlers (see @{gui.addHandler})
-- <br><br>
-- @type gui.KeyPress

--- Key code.
-- (undecipherable for now)
-- @field KeyPress.keyCode

--- Modifier Keys.
-- @field KeyPress.mods

--- Text character.
-- @field KeyPress.textCharacter


return gui

+ 162
- 0
ports/protoplug/ProtoplugFiles/include/core/manageparams.lua View File

@@ -0,0 +1,162 @@
-- Manage Params
-- takes a list of parameter descriptions and manages all the parameter overrides.
--[[ example usage :

params = plugin.manageParams {
Harshness = {
max = 510;
changed = function(val) DoSomethingWithNewValue(val) end;
};
["Wave Style"] = {
type = "list";
values = {"peaky"; "siney"; "wavey"};
changed = function(val) myVar = var end;
};
}
--]]

local util = require "include/luautil"
local script = require "include/core/script"

local paramConstructors =
{
double = function(param)
param.min = param.min or 0
param.max = param.max or 1
param.showDecimals = param.showDecimals or 4
param.getText = function()
return tostring(
util.roundDecimal(
plugin.getParameter(param.index)*(param.max-param.min)+param.min
,param.showDecimals)
)
end
param.getValue = function()
return plugin.getParameter(param.index)*(param.max-param.min)+param.min
end
param.Value2Raw = function(val)
return (val-param.min)/(param.max-param.min)
end
return param
end;
int = function(param)
param.min = param.min or 0
param.max = param.max or 127
param.getText = function()
return tostring(
math.floor(plugin.getParameter(param.index)*(param.max-param.min)+param.min)
)
end
param.getValue = function()
return math.floor(plugin.getParameter(param.index)*(param.max-param.min)+param.min)
end
param.Value2Raw = function(val)
return (val-param.min)/(param.max-param.min)
end
return param
end;
list = function(param)
param.getText = function()
local i = plugin.getParameter(param.index)*(#param.values-0.1)+1
return tostring(param.values[math.floor(i)])
end
param.getValue = function()
local i = plugin.getParameter(param.index)*(#param.values-0.1)+1
return param.values[math.floor(i)]
end
param.getKey = function()
return plugin.getParameter(param.index)*(#param.values-0.1)+1
end
param.Value2Raw = function(val)
for k,v in ipairs(param.values) do
if v==val then
return (k-1)/(#param.values-0.5)
end
end
error ("value "..val.." not in value list for "..param.key)
end
return param
end;
}


return function(args)
local params = {}
local index2param = {}
for key, param in pairs(args) do
param.type = param.type or "double"
param.index = key - 1
param = paramConstructors[param.type](param)

if type(param.name) ~= "string" then
param.name = ("Param %i (%s)"):format(param.index, param.type)
end

param.set = function(val)
plugin.setParameter(param.index, param.Value2Raw(val))
param.changed(param.getValue())
end
params[key] = param
index2param[param.index] = param
end

function plugin.getParameterName(index)
local param = index2param[index]
if param then
return param.name
end
end

function plugin.getParameterText(index)
local param = index2param[index]
if param then
return param.getText()
end
end
function plugin.parameterText2Double(index, text)
local param = index2param[index]
if param then
return param.Value2Raw(text)
end
end

function plugin.paramChanged(index)
local param = index2param[index]
if param and param.changed then
param.changed(param.getValue())
end
end
local function iter (params, cur)
local k,v = next(params, cur)
while v and type(v)~="table" do
k,v = next(params, k)
end
return k, v
end
function params.each()
return iter, params, nil
end
function params.resetToDefaults()
for key, param in pairs(args) do
if type(param)=="table" then
plugin.setParameter(param.index, param.Value2Raw(param.default))
param.changed(param.getValue())
end
end
end
script.addHandler("init", function ()
for key, param in params.each() do
param.changed(param.getValue())
end
end)
return params;
end

+ 379
- 0
ports/protoplug/ProtoplugFiles/include/core/midi.lua View File

@@ -0,0 +1,379 @@
--- `midi` contains MIDI-related classes and functions.
-- Example of receiving MIDI input : @{sine-organ.lua}.
--
-- Example of producing MIDI output : @{midi-chordify.lua}.
--
-- The `midi` global is available to every protoplug script after including the
-- main protoplug header :
-- require "include/protoplug"
-- @module midi

-- Bitte ein BitOp
local bnot = bit.bnot
local band, bor, bxor = bit.band, bit.bor, bit.bxor
local lshift, rshift, rol = bit.lshift, bit.rshift, bit.rol

ffi.cdef [[

typedef struct pMidiBuffer
{ void *pointer; } pMidiBuffer;

uint8_t *MidiBuffer_getDataPointer(pMidiBuffer mb);
int MidiBuffer_getDataSize(pMidiBuffer mb);
void MidiBuffer_resizeData(pMidiBuffer mb, int size);

// artist's rendition of the juce::MidiBuffer internal format
// ("don't write code that relies on it!" -Jules)
typedef struct MidiEvent
{
int32_t time;
const uint16_t dataSize;
uint8_t data[?];
} MidiEvent;
]]

local midi = {}

--- Convert a MIDI note number to frequency.
-- Call this function to get a note's frequency.
-- @param note the MIDI note (0-127)
-- @return the frequency in samples^-1
-- @function midi.noteToFreq
function midi.noteToFreq(n)
return 2^((n-69)/12)*440/plugin.getSampleRate()
end


--- Midi Event List.
-- A buffer containing midi events, as received by @{plugin.processBlock}
-- <br><br>
-- @type midi.Buffer
midi.Buffer = ffi.typeof("pMidiBuffer")

local locks = {}

local Buffer_mt = {
-- methods
__index = {
--- Iterate over each @{midi.Event} in the buffer.
-- @usage for ev in myBuffer:eachEvent() do print(ev:getNote()) end
-- @function Buffer:eachEvent
eachEvent = function (self)
-- COROUTINE ITERATOR IS EVIL ITERATOR
return coroutine.wrap(function ()
local dataStart = protolib.MidiBuffer_getDataPointer(self)
local msg = dataStart
local nBytes = protolib.MidiBuffer_getDataSize(self)
self:lock()
while msg < dataStart + nBytes do
ret = ffi.cast("MidiEvent*",msg)
coroutine.yield(ret)
msg = msg +
ffi.sizeof"int32_t" +
ffi.sizeof"uint16_t" +
ffi.sizeof"uint8_t" * ret.dataSize
end
self:unlock()
end)
end;
--- Remove all MIDI events from the buffer.
-- @function Buffer:clear
clear = function (self)
self:checkLock()
protolib.MidiBuffer_resizeData(self, 0)
end;
--- Add a MIDI event.
-- @tparam midi.Event event
-- @function Buffer:addEvent
addEvent = function (self, event)
self:checkLock()
local nBytes = protolib.MidiBuffer_getDataSize(self)
protolib.MidiBuffer_resizeData(self, nBytes + event.dataSize+ffi.sizeof("int32_t")+ffi.sizeof("uint16_t"))
local dataStart = protolib.MidiBuffer_getDataPointer(self)
ffi.copy(dataStart + nBytes, event, event.dataSize+ffi.sizeof("int32_t")+ffi.sizeof("uint16_t"))
end;
-- internal
lock = function (self)
local addr = tonumber(ffi.cast("int", protolib.MidiBuffer_getDataPointer(self)))
locks[addr] = locks[addr] and locks[addr] + 1 or 1
end;
unlock = function (self)
local addr = tonumber(ffi.cast("int", protolib.MidiBuffer_getDataPointer(self)))
if not locks[addr] then return end
locks[addr] = locks[addr] - 1
if locks[addr] < 1 then locks[addr] = nil end
end;
checkLock = function (self)
local addr = tonumber(ffi.cast("int", protolib.MidiBuffer_getDataPointer(self)))
if locks[addr] then
error "Cannot modify a midi.Buffer while iterating through it."
end
end;
debug = function (self)
self:checkLock()
local o = ""
local max = protolib.MidiBuffer_getDataSize(self)
local addr = protolib.MidiBuffer_getDataPointer(self)
for i = 0,max-1 do
addr = addr + 1
o = o..bit.tohex(addr[0],4).." "
end
print (o)
end;
};
}
ffi.metatype(midi.Buffer, Buffer_mt)

--- Midi Event.
-- A single midi event as returned by @{Buffer:eachEvent}
-- <br><br>
-- @type midi.Event

midi.Event = setmetatable ({}, {
--- Constructor : copy another event.
-- @tparam midi.Event other
-- @display midi.Event
-- @function Event

--- Constructor : create a custom event.
-- Create an event from given bytes (or zeros if not supplied)
-- @usage myEv = midi.Event(0, 3, {0x90, 0x30, 0x7f}) -- note on
-- @param time
-- @param dataSize
-- @param[opt] data
-- @display midi.Event
-- @function midi.Event
__call = function(self, ...)
if select("#", ...)==1 then
local o = ...
local n = ffi.new("MidiEvent", o.dataSize, o.time, o.dataSize)
ffi.copy(n.data, o.data, o.dataSize)
return n
elseif select("#", ...)==2 then
local time, dataSize, data = ...
local n = ffi.new("MidiEvent", dataSize, time, dataSize)
if data then
for k,v in ipairs(data) do n.data[k-1] = v end
else
ffi.fill(n.data, dataSize)
end
return n
end
end;
})
--- Constructor : note on.
-- @param channel (1-16)
-- @param note (0-127)
-- @param vel (1-127)
-- @param[opt=0] pos sample offset
-- @treturn midi.Event
-- @function Event.noteOn
midi.Event.noteOn = function (channel, note, vel, pos)
pos = pos or 0
local n = midi.Event(pos, 3)
n.data[0] = bor(0x90, channel-1)
n.data[1] = band(note, 127)
n.data[2] = band(vel, 127)
return n
end
--- Constructor : note off.
-- @param channel (1-16)
-- @param note (0-127)
-- @param[opt=0] vel (0-127)
-- @param[opt=0] pos sample offset
-- @treturn midi.Event
-- @function Event.noteOff
midi.Event.noteOff = function (channel, note, vel, pos)
pos = pos or 0
vel = vel or 0
local n = midi.Event(pos, 3)
n.data[0] = bor(0x80, channel-1)
n.data[1] = band(note, 127)
n.data[2] = band(vel, 127)
return n
end
--- Constructor : pitch bend.
-- @param channel (1-16)
-- @param pitch bend value (0-16383)
-- @param[opt=0] pos sample offset
-- @treturn midi.Event
-- @function Event.pitchBend
midi.Event.pitchBend = function (channel, val, pos)
pos = pos or 0
local n = midi.Event(pos, 3)
n.data[0] = bor(0xe0, channel-1)
n.data[1] = band(val, 127)
n.data[2] = band(rshift(val,7), 127)
return n
end
--- Constructor : Control change.
-- @param channel (1-16)
-- @param number control number (0-247)
-- @param value control value (0-127)
-- @param[opt=0] pos sample offset
-- @treturn midi.Event
-- @function Event.control
midi.Event.control = function (channel, num, val, pos)
pos = pos or 0
local n = midi.Event(pos, 3)
n.data[0] = bor(0xb0, channel-1)
n.data[1] = band(num, 127)
n.data[2] = band(val, 127)
return n
end

local MidiEvent_mt = {
-- todo precalculate ?
-- status = band(self.data[0], 0xf0)
-- note = band(self.data[1], 0x7f)
-- vel = band(self.data[2], 0x7f)
-- also sanity check ? if msg.dataSize>=3 then
-- methods
__index = {
--- Get channel.
-- @return the MIDI channel (1-16)
-- @function Event:getChannel
getChannel = function (self)
if band(self.data[0], 0xf0) ~= 0xf0 then
return band(self.data[0], 0xf) + 1
end
end;
--- Set channel.
-- @param channel the MIDI channel (1-16)
-- @function Event:setChannel
setChannel = function (self, channel)
if band(self.data[0], 0xf0) ~= 0xf0 then
self.data[0] =
bor(
band(self.data[0], 0xf0),
channel-1
)
end
end;
--- Is a note on event.
-- @treturn boolean whether event is a note on.
-- @function Event:isNoteOn
isNoteOn = function (self)
return (band(self.data[0], 0xf0)==0x90 and band(self.data[2], 0x7f)~=0)
end;
--- Is a note off event.
-- @treturn boolean whether event is a note off.
-- @function Event:isNoteOff
isNoteOff = function (self)
return (band(self.data[0], 0xf0)==0x80 or (band(self.data[0], 0xf0)==0x90 and band(self.data[2], 0x7f)==0))
end;
--- Get note.
-- @return the MIDI note number (0-127)
-- @function Event:getNote
getNote = function (self)
return band(self.data[1], 0x7f)
end;
--- Set note.
-- @param note the MIDI note number (0-127)
-- @function Event:setNote
setNote = function (self, note)
if self:isNoteOn() or self:isNoteOff() then
self.data[1] = band(note, 127)
end
end;
--- Get velocity.
-- @return the MIDI velocity (1-127)
-- @function Event:getVel
getVel = function (self)
return band(self.data[2], 0x7f)
end;
--- Set velocity.
-- @param vel the MIDI velocity (1-127)
-- @function Event:setVel
setVel = function (self, vel)
if self:isNoteOn() or self:isNoteOff() then
self.data[2] = vel
end
end;
--- Is a pitch bend event.
-- @treturn boolean whether event is a pitch bend on.
-- @function Event:isPitchBend
isPitchBend = function (self)
return band(self.data[0], 0xf0)==0xe0
end;
--- Get pitch bend value.
-- @return pitch bend value (0-16383).
-- @function Event:getPitchBendValue
getPitchBendValue = function (self)
if not self:isPitchBend() then error "not a pitch bend event" end
return bor(self.data[1], lshift(self.data[2], 7))
end;
--- Is a Control Change event.
-- @treturn boolean whether event is a control change.
-- @function Event:isControl
isControl = function (self)
return band(self.data[0], 0xf0)==0xb0
end;
--- Get control number.
-- @return control number (0-247).
-- @function Event:getControlNumber
getControlNumber = function (self)
if not self:isControl() then error "not a control event" end
return self.data[1]
end;
--- Get control value.
-- @return control value (0-127).
-- @function Event:getControlValue
getControlValue = function (self)
if not self:isControl() then error "not a control event" end
return self.data[2]
end;
debug = function (self)
print (tonumber(self.time).." "..
tonumber(self.dataSize).." "..
bit.tohex(self.data[0],4).." "..
bit.tohex(self.data[1],4).." "..
bit.tohex(self.data[2],4))
end;
};
}

--- Sample position relatively to the start of the block.
-- This value is often 0 because most hosts call @{plugin.processBlock} at the
-- beginning of beats and beat divisions. It is never higher than the
-- current @{plugin.processBlock}'s `smax` and any events created by the script
-- should respect this rule.
-- @field Event.time

--- Size of the MIDI message in bytes
-- @field Event.dataSize

--- The raw MIDI message
-- (`const uint8_t*` cdata)
-- @field Event.data

ffi.metatype("MidiEvent", MidiEvent_mt)

return midi

+ 273
- 0
ports/protoplug/ProtoplugFiles/include/core/plugin.lua View File

@@ -0,0 +1,273 @@
--- Use `plugin` to define the AU/VST audio plugin's behaviour.
-- The `plugin` global is available to every protoplug script after including the
-- main protoplug header :
-- require "include/protoplug"
-- @module plugin

ffi.cdef [[

// pasted from juce_AudioPlayHead.h
typedef struct CurrentPositionInfo
{
double bpm;
int timeSigNumerator;
int timeSigDenominator;
int64_t timeInSamples;
double timeInSeconds;
double editOriginTime;
double ppqPosition;
double ppqPositionOfLastBarStart;
int frameRate;
bool isPlaying;
bool isRecording;
double ppqLoopStart;
double ppqLoopEnd;
bool isLooping;
} CurrentPositionInfo;

typedef struct pAudioPlayHead
{ void *pointer; } pAudioPlayHead;

bool AudioPlayHead_getCurrentPosition(pAudioPlayHead self, CurrentPositionInfo& result);
]]

local script = require "include/core/script"

local plugin = {}

local sampleRate

script.addHandler("init", function ()
--- Override functions.
-- Define these functions and the host will call them.
-- <br><br>
-- @section overrides
--- Process Audio Block.
-- Override this function to input and output audio and MIDI data.
--
-- This override is handled automatically if @{stereoFx} or @{polyGen} are used.
-- Use this function to handle the raw data instead.
-- @param samples a C float** pointing to two channels of samples, serving as input and output
-- @param smax the maximum sample index (nSamples - 1)
-- @tparam midi.Buffer midiBuf the MIDI data for this block, serving as input and output
-- @usage function plugin.processBlock (samples, smax) -- let's ignore midi for this example
-- for i = 0, smax do
-- samples[0][i] = sin(myTime) -- left channel
-- samples[1][i] = sin(myTime) -- right channel
-- myTime = myTime + myDelta
-- end
-- end
-- @function plugin.processBlock
local dbged = false
if type(plugin.processBlock) == "function" then
local prepared = false
function plugin_processBlock(nSamples, samples, midiBuf, playHead, _sampleRate)
if not dbged then
dbged=true
end
sampleRate = _sampleRate
if not prepared then
prepared = true
if plugin.prepareToPlay then
for _,v in ipairs(plugin.prepareToPlay) do
v()
end
end
end
samples = ffi.typeof("float**")(samples)
midiBuf = ffi.typeof("pMidiBuffer")(midiBuf)
plugin.playHead = ffi.typeof("pAudioPlayHead")(playHead)
plugin.processBlock(samples, nSamples-1, midiBuf)
plugin.playHead = nil
end
end
--- Return the name of a parameter.
--
-- This override is handled automatically if @{manageParams} is used.
-- @param index parameter index (0-126)
-- @treturn string the parameter's name
-- @function plugin.getParameterName
plugin_getParameterName = plugin.getParameterName
--- Return the representation of a parameter's value.
-- Override this function to choose how each parameter's value should
-- be displayed by the host. The parameter's current value can be obtained
-- using @{plugin.getParameter}
--
-- This override is handled automatically if @{manageParams} is used.
-- @param index parameter index (0-126)
-- @treturn string a string representation of the parameter's current value
-- @function plugin.getParameterText
plugin_getParameterText = plugin.getParameterText
--- Handle parameter changes.
-- Override this function to do something when a parameter changes
-- The parameter's current value can be obtained using @{plugin.getParameter}
--
-- This override is handled automatically if @{manageParams} is used.
-- @param index parameter index (0-126)
-- @function plugin.paramChanged
plugin_paramChanged = plugin.paramChanged
-- todo
plugin_parameterText2Double = plugin.parameterText2Double
--- Return the tail length in seconds (effects only).
-- Override this function to define the effect's audio tail length.
-- @return the tail length in seconds
-- @function plugin.getTailLengthSeconds
plugin_getTailLengthSeconds = plugin.getTailLengthSeconds

end)
--- Callback functions.
-- Functions that your script can call.
-- <br><br>
-- @section callbacks

--- Automatically set up a list of parameters.
-- Call this function with a table containing parameter definitions as argument, and
-- it will perform the repetitive task of defining all the parameter-related overrides.
--
-- The format of the parameter list is demonstrated in @{classic-filter.lua}
-- @param paramList a table with parameter definitions (see example)
-- @function plugin.manageParams
plugin.manageParams = require "include/core/manageparams"

--- Set (automate) a parameter's value.
-- The value must be normalized to be between 0 and 1.
-- @param index parameter index (0-126)
-- @param value parameter value (0-1)
-- @function plugin.setParameter
plugin.setParameter = plugin_setParameter

--- Get a parameter's value.
-- The values are between 0 and 1, but different minimums and maximums can
-- be easily simulated using @{plugin.manageParams}.
-- @param index parameter index (0-126)
function plugin.getParameter(index)
return plugin_params[index]
end
plugin_params = ffi.typeof("const double *")(plugin_params)

--- Get host position info, if available.
-- Only call this from within @{processBlock}.
-- @treturn plugin.PositionInfo current position info, or `nil` depending on the host.
-- @function plugin.getCurrentPosition
plugin.getCurrentPosition = function ()
if not plugin.playHead then return end
local pos = ffi.new("CurrentPositionInfo")
local res = protolib.AudioPlayHead_getCurrentPosition(plugin.playHead, pos)
if res==true then
return pos
end
end

--- Get host samplerate.
-- The value is unknown until the plugin `prepareToPlay` event has been emitted.
-- The value is always known in @{processBlock}. An error is caused if an
-- attempt is made to access the sample rate prematurely.
-- @see plugin.addHandler
-- @return current samplerate.
-- @function plugin.getSampleRate
plugin.getSampleRate = function ()
if sampleRate == nil then
error ("Trying to use sampleRate when it is not yet known. " ..
"Use plugin.addHandler('prepareToPlay',...) to initialize and use the samplerate. ")
end
return sampleRate
end

--- Check if the samplerate is known.
-- @treturn boolean
-- @function plugin.isSampleRateKnown
plugin.isSampleRateKnown = function ()
return (sampleRate ~= nil)
end

--- Add a handler for a VST/AU event.
-- The following events are available :
--
-- - `"prepareToPlay"` - Emitted before the first call to @{processBlock}, when the samplerate is known.
-- @see script.addHandler
-- @see gui.addHandler
-- @tparam string event the event to handle
-- @tparam function handler a function to add the event's handlers
function plugin.addHandler(event, handler)
if not plugin[event] then plugin[event] = {} end
table.insert(plugin[event], handler)
end


--- Host position information.
-- A container type for host-related information as returned by @{plugin.getCurrentPosition}
--
-- Is a [JUCE AudioPlayHead::CurrentPositionInfo](http://www.juce.com/api/structAudioPlayHead_1_1CurrentPositionInfo.html)
-- <br><br>
--@type plugin.PositionInfo

--- Host tempo (beats per minute)
-- @field PositionInfo.bpm


--- Time signature numerator ie. *3*/4
-- @field PositionInfo.timeSigNumerator


--- Time signature denominator ie. 3/*4*
-- @field PositionInfo.timeSigDenominator


--- Current position on the host's timeline (samples)
-- @field PositionInfo.timeInSamples


--- Current position on the host's timeline (seconds)
-- @field PositionInfo.timeInSeconds


--- Position of the start of the edit region on the host's timeline
-- @field PositionInfo.editOriginTime


--- Current position on the host's timeline (pulses-per-quarter-note)
-- @field PositionInfo.ppqPosition


--- Position of the last bar start (pulses-per-quarter-note).
-- (or zero if unavailable.)
-- @field PositionInfo.ppqPositionOfLastBarStart


--- Video frame rate
-- @field PositionInfo.frameRate


--- Is playing
-- @field PositionInfo.isPlaying


--- Is recording
-- @field PositionInfo.isRecording


--- Position of the loop start (pulses-per-quarter-note).
-- (or zero if unavailable.)
-- @field PositionInfo.ppqLoopStart


--- Position of the loop end (pulses-per-quarter-note).
-- (or zero if unavailable.)
-- @field PositionInfo.ppqLoopEnd


--- Is looping
-- @field PositionInfo.isLooping



return plugin

+ 177
- 0
ports/protoplug/ProtoplugFiles/include/core/polygen.lua View File

@@ -0,0 +1,177 @@
--- Use this module to create a polyphonic generator with virtual tracks.
-- Example at @{sine-organ.lua}.
--
-- This module facilitates the creation of polyphonic instruments. It acts
-- as a layer that covers the @{plugin.processBlock} function, receives MIDI
-- notes and dispatches them to virtual tracks. The `polyGen.VTrack` prototype
-- is exposed for you to define audio processing in a simple,
-- monophonic, per-note fashion. Initialize this module by calling `polyGen.initTracks`.
--
-- The `polyGen` global is available to every protoplug script after including the
-- main protoplug header :
-- require "include/protoplug"
-- @module polyGen



--- Set up virtual tracks.
-- This function must be called by any script that wishes to use this module.
-- @param[opt=8] n the number of virtual tracks to use (aka. voices or polyphony)
-- @function polyGen.initTracks

--- Virtual track.
-- Virtual track. A monophonic voice that defines the instrument's sound.
-- <br><br>
-- @type polyGen.VTrack


--- Override to additively process an audio block.
-- Define the output of a virtual track in this method.
-- Use `self.noteIsOn`, `self.noteFreq`, or any fields you defined to
-- determine current the state of the calling track.
--
-- This method is called successively on every track,
-- which should *add* their output to `samples`.
-- @param samples a C `float**` pointing to two channels of samples to add to.
-- @param smax the maximum sample index (nSamples - 1)
-- @see sine-organ.lua
-- @function VTrack:addProcessBlock

--- Override to recieve note on.
-- Override this method to handle a note getting dispatched to a virtual track.
-- @param note the MIDI note number (0-127)
-- @param vel the MIDI velocity (0-127)
-- @function VTrack:noteOn

--- Override to recieve note off.
-- Override this method to handle a note off on a virtual track.
-- @param note a reminder of the MIDI note number
-- @function VTrack:noteOff

--- Override to allow initialisation.
-- Override this method to perform initialisation tasks on each track,
-- for example to create any per-track fields.
-- @function VTrack:init
local polyGen = {}

local script = require "include/core/script"
local VTrack = {noteIsOn = false, noteFreq=0.01, notePeriod=100, age = 0, note = -1}
VTrack.__index = VTrack
VTrack.tracks = { }

function VTrack.new(i)
local o = {}
setmetatable(o,VTrack)
o.i = i --same
return o
end

local function processMidiEvent(msg)
if msg:isNoteOn() then
-- note on, choose the best track for a new note
local oldestPlaying_age, oldestPlaying_i = -1, -1
local oldestReleased_age, oldestReleased_i = -1, -1
for i=1,VTrack.numTracks do
vt = VTrack.tracks[i]
vt.age = vt.age+1
if vt.note ~= -1 then
-- track note is on
if vt.age>oldestPlaying_age then
oldestPlaying_i = i
oldestPlaying_age = vt.age
end
else
-- track is free
if vt.age>oldestReleased_age then
oldestReleased_i = i
oldestReleased_age = vt.age
end
end
end
local chosentrack = {}
if oldestReleased_i ~= -1 then
chosentrack = VTrack.tracks[oldestReleased_i]
else
chosentrack = VTrack.tracks[oldestPlaying_i]
end
chosentrack.age = 0
chosentrack.note = msg:getNote()
chosentrack.noteFreq = midi.noteToFreq(chosentrack.note)
chosentrack.notePeriod = 1/chosentrack.noteFreq
if VTrack.noteOn~=nil then
chosentrack:noteOn(chosentrack.note, msg:getVel(), msg)
end
chosentrack.noteIsOn = true
elseif msg:isNoteOff() then
-- note off
for i=1,VTrack.numTracks do
vt = VTrack.tracks[i]
if vt.note == msg:getNote() then
vt.age = 0
vt.note = -1
if VTrack.noteOff~=nil then
vt:noteOff(msg:getNote(), msg)
end
vt.noteIsOn = false
end
end
end
end

function polyGen.initTracks(n)
VTrack.numTracks = n or 8
for i=1,VTrack.numTracks do
VTrack.tracks[i] = VTrack.new(i)
end

function plugin.processBlock (samples, smax, midiBuf)
for msg in midiBuf:eachEvent() do
processMidiEvent(msg)
end
for i=0,smax do
samples[0][i] = 0
samples[1][i] = 0
end
for i=1,VTrack.numTracks do
if VTrack.addProcessBlock~=nil then
VTrack.tracks[i]:addProcessBlock(samples, smax)
end
end
end

script.addHandler("init", function ()
if VTrack.init~=nil then
for i = 1,VTrack.numTracks do
VTrack.tracks[i]:init()
end
end
end)
end

polyGen.VTrack = VTrack

--- Track number.
-- Use `self.i` to check which virtual track is being called.
-- @field VTrack.i

--- Current MIDI note.
-- The MIDI note number that is currently being played by this track,
-- or `-1` if in note off state.
-- @field VTrack.note

--- Current note frequency.
-- The note frequency that is currently being played by this track.
-- @field VTrack.noteFreq

--- Current note period.
-- `1/noteFreq`
-- @field VTrack.notePeriod

--- Note is on.
-- Whether the track is playing a note (`boolean`).
-- @field VTrack.noteIsOn


return polyGen

+ 136
- 0
ports/protoplug/ProtoplugFiles/include/core/script.lua View File

@@ -0,0 +1,136 @@
--- Use `script` to handle script events, libraries and files.
-- The `script` global is available to every protoplug script after including the
-- main protoplug header :
-- require "include/protoplug"
-- @module script

local script = {}

--- Add a handler for a script event.
-- The following events are available :
--
-- - `"init"` - Emitted after the script has been compiled and run.
-- - `"preClose"` - Emitted before the script state gets destroyed.
-- @see plugin.addHandler
-- @see gui.addHandler
-- @tparam string event the event to handle
-- @tparam function handler a function to add the event's handlers

function script.addHandler(event, handler)
if not script[event] then script[event] = {} end
table.insert(script[event], handler)
end
--- Save script data.
-- Override this function to save any custom data.
--
-- This gets called :
-- - when the host saves the plugin's state (eg. when saving a project)
-- - right before the script is recompiled, to keep custom data across compilations.
-- @treturn string the data to be saved
-- @function script.saveData

--- Load script data.
-- Override this function to load any custom data.
-- Be warned that the data might originate from another script, so it's a good
-- idea to start the data with a header confirming the format.
--
-- This gets called :
-- - when the host loads the plugin's state (eg. when loading a project)
-- - right after the script is recompiled, to keep custom data across compilations.
-- @tparam string data the data to be loaded
-- @function script.loadData


--- Load shared libraries.
-- Protoplug scripts should use this wrapper function instead of LuaJIT's
-- [ffi.load](http://luajit.org/ext_ffi_api.html#ffi_load).
-- It has the same behaviour as `ffi.load`, but it adds `protoplug/lib` as a
-- search path, and can accept multiple arguments to test for different
-- library names. The names are tested from left to right until one load
-- successfully. If none of them work, an error is raised.
-- sdl = script.ffiLoad("sdl")
-- This looks for `libsdl.so` or `sdl.dll` in protoplug's lib folder and
-- in the system paths.
--
-- fftw = script.ffiLoad("libfftw3.so.3", "libfftw3-3.dll")
-- This looks for the supplied names in the same locations as above. This is
-- necessary for libs like FFTW, that have has platform-dependent names.
-- @tparam string libName
-- @tparam[opt] string ... alternate names for the same library
-- @return The library's ffi namespace
-- @function script.ffiLoad
local function file_exists(name)
local f=io.open(name,"r")
if f~=nil then io.close(f) return true else return false end
end
local function tryLoad(lib)
if string.find(lib, "/") or string.find(lib, "\\") then
return ffi.load(lib)
end
local libfile = lib
if ffi.os=="Windows" then
if not string.find(lib, "%.") then
libfile = libfile..".dll"
end
else -- assuming posix
if not string.find(lib,"%.") then
libfile = libfile..".so"
end
if string.sub(lib, 1, 3) ~= "lib" then
libfile = "lib"..libfile
end
end
libfile = protoplug_dir.."/lib/"..libfile
if file_exists(libfile) then
return ffi.load(libfile)
end
local success, ret = pcall(ffi.load, lib)
if success then return ret end
end
function script.ffiLoad(...)
local args={...}
local ret
for _,lib in ipairs(args) do
ret = tryLoad(lib)
if ret then break end
end
return ret and ret or error("could not find library "..
table.concat({...}, ", "))
end

--- Current protoplug directory.
-- The full path of the `protoplug` directory currently being used. It should
-- be alongside the protoplug fx and gen dynamic libraries.
-- @predefined protoplugDir
script.protoplugDir = protoplug_dir

-- Wrap the raw global override called by protoplug
function script_init()
if script.preClose then
function script_preClose()
for _,v in ipairs(script.preClose) do
v()
end
end
end
if script.init then
for _,v in ipairs(script.init) do
v()
end
end
script_saveData = script.saveData
script_loadData = script.loadData
end

-- add handler to repaint gui after recompiling
script.addHandler("init", function ()
local gui = require "include/core/gui"
local guiComp = gui.getComponent()
if guiComp ~= nil then
guiComp:repaint()
end
end)

return script

+ 69
- 0
ports/protoplug/ProtoplugFiles/include/core/stereofx.lua View File

@@ -0,0 +1,69 @@
--- Use this module to create a stereo effect.
-- Example at @{classic-filter.lua}.
--
-- This module acts as a layer that conceals the @{plugin.processBlock} function,
-- manages stereo channels, and exposes the `stereoFx.Channel` prototype for you
-- define per-channel audio processing. Initialize it by calling `stereoFx.init`.
--
-- The `stereoFx` global is available to every protoplug script after including the
-- main protoplug header :
-- require "include/protoplug"
-- @module stereoFx



--- Set up channels.
-- This function must be called by any script that wishes to use this module.
-- @function stereoFx.init

--- Channel.
-- This class represents a channel (ie. left or right).
-- <br><br>
-- @type stereoFx.Channel


--- Override to process a channel's audio block.
-- Define the audio processing of a single channel in this function.
-- @param samples a C float* serving as input and output
-- @param smax the maximum sample index (nSamples - 1)
-- @function Channel:processBlock

--- Override to handle initialisation.
-- Override this method to perform initialisation tasks on each channel,
-- for example to create any per-channel fields.
-- @function Channel:init

local stereoFx = {}

local script = require "include/core/script"

local Channel = { }
function Channel:new (o)
setmetatable(o, self)
self.__index = self
return o
end

local LChannel = Channel:new{ }
local RChannel = Channel:new{ }

function stereoFx.init()
function plugin.processBlock (samples, smax)
if Channel.processBlock==nil then return 0 end
LChannel:processBlock(samples[0], smax)
RChannel:processBlock(samples[1], smax)
end

script.addHandler("init", function ()
if Channel.init~=nil then
LChannel:init()
RChannel:init()
end
end)
end

stereoFx.Channel = Channel
stereoFx.LChannel = LChannel
stereoFx.RChannel = RChannel

return stereoFx

+ 250
- 0
ports/protoplug/ProtoplugFiles/include/iluaembed.lua View File

@@ -0,0 +1,250 @@
-- iluaembed.lua
-- based on Steve Donovan's executable ilua.lua (2007)
-- "A more friendly Lua interactive prompt
-- doesn't need '='
-- will try to print out tables recursively, subject to the pretty_print_limit value."
--
-- version by osar.fr to embed the interactive Lua console in C/C++ programs
-- creates a global function to be called by the host
--


local pretty_print_limit = 20
local max_depth = 7
local table_clever = true
local prompt = '> '
local verbose = false
local strict = true
-- suppress strict warnings
_ = true

-- imported global functions
local sub = string.sub
local match = string.match
local find = string.find
local push = table.insert
local pop = table.remove
local append = table.insert
local concat = table.concat
local floor = math.floor
local write = io.write
local read = io.read

local savef
local collisions = {}
local G_LIB = {}
local declared = {}
local line_handler_fn, global_handler_fn
local print_handlers = {}

ilua = {}
local num_prec
local num_all

local jstack = {}



local function oprint(...)
if savef then
savef:write(concat({...},' '),'\n')
end
print(...)
end

local function join(tbl,delim,limit,depth)
if not limit then limit = pretty_print_limit end
if not depth then depth = max_depth end
local n = #tbl
local res = ''
local k = 0
-- very important to avoid disgracing ourselves with circular referencs...
if #jstack > depth then
return "..."
end
for i,t in ipairs(jstack) do
if tbl == t then
return "<self>"
end
end
push(jstack,tbl)
-- this is a hack to work out if a table is 'list-like' or 'map-like'
-- you can switch it off with ilua.table_options {clever = false}
local is_list
if table_clever then
local index1 = n > 0 and tbl[1]
local index2 = n > 1 and tbl[2]
is_list = index1 and index2
end
if is_list then
for i,v in ipairs(tbl) do
res = res..delim..ilua.val2str(v)
k = k + 1
if k > limit then
res = res.." ... "
break
end
end
else
for key,v in pairs(tbl) do
if type(key) == 'number' then
key = '['..tostring(key)..']'
else
key = tostring(key)
end
res = res..delim..key..'='..ilua.val2str(v)
k = k + 1
if k > limit then
res = res.." ... "
break
end
end
end
pop(jstack)
return sub(res,2)
end


function ilua.val2str(val)
local tp = type(val)
if print_handlers[tp] then
local s = print_handlers[tp](val)
return s or '?'
end
if tp == 'function' then
return tostring(val)
elseif tp == 'table' then
if val.__tostring then
return tostring(val)
else
return '{'..join(val,',')..'}'
end
elseif tp == 'string' then
return "'"..val.."'"
elseif tp == 'number' then
-- we try only to apply floating-point precision for numbers deemed to be floating-point,
-- unless the 3rd arg to precision() is true.
if num_prec and (num_all or floor(val) ~= val) then
return num_prec:format(val)
else
return tostring(val)
end
else
return tostring(val)
end
end

function ilua.pretty_print(...)
local arg = {...}
for i,val in ipairs(arg) do
oprint(ilua.val2str(val))
end
_G['_'] = arg[1]
end

function ilua.compile(line)
if verbose then oprint(line) end
local f,err = loadstring(line,'local')
return err,f
end

function ilua.evaluate(chunk)
local ok,res = pcall(chunk)
if not ok then
return res
end
return nil -- meaning, fine!
end

function ilua.eval_lua(line)
if savef then
savef:write(prompt,line,'\n')
end
-- is the line handler interested?
if line_handler_fn then
line = line_handler_fn(line)
-- returning nil here means that the handler doesn't want
-- Lua to see the string
if not line then return end
end
-- is it an expression?
local err,chunk = ilua.compile('ilua.pretty_print('..line..')')
if err then
-- otherwise, a statement?
err,chunk = ilua.compile(line)
end
-- if compiled ok, then evaluate the chunk
if not err then
err = ilua.evaluate(chunk)
end
-- if there was any error, print it out
if err then
oprint(err)
end
end



-- functions available in scripts
function ilua.precision(len,prec,all)
if not len then num_prec = nil
else
num_prec = '%'..len..'.'..prec..'f'
end
num_all = all
end

function ilua.table_options(t)
if t.limit then pretty_print_limit = t.limit end
if t.depth then max_depth = t.depth end
if t.clever ~= nil then table_clever = t.clever end
end

-- inject @tbl into the global namespace
function ilua.import(tbl,dont_complain,lib)
lib = lib or '<unknown>'
if type(tbl) == 'table' then
for k,v in pairs(tbl) do
local key = rawget(_G,k)
-- NB to keep track of collisions!
if key and k ~= '_M' and k ~= '_NAME' and k ~= '_PACKAGE' and k ~= '_VERSION' then
append(collisions,{k,lib,G_LIB[k]})
end
_G[k] = v
G_LIB[k] = lib
end
end
if not dont_complain and #collisions > 0 then
for i, coll in ipairs(collisions) do
local name,lib,oldlib = coll[1],coll[2],coll[3]
write('warning: ',lib,'.',name,' overwrites ')
if oldlib then
write(oldlib,'.',name,'\n')
else
write('global ',name,'\n')
end
end
end
end

function ilua.print_handler(name,handler)
print_handlers[name] = handler
end

function ilua.line_handler(handler)
line_handler_fn = handler
end

function ilua.global_handler(handler)
global_handler_fn = handler
end

function ilua.print_variables()
for name,v in pairs(declared) do
print(name,type(_G[name]))
end
end

function ilua_runline(line)
ilua.eval_lua(line)
end

+ 29
- 0
ports/protoplug/ProtoplugFiles/include/luautil.lua View File

@@ -0,0 +1,29 @@
-- lua utils

local util = {}

-- include cdefs
function util.requireCdef(incpath)
local incfile = io.open(incpath)
if incfile==nil then
error ("can't open include file : "..incpath)
end
local incstring = incfile:read "*a"
incfile:close()
ffi.cdef (incstring)
end

-- merge in modules or tables in general
function util.merge (src, dst)
for k,v in pairs(src) do
dst[k] = v
end
end

-- round x to n decimal places
function util.roundDecimal(x, n)
local p = math.pow(10, n)
return math.floor(x*p+0.5)/p
end

return util

+ 111
- 0
ports/protoplug/ProtoplugFiles/include/pac/cookbook filters float.lua View File

@@ -0,0 +1,111 @@
-- Cookbook Filters Module FLOAT TEST
-- Based on Worp Filter.lua implementation by Ico Doornekamp. (https://github.com/zevv/worp)
-- Based on the Cookbook formulae by Robert Bristow-Johnson <rbj@audioimagination.com>
-- osar.fr

--[[
example usage :
local f = Filter {
type = "lp" -- filter type, see below
f = 440; -- frequency(Hz), (0-20000)
gain = 0; -- filter gain(dB), (-60 to 60)
Q = 1; -- resonance, (0.1-100)
}
for sample in eachSample()
sample = f.process(sample)
end

filter types :
hp: High pass
lp: Low pass
bp: Band pass
bs: Band stop (aka, Notch)
ls: Low shelf
hs: High shelf
ap: All pass
eq: Peaking EQ filter
--]]

local Float = ffi.typeof("float[1]")
--[[local function Float (n)
return ffi.cast("float", n)
end--]]

local function Filter(params)
local a0, a1, a2, b0, b1, b2
local x0, x1, x2 = Float(0), Float(0), Float(0)
local y0, y1, y2 = Float(0), Float(0), Float(0)
local params = params or {type = "lp", f = 440, gain = 0, Q = 1}
public = {
update = function (args)
for k,v in pairs(args) do
params[k] = v
end
--print (
-- "type "..params.type..
-- ", f "..params.f..
-- ", gain "..params.gain..
-- ", Q "..params.Q
--)
local w0 = 2 * math.pi * (params.f / plugin.getSampleRate())
local alpha = math.sin(w0) / (2*params.Q)
local cos_w0 = math.cos(w0)
local A = math.pow(10, params.gain/40)
if params.type == "hp" then
b0, b1, b2 = (1 + cos_w0)/2, -(1 + cos_w0), (1 + cos_w0)/2
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "lp" then
b0, b1, b2 = (1 - cos_w0)/2, 1 - cos_w0, (1 - cos_w0)/2
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "bp" then
b0, b1, b2 = params.Q*alpha, 0, -params.Q*alpha
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "bs" then
b0, b1, b2 = 1, -2*cos_w0, 1
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "ls" then
local ap1, am1, tsAa = A+1, A-1, 2 * math.sqrt(A) * alpha
local am1_cos_w0, ap1_cos_w0 = am1 * cos_w0, ap1 * cos_w0
b0, b1, b2 = A*( ap1 - am1_cos_w0 + tsAa ), 2*A*( am1 - ap1_cos_w0 ), A*( ap1 - am1_cos_w0 - tsAa )
a0, a1, a2 = ap1 + am1_cos_w0 + tsAa, -2*( am1 + ap1_cos_w0 ), ap1 + am1_cos_w0 - tsAa

elseif params.type == "hs" then
local ap1, am1, tsAa = A+1, A-1, 2 * math.sqrt(A) * alpha
local am1_cos_w0, ap1_cos_w0 = am1 * cos_w0, ap1 * cos_w0
b0, b1, b2 = A*( ap1 + am1_cos_w0 + tsAa ), -2*A*( am1 + ap1_cos_w0 ), A*( ap1 + am1_cos_w0 - tsAa )
a0, a1, a2 = ap1 - am1_cos_w0 + tsAa, 2*( am1 - ap1_cos_w0 ), ap1 - am1_cos_w0 - tsAa

elseif params.type == "eq" then
b0, b1, b2 = 1 + alpha*A, -2*cos_w0, 1 - alpha*A
a0, a1, a2 = 1 + alpha/A, -2*cos_w0, 1 - alpha/A

elseif params.type == "ap" then
b0, b1, b2 = 1 - alpha, -2*cos_w0, 1 + alpha
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

else
error("Unsupported filter type " .. params.type)
end
print(a0)
a0, a1, a2, b0, b1, b2 = Float(a0), Float(a1), Float(a2), Float(b0), Float(b1), Float(b2)
print(a0[0])
end;
process = function (x0)
y2[0], y1[0] = y1[0], y0[0]
y0[0] = (b0[0] / a0[0]) * x0[0] + (b1[0] / a0[0]) * x1[0] + (b2[0] / a0[0]) * x2[0] - (a1[0] / a0[0]) * y1[0] - (a2[0] / a0[0]) * y2[0]
x2[0], x1[0] = x1[0], x0[0]
return y0[0]
end;
}
public.update(params)
return public
end

return Filter

+ 108
- 0
ports/protoplug/ProtoplugFiles/include/pac/cookbook filters.lua View File

@@ -0,0 +1,108 @@
-- Cookbook Filters Module
-- Based on Worp Filter.lua implementation by Ico Doornekamp. (https://github.com/zevv/worp)
-- Based on the Cookbook formulae by Robert Bristow-Johnson <rbj@audioimagination.com>
-- osar.fr

--[[
example usage :
local f = Filter {
type = "lp" -- filter type, see below
f = 440; -- frequency(Hz), (0-20000)
gain = 0; -- filter gain(dB), (-60 to 60)
Q = 1; -- resonance, (0.1-100)
}
for sample in eachSample()
sample = f.process(sample)
end

filter types :
hp: High pass
lp: Low pass
bp: Band pass
bs: Band stop (aka, Notch)
ls: Low shelf
hs: High shelf
ap: All pass
eq: Peaking EQ filter
--]]

local function Filter(params)
local a0, a1, a2, b0, b1, b2
local x0, x1, x2 = 0, 0, 0
local y0, y1, y2 = 0, 0, 0
local params = params or {type = "lp", f = 440, gain = 0, Q = 1}
public = {
update = function (args)
args = args or {}
for k,v in pairs(args) do
params[k] = v
end
if params.f < 10 then params.f = 10 end
if not plugin.isSampleRateKnown() then return end
--print (
-- "type "..params.type..
-- ", f "..params.f..
-- ", gain "..params.gain..
-- ", Q "..params.Q
--)
local w0 = 2 * math.pi * (params.f / plugin.getSampleRate())
local alpha = math.sin(w0) / (2*params.Q)
local cos_w0 = math.cos(w0)
local A = math.pow(10, params.gain/40)
if params.type == "hp" then
b0, b1, b2 = (1 + cos_w0)/2, -(1 + cos_w0), (1 + cos_w0)/2
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "lp" then
b0, b1, b2 = (1 - cos_w0)/2, 1 - cos_w0, (1 - cos_w0)/2
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "bp" then
b0, b1, b2 = params.Q*alpha, 0, -params.Q*alpha
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "bs" then
b0, b1, b2 = 1, -2*cos_w0, 1
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

elseif params.type == "ls" then
local ap1, am1, tsAa = A+1, A-1, 2 * math.sqrt(A) * alpha
local am1_cos_w0, ap1_cos_w0 = am1 * cos_w0, ap1 * cos_w0
b0, b1, b2 = A*( ap1 - am1_cos_w0 + tsAa ), 2*A*( am1 - ap1_cos_w0 ), A*( ap1 - am1_cos_w0 - tsAa )
a0, a1, a2 = ap1 + am1_cos_w0 + tsAa, -2*( am1 + ap1_cos_w0 ), ap1 + am1_cos_w0 - tsAa

elseif params.type == "hs" then
local ap1, am1, tsAa = A+1, A-1, 2 * math.sqrt(A) * alpha
local am1_cos_w0, ap1_cos_w0 = am1 * cos_w0, ap1 * cos_w0
b0, b1, b2 = A*( ap1 + am1_cos_w0 + tsAa ), -2*A*( am1 + ap1_cos_w0 ), A*( ap1 + am1_cos_w0 - tsAa )
a0, a1, a2 = ap1 - am1_cos_w0 + tsAa, 2*( am1 - ap1_cos_w0 ), ap1 - am1_cos_w0 - tsAa

elseif params.type == "eq" then
b0, b1, b2 = 1 + alpha*A, -2*cos_w0, 1 - alpha*A
a0, a1, a2 = 1 + alpha/A, -2*cos_w0, 1 - alpha/A

elseif params.type == "ap" then
b0, b1, b2 = 1 - alpha, -2*cos_w0, 1 + alpha
a0, a1, a2 = 1 + alpha, -2*cos_w0, 1 - alpha

else
error("Unsupported filter type " .. params.type)
end
end;
process = function (x0)
y2, y1 = y1, y0
y0 = (b0 / a0) * x0 + (b1 / a0) * x1 + (b2 / a0) * x2 - (a1 / a0) * y1 - (a2 / a0) * y2
x2, x1 = x1, x0
return y0
end;
}
-- initialize when the samplerate in known
plugin.addHandler("prepareToPlay", public.update)
return public
end

return Filter

+ 38
- 0
ports/protoplug/ProtoplugFiles/include/pac/delay line.lua View File

@@ -0,0 +1,38 @@
-- delay line 1
-- with dc filter and shitty linear interpolation

-- todo test full float version
-- and possibly pointer arithmetic version

local function blend(a,b,p) return (a*p + b*(1-p)) end

function Line (bufSize)
local buf = ffi.new("double[?]", bufSize)
local pos = 0 -- todo int
local dc1, dc2 = 0, 0
return {
goBack = function (dt)
-- todo assert dt<bufSize
local fpos = pos - dt
local ipos1 = math.floor(fpos)
local ipos2 = ipos1 + 1
local frac = fpos - ipos1
if ipos1 < 0 then ipos1 = ipos1 + bufSize end
if ipos2 < 0 then ipos2 = ipos2 + bufSize end
if (ipos1)>=bufSize or (ipos1)<0 then error("accessed buf "..(ipos1)) end -- DEBUG
if (ipos2)>=bufSize or (ipos2)<0 then error("accessed buf "..(ipos2)) end -- DEBUG
return blend(buf[ipos2], buf[ipos1], frac)
end;
push = function (s)
pos = pos + 1
if pos >= bufSize then pos = 0 end
dc1 = dc1 + (s - dc2) * 0.000002
dc2 = dc2 + dc1
dc1 = dc1 * 0.96
if (pos)>=bufSize or (pos)<0 then error("accessed buf "..(pos)) end -- DEBUG
buf[pos] = s - dc2
end;
}
end

return Line

+ 259
- 0
ports/protoplug/ProtoplugFiles/include/pac/freqgraph.lua View File

@@ -0,0 +1,259 @@
-- pac freqgraph.lua
--[[
an interactive histogram-ish frequency graph
used in "spectral filter" and "pitch distort"
usage :
local Freqgraph = require "include/pac/freqgraph"
local fg = Freqgraph {
-- required paramters :
-- an array (Lua or C) containing the values to be read and modified by the interactive graph
data = ;
-- number of elements in the array
dataSize = ;
-- optional paramters :
-- the position and size of the graph
bounds = juce.Rectangle_int{15,0,480,330};
title = "";
yAxis = {
name = "amplitude (%)";
values = {
[0] = "0";
[0.5] = "50";
[1] = "100";
}
}
-- colours : pageBack, pageFore, graphBack, graphFore
}
-- public methods :
-- paint the graph onto a pGraphics ctype
fg:paint(g)
-- change the graph's position
fg:setPos(x, y)

--]]

local J = require "include/protojuce"

-- class
local M = {
-- default values
bounds = J.Rectangle_int{15,0,480,330};
pageBack = J.Colour.black;
pageFore = J.Colour.green;
graphBack = J.Colour{r=0, g=0, b=160};
graphFore = J.Colour.green;
yAxis = {
name = "amplitude (%)";
values = {
[0] = "0";
[0.25] = "50";
[0.5] = "100";
[0.75] = "150";
[1] = "200";
}
}
}
M.__index = M

setmetatable(M, {
-- constructor
__call = function (_, arg)
local self = setmetatable(arg, M)
self.frame = J.Rectangle_int(4, 30, self.bounds.w-50, self.bounds.h-65)
self.outFrame = J.Rectangle_int(2, 28, self.frame.w+4, self.frame.h+4)
self.yAmp = 1/self.frame.h
-- display-coord quarters in data coordinates
self.q1 = self:x2bar(self.frame.w/4)
self.q2 = self:x2bar(self.frame.w/2)
self.bgFill = J.FillType(self.pageBack)
self.bgFill2 = J.FillType(self.graphBack)
self.fgFill = J.FillType(self.graphFore)
self:InitBackBuffer()
self.dirtyLeft, self.dirtyRight = 0, self.dataSize-1
gui.addHandler("mouseDrag", function (event)
self:mouseDrag(event)
end)
gui.addHandler("mouseUp", function (event)
self:mouseUp(event)
end)
plugin.addHandler("prepareToPlay", function ()
self:InitBackBuffer()
end)
return self
end;
})

-- Coordinate system conversion between displayed bars <-> data
-- cheap log-like scale made of 3 linear functions
function M:x2bar(x)
if x<self.frame.w/4 then
return math.floor(x*(self.dataSize/(4*self.frame.w)))
elseif x<self.frame.w/2 then
return math.floor(x*((3*self.dataSize)/(4*self.frame.w))-(self.dataSize/8))
else
return math.floor(x*((3*self.dataSize)/(2*self.frame.w))-(self.dataSize/2))
end
end

function M:bar2x(s)
if s<self.q1 then
return math.floor((4*self.frame.w*s)/self.dataSize)
elseif s<self.q2 then
return math.floor((self.frame.w*(self.dataSize+8*s))/(6*self.dataSize))
else
return math.floor((self.frame.w*(self.dataSize+2*s))/(3*self.dataSize))
end
end

function M:y2amp(y) return 1 - y*self.yAmp end
function M:amp2y(a) return math.floor(self.frame.h - a*self.frame.h) end

-- on mouse drag, interpolate the movement, update the data, and mark the dirty graph area
function M:mouseDrag(event)
if not self.bounds:contains(event.mouseDownPos) then
return
end
if self.bar ~= nil then
self.oldbar = self.bar
self.oldamp = self.amp
end
self.bar = self:x2bar(event.x-self.frame.x-self.bounds.x)
self.amp = self:y2amp(event.y-self.frame.y-self.bounds.y)
-- limit to bounds
if self.bar<0 then self.bar=0 end
if self.bar>self.dataSize-1 then self.bar=self.dataSize-1 end
if self.amp<0 then self.amp=0 end
if self.amp>1 then self.amp=1 end
-- interpolate and set
local x1, x2, y1, y2 = self.oldbar,self.bar,self.oldamp,self.amp
if x1 == nil or x1==x2 then
x1,y1 = x2,y2
self.data[x2] = y2
else
if x1>x2 then
x1, x2, y1, y2 = x2, x1, y2, y1
end
for i=x1,x2 do
local x = (x2-i)/(x2-x1)
self.data[i] = y1*x + y2*(1-x)
end
end
-- create or enlarge the currently dirty area (ie. needing a repaint)
if self.dirtyLeft then
if x1<self.dirtyLeft then self.dirtyLeft = x1 end
if x2>self.dirtyRight then self.dirtyRight = x2 end
else
self.dirtyLeft, self.dirtyRight = x1, x2
end
event.originalComponent:repaint()
end

function M:mouseUp(event)
self.bar = nil
self.oldbar = nil
end

-- create the backbuffer and draw all permanent parts of the graph
function M:InitBackBuffer()
self.backBuffer = J.Image(
J.Image.PixelFormat.RGB,
self.bounds.w,
self.bounds.h, true)
local g = J.Graphics(self.backBuffer)
g:fillAll(self.pageBack)
g:setColour(self.graphFore)
g:drawRect(self.outFrame, 1)
g:setColour(self.pageFore)
if self.title then
g:setFont(17)
g:drawText("== "..self.title.." ==", self.frame.x, 5, self.frame.w, 20, J.Justification.centred)
end
-- draw the Y axis labels
g:saveState()
g:addTransform(J.AffineTransform(0, -1, self.bounds.w, 1, 0, self.frame.y))
g:setFont(16)
g:drawText(self.yAxis.name, 0, 0, self.frame.h, 20, J.Justification.centred)
g:restoreState()
g:setFont(14)
for pos, label in pairs(self.yAxis.values) do
local y = self.frame.y+((self.frame.h-10)*(1-pos))-6
g:drawText(tostring(label), self.frame:getR()+3, y, 33, 20)
end
-- draw the X axis labels
g:setFont(16)
g:drawText("frequency (kHz)", self.frame.x, self.bounds.h-20, self.frame.w, 20, J.Justification.centred)
g:setFillType(self.fgFill)
local sr = 44100
if plugin.isSampleRateKnown() then
sr = plugin.getSampleRate()
else
-- if the samplerate is unknown, call this again when it becomes known
plugin.addHandler('prepareToPlay', function() self:InitBackBuffer() end)
end
local f,fmax = 0, sr/2
local function f2x(f)
return self:bar2x(f/fmax*self.dataSize)+self.frame.x
end
g:setFont(14)
while f<fmax do
if f%10000==0 then
g:fillRect(f2x(f), self.frame:getB(), 3, 8)
elseif f%1000==0 then
g:fillRect(f2x(f), self.frame:getB(), 2, 4)
end
f = f + 100
end
g:drawText("0", f2x(0)-2, self.frame:getB()+3, 20, 20)
g:drawText("2", f2x(2000)-2, self.frame:getB()+3, 20, 20)
g:drawText("10", f2x(10000)-2, self.frame:getB()+3, 20, 20)
g:drawText("20", f2x(20000)-2, self.frame:getB()+3, 20, 20)
g = nil
-- draw the entire graph's contents
self:DrawBars(0, self.dataSize-1)
end

-- update the graph between left and right
function M:DrawBars(leftBar, rightBar)
local g = J.Graphics(self.backBuffer)
g:setFillType(self.bgFill2)
local leftX, rightX = self:bar2x(leftBar), self:bar2x(rightBar+1)
g:fillRect(leftX+self.frame.x, self.frame.y, rightX-leftX, self.frame.h)
g:setFillType(self.fgFill)
local lastX = -1
for i = leftBar, rightBar do
local x = self:bar2x(i)
if x~=lastX then
local width = math.max(1,self:bar2x(i+1)-x)
local y = self:amp2y(self.data[i])
local height = self.frame.h-y
g:fillRect(J.Rectangle_int(x+self.frame.x, y+self.frame.y, width, height))
end
lastX = x
end
end

-- on paint, update the backbuffer where necessary, and blit it
function M:paint(g)
if self.dirtyLeft then
local l, r = self.dirtyLeft, self.dirtyRight
self.dirtyLeft, self.dirtyRight = nil, nil
self:DrawBars(l, r)
end
g:drawImageAt(self.backBuffer, self.bounds.x, self.bounds.y)
end

function M:setPos(x,y)
self.bounds.x, self.bounds.y = x, y
local guiComp = gui.getComponent()
if guiComp ~= nil then
guiComp:repaint()
end
end

return M

+ 65
- 0
ports/protoplug/ProtoplugFiles/include/pac/harmograph.lua View File

@@ -0,0 +1,65 @@
-- harmograph
local J = require "include/protojuce"

function Harmograph(args)
local bounds = args.bounds or J.Rectangle_int{15,0,480,330};
local pageBack = args.pageBack or J.Colour.white;
local pageFore = args.pageFore or J.Colour.black;
local graphBack = args.graphBack or J.Colour.white;
local graphFore = args.graphFore or J.Colour.black;
local yMax = args.yMax or 500
local pos = args.pos or 0
local frame = J.Rectangle_int(4, 30, bounds.w-50, bounds.h-65)
local outFrame = J.Rectangle_int(2, 28, frame.w+4, frame.h+4)
local backBuffer = J.Image(J.Image.PixelFormat.RGB, bounds.w, bounds.h, true)
-- initialize backbuffer
do
local g = J.Graphics(backBuffer)
g:fillAll(pageBack)
g:setColour(graphFore)
g:drawRect(outFrame, 1)
g:setColour(pageFore)
-- draw the Y axis labels
g:setFont(14)
for pos, label in pairs{0=0; 0.5=50; 1=100} do
local y = self.frame.y+((self.frame.h-10)*(1-pos))-6
g:drawText(tostring(label), self.frame:getR()+3, y, 33, 20)
end
end
local renderGraph = function()
end
renderGraph()
local yfactor = 0.5*frame.h/yMax
return {
draw = function (g)
g:setColour(J.Colour.black)
for x=0,frame.w do
if x==math.floor(pos*frame.w) then
g:setColour(J.Colour.blue)
g:drawLine(x+10, 10, x+10, 410)
end
local ls = makeLengths(x/graphW)
g:setColour(J.Colour(64,64,64))
for k,v in ipairs(ls) do
g:setPixel(x+10, graphH-(v*3)*yfactor)
end
g:setColour(J.Colour(128,128,128))
for k,v in ipairs(ls) do
g:setPixel(x+10, graphH-(v*2)*yfactor)
end
g:setColour(J.Colour.black)
for k,v in ipairs(ls) do
g:setPixel(x+10, graphH-v*yfactor)
end
end
end,
}
end

return Harmograph

+ 31
- 0
ports/protoplug/ProtoplugFiles/include/protojuce.lua View File

@@ -0,0 +1,31 @@
-- protojuce.lua
-- a GUI module for protoplug that wraps some JUCE features

local util = require"include/luautil"
local script = require "include/core/script"

-- module
local J = {}

-- todo relative, wat ?
util.requireCdef(script.protoplugDir.."/include/protojuce/cdef/typedefs.h")

J.AudioFormatReader = require"include/protojuce/audioformatreader"
J.LagrangeInterpolator= require"include/protojuce/lagrangeinterpolator"
J.Colour = require"include/protojuce/colour"
J.Path = require"include/protojuce/path"
J.Graphics = require"include/protojuce/graphics"
J.ColourGradient = require"include/protojuce/colourgradient"
J.FillType = require"include/protojuce/filltype"
J.Font = require"include/protojuce/font"
J.Component = require"include/protojuce/component"
J.AffineTransform = require"include/protojuce/affinetransform"
J.Rectangle_int = require"include/protojuce/rectangle_int"
J.Rectangle_float = require"include/protojuce/rectangle_float"
J.RectanglePlacement= require"include/protojuce/rectangleplacement"
J.Image = require"include/protojuce/image"
J.Justification = require"include/protojuce/justification"
J.Point = require"include/protojuce/point"
J.Line = require"include/protojuce/line"

return J

+ 120
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/affinetransform.lua View File

@@ -0,0 +1,120 @@
--- A geometric transformation.
-- Is converted to a [JUCE AffineTransform](http://www.juce.com/api/classAffineTransform.html).
--
-- The default constructor makes an `identity` transform, so all kinds of
-- transformations can be created as follows :
-- rot180 = juce.AffineTransform():rotated(math.pi)
-- chainey = juce.AffineTransform():scaled(2.5):translated(140,140)
-- @classmod juce.AffineTransform

--- Constuctor.
-- parameters thusly define a transformation matrix :
--
-- (mat00 mat01 mat02)
-- (mat10 mat11 mat12)
-- (0 0 1)
-- @param mat00
-- @param mat01
-- @param mat02
-- @param mat10
-- @param mat11
-- @param mat12
-- @within Constructors
-- @constructor
-- @function AffineTransform

local AffineTransform = setmetatable({}, {
__call = function(self, ...)
if select("#", ...)==0 then
return ffi.new("AffineTransform", 1,0,0, 0,1,0)
end
return ffi.new("AffineTransform", ...)
end;
})

local AffineTransform_mt = {
-- methods
__index = {

--- Translated.
-- @param dx the horizontal offset
-- @param dy the vertical offset
-- @return a translated version of this transform
-- @function translated
translated = function (self, dx, dy)
return AffineTransform(
self.mat00, self.mat01, self.mat02 + dx,
self.mat10, self.mat11, self.mat12 + dy)
end;

--- Rotated.
-- @param rad the degree of rotation in radians
-- @return a rotated version of this transform
-- @function rotated
rotated = function (self, rad)
local cosRad = math.cos (rad)
local sinRad = math.sin (rad)
return AffineTransform(
cosRad * self.mat00 + -sinRad * self.mat10,
cosRad * self.mat01 + -sinRad * self.mat11,
cosRad * self.mat02 + -sinRad * self.mat12,
sinRad * self.mat00 + cosRad * self.mat10,
sinRad * self.mat01 + cosRad * self.mat11,
sinRad * self.mat02 + cosRad * self.mat12)
end;

--- Scaled.
-- @param scaleX
-- @param[opt=scaleX] scaleY
-- @return a scaled version of this transform
-- @function scaled
scaled = function (self, scaleX, scaleY)
scaleY = scaleY or scaleX
return AffineTransform(
scaleX * self.mat00, scaleX * self.mat01, scaleX * self.mat02,
scaleY * self.mat10, scaleY * self.mat11, scaleY * self.mat12)
end;

--- Followed by.
-- @param other
-- @return a version of this transform followed by another
-- @function followedBy
followedBy = function (self, other)
return AffineTransform(
other.mat00 * self.mat00 + other.mat01 * self.mat10,
other.mat00 * self.mat01 + other.mat01 * self.mat11,
other.mat00 * self.mat02 + other.mat01 * self.mat12 + other.mat02,
other.mat10 * self.mat00 + other.mat11 * self.mat10,
other.mat10 * self.mat01 + other.mat11 * self.mat11,
other.mat10 * self.mat02 + other.mat11 * self.mat12 + other.mat12)
end;
};
}

ffi.metatype("AffineTransform", AffineTransform_mt)

--- Matrix [0] [0]
-- @simplefield mat00

--- Matrix [0] [1]
-- @simplefield mat01

--- Matrix [0] [2]
-- @simplefield mat02

--- Matrix [1] [0]
-- @simplefield mat10

--- Matrix [1] [1]
-- @simplefield mat11

--- Matrix [1] [2]
-- @simplefield mat12

--- Identity.
-- The non-transform.
-- @predefined juce.AffineTransform.identity

AffineTransform.identity = AffineTransform(1,0,0, 0,1,0)

return AffineTransform

+ 147
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/audioformatreader.lua View File

@@ -0,0 +1,147 @@
--- Class to read audio files.
-- Example usage: @{soundfile-test.lua}.
--
-- Reads the formats that JUCE supports, namely: WAV, AIFF, Flac, Ogg-Vorbis, Windows Media codecs,
-- CoreAudio codecs, MP3.
--
-- Is a pointer to a [JUCE AudioFormatReader](http://www.juce.com/api/classAudioFormatReader.html),
-- and wraps some [AudioFormatManager](http://www.juce.com/api/classAudioFormatManager.html)
-- functionality.
-- @classmod juce.AudioFormatReader

local plugin = require"include/core/plugin"
local LagrangeInterpolator= require"include/protojuce/lagrangeinterpolator"

ffi.cdef [[
pAudioFormatReader AudioFormatReader_new(const char *filename);
bool AudioFormatReader_read (pAudioFormatReader a,
int *const * destSamples,
int numDestChannels,
int64_t startSampleInSource,
int numSamplesToRead,
bool fillLeftoverChannelsWithCopies);
void AudioFormatReader_delete(pAudioFormatReader a);
]]

local AudioFormatReader = setmetatable ({}, {

--- Load a sound file as an AudioFormatReader.
-- The path can be absolute or relative to the protoplug directory.
-- Returns `nil` if unsuccessful. The file will remain open until the
-- AudioFormatReader is unset or otherwise garbage-collected.
-- @param filename
-- @within Constructors
-- @constructor
-- @function AudioFormatReader

__call = function(self, filename)
local afr = protolib.AudioFormatReader_new(filename)
if afr.pointer == nil then return end
return ffi.gc(afr, protolib.AudioFormatReader_delete)
end;
})

local AudioFormatReader_mt = {
-- methods
__index = {

--- Read samples.
-- Copies a number of samples from the file into the provided array.
-- @param destSamples a cdata array of pointers to buffers for each channel (`int * const *`)
-- @param numDestChannels the number of elements in `destSamples`
-- @param startSampleInSource
-- @param numSamplesToRead
-- @tparam[opt=true] boolean fillLeftoverChannelsWithCopies used if `destSamples` has more channels than the source.
-- @treturn boolean success
-- @function read
read = function (self, destSamples, numDestChannels, startSampleInSource, numSamplesToRead, fillLeftoverChannelsWithCopies)
if fillLeftoverChannelsWithCopies==nil then
fillLeftoverChannelsWithCopies = true
end
return protolib.AudioFormatReader_read(self, destSamples, numDestChannels, startSampleInSource, numSamplesToRead, fillLeftoverChannelsWithCopies)
end;

--- Read entire wave to float array.
-- A simplified wrapper function for `read`
-- @param[opt=2] nChannels number of channels to be returned
-- @param[opt=true] resample whether to perform samplerate conversion to match the host's sample rate.
-- If `true`, the length of the returned array may not be the wave's original `lengthInSamples`.
-- It will be given by the second returned value.
-- @return a two-dimensional cdata array of channels containing samples (`float [nChannels][nSamples]`)
-- @return the number of samples in each channel of the returned array
-- @function readToFloat
readToFloat = function (self, nChannels, resample)
nChannels = nChannels or 2
resample = resample or true
local floty = ffi.new("float["..nChannels.."]["..tonumber(self.lengthInSamples).."]")
local inty_arg = ffi.new("int*["..nChannels.."]")
for ch=0,nChannels-1 do
inty_arg[ch] = ffi.cast("int*", floty)+self.lengthInSamples*ch
end
local gotWave = self:read(inty_arg, nChannels, 0, tonumber(self.lengthInSamples))
if not gotWave then error "can't read wave" end
if not self.usesFloatingPointData then
for i=0,tonumber(self.lengthInSamples)-1 do
for ch=0,nChannels-1 do
floty[ch][i] = inty_arg[ch][i]/0x80000000
end
end
end
if resample then
local plugSampleRate = plugin.getSampleRate()
if self.sampleRate ~= plugSampleRate then
local len2 = math.floor((plugSampleRate*tonumber(self.lengthInSamples))/self.sampleRate)
local flot2 = ffi.new("float["..nChannels.."]["..len2.."]")
local li = LagrangeInterpolator()
for ch=0,nChannels-1 do
li:process(self.sampleRate/plugSampleRate, floty[ch], flot2[ch], len2)
end
return flot2, len2
end
end
return floty, self.lengthInSamples
end;

--- Read entire wave to double array.
-- This wraps `readToFloat` and returns an array containing `double`-precision numbers.
-- This takes twice as much space, but it may be faster to use, as this is the native Lua type.
-- @param[opt=2] nChannels number of channels to be returned
-- @param[opt=true] resample whether to perform samplerate conversion to match the host's sample rate.
-- If `true`, the length of the returned array may not be the wave's original `lengthInSamples`.
-- It will be given by the second returned value.
-- @return a two-dimensional cdata array of channels containing samples (`double [nChannels][nSamples]`)
-- @return the number of samples in each channel of the returned array
-- @function readToDouble
readToDouble = function (self, nChannels, resample)
nChannels = nChannels or 2
resample = resample or true
local floty, len = self:readToFloat(nChannels)
local douby = ffi.new("double["..nChannels.."]["..tonumber(len).."]")
for i=0,tonumber(len)-1 do
for ch=0,nChannels-1 do
douby[ch][i] = floty[ch][i]
end
end
return douby, len
end;
}
}
ffi.metatype("pAudioFormatReader", AudioFormatReader_mt);

--- Sample rate
-- @simplefield sampleRate

--- Bits per sample
-- @simplefield bitsPerSample

--- Length in samples
-- @simplefield lengthInSamples

--- Number of channels
-- @simplefield numChannels

--- Uses floating point data (boolean)
-- @simplefield usesFloatingPointData

return AudioFormatReader

+ 247
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/cdef/graphics.h View File

@@ -0,0 +1,247 @@
// protojuce/cdefs/graphics.h
// c definitions as exported by protoplug
// included by protojuce.lua


pGraphics Graphics_new(pImage imageToDrawOnto);

void Graphics_delete(pGraphics g);

void Graphics_setColour(pGraphics self, Colour newColour);


void Graphics_setOpacity(pGraphics self, float newOpacity);


void Graphics_setGradientFill(pGraphics self, const pColourGradient gradient);


void Graphics_setTiledImageFill(pGraphics self, const pImage imageToUse,
int anchorX, int anchorY,
float opacity);


void Graphics_setFillType(pGraphics self, const pFillType newFill);


void Graphics_setFont(pGraphics self, const pFont newFont);


void Graphics_setFont2(pGraphics self, float newFontHeight);


pFont Graphics_getCurrentFont(pGraphics self);


void Graphics_drawSingleLineText(pGraphics self, const char * text,
int startX, int baselineY,
int justification);


void Graphics_drawMultiLineText(pGraphics self, const char * text,
int startX, int baselineY,
int maximumLineWidth);


void Graphics_drawText(pGraphics self, const char * text,
int x, int y, int width, int height,
int justificationType,
bool useEllipsesIfTooBig);


void Graphics_drawText2(pGraphics self, const char * text,
Rectangle_int area,
int justificationType,
bool useEllipsesIfTooBig);


void Graphics_drawFittedText(pGraphics self, const char * text,
int x, int y, int width, int height,
int justificationFlags,
int maximumNumberOfLines,
float minimumHorizontalScale /* = 0.7f */);


void Graphics_drawFittedText2(pGraphics self, const char * text,
Rectangle_int area,
int justificationFlags,
int maximumNumberOfLines,
float minimumHorizontalScale/* = 0.7f */);


void Graphics_fillAll(pGraphics self);


void Graphics_fillAll2(pGraphics self, Colour colourToUse);


void Graphics_fillRect(pGraphics self, Rectangle_int rectangle);


void Graphics_fillRect2(pGraphics self, Rectangle_float rectangle);


void Graphics_fillRect3(pGraphics self, int x, int y, int width, int height);


void Graphics_fillRect4(pGraphics self, float x, float y, float width, float height);


void Graphics_fillRoundedRectangle(pGraphics self, float x, float y, float width, float height,
float cornerSize);


void Graphics_fillRoundedRectangle2(pGraphics self, Rectangle_float rectangle,
float cornerSize);


void Graphics_fillCheckerBoard(pGraphics self, Rectangle_int area,
int checkWidth, int checkHeight,
Colour colour1, Colour colour2);


void Graphics_drawRect(pGraphics self, int x, int y, int width, int height, int lineThickness /* = 1 */);


void Graphics_drawRect2(pGraphics self, float x, float y, float width, float height, float lineThickness/* = 1.0f */);


void Graphics_drawRect3(pGraphics self, Rectangle_int rectangle, int lineThickness /* = 1 */);


void Graphics_drawRect4(pGraphics self, Rectangle_float rectangle, float lineThickness /* = 1.0f */);


void Graphics_drawRoundedRectangle(pGraphics self, float x, float y, float width, float height,
float cornerSize, float lineThickness);


void Graphics_drawRoundedRectangle2(pGraphics self, Rectangle_float rectangle,
float cornerSize, float lineThickness);


void Graphics_setPixel(pGraphics self, int x, int y);


void Graphics_fillEllipse(pGraphics self, float x, float y, float width, float height);


void Graphics_fillEllipse2(pGraphics self, Rectangle_float area);


void Graphics_drawEllipse(pGraphics self, float x, float y, float width, float height,
float lineThickness);


void Graphics_drawLine(pGraphics self, float startX, float startY, float endX, float endY);


void Graphics_drawLine2(pGraphics self, float startX, float startY, float endX, float endY, float lineThickness);


void Graphics_drawLine3(pGraphics self, Line_float line);


void Graphics_drawLine4(pGraphics self, Line_float line, float lineThickness);


void Graphics_drawDashedLine(pGraphics self, Line_float line,
const float* dashLengths, int numDashLengths,
float lineThickness /* = 1.0f */,
int dashIndexToStartFrom /* = 0 */);


void Graphics_drawVerticalLine(pGraphics self, int x, float top, float bottom);


void Graphics_drawHorizontalLine(pGraphics self, int y, float left, float right);


void Graphics_fillPath(pGraphics self, pPath path,
AffineTransform transform);


void Graphics_strokePath(pGraphics self, pPath path,
PathStrokeType strokeType,
AffineTransform transform);


void Graphics_drawArrow(pGraphics self, Line_float line,
float lineThickness,
float arrowheadWidth,
float arrowheadLength);


void Graphics_setImageResamplingQuality(pGraphics self, const int newQuality);


void Graphics_drawImageAt(pGraphics self, pImage imageToDraw, int topLeftX, int topLeftY,
bool fillAlphaChannelWithCurrentBrush /* = false */);


void Graphics_drawImage(pGraphics self, pImage imageToDraw,
int destX, int destY, int destWidth, int destHeight,
int sourceX, int sourceY, int sourceWidth, int sourceHeight,
bool fillAlphaChannelWithCurrentBrush /* = false */);


void Graphics_drawImageTransformed(pGraphics self, pImage imageToDraw,
AffineTransform transform,
bool fillAlphaChannelWithCurrentBrush /* = false */);


void Graphics_drawImageWithin(pGraphics self, pImage imageToDraw,
int destX, int destY, int destWidth, int destHeight,
int placementWithinTarget,
bool fillAlphaChannelWithCurrentBrush /* = false */);


Rectangle_int Graphics_getClipBounds(pGraphics self);


bool Graphics_clipRegionIntersects(pGraphics self, Rectangle_int area);


bool Graphics_reduceClipRegion(pGraphics self, int x, int y, int width, int height);


bool Graphics_reduceClipRegion2(pGraphics self, Rectangle_int area);


bool Graphics_reduceClipRegion4(pGraphics self, pPath path, AffineTransform transform);


bool Graphics_reduceClipRegion5(pGraphics self, pImage image, AffineTransform transform);


void Graphics_excludeClipRegion(pGraphics self, Rectangle_int rectangleToExclude);


bool Graphics_isClipEmpty(pGraphics self);


void Graphics_saveState(pGraphics self);


void Graphics_restoreState(pGraphics self);


void Graphics_beginTransparencyLayer(pGraphics self, float layerOpacity);


void Graphics_endTransparencyLayer(pGraphics self);


void Graphics_setOrigin(pGraphics self, Point_int newOrigin);


void Graphics_setOrigin2(pGraphics self, int newOriginX, int newOriginY);


void Graphics_addTransform(pGraphics self, AffineTransform transform);


void Graphics_resetToDefaultState(pGraphics self);


bool Graphics_isVectorDevice(pGraphics self);

+ 163
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/cdef/path.h View File

@@ -0,0 +1,163 @@

pPath Path_new();

void Path_delete(pPath p);


Rectangle_float Path_getBounds(pPath self);

Rectangle_float Path_getBoundsTransformed (pPath self, AffineTransform transform);

bool Path_contains (pPath self, float x, float y,
float tolerance);

bool Path_contains2 (pPath self, Point_float point,
float tolerance);

bool Path_intersectsLine (pPath self, Line_float line,
float tolerance);

Line_float Path_getClippedLine (pPath self, Line_float line, bool keepSectionOutsidePath);

float Path_getLength (pPath self, AffineTransform transform);

Point_float Path_getPointAlongPath (pPath self, float distanceFromStart,
AffineTransform transform);

float Path_getNearestPoint (pPath self, Point_float targetPoint,
Point_float &pointOnPath,
AffineTransform transform);

void Path_clear(pPath self);

void Path_startNewSubPath (pPath self, float startX, float startY);

void Path_startNewSubPath2 (pPath self, Point_float start);

void Path_closeSubPath(pPath self);

void Path_lineTo (pPath self, float endX, float endY);

void Path_lineTo2 (pPath self, Point_float end);

void Path_quadraticTo (pPath self, float controlPointX,
float controlPointY,
float endPointX,
float endPointY);

void Path_quadraticTo2 (pPath self, Point_float controlPoint,
Point_float endPoint);

void Path_cubicTo (pPath self, float controlPoint1X,
float controlPoint1Y,
float controlPoint2X,
float controlPoint2Y,
float endPointX,
float endPointY);

void Path_cubicTo2 (pPath self, Point_float controlPoint1,
Point_float controlPoint2,
Point_float endPoint);

Point_float Path_getCurrentPosition(pPath self);

void Path_addRectangle (pPath self, float x, float y, float width, float height);

void Path_addRectangle2 (pPath self, Rectangle_float rectangle);

void Path_addRoundedRectangle2 (pPath self, float x, float y, float width, float height,
float cornerSize);

void Path_addRoundedRectangle3 (pPath self, float x, float y, float width, float height,
float cornerSizeX,
float cornerSizeY);

void Path_addRoundedRectangle4 (pPath self, float x, float y, float width, float height,
float cornerSizeX, float cornerSizeY,
bool curveTopLeft, bool curveTopRight,
bool curveBottomLeft, bool curveBottomRight);

void Path_addRoundedRectangle5 (pPath self, Rectangle_float rectangle, float cornerSizeX, float cornerSizeY);

void Path_addRoundedRectangle6 (pPath self, Rectangle_float rectangle, float cornerSize);

void Path_addTriangle (pPath self, float x1, float y1,
float x2, float y2,
float x3, float y3);

void Path_addQuadrilateral (pPath self, float x1, float y1,
float x2, float y2,
float x3, float y3,
float x4, float y4);

void Path_addEllipse (pPath self, float x, float y, float width, float height);

void Path_addArc (pPath self, float x, float y, float width, float height,
float fromRadians,
float toRadians,
bool startAsNewSubPath);

void Path_addCentredArc (pPath self, float centreX, float centreY,
float radiusX, float radiusY,
float rotationOfEllipse,
float fromRadians,
float toRadians,
bool startAsNewSubPath);

void Path_addPieSegment (pPath self, float x, float y,
float width, float height,
float fromRadians,
float toRadians,
float innerCircleProportionalSize);

void Path_addLineSegment (pPath self, Line_float line, float lineThickness);

void Path_addArrow (pPath self, Line_float line,
float lineThickness,
float arrowheadWidth,
float arrowheadLength);

void Path_addPolygon (pPath self, Point_float centre,
int numberOfSides,
float radius,
float startAngle);

void Path_addStar (pPath self, Point_float centre,
int numberOfPoints,
float innerRadius,
float outerRadius,
float startAngle);

void Path_addBubble (pPath self, Rectangle_float bodyArea,
Rectangle_float maximumArea,
Point_float arrowTipPosition,
const float cornerSize,
const float arrowBaseWidth);

void Path_addPath (pPath self, pPath pathToAppend);

void Path_addPath2 (pPath self, pPath pathToAppend,
AffineTransform transformToApply);

void Path_applyTransform (pPath self, AffineTransform transform);

void Path_scaleToFit (pPath self, float x, float y, float width, float height,
bool preserveProportions);

AffineTransform Path_getTransformToScaleToFit (pPath self, float x, float y, float width, float height,
bool preserveProportions,
int justificationType);

AffineTransform Path_getTransformToScaleToFit2 (pPath self, Rectangle_float area,
bool preserveProportions,
int justificationType);

pPath Path_createPathWithRoundedCorners (pPath self, float cornerRadius);

void Path_setUsingNonZeroWinding (pPath self, bool isNonZeroWinding);

bool Path_isUsingNonZeroWinding(pPath self);

void Path_toString(pPath self, char* dest, int bufSize);

void Path_restoreFromString (pPath self, const char *src);

+ 133
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/cdef/typedefs.h View File

@@ -0,0 +1,133 @@
// protojuce/cdefs/typedefs.h
// c structures as exported by protoplug
// included by protojuce.lua

// pointer-structs :
// this is equivalent passing the pointers directly

typedef struct pGraphics
{ void *pointer; } pGraphics;

typedef struct pFillType
{ void *pointer; } pFillType;

typedef struct pColourGradient
{ void *pointer; } pColourGradient;

typedef struct pImage
{ void *pointer; } pImage;

typedef struct pFont
{ void *pointer; } pFont;

typedef struct pPath
{ void *pointer; } pPath;

typedef struct pComponent
{ void *pointer; } pComponent;

//typedef struct pMidiBuffer
//{ void *pointer; } pMidiBuffer;

//typedef struct pMidiBuffer_Iterator
//{ void *pointer; } pMidiBuffer_Iterator;


// accessible structs that get converted to JUCE objects

typedef struct pAudioFormatReader
{
const void *pointer;
const double sampleRate;
const unsigned int bitsPerSample;
const int64_t lengthInSamples;
const unsigned int numChannels;
const bool usesFloatingPointData;
} pAudioFormatReader;

typedef struct LagrangeInterpolator
{
float lastInputSamples[5];
double subSamplePos;
} LagrangeInterpolator;

typedef struct Colour
{
union
{
struct { uint8_t b, g, r, a; };
uint32_t argb;
};
} Colour;

typedef struct Point_int
{
int x, y;
} Point_int;

typedef struct Point_float
{
float x, y;
} Point_float;

typedef struct Line_int
{
int startx, starty;
int endx, endy;
} Line_int;

typedef struct Line_float
{
float startx, starty;
float endx, endy;
} Line_float;

typedef struct Rectangle_int
{
int x, y, w, h;
} Rectangle_int;

typedef struct Rectangle_float
{
float x, y, w, h;
} Rectangle_float;

typedef struct KeyPress
{
int keyCode;
int mods;
wchar_t textCharacter;
} KeyPress;

typedef struct AffineTransform
{
float mat00, mat01, mat02;
float mat10, mat11, mat12;
} AffineTransform;

typedef struct PathStrokeType
{
float thickness;
int jointStyle;
int endStyle;
} PathStrokeType;

typedef struct MouseEvent
{
int x, y;
int mods;
pComponent eventComponent;
pComponent originalComponent;
int64_t eventTime;
int64_t mouseDownTime;
Point_int mouseDownPos;
uint8_t numberOfClicks, wasMovedSinceMouseDown;
} MouseEvent;

typedef struct MouseWheelDetails
{
float deltaX;
float deltaY;
bool isReversed;
bool isSmooth;
} MouseWheelDetails;

+ 70
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/colour.lua View File

@@ -0,0 +1,70 @@
--- A simple colour class.
-- Is converted to a [JUCE Colour](http://www.juce.com/api/classColour.html)
-- @classmod juce.Colour

--- Constuctor with classical arguments.
-- @param r red
-- @param g green
-- @param b blue
-- @param[opt] a alpha
-- @within Constructors
-- @constructor
-- @function Colour

--- Constuctor with named arguments.
-- Every field is optional.
-- @tparam table args
-- @param args.r red
-- @param args.g green
-- @param args.b blue,
-- @param args.a alpha
-- @within Constructors
-- @constructor
-- @function Colour

local Colour = setmetatable({}, {
__call = function (self, ...)
local c = {}
c.r, c.g, c.b, c.a = ...
if type(c.r)=="table" then c = c.r end
c.a = c.a or 0xff
return ffi.new("Colour",c)
end
})
local Colour_mt = {
-- operator '=='
__eq = function(self, rhs)
return self.argb == rhs.argb
end;
}
ffi.metatype("Colour", Colour_mt);

Colour.black = Colour()
Colour.white = Colour(255,255,255)
Colour.red = Colour(255,0,0)
Colour.green = Colour(0,255,0)
Colour.blue = Colour(0,0,255)

--- Red (0-255)
-- @simplefield r

--- Green (0-255)
-- @simplefield g

--- Blue (0-255)
-- @simplefield b

--- Alpha (0-255)
-- @simplefield a

--- @predefined black

--- @predefined white

--- @predefined red

--- @predefined green

--- @predefined blue

return Colour

+ 101
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/colourgradient.lua View File

@@ -0,0 +1,101 @@
--- Colour Gradient.
-- Is a pointer to a [JUCE ColourGradient](http://www.juce.com/api/classColourGradient.html)
-- @classmod juce.ColourGradient

ffi.cdef [[
pColourGradient ColourGradient_new (Colour c1, float x1, float y1, Colour c2, float x2, float y2, bool isRadial);
void ColourGradient_delete (pColourGradient c);

int ColourGradient_addColour (pColourGradient self, double proportionAlongGradient,
Colour colour);
void ColourGradient_removeColour (pColourGradient self, int index);
void ColourGradient_multiplyOpacity (pColourGradient self, float multiplier);
int ColourGradient_getNumColours(pColourGradient self);
Colour ColourGradient_getColour (pColourGradient self, int index);
void ColourGradient_setColour (pColourGradient self, int index, Colour newColour);
Colour ColourGradient_getColourAtPosition (pColourGradient self, double position);
]]

--- Constuctor.
-- @tparam juce.Colour colour1 colour at the beginning of the gradient
-- @param x1 coordinates of colour1
-- @param y1 coordinates of colour1
-- @tparam juce.Colour colour2 colour at the end of the gradient
-- @param x2 coordinates of colour2
-- @param y2 coordinates of colour2
-- @tparam boolean isRadial whether the gradient should be linear or radial
-- @within Constructors
-- @constructor
-- @function Colour

local function ColourGradient(colour1, x1, y1, colour2, x2, y2, isRadial)
return ffi.gc(
protolib.ColourGradient_new(colour1, x1, y1, colour2, x2, y2, isRadial),
protolib.ColourGradient_delete
)
end

local ColourGradient_mt = {
-- methods
__index = {

--- Add colour.
-- Any number of colours can be added between the start and end of the gradient.
-- @param proportionAlongGradient
-- @tparam juce.Colour colour
-- @return the new colour's index
-- @function addColour
addColour = function (self, proportionAlongGradient, colour)
return protolib.ColourGradient_addColour (self, proportionAlongGradient, colour)
end;

--- Remove colour.
-- @param index colour index between 0 and getNumColours() - 1
-- @function removeColour
removeColour = function (self, index)
protolib.ColourGradient_removeColour (self, index)
end;

--- Multiply opacity.
-- @param multiplier factor to multiply the alpha values by
-- @function multiplyOpacity
multiplyOpacity = function (self, multiplier)
protolib.ColourGradient_multiplyOpacity (self, multiplier)
end;

--- Get number colour.
-- @return the number of colours
-- @function getNumColours
getNumColours = function (self)
return protolib.ColourGradient_getNumColours(self)
end;

--- Get colour.
-- @param index colour index between 0 and getNumColours() - 1
-- @treturn juce.Colour the coulour at the specified index
-- @function getColour
getColour = function (self, index)
return protolib.ColourGradient_getColour (self, index)
end;

--- Get colour.
-- @param index colour index between 0 and getNumColours() - 1
-- @tparam juce.Colour newColour
-- @function setColour
setColour = function (self, index, newColour)
protolib.ColourGradient_setColour (self, index, newColour)
end;

--- Get interpolated colour
-- @param position the position between 0 and 1
-- @treturn juce.Colour the interpolated colour at the specified position
-- @function getColourAtPosition
getColourAtPosition = function (self, position)
return protolib.ColourGradient_getColourAtPosition (self, position)
end;
};
}

ffi.metatype("pColourGradient", ColourGradient_mt)

return ColourGradient

+ 73
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/component.lua View File

@@ -0,0 +1,73 @@
--- JUCE Component.
-- Is a pointer to a [JUCE Component](http://www.juce.com/api/classComponent.html)
--
-- As of now, components can't be created by protoplug scripts. This is mainly
-- for accessing the custom GUI component using @{gui.getComponent}.
-- @classmod juce.Component

ffi.cdef [[
void Component_repaint(pComponent self);
void Component_repaint2(pComponent self, int x, int y, int width, int height);
void Component_repaint3(pComponent self, Rectangle_int area);
pImage Component_createComponentSnapshot (pComponent self,
Rectangle_int areaToGrab,
bool clipImageToComponentBounds,
float scaleFactor);
]]

local Component_mt = {
-- methods
__index = {

--- Request total repaint.
-- Tell the operating system that the component is "dirty" and needs to be redrawn.
-- The component's paint method will be called asynchronously (@{gui.paint})
-- @function repaint

--- Request partial repaint.
-- Tell the operating system that a portion of the component is "dirty" and needs to be redrawn.
-- The component's paint method will be called asynchronously (@{gui.paint}). The dirty region will be accessible
-- with Graphics.getClipBounds().
-- @tparam juce.Rectangle_int area the region needing the be redrawn
-- @function repaint

--- Request partial repaint.
-- Tell the operating system that a portion of the component is "dirty" and needs to be redrawn.
-- The component's paint method will be called asynchronously (@{gui.paint}). The dirty region will be accessible
-- with Graphics.getClipBounds().
-- @param x the region needing the be redrawn
-- @param y the region needing the be redrawn
-- @param width the region needing the be redrawn
-- @param height the region needing the be redrawn
-- @function repaint
repaint = function (self, ...)
if select("#", ...) == 4 then
protolib.Component_repaint2(self, ...)
elseif select("#", ...) == 1 then
protolib.Component_repaint3(self, ...)
else
protolib.Component_repaint(self)
end
end;

--- Create component snapshot.
-- Paint the component into a virtual buffer and return it as an image.
-- @tparam juce.Rectangle_int areaToGrab the region to the be drawn
-- @param[opt=true] clipImageToComponentBounds
-- @param[opt=1] scaleFactor
-- @treturn juce.Image
-- @function createComponentSnapshot
createComponentSnapshot = function (self, areaToGrab, clipImageToComponentBounds, scaleFactor)
clipImageToComponentBounds = clipImageToComponentBounds or true
scaleFactor = scaleFactor or 1
local i = protolib.Component_createComponentSnapshot(self, areaToGrab, clipImageToComponentBounds, scaleFactor)
i = ffi.gc(i, protolib.Image_delete)
return i
end
}
}
ffi.metatype("pComponent", Component_mt)

return {}

+ 74
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/filltype.lua View File

@@ -0,0 +1,74 @@
--- Fill Type.
-- Is a pointer to a [JUCE FillType](http://www.juce.com/api/classFillType.html).
-- Can be used by @{juce.Graphics} for fill operations.
-- @classmod juce.FillType

local Colour = require"include/protojuce/colour"

ffi.cdef [[
pFillType FillType_new(Colour c);
pFillType FillType_new2(pColourGradient c);
void FillType_delete(pFillType f);
void FillType_setOpacity (pFillType f, float newOpacity);
]]


--- Constuct from a @{juce.Colour}.
-- @tparam juce.Colour Colour
-- @within Constructors
-- @constructor
-- @function FillType

--- Constuct from a @{juce.ColourGradient}.
-- @tparam juce.ColourGradient Gradient
-- @within Constructors
-- @constructor
-- @function FillType

local FillType = setmetatable({}, {
__call = function (self, a)
if ffi.istype("Colour", a) then
return ffi.gc(
protolib.FillType_new(a),
protolib.FillType_delete
)
else -- gradient
return ffi.gc(
protolib.FillType_new2(a),
protolib.FillType_delete
)
end
end
})
local FillType_mt = {
-- methods
__index = {
--- Set Overall Opacity.
-- @param newOpacity
-- @function setOpacity
setOpacity = function (self, newOpacity)
protolib.FillType_setOpacity(self, newOpacity)
end;
}
}
ffi.metatype("pFillType", FillType_mt)

FillType.black = FillType(Colour.black)
FillType.white = FillType(Colour.white)
FillType.red = FillType(Colour.red)
FillType.green = FillType(Colour.green)
FillType.blue = FillType(Colour.blue)


--- @predefined black

--- @predefined white

--- @predefined red

--- @predefined green

--- @predefined blue

return FillType

+ 43
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/font.lua View File

@@ -0,0 +1,43 @@
--- Font.
-- Is a pointer to a [JUCE Font](http://www.juce.com/api/classFont.html).
-- Can be used by @{juce.Graphics} for text operations.
-- @classmod juce.Font

ffi.cdef [[
pFont Font_new(const char *typefaceName, float fontHeight, int styleFlags, bool hinted);
void Font_delete(pFont f);
]]

--- Constuctor.
-- Caveat : on OSX and Linux, hinting only works for protoplug's
-- built-in hinted fonts (`DejaVu Sans Mono` and `Source Code Pro`). On
-- Windows it's available for every font. Cross-platform hinting is on the be
-- todo list.
-- @tparam string typefaceName
-- @tparam number fontHeight
-- @param[opt=0] styleFlags any combination of @{styles}
-- @tparam[opt=false] bool hinted
-- @within Constructors
-- @constructor
-- @function Font
local Font = setmetatable({}, {
__call = function (self, typefaceName, fontHeight, styleFlags, hinted)
styleFlags = styleFlags or 0
hinted = hinted or false;
return ffi.gc(
protolib.Font_new(typefaceName, fontHeight, styleFlags, hinted),
protolib.Font_delete
)
end
})

--- Font styles.
-- @table juce.Font.styles
Font.styles = {
plain = 0, -- `0`
bold = 1, -- `1`
italic = 2, -- `2`
underlined = 4 -- `4`
}

return Font

+ 140
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/generate memo.txt View File

@@ -0,0 +1,140 @@
Some notes on creating the c++ export header, the c ffi import header, and the lua wrapper from JUCE library code. It's a mix of manual labor and notepad++ regular expression replacements, which was probably faster than doing everything manually or making a full parser and code generator. And it starts with the GNU C preprocessor :

========== JUCE header to c++ export header =========

cpp -P juce_path.h

manually remove unwanted code, paste PROTO_API in front of desired functions.

Add "self" :
PROTO_API (.*?)\((.*?)\{(.*?)\}
->
PROTO_API \1\(pPath self, \2\{\3\}

pPath self, )
(normal mode)->
pPath self)


Prefix and create exported function bodies :
PROTO_API (.*?) (.*?)\(pPath self(.*?)\)\r\n\{\r\n\r\n\}
->
PROTO_API \1 Path_\2\(\3\)\r\n\{\r\n\treturn self.p->\2\(\3\)\r\n\}

(,
(normal mode)->
(

Remove "return" from void function bodies :
PROTO_API void (.*?)return
->
PROTO_API void \1

Add "self" in definition arguments :
PROTO_API (.*?)\(
(disable . matches newline)->
PROTO_API (.*?)\(pPath self,

, )
)

add the ; which i forgot :
)\r\n}
);\r\n}

Start removing types from function call arguments :
\{([^\}]*?)const (.*?)\}
(repeat until none left)->
\{\1\2\}

Remove default parameter values from call arguments :
\{([^\}]*?) = (.*?)([,\)])(.*?)\}
->
\{\1\3\4\}

More removing types and replacing them with conversions (repeat until done) :
\{([^\}]*?)AffineTransform& (.*?)([,)])(.*?)\}
(repeat until none left)->
\{\1\2\.toJuceAff\(\)\3\4\}

\{([^\}]*?)Point<float> (.*?)([,)])(.*?)\}
\{\1\2\.toJucePoint\(\)\3\4\}

Remove basic types from function call argument lists :
\{([^\}]*?)float (.*?)\}
\{\1\2\}

Replace classes by structs in definition argument lists (and return type) :
PROTO_API ([^\)]*?)const AffineTransform& (.*?)\)
PROTO_API \1exAffineTransform \2\)

PROTO_API ([^\)]*?)const Point<float> (.*?)\)
PROTO_API \1exPoint_float \2\)


========== c++ export header to c ffi import header =========
Remove ex, eg. exPoint_int -> Point_int :
' ex'
' '

Remove bodies (mwaha) :
PROTO_API (.*?)\)(.*?)\}\r\n
\1\);\r\n

Remove default values :
= (.*?)([),])
\2


========== c ffi import header to lua wrapper =========

Remove all parameter types : last param :
,([^\),]*?) ([^ ]*?)\)
, \2\)

Remove all paramter types : middle params in a line :
, ([^\), ]*?) ([^ ]*?),
, \2\,

Remove all paramter types : middle params after newline :
\r\n([ ]+)(.*?) (.*?),
\r\n\1\3,

Wrap it !
\r\n\r\n([^\r\n]*?) Path_(.*?)\((.*?)\);
\2 = function \(\3\)\r\n\treturn\1 protolib\.Path_\2\(\3\)\r\nend;\r\n\r\n

'returnvoid '
''

return(.*?)
return





ldoc madness (gradually remove parameters) :
\r\n\t\t(.*?) = function (\(self,
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?),
[ \r\n\t]*?([^\) \r\n\t].*?)\))

\r\n\t\t--- \1\.
\r\n\t\t-- @param \3
\r\n\t\t-- @param \4
\r\n\t\t-- @param \5
\r\n\t\t-- @param \6
\r\n\t\t-- @param \7
\r\n\t\t-- @param \8
\r\n\t\t-- @param \9
\r\n\t\t-- @param ${10}
\r\n\t\t-- @param ${11}
\r\n\t\t-- @function \1
\r\n\t\t\1 = function \2

+ 777
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/graphics.lua View File

@@ -0,0 +1,777 @@
--- Graphics drawing target.
-- Is a pointer to a [JUCE Graphics](http://www.juce.com/api/classGraphics.html) object.
-- Received in @{gui.paint} as an argument.
-- @classmod juce.Graphics

local script = require "include/core/script"
local util = require"include/luautil"
util.requireCdef(script.protoplugDir.."/include/protojuce/cdef/graphics.h")
local Justification = require"include/protojuce/justification"
local RectanglePlacement = require"include/protojuce/rectangleplacement"
local AffineTransform = require"include/protojuce/affinetransform"
local Path = require"include/protojuce/path"

local Graphics = setmetatable({}, {
--- Constuct from a @{juce.Image}.
-- Use this constructor to draw directly onto an @{juce.Image} in memory.
--
-- A typical use is to can create a @{juce.Image} object and use it as a
-- backbuffer for pre-rendering graphics.
-- @tparam juce.Image imageToDrawOnto
-- @within Constructors
-- @constructor
-- @function Graphics
__call = function (self, imageToDrawOnto)
return ffi.gc(
protolib.Graphics_new(imageToDrawOnto),
protolib.Graphics_delete)
end
})

local Graphics_mt = {
-- methods
__index = {

--- Set working colour.
-- Set the colour to be used for subsequent calls such as @{drawRect} and @{drawText}.
-- @tparam juce.Colour newColour
-- @function setColour
setColour = function (self, newColour)
protolib.Graphics_setColour(self, newColour)
end;


--- Set working opacity.
-- Set the opacity to be used for subsequent calls.
-- @param newOpacity
-- @function setOpacity
setOpacity = function (self, newOpacity)
protolib.Graphics_setOpacity(self, newOpacity)
end;



--- Set working Gradient.
-- Use a gradient as fill for subsequent calls such as @{fillRect}.
-- @tparam juce.ColourGradient gradient
-- @function setGradientFill
setGradientFill = function (self, gradient)
protolib.Graphics_setGradientFill(self, gradient)
end;


--- Set Tiled Image Fill.
-- Use a tiled image as fill for subsequent calls such as @{fillRect}.
-- @tparam juce.Image imageToUse
-- @param anchorX
-- @param anchorY
-- @param opacity
-- @function setTiledImageFill
setTiledImageFill = function (self, imageToUse,
anchorX, anchorY,
opacity)
protolib.Graphics_setTiledImageFill(self, imageToUse,
anchorX, anchorY,
opacity)
end;


--- Set Fill.
-- @tparam juce.FillType newFill
-- @function setFillType
setFillType = function (self, newFill)
protolib.Graphics_setFillType(self, newFill)
end;


--- Set Font.
-- @tparam juce.Font newFont
-- @function setFont

--- Set Font.
-- @tparam number newFontHeight
-- @function setFont
setFont = function (self, newFont)
if type(newFont) == "number" then -- height
protolib.Graphics_setFont2(self, newFont)
else
protolib.Graphics_setFont(self, newFont)
end
end;


--- Get Current Font.
-- treturn juce.Font the current font
-- @function getCurrentFont
getCurrentFont = function (self)
local f = protolib.Graphics_getCurrentFont(self)
f = ffi.gc(f, protolib.Font_delete)
return f
end;


--- Draw single line of text.
-- @tparam string text
-- @param startX
-- @param baselineY
-- @tparam[opt=Justification.left] juce.Justification justification
-- @function drawSingleLineText
drawSingleLineText = function (self, text,
startX, baselineY,
justification)
justification = justification or Justification.left
protolib.Graphics_drawSingleLineText(self, text,
startX, baselineY,
justification)
end;


--- Draw multiline text.
-- @tparam string text
-- @param startX
-- @param baselineY
-- @param maximumLineWidth
-- @function drawMultiLineText
drawMultiLineText = function (self, text,
startX, baselineY,
maximumLineWidth)
protolib.Graphics_drawMultiLineText(self, text,
startX, baselineY,
maximumLineWidth)
end;


--- Draw text.
-- @param x
-- @param y
-- @param width
-- @param height
-- @tparam[opt=Justification.left] juce.Justification justification
-- @param[opt=false] useEllipsesIfTooBig
-- @function drawText

--- Draw text.
-- @tparam juce.Rectangle_int area
-- @tparam[opt=Justification.left] juce.Justification justification
-- @param[opt=false] useEllipsesIfTooBig
-- @function drawText
drawText = function (self, text, ...)
if select('#',...) >= 4 then
local x, y, width, height, justificationType, useEllipsesIfTooBig = ...
justificationType = justificationType or Justification.left
useEllipsesIfTooBig = useEllipsesIfTooBig or false
protolib.Graphics_drawText(self, text,
x, y, width, height,
justificationType,
useEllipsesIfTooBig)
else -- Rectangle_int
local area, justificationType, useEllipsesIfTooBig = ...
justificationType = justificationType or Justification.left
useEllipsesIfTooBig = useEllipsesIfTooBig or false
protolib.Graphics_drawText2(self, text,
area,
justificationType,
useEllipsesIfTooBig)
end
end;


--- Draw fitted text.
-- Awkwardly squishes the font (up to minimumHorizontalScale) if necessary.
-- @param x
-- @param y
-- @param width
-- @param height
-- @tparam juce.Justification justification
-- @param maximumNumberOfLines
-- @param[opt=0.7] minimumHorizontalScale
-- @function drawFittedText

--- Draw fitted text.
-- Awkwardly squishes the font (up to minimumHorizontalScale) if necessary.
-- @tparam juce.Rectangle_int area
-- @tparam juce.Justification justification
-- @param maximumNumberOfLines
-- @param[opt=0.7] minimumHorizontalScale
-- @function drawFittedText
drawFittedText = function (self, text, ...)
if select('#',...) >= 6 then
local x, y, width, height, justificationFlags, maximumNumberOfLines, minimumHorizontalScale = ...
minimumHorizontalScale = minimumHorizontalScale or 0.7
protolib.Graphics_drawFittedText(self, text,
x, y, width, height,
justificationFlags,
maximumNumberOfLines,
minimumHorizontalScale)
else
local area, justificationFlags, maximumNumberOfLines, minimumHorizontalScale = ...
minimumHorizontalScale = minimumHorizontalScale or 0.7
protolib.Graphics_drawFittedText2(self, text,
area,
justificationFlags,
maximumNumberOfLines,
minimumHorizontalScale)
end
end;

--- Fill the entire graphics target.
-- @tparam[opt] juce.Colour colourToUse
-- @function fillAll
fillAll = function (self, colourToUse)
if colourToUse then
protolib.Graphics_fillAll2(self, colourToUse)
else
protolib.Graphics_fillAll(self)
end
end;


--- Fill rectangle with current fill type.
-- @param x
-- @param y
-- @param width
-- @param height
-- @function fillRect

--- Fill rectangle with current fill type.
-- @tparam juce.Rectangle_int area
-- @function fillRect
fillRect = function (self, ...)
if select('#',...) == 4 then
local x, y, width, height = ...
protolib.Graphics_fillRect3(self, x, y, width, height)
else
local rectangle = ...
if ffi.istype("Rectangle_int", rectangle) then
protolib.Graphics_fillRect(self, rectangle)
else
protolib.Graphics_fillRect2(self, rectangle)
end
end
end;


fillRect_int = function (self, x, y, width, height)
protolib.Graphics_fillRect3(self, x, y, width, height)
end;


--- Fill rectangle (sub-pixel accuracy).
-- @param x
-- @param y
-- @param width
-- @param height
-- @function fillRect_float
fillRect_float = function (self, x, y, width, height)
protolib.Graphics_fillRect4(self, x, y, width, height)
end;


--- Fill rounded rectangle.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param cornerSize
-- @function fillRoundedRectangle

--- Fill rounded rectangle.
-- @tparam juce.Rectangle_int area
-- @param cornerSize
-- @function fillRoundedRectangle
fillRoundedRectangle = function (self, ...)
if select('#',...) == 5 then
local x, y, width, height, cornerSize = ...
protolib.Graphics_fillRoundedRectangle(self, x, y, width, height,
cornerSize)
else
local rectangle, cornerSize = ...
protolib.Graphics_fillRoundedRectangle2(self, rectangle,
cornerSize)
end
end;


--- Fill *chequerboard*.
-- (and i thought juce used British spelling)
-- @tparam juce.Rectangle_int area
-- @param checkWidth
-- @param checkHeight
-- @tparam juce.Colour colour1
-- @tparam juce.Colour colour2
-- @function fillCheckerBoard
fillCheckerBoard = function (self, area,
checkWidth, checkHeight,
colour1, colour2)
protolib.Graphics_fillCheckerBoard(self, area,
checkWidth, checkHeight,
colour1, colour2)
end;


--- Draw rectangle.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param[opt=1] lineThickness
-- @function drawRect

--- Draw rectangle.
-- @tparam juce.Rectangle_int area
-- @param[opt=1] lineThickness
-- @function drawRect
drawRect = function (self, ...)
if select('#',...) >= 4 then
local x, y, width, height, lineThickness = ...
lineThickness = lineThickness or 1
protolib.Graphics_drawRect(self, x, y, width, height, lineThickness)
else
local rectangle, lineThickness = ...
lineThickness = lineThickness or 1
protolib.Graphics_drawRect3(self, rectangle, lineThickness)
end
end;


--- Draw rect (sub-pixel accuracy).
-- @param x
-- @param y
-- @param width
-- @param height
-- @param[opt=1] lineThickness
-- @function drawRect_float

--- Draw rect (sub-pixel accuracy).
-- @tparam juce.Rectangle_int area
-- @param[opt=1] lineThickness
-- @function drawRect_float
drawRect_float = function (self, ...)
if select('#',...) >= 4 then
local x, y, width, height, lineThickness = ...
lineThickness = lineThickness or 1
protolib.Graphics_drawRect2(self, x, y, width, height, lineThickness)
else
local rectangle, lineThickness = ...
lineThickness = lineThickness or 1
protolib.Graphics_drawRect4(self, rectangle, lineThickness)
end
end;


--- Draw rounded rectangle.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param cornerSize
-- @param[opt=1] lineThickness
-- @function drawRoundedRectangle

--- Draw rounded rectangle.
-- @tparam juce.Rectangle_int area
-- @param cornerSize
-- @param[opt=1] lineThickness
-- @function drawRoundedRectangle
drawRoundedRectangle = function (self, ...)
if select('#',...) >= 5 then
local x, y, width, height, cornerSize, lineThickness = ...
lineThickness = lineThickness or 1
protolib.Graphics_drawRoundedRectangle(self, x, y, width, height, cornerSize, lineThickness)
else
local rectangle, cornerSize, lineThickness = ...
lineThickness = lineThickness or 1
protolib.Graphics_drawRoundedRectangle2(self, rectangle, cornerSize, lineThickness)
end
end;


--- Set pixel with current colour.
-- @param x
-- @param y
-- @function setPixel
setPixel = function (self, x, y)
protolib.Graphics_setPixel(self, x, y)
end;


--- Fill ellipse with current fill.
-- @param x
-- @param y
-- @param width
-- @param height
-- @function fillEllipse
fillEllipse = function (self, ...)
if select('#',...) == 4 then
local x, y, width, height = ...
protolib.Graphics_fillEllipse(self, x, y, width, height)
else
local area = ...
protolib.Graphics_fillEllipse2(self, area)
end
end;


--- Draw ellipse with current colour.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param[opt=1] lineThickness
-- @function drawEllipse
drawEllipse = function (self, x, y, width, height,
lineThickness)
lineThickness = lineThickness or 1
protolib.Graphics_drawEllipse(self, x, y, width, height,
lineThickness)
end;


--- Draw line.
-- @param startX
-- @param startY
-- @param endX
-- @param endY
-- @param[opt=1] lineThickness
-- @function drawLine

--- Draw line.
-- @tparam juce.Line line
-- @param[opt=1] lineThickness
-- @function drawLine
drawLine = function (self, ...)
if select('#',...) == 4 then
local startX, startY, endX, endY = ...
protolib.Graphics_drawLine(self, startX, startY, endX, endY)
elseif select('#',...) == 5 then
local startX, startY, endX, endY, lineThickness = ...
protolib.Graphics_drawLine2(self, startX, startY, endX, endY, lineThickness)
elseif select('#',...) == 1 then
local line = ...
protolib.Graphics_drawLine3(self, line)
else
local line, lineThickness = ...
protolib.Graphics_drawLine4(self, line, lineThickness)
end
end;


--- Draw dashed line.
-- @tparam juce.Line line
-- @param dashLengths (const float* ctype)
-- @param numDashLengths
-- @param[opt=1] lineThickness
-- @param[opt=0] dashIndexToStartFrom
-- @function drawDashedLine
drawDashedLine = function (self, line,
dashLengths, numDashLengths,
lineThickness,
dashIndexToStartFrom)
lineThickness = lineThickness or 1
dashIndexToStartFrom = dashIndexToStartFrom or 0
protolib.Graphics_drawDashedLine(self, line,
dashLengths, numDashLengths,
lineThickness,
dashIndexToStartFrom)
end;


--- Draw vertical line.
-- @param x
-- @param top
-- @param bottom
-- @function drawVerticalLine
drawVerticalLine = function (self, x, top, bottom)
protolib.Graphics_drawVerticalLine(self, x, top, bottom)
end;


--- Draw horizontal line.
-- @param y
-- @param left
-- @param right
-- @function drawHorizontalLine
drawHorizontalLine = function (self, y, left, right)
protolib.Graphics_drawHorizontalLine(self, y, left, right)
end;


--- Fill path.
-- @tparam juce.Path path
-- @tparam[opt=juce.AffineTransform.identity] juce.AffineTransform transform
-- @function fillPath
fillPath = function (self, path,
transform)
transform = transform or AffineTransform.identity
protolib.Graphics_fillPath(self, path,
transform)
end;


--- Stroke path.
-- All named arguments are optional
-- @tparam juce.Path path
-- @param[opt] args
-- @param args.thickness
-- @tparam juce.Path.JointStyle args.jointStyle *default* : juce.Path.JointStyle.mitered
-- @tparam juce.Path.EndCapStyle args.endCapStyle *default* : juce.Path.EndCapStyle.butt
-- @tparam juce.AffineTransform args.transform *default* : juce.AffineTransform.identity
-- @function strokePath
strokePath = function (self, path, args)
args = args or {}
args.thickness = args.thickness or 1
args.jointStyle = args.jointStyle or Path.JointStyle.mitered
args.endCapStyle = args.endCapStyle or Path.EndCapStyle.butt
args.transform = args.transform or AffineTransform.identity
local strokeType = ffi.new("PathStrokeType", args.thickness, args.jointStyle, args.endCapStyle)
protolib.Graphics_strokePath(self, path,
strokeType,
args.transform)
end;


--- Draw arrow.
-- @tparam juce.Line line
-- @param lineThickness
-- @param arrowheadWidth
-- @param arrowheadLength
-- @function drawArrow
drawArrow = function (self, line,
lineThickness,
arrowheadWidth,
arrowheadLength)
protolib.Graphics_drawArrow(self, line,
lineThickness,
arrowheadWidth,
arrowheadLength)
end;


--- Set image resampling quality.
-- @tparam juce.Graphics.ResamplingQuality newQuality
-- @function setImageResamplingQuality
setImageResamplingQuality = function (self, newQuality)
protolib.Graphics_setImageResamplingQuality(self, newQuality)
end;


--- Draw unscaled image at location.
-- @tparam juce.Image imageToDraw
-- @param topLeftX
-- @param topLeftY
-- @param[opt=false] fillAlphaChannelWithCurrentBrush
-- @function drawImageAt
drawImageAt = function (self, imageToDraw, topLeftX, topLeftY,
fillAlphaChannelWithCurrentBrush)
fillAlphaChannelWithCurrentBrush = fillAlphaChannelWithCurrentBrush or false
protolib.Graphics_drawImageAt(self, imageToDraw, topLeftX, topLeftY,
fillAlphaChannelWithCurrentBrush)
end;


--- Draw a portion of an image, stretched into a target rectangle.
-- @tparam juce.Image imageToDraw
-- @param destX
-- @param destY
-- @param destWidth
-- @param destHeight
-- @param sourceX
-- @param sourceY
-- @param sourceWidth
-- @param sourceHeight
-- @param[opt=false] fillAlphaChannelWithCurrentBrush
-- @function drawImage
drawImage = function (self, imageToDraw,
destX, destY, destWidth, destHeight,
sourceX, sourceY, sourceWidth, sourceHeight,
fillAlphaChannelWithCurrentBrush)
fillAlphaChannelWithCurrentBrush = fillAlphaChannelWithCurrentBrush or false
protolib.Graphics_drawImage(self, imageToDraw,
destX, destY, destWidth, destHeight,
sourceX, sourceY, sourceWidth, sourceHeight,
fillAlphaChannelWithCurrentBrush)
end;


--- Draw transformed image.
-- @tparam juce.Image imageToDraw
-- @tparam juce.AffineTransform transform
-- @param[opt=false] fillAlphaChannelWithCurrentBrush
-- @function drawImageTransformed
drawImageTransformed = function (self, imageToDraw,
transform,
fillAlphaChannelWithCurrentBrush)
fillAlphaChannelWithCurrentBrush = fillAlphaChannelWithCurrentBrush or false
protolib.Graphics_drawImageTransformed(self, imageToDraw,
transform,
fillAlphaChannelWithCurrentBrush)
end;


--- Draw image within.
-- @tparam juce.Image imageToDraw
-- @param destX
-- @param destY
-- @param destWidth
-- @param destHeight
-- @param[opt=juce.RectanglePlacement.centred] placementWithinTarget
-- @param[opt=false] fillAlphaChannelWithCurrentBrush
-- @function drawImageWithin
drawImageWithin = function (self, imageToDraw,
destX, destY, destWidth, destHeight,
placementWithinTarget,
fillAlphaChannelWithCurrentBrush)
fillAlphaChannelWithCurrentBrush = fillAlphaChannelWithCurrentBrush or false
placementWithinTarget = placementWithinTarget or RectanglePlacement.centred
protolib.Graphics_drawImageWithin(self, imageToDraw,
destX, destY, destWidth, destHeight,
placementWithinTarget,
fillAlphaChannelWithCurrentBrush)
end;


--- Get clip bounds.
-- Get the portion of the graphics target that needs to be redrawn.
-- @treturn juce.Rectangle_int Clipping area
-- @function getClipBounds
getClipBounds = function (self)
return protolib.Graphics_getClipBounds(self)
end;


--- Clip region intersects.
-- Check if a rectangle intersects with the redrawing region
-- @treturn juce.Rectangle_int Clipping area
-- @treturn boolean intersection check
-- @function clipRegionIntersects
clipRegionIntersects = function (self, area)
return protolib.Graphics_clipRegionIntersects(self, area)
end;


reduceClipRegion = function (self, ...)
local control = select(1, ...)
if type(control)=="number" then
local x, y, width, height = ...
return protolib.Graphics_reduceClipRegion(self, x, y, width, height)
elseif ffi.istype("Rectangle_int", control) then
local area = ...
return protolib.Graphics_reduceClipRegion2(self, area)
elseif ffi.istype("pPath", control) then
local path, transform = ...
transform = transform or AffineTransform.identity
return protolib.Graphics_reduceClipRegion4(self, path, transform)
else -- pImage
local image, transform = ...
return protolib.Graphics_reduceClipRegion5(self, image, transform)
end
end;


excludeClipRegion = function (self, rectangleToExclude)
protolib.Graphics_excludeClipRegion(self, rectangleToExclude)
end;


--- Is clipping region empty.
-- @treturn boolean whether the redrawing area is empty
-- @function isClipEmpty
isClipEmpty = function (self)
return protolib.Graphics_isClipEmpty(self)
end;


--- Save state.
-- Saves the current state of the graphics target on a stack.
-- This does not save the actual graphic's contents but its current
-- colour, transform, origin, etc.
-- @function saveState
saveState = function (self)
protolib.Graphics_saveState(self)
end;


--- Restore state.
-- Restores a state of the graphics target from the stack.
-- Useful to cancel any previous uses
-- of @{addTransform}, @{setColour}, etc.
-- @function restoreState
restoreState = function (self)
protolib.Graphics_restoreState(self)
end;


--- Begin transparency layer.
-- Saves the current state and begins drawing on a temporary layer,
-- to be applied with the specified final transparency.
-- @function beginTransparencyLayer
beginTransparencyLayer = function (self, layerOpacity)
protolib.Graphics_beginTransparencyLayer(self, layerOpacity)
end;


--- End transparency layer.
-- Applies the transparency layer that was started with @{beginTransparencyLayer}.
-- @function endTransparencyLayer
endTransparencyLayer = function (self)
protolib.Graphics_endTransparencyLayer(self)
end;


--no
-- Set origin. tparam juce.Point newOrigin function setOrigin

--- Set origin.
-- @param newOriginX
-- @param newOriginY
-- @function setOrigin
setOrigin = function (self, ...)
if select("#", ...) == 1 then
protolib.Graphics_setOrigin(self, ...)
else
protolib.Graphics_setOrigin2(self, ...)
end
end;


--- Add a transformation matrix.
-- The matrix will be chained onto the current one, and affect all
-- subsequent graphics operations. Use @{saveState} and @{restoreState}
-- to apply a temporary transform.
-- @tparam juce.AffineTransform transform
-- @function addTransform
addTransform = function (self, transform)
protolib.Graphics_addTransform(self, transform)
end;


--- Reset to default state.
-- @function resetToDefaultState
resetToDefaultState = function (self)
protolib.Graphics_resetToDefaultState(self)
end;


--- Is vector device.
-- @treturn boolean whether the target is a vector device.
-- @function isVectorDevice
isVectorDevice = function (self)
return protolib.Graphics_isVectorDevice(self)
end;
}
}

--- Resampling qualities.
-- @table juce.Graphics.ResamplingQuality
Graphics.ResamplingQuality =
{
low = 0;
medium = 1;
high = 2
};

ffi.metatype("pGraphics", Graphics_mt);

return Graphics

+ 74
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/image.lua View File

@@ -0,0 +1,74 @@
--- Image.
-- Images can be loaded from a file, or created as temporary graphics targets.
--
-- Is a pointer to a [JUCE Image](http://www.juce.com/api/classImage.html),
-- and wraps some [JUCE ImageFileFormat](http://www.juce.com/api/classImageFileFormat.html)
-- functionality.
-- @classmod juce.Image

ffi.cdef [[
pImage Image_new();
pImage Image_new2(int pixelFormat, int imageWidth, int imageHeight, bool clearImage);
void Image_delete(pImage i);
bool Image_isValid(pImage i);

pImage ImageFileFormat_loadFrom2(const char *filename);
]]

local Image = setmetatable ({}, {

--- Load an image from a file.
-- The path can be absolute or relative to the protoplug directory.
-- To check if the file was loaded successfully, use @{isValid}.
-- @param filename
-- @within Constructors
-- @constructor
-- @function Image

--- Create a temporary in-memory image.
-- @tparam juce.Image.PixelFormat pixelFormat
-- @param imageWidth
-- @param imageHeight
-- @tparam boolean clearImage fill the image with black
-- @within Constructors
-- @constructor
-- @function Image
__call = function(self, ...)
if select("#", ...)==4 then
return ffi.gc(
protolib.Image_new2(...),
protolib.Image_delete
)
else
return ffi.gc(
protolib.ImageFileFormat_loadFrom2(...),
protolib.Image_delete
)
end
end;
})

local Image_mt = {
-- methods
__index = {

--- Check Image validity.
-- @treturn boolean whether the image is valid and can be used.
-- @function isValid
isValid = function (self)
return protolib.Image_isValid(self)
end;
}
}
ffi.metatype("pImage", Image_mt);

--- Pixel formats.
-- @table juce.Image.PixelFormat
Image.PixelFormat = {
UnknownFormat = 0; -- 0
RGB = 1; -- 1
ARGB = 2; -- 2
SingleChannel = 3 -- 3
}

return Image

+ 26
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/justification.lua View File

@@ -0,0 +1,26 @@
--- Justification.
-- Is converted to a [JUCE Justification](http://www.juce.com/api/Justification.html)
-- @classmod juce.Justification

--- Justification Constants.
-- @table juce.Justification
local r = {
left = 1;
right = 2;
horizontallyCentred = 4;
top = 8;
bottom = 16;
verticallyCentred = 32;
horizontallyJustified = 64;
centred = 36;
centredLeft = 33;
centredRight = 34;
centredTop = 12;
centredBottom = 20;
topLeft = 9;
topRight = 10;
bottomLeft = 17;
bottomRight = 18
}

return r

+ 41
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/lagrangeinterpolator.lua View File

@@ -0,0 +1,41 @@
--- Lagrange Interpolator.
-- Is converted to a [JUCE LagrangeInterpolator](http://www.juce.com/api/classLagrangeInterpolator.html)
-- @classmod juce.LagrangeInterpolator

ffi.cdef [[
LagrangeInterpolator LagrangeInterpolator_create();
int LagrangeInterpolator_process(LagrangeInterpolator ex,
double speedRatio,
const float* inputSamples,
float* outputSamples,
int numOutputSamplesToProduce);
]]

--- Constuctor.
-- @within Constructors
-- @constructor
-- @function LagrangeInterpolator
local LagrangeInterpolator = setmetatable({}, {
__call = function (self)
return protolib.LagrangeInterpolator_create()
end
})

local LagrangeInterpolator_mt = {
-- methods
__index = {
--- Interpolate.
-- @param speedRatio number of input samples per output sample (input/output)
-- @param inputSamples pointer to a cdata `float` array
-- @param outputSamples pointer to a cdata `float` array
-- @param numOutputSamplesToProduce
-- @treturn number number of input samples that were processed
-- @function process
process = function (self, speedRatio, inputSamples, outputSamples, numOutputSamplesToProduce)
return protolib.LagrangeInterpolator_process(self, speedRatio, inputSamples, outputSamples, numOutputSamplesToProduce)
end;
}
}
ffi.metatype("LagrangeInterpolator", LagrangeInterpolator_mt);

return LagrangeInterpolator

+ 50
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/line.lua View File

@@ -0,0 +1,50 @@
--- Line.
-- Is converted to a [JUCE Line](http://www.juce.com/api/classLine.html)
-- @classmod juce.Line

--- Constuctor
-- @param x1
-- @param y1
-- @param x2
-- @param y2
-- @within Constructors
-- @constructor
-- @function Line

--- Constuctor
-- @param args
-- @param args.x1
-- @param args.y1
-- @param args.x2
-- @param args.y2
-- @within Constructors
-- @constructor
-- @function Line

local Line = ffi.typeof("Line_float")

local Line_mt = {
-- operator '=='
__eq = function(self, rhs)
return self.x1 == rhs.x1 and
self.y1 == rhs.y1 and
self.x2 == rhs.x2 and
self.y2 == rhs.y2
end;
}
ffi.metatype(Line, Line_mt)


--- Point 1 X position
-- @simplefield x1

--- Point 1 Y position
-- @simplefield y1

--- Point 2 X position
-- @simplefield x2

--- Point 2 Y position
-- @simplefield y2

return Line

+ 586
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/path.lua View File

@@ -0,0 +1,586 @@
--- Path.
-- Is a pointer to a [JUCE Path](http://www.juce.com/api/classPath.html).
-- @classmod juce.Path

local script = require "include/core/script"
local Point = require"include/protojuce/point"
local AffineTransform = require"include/protojuce/affinetransform"
local util = require"include/luautil"
util.requireCdef(script.protoplugDir.."/include/protojuce/cdef/path.h")

--- Constuctor
-- @within Constructors
-- @constructor
-- @function Path

local Path_mt = {
-- methods
__index = {

--- Get bounds.
-- @treturn Rectangle_float rectangle containing the path
-- @function getBounds
getBounds = function (self)
return protolib.Path_getBounds(self)
end;

--- Get bounds transformed.
-- @tparam juce.AffineTransform transform
-- @treturn Rectangle_float rectangle containing the transformed path
-- @function getBoundsTransformed
getBoundsTransformed = function (self, transform)
return protolib.Path_getBoundsTransformed (self, transform)
end;

--- Contains.
-- @param pointX
-- @param pointY
-- @param[opt=1] tolerance
-- @treturn boolean whether the path contains the point
-- @see closeSubPath
-- @function contains

--- Contains.
-- @tparam juce.Point point
-- @param[opt=1] tolerance
-- @treturn boolean whether the path contains the point
-- @see closeSubPath
-- @function contains
contains = function (self, ...)
local control = ...
tolerance = tolerance or 1
if type(control)=="number" then
return protolib.Path_contains (self, ...)
else
return protolib.Path_contains2 (self, ...)
end
end;

--- Intersects line.
-- @tparam juce.Line line
-- @param[opt=1] tolerance
-- @treturn boolean whether the path intersects the line
-- @function intersectsLine
intersectsLine = function (self, line, tolerance)
tolerance = tolerance or 1
return protolib.Path_intersectsLine (self, line, tolerance)
end;

--- Get clipped line.
-- @tparam juce.Line line
-- @tparam boolean keepSectionOutsidePath
-- @treturn juce.Line_float the line clipped by the path
-- @function getClippedLine
getClippedLine = function (self, line, keepSectionOutsidePath)
return protolib.Path_getClippedLine (self, line, keepSectionOutsidePath)
end;

--- Get length.
-- @tparam[opt=juce.AffineTransform.identity] juce.AffineTransform transform
-- @return length of the path
-- @function getLength
getLength = function (self, transform)
transform = transform or AffineTransform.identity
return protolib.Path_getLength (self, transform)
end;

--- Get point along path.
-- @param distanceFromStart
-- @tparam[opt=juce.AffineTransform.identity] juce.AffineTransform transform
-- @treturn Point_float the point on the path
-- @function getPointAlongPath
getPointAlongPath = function (self, distanceFromStart, transform)
transform = transform or AffineTransform.identity
return protolib.Path_getPointAlongPath (self, distanceFromStart, transform)
end;

--- Get nearest point.
-- Get the nearest on-path point to an arbitrary point, and
-- the distance between the points
-- @tparam juce.Point targetPoint
-- @tparam[opt=juce.AffineTransform.identity] juce.AffineTransform transform
-- @return distance
-- @treturn juce.Point pointOnPath
-- @function getNearestPoint
getNearestPoint = function (self, targetPoint,
transform)
transform = transform or AffineTransform.identity
local pointOnPath = Point()
local distance = protolib.Path_getNearestPoint (self, targetPoint,
pointOnPath,
transform)
return distance, pointOnPath
end;

--- Clear.
-- @function clear
clear = function (self)
protolib.Path_clear(self)
end;

--- Start new sub path.
-- @param startX
-- @param startY
-- @function startNewSubPath

--- Start new sub path.
-- @tparam juce.Point start
-- @function startNewSubPath
startNewSubPath = function (self, ...)
local control = ...
if type(control)=="number" then
protolib.Path_startNewSubPath (self, ...)
else
protolib.Path_startNewSubPath2 (self, ...)
end
end;

--- Close sub path.
-- @function closeSubPath
closeSubPath = function (self)
protolib.Path_closeSubPath(self)
end;

--- Line to.
-- @param endX
-- @param endY
-- @function lineTo

--- Line to.
-- @tparam juce.Point endpoint
-- @function lineTo
lineTo = function (self, ...)
local control = ...
if type(control)=="number" then
protolib.Path_lineTo (self, ...)
else
protolib.Path_lineTo2 (self, ...)
end
end;

--- Quadratic to.
-- @param controlPointX
-- @param controlPointY
-- @param endPointX
-- @param endPointY
-- @function quadraticTo

--- Quadratic to2.
-- @tparam juce.Point controlPoint
-- @tparam juce.Point endPoint
-- @function quadraticTo2
quadraticTo = function (self, ...)
local control = ...
if type(control)=="number" then
protolib.Path_quadraticTo (self, ...)
else
protolib.Path_quadraticTo2 (self, ...)
end
end;

--- Cubic to.
-- @param controlPoint1X
-- @param controlPoint1Y
-- @param controlPoint2X
-- @param controlPoint2Y
-- @param endPointX
-- @param endPointY
-- @function cubicTo

--- Cubic to.
-- @tparam juce.Point controlPoint1
-- @tparam juce.Point controlPoint2
-- @tparam juce.Point endPoint
-- @function cubicTo
cubicTo = function (self, ...)
local control = ...
if type(control)=="number" then
protolib.Path_cubicTo (self, ...)
else
protolib.Path_cubicTo2 (self, ...)
end
end;

--- Get current position.
-- @treturn juce.Point the current path construction position
-- @function getCurrentPosition
getCurrentPosition = function (self)
return protolib.Path_getCurrentPosition(self)
end;

--- Add rectangle.
-- @param x
-- @param y
-- @param width
-- @param height
-- @function addRectangle

--- Add rectangle.
-- @tparam juce.Rectangle_float rectangle
-- @function addRectangle
addRectangle = function (self, ...)
local control = ...
if type(control)=="number" then
protolib.Path_addRectangle (self, ...)
else
protolib.Path_addRectangle2 (self, ...)
end
end;

--- Add rounded rectangle.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param cornerSize
-- @function addRoundedRectangle

--- Add rounded rectangle.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param cornerSizeX
-- @param cornerSizeY
-- @function addRoundedRectangle

--- Add rounded rectangle.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param cornerSizeX
-- @param cornerSizeY
-- @tparam boolean curveTopLeft
-- @tparam boolean curveTopRight
-- @tparam boolean curveBottomLeft
-- @tparam boolean curveBottomRight
-- @function addRoundedRectangle

--- Add rounded rectangle.
-- @tparam juce.Rectangle_float rectangle
-- @param cornerSizeX
-- @param cornerSizeY
-- @function addRoundedRectangle

--- Add rounded rectangle.
-- @tparam juce.Rectangle_float rectangle
-- @param cornerSize
-- @function addRoundedRectangle
addRoundedRectangle = function (self, ...)
if select('#',...) == 5 then
protolib.Path_addRoundedRectangle2 (self, ...)
elseif select('#',...) == 6 then
protolib.Path_addRoundedRectangle3 (self, ...)
elseif select('#',...) == 10 then
protolib.Path_addRoundedRectangle4 (self, ...)
elseif select('#',...) == 3 then
protolib.Path_addRoundedRectangle5 (self, ...)
elseif select('#',...) == 2 then
protolib.Path_addRoundedRectangle6 (self, ...)
end
end;

--- Add triangle.
-- @param x1
-- @param y1
-- @param x2
-- @param y2
-- @param x3
-- @param y3
-- @function addTriangle
addTriangle = function (self, x1, y1,
x2, y2,
x3, y3)
protolib.Path_addTriangle (self, x1, y1,
x2, y2,
x3, y3)
end;

--- Add quadrilateral.
-- @param x1
-- @param y1
-- @param x2
-- @param y2
-- @param x3
-- @param y3
-- @param x4
-- @param y4
-- @function addQuadrilateral
addQuadrilateral = function (self, x1, y1,
x2, y2,
x3, y3,
x4, y4)
protolib.Path_addQuadrilateral (self, x1, y1,
x2, y2,
x3, y3,
x4, y4)
end;

--- Add ellipse.
-- @param x
-- @param y
-- @param width
-- @param height
-- @function addEllipse
addEllipse = function (self, x, y, width, height)
protolib.Path_addEllipse (self, x, y, width, height)
end;

--- Add arc.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param fromRadians the start angle, clockwise from the top
-- @param toRadians the end angle
-- @param[opt=false] startAsNewSubPath
-- @function addArc
addArc = function (self, x, y, width, height,
fromRadians,
toRadians, startAsNewSubPath)
startAsNewSubPath = startAsNewSubPath or false
protolib.Path_addArc (self, x, y, width, height,
fromRadians,
toRadians, startAsNewSubPath)
end;

--- Add centred arc.
-- @param centreX
-- @param centreY
-- @param radiusX
-- @param radiusY
-- @param rotationOfEllipse the ellipse inclination
-- @param fromRadians the start angle, clockwise from the top
-- @param toRadians the end angle
-- @param[opt=false] startAsNewSubPath
-- @function addCentredArc
addCentredArc = function (self, centreX, centreY,
radiusX, radiusY,
rotationOfEllipse,
fromRadians,
toRadians, startAsNewSubPath)
startAsNewSubPath = startAsNewSubPath or false
protolib.Path_addCentredArc (self, centreX, centreY,
radiusX, radiusY,
rotationOfEllipse,
fromRadians,
toRadians, startAsNewSubPath)
end;

--- Add pie segment.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param fromRadians the start angle, clockwise from the top
-- @param toRadians the end angle
-- @param[opt=0] innerCircleProportionalSize band proportion size, if specified
-- @function addPieSegment
addPieSegment = function (self, x, y,
width, height,
fromRadians,
toRadians, innerCircleProportionalSize)
innerCircleProportionalSize = innerCircleProportionalSize or 0
protolib.Path_addPieSegment (self, x, y,
width, height,
fromRadians,
toRadians, innerCircleProportionalSize)
end;

--- Add line segment.
-- @tparam juce.Line line
-- @param lineThickness
-- @function addLineSegment
addLineSegment = function (self, line, lineThickness)
protolib.Path_addLineSegment (self, line, lineThickness)
end;

--- Add arrow.
-- @tparam juce.Line line
-- @param lineThickness
-- @param arrowheadWidth
-- @param arrowheadLength
-- @function addArrow
addArrow = function (self, line,
lineThickness,
arrowheadWidth, arrowheadLength)
protolib.Path_addArrow (self, line,
lineThickness,
arrowheadWidth, arrowheadLength)
end;

--- Add polygon.
-- @tparam juce.Point centre
-- @param numberOfSides
-- @param radius
-- @param[opt=0] startAngle
-- @function addPolygon
addPolygon = function (self, centre,
numberOfSides,
radius, startAngle)
startAngle = startAngle or 0
protolib.Path_addPolygon (self, centre,
numberOfSides,
radius, startAngle)
end;

--- Add star.
-- @tparam juce.Point centre
-- @param numberOfPoints
-- @param innerRadius
-- @param outerRadius
-- @param[opt=0] startAngle
-- @function addStar
addStar = function (self, centre,
numberOfPoints,
innerRadius,
outerRadius, startAngle)
startAngle = startAngle or 0
protolib.Path_addStar (self, centre,
numberOfPoints,
innerRadius,
outerRadius, startAngle)
end;

--- Add bubble.
-- @param bodyArea
-- @param maximumArea
-- @param arrowTipPosition
-- @param cornerSize
-- @param arrowBaseWidth
-- @function addBubble
addBubble = function (self, bodyArea,
maximumArea,
arrowTipPosition,
cornerSize, arrowBaseWidth)
protolib.Path_addBubble (self, bodyArea,
maximumArea,
arrowTipPosition,
cornerSize, arrowBaseWidth)
end;

--- Add path.
-- @param pathToAppend
-- @tparam[opt=juce.AffineTransform.identity] juce.AffineTransform transform
-- @function addPath
addPath = function (self, pathToAppend, transformToApply)
if transformToApply then
protolib.Path_addPath2 (self, pathToAppend, transformToApply)
else
protolib.Path_addPath (self, pathToAppend)
end
end;

--- Apply transform.
-- @tparam juce.AffineTransform transform
-- @function applyTransform
applyTransform = function (self, transform)
protolib.Path_applyTransform (self, transform)
end;

--- Scale to fit.
-- @param x
-- @param y
-- @param width
-- @param height
-- @param preserveProportions
-- @function scaleToFit
scaleToFit = function (self, x, y, width, height, preserveProportions)
protolib.Path_scaleToFit (self, x, y, width, height, preserveProportions)
end;

--- Get transform to scale to fit.
-- @param x
-- @param y
-- @param width
-- @param height
-- @tparam boolean preserveProportions
-- @tparam[opt=Justification.centred] juce.Justification justification
-- @treturn juce.AffineTransform the required transform
-- @function getTransformToScaleToFit

--- Get transform to scale to fit.
-- @tparam juce.Rectangle_float area
-- @tparam boolean preserveProportions
-- @tparam[opt=Justification.centred] juce.Justification justification
-- @treturn juce.AffineTransform the required transform
-- @function getTransformToScaleToFit
getTransformToScaleToFit = function (self, ...)
local control = ...
if type(control)=="number" then
return protolib.Path_getTransformToScaleToFit (self, ...)
else
return protolib.Path_getTransformToScaleToFit2 (self, ...)
end
end;

--- Create path with rounded corners.
-- @param cornerRadius
-- @treturn juce.Path the rounded path
-- @function createPathWithRoundedCorners
createPathWithRoundedCorners = function (self, cornerRadius)
return protolib.Path_createPathWithRoundedCorners (self, cornerRadius)
end;

--- Set using non zero winding.
-- @tparam boolean isNonZeroWinding
-- @function setUsingNonZeroWinding
setUsingNonZeroWinding = function (self, isNonZeroWinding)
protolib.Path_setUsingNonZeroWinding (self, isNonZeroWinding)
end;

--- Is using non zero winding.
-- @treturn boolean whether the path is using non-zero winding
-- @function isUsingNonZeroWinding
isUsingNonZeroWinding = function (self)
return protolib.Path_isUsingNonZeroWinding(self)
end;

toString = function (self, dest, bufSize)
protolib.Path_toString(self, dest, bufSize)
end;

restoreFromString = function (self, src)
protolib.Path_restoreFromString (self, src)
end;
}
}

ffi.metatype("pPath", Path_mt)


local Line = ffi.typeof("Line_float")

local Path = {
--- Joint styles.
-- for use with @{juce.Graphics.strokePath}
-- @table juce.Path.JointStyle
JointStyle =
{
mitered = 0;
curved = 1;
beveled = 2
};
--- End cap styles.
-- for use with @{juce.Graphics.strokePath}
-- @table juce.Path.EndCapStyle
EndCapStyle =
{
butt = 0;
square = 1;
rounded = 2
}
};

Path = setmetatable(Path,{
-- constructor
__call = function ()
return ffi.gc(
protolib.Path_new(),
protolib.Path_delete
)
end;
})

return Path

+ 37
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/point.lua View File

@@ -0,0 +1,37 @@
--- Point.
-- Is converted to a [JUCE Point](http://www.juce.com/api/classPoint.html)
-- @classmod juce.Point

--- Constuctor
-- @param x
-- @param y
-- @within Constructors
-- @constructor
-- @function Point

--- Constuctor
-- @param args
-- @param args.x
-- @param args.y
-- @within Constructors
-- @constructor
-- @function Point

local Point = ffi.typeof("Point_float")

local Point_mt = {
-- operator '=='
__eq = function(self, rhs)
return self.x == rhs.x and
self.y == rhs.y
end;
}
ffi.metatype(Point, Point_mt)

--- Point X position
-- @simplefield x

--- Point Y position
-- @simplefield y

return Point

+ 89
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/rectangle_float.lua View File

@@ -0,0 +1,89 @@
--- A floating-point (sub-pixel) rectangle.
-- Is converted to a [JUCE Rectangle](http://www.juce.com/api/classRectangle.html)
-- @classmod juce.Rectangle_float

--- Constuctor with classical arguments.
-- @param x left position
-- @param y top position
-- @param w width
-- @param h height
-- @within Constructors
-- @constructor
-- @function Rectangle_float

--- Constuctor with named arguments.
-- Every field is optional.
-- @tparam table args
-- @param args.x left position
-- @param args.y top position
-- @param args.w width
-- @param args.h height
-- @within Constructors
-- @constructor
-- @function Rectangle_float

local Rectangle_float = ffi.typeof("Rectangle_float")

local Rectangle_int = {} -- circular dependency technique

local Rectangle_float_mt = {
-- operator '=='
__eq = function(self, rhs)
return self.x == rhs.x and
self.y == rhs.y and
self.w == rhs.w and
self.h == rhs.h
end;
-- methods
__index = {
--- To int.
-- Convert to a pixel-aligned rectangle
-- @treturn juce.Rectangle_int
-- @function toInt
toInt = function (self)
Rectangle_int = Rectangle_float or require"include/protojuce/rectangle_int"
return Rectangle_int {
self.x, self.y, self.w, self.h
}
end;
--- Contains.
-- @tparam juce.Point point
-- @treturn boolean whether the rectangle contains the point
-- @function contains
contains = function (self, p)
return p.x>=self.x and p.x<=(self.x+self.w) and
p.y>=self.y and p.y<=(self.y+self.h)
end;
--- Get right.
-- @return the rectangle's right position on the X axis
-- @function getR
getR = function (self)
return self.x + self.w
end;
--- Get bottom.
-- @return the rectangle's bottom position on the Y axis
-- @function getB
getB = function (self)
return self.y + self.h
end;
};
}
ffi.metatype(Rectangle_float, Rectangle_float_mt)

--- Left position
-- @simplefield x

--- Top position
-- @simplefield y

--- Width
-- @simplefield w

--- Height
-- @simplefield h

return Rectangle_float

+ 89
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/rectangle_int.lua View File

@@ -0,0 +1,89 @@
--- An integer (pixel-aligned) rectangle.
-- Is converted to a [JUCE Rectangle](http://www.juce.com/api/classRectangle.html)
-- @classmod juce.Rectangle_int

--- Constuctor with classical arguments.
-- @param x left position
-- @param y top position
-- @param w width
-- @param h height
-- @within Constructors
-- @constructor
-- @function Rectangle_int

--- Constuctor with named arguments.
-- Every field is optional.
-- @tparam table args
-- @param args.x left position
-- @param args.y top position
-- @param args.w width
-- @param args.h height
-- @within Constructors
-- @constructor
-- @function Rectangle_int

local Rectangle_int = ffi.typeof("Rectangle_int")

local Rectangle_float = {} -- circular dependency technique

local Rectangle_int_mt = {
-- operator '=='
__eq = function(self, rhs)
return self.x == rhs.x and
self.y == rhs.y and
self.w == rhs.w and
self.h == rhs.h
end;
-- methods
__index = {
--- To float.
-- Convert to a sub-pixel rectangle
-- @treturn juce.Rectangle_float
-- @function toFloat
toFloat = function (self)
Rectangle_float = Rectangle_float or require"include/protojuce/rectangle_float"
return Rectangle_float {
self.x, self.y, self.w, self.h
}
end;
--- Contains.
-- @tparam juce.Point point
-- @treturn boolean whether the rectangle contains the point
-- @function contains
contains = function (self, p)
return p.x>=self.x and p.x<=(self.x+self.w) and
p.y>=self.y and p.y<=(self.y+self.h)
end;
--- Get right.
-- @return the rectangle's right position on the X axis
-- @function getR
getR = function (self)
return self.x + self.w
end;
--- Get bottom.
-- @return the rectangle's bottom position on the Y axis
-- @function getB
getB = function (self)
return self.y + self.h
end;
};
}
ffi.metatype(Rectangle_int, Rectangle_int_mt)

--- Left position
-- @simplefield x

--- Top position
-- @simplefield y

--- Width
-- @simplefield w

--- Height
-- @simplefield h

return Rectangle_int

+ 22
- 0
ports/protoplug/ProtoplugFiles/include/protojuce/rectangleplacement.lua View File

@@ -0,0 +1,22 @@
--- Rectangle Placement.
-- Is converted to a [JUCE RectanglePlacement](http://www.juce.com/api/RectanglePlacement.html)
-- @classmod juce.RectanglePlacement

--- Rectangle Placement Constants.
-- @table juce.RectanglePlacement
local r = {
xLeft = 1;
xRight = 2;
xMid = 4;
yTop = 8;
yBottom = 16;
yMid = 32;
stretchToFit = 64;
fillDestination = 128;
onlyReduceInSize = 256;
onlyIncreaseInSize = 512;
doNotResize = 768;
centred = 4 + 32
}

return r

+ 19
- 0
ports/protoplug/ProtoplugFiles/include/protoplug.lua View File

@@ -0,0 +1,19 @@
-- protoplug.lua
-- basic globals for every protoplug script

-- luaJIT
ffi = require "ffi"
bit = require "bit"

-- load protoplug as a dynamic library using ffi
protolib = ffi.load(protoplug_path)

juce = require "include/protojuce"

midi = require "include/core/midi"
script = require "include/core/script"
plugin = require "include/core/plugin"
gui = require "include/core/gui"
polyGen = require "include/core/polygen"
stereoFx = require "include/core/stereofx"


+ 38
- 0
ports/protoplug/ProtoplugFiles/prefs.default.xml View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
prefs.default.xml
Protoplug doesn't actually use this file. If you want to customize
keyboard shorctus, make a copy of this file, call it "prefs.xml",
and modify that file instead. Future releases of protoplug will
only overwrite "prefs.default.xml" and you'll keep your custom settings.
-->

<KEYMAPPINGS basedOnDefaults="0">
<MAPPING commandId="10" description="Compile Now" key="ctrl + return"/>
<MAPPING commandId="30" description="Show Code"/>
<MAPPING commandId="31" description="Show Parameters"/>
<MAPPING commandId="32" description="Show Custom GUI"/>
<MAPPING commandId="40" description="Show Next" key="ctrl + tab"/>
<MAPPING commandId="41" description="Show Previous" key="ctrl + shift + tab"/>
<MAPPING commandId="50" description="Open"/>
<MAPPING commandId="51" description="Save As"/>
<MAPPING commandId="60" description="Pop Out"/>
<MAPPING commandId="61" description="Always On Top"/>
<MAPPING commandId="70" description="Help"/>
<MAPPING commandId="25" description="Find Selected" key="ctrl + F3"/>
<MAPPING commandId="26" description="Find Next" key="F3"/>
<MAPPING commandId="27" description="Find Previous" key="shift + F3"/>
</KEYMAPPINGS>

<!--
if you're using this as a reference, perhaps i should mention :
change font size : ctrl + mouse wheel
and the JUCE editor shortcuts :
cut : ctrl + x
copy : ctrl + c
paste : ctrl + v
undo : ctrl + z
redo : ctrl + y
(not customisable as of this release)
-->

+ 22
- 0
ports/protoplug/ProtoplugFiles/themes/SciTE black mod.xml View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<theme>
<color target="Default" hex="FFeeeeee"/>
<color target="Background" hex="FF000000"/>
<color target="Highlight" hex="FF101050"/>
<color target="Margintext" hex="ff488f8f"/>
<color target="Marginback" hex="ff181818"/>
<color target="Caret" hex="FFFFFFFF"/>
<color target="Comment" hex="ff00FF00"/>
<color target="Integer" hex="ffFF00FF"/>
<color target="Float" hex="ffFF00FF"/>
<color target="Keyword" hex="ff40a0FF"/>
<color target="String" hex="ffFF9D00"/>
<color target="Operator" hex="ff989898"/>
<color target="Punctuation" hex="ff989898"/>
<color target="Bracket" hex="ff989898"/>
<color target="Error" hex="ff989898"/>
<font priority="1" typeface="Lucida Console" size="15" hinted="true"/>
</theme>

+ 21
- 0
ports/protoplug/ProtoplugFiles/themes/juce default.xml View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<theme>
<color target="Default" hex="FF000000"/>
<color target="Background" hex="FFffffff"/>
<color target="Highlight" hex="FFeeeeff"/>
<color target="Margintext" hex="FF888880"/>
<color target="Marginback" hex="ffcccccc"/>
<color target="Caret" hex="FF000000"/>
<color target="Comment" hex="ff3c3c3c"/>
<color target="Integer" hex="ff880000"/>
<color target="Float" hex="ff885500"/>
<color target="Keyword" hex="ff0000cc"/>
<color target="String" hex="ff990099"/>
<color target="Operator" hex="ff225500"/>
<color target="Punctuation" hex="ff225500"/>
<color target="Bracket" hex="ff000055"/>
<color target="Error" hex="ff225500"/>

</theme>

+ 22
- 0
ports/protoplug/ProtoplugFiles/themes/npp blackboard.xml View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<theme>
<color target="Default" hex="FFF8F8F8"/>
<color target="Background" hex="FF0C1021"/>
<color target="Highlight" hex="FF253B76"/>
<color target="Margintext" hex="FF888880"/>
<color target="Marginback" hex="FF2E3436"/>
<color target="Caret" hex="FFFFFFFF"/>
<color target="Comment" hex="FFAEAEAE"/>
<color target="Integer" hex="FFD8FA3C"/>
<color target="Float" hex="FFD8FA3C"/>
<color target="Keyword" hex="FFFBDE2D"/>
<color target="String" hex="FF61CE3C"/>
<color target="Operator" hex="FFFBDE2D"/>
<color target="Bracket" hex="FFFBDE2D"/>
<color target="Punctuation" hex="FFFBDE2D"/>
<color target="Error" hex="FFFFCC00"/>

<font priority="1" typeface="DejaVu Sans Mono" size="15" hinted="true"/>
</theme>

+ 22
- 0
ports/protoplug/ProtoplugFiles/themes/npp default.xml View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<theme>
<color target="Default" hex="FF000000"/>
<color target="Background" hex="FFffffff"/>
<color target="Highlight" hex="FFC0C0C0"/>
<color target="Margintext" hex="ff888880"/>
<color target="Marginback" hex="ffeeeeee"/>
<color target="Caret" hex="FF000000"/>
<color target="Comment" hex="ff008000"/>
<color target="Integer" hex="ffFF8000"/>
<color target="Float" hex="ffFF8000"/>
<color target="Keyword" hex="ff0000FF"/>
<color target="String" hex="ff808080"/>
<color target="Operator" hex="ff000080"/>
<color target="Punctuation" hex="ff000080"/>
<color target="Bracket" hex="ff000080"/>
<color target="Error" hex="ffaa5500"/>
<font priority="1" typeface="Source Code Pro" size="15" hinted="true"/>
</theme>

+ 22
- 0
ports/protoplug/ProtoplugFiles/themes/npp hello kitty.xml View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<theme>
<color target="Default" hex="FF000000"/>
<color target="Background" hex="FFFFB0FF"/>
<color target="Highlight" hex="FFFFD5FF"/>
<color target="Margintext" hex="ffFFFFFF"/>
<color target="Marginback" hex="ffFF80FF"/>
<color target="Caret" hex="FFFFFFFF"/>
<color target="Comment" hex="ff008000"/>
<color target="Integer" hex="ffFF0000"/>
<color target="Float" hex="ffFF0000"/>
<color target="Keyword" hex="ff0000FF"/>
<color target="String" hex="ff808080"/>
<color target="Operator" hex="ff000080"/>
<color target="Punctuation" hex="ff000080"/>
<color target="Bracket" hex="ff000080"/>
<color target="Error" hex="ffaa5500"/>
<font priority="1" typeface="Source Code Pro" size="16" hinted="true"/>
</theme>

+ 22
- 0
ports/protoplug/ProtoplugFiles/themes/npp mono industrial.xml View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<theme>
<color target="Default" hex="FFFFFFFF"/>
<color target="Background" hex="FF222C28"/>
<color target="Highlight" hex="FF919994"/>
<color target="Margintext" hex="ff999999"/>
<color target="Marginback" hex="ff2E3436"/>
<color target="Caret" hex="FFFFFFFF"/>
<color target="Comment" hex="ff666C68"/>
<color target="Integer" hex="ffE98800"/>
<color target="Float" hex="ffE98800"/>
<color target="Keyword" hex="ffC23B00"/>
<color target="String" hex="ffFFFFFF"/>
<color target="Operator" hex="ffA8B3AB"/>
<color target="Punctuation" hex="ffA8B3AB"/>
<color target="Bracket" hex="ffA8B3AB"/>
<color target="Error" hex="ffaa5500"/>
<font priority="1" typeface="DejaVu Sans Mono" size="15" hinted="true"/>
</theme>

+ 71
- 0
ports/protoplug/Source/BinaryData.cpp View File

@@ -0,0 +1,71 @@
/* ==================================== JUCER_BINARY_RESOURCE ====================================

This is an auto-generated file: Any edits you make may be overwritten!

*/

namespace BinaryData
{

//================== lua-16.png ==================
static const unsigned char temp_binary_data_0[] =
{ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,16,0,0,0,16,8,6,0,0,0,31,243,255,97,0,0,1,24,73,68,65,84,56,141,149,147,61,78,3,49,16,133,223,216,102,181,252,72,81,138,40,74,131,4,71,200,17,16,53,125,202,228,14,72,217,2,25,87,4,137,75,80,114,11,10,
106,238,145,52,9,18,18,171,104,226,161,8,113,204,254,37,251,26,91,99,127,207,51,242,12,161,165,140,113,83,102,255,180,221,171,140,218,26,0,86,254,25,54,189,176,143,169,140,217,206,170,236,104,127,169,12,198,82,138,62,147,68,61,51,203,117,92,130,58,4,
143,199,87,16,121,196,102,99,135,163,209,229,27,0,36,201,201,93,167,147,14,153,237,140,170,234,138,181,88,220,163,215,59,7,0,204,231,223,24,12,94,126,68,220,89,200,204,24,55,173,131,1,4,24,0,250,253,11,136,224,52,102,84,83,221,0,48,153,188,150,246,49,
67,77,233,239,212,237,166,16,1,86,171,60,138,58,2,42,190,177,74,203,101,94,123,166,142,49,40,138,136,56,24,24,163,178,182,6,90,211,67,48,219,46,86,210,212,32,207,185,142,41,200,133,6,252,107,36,149,173,215,252,117,12,90,204,88,3,128,247,239,31,90,223,
192,123,185,61,4,23,103,162,52,141,81,91,203,238,188,105,152,126,1,241,29,109,224,248,198,121,57,0,0,0,0,73,69,78,68,174,66,96,130,0,0 };

const char* lua16_png = (const char*) temp_binary_data_0;

//================== lua-32.png ==================
static const unsigned char temp_binary_data_1[] =
{ 137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,32,0,0,0,32,8,6,0,0,0,115,122,122,244,0,0,5,54,73,68,65,84,88,133,189,150,107,108,83,101,24,199,255,239,123,78,47,235,122,177,237,202,50,24,142,49,32,97,42,48,8,226,5,89,100,16,65,72,70,204,8,32,137,
132,24,3,146,8,209,152,176,193,88,41,12,8,160,120,201,34,16,140,176,15,106,36,40,34,36,154,96,2,36,98,48,192,46,162,136,72,22,182,193,230,24,237,232,189,61,59,231,60,126,88,90,183,222,104,65,124,62,157,247,185,253,254,231,205,123,99,248,31,204,110,223,
109,242,251,163,47,9,2,115,136,34,107,245,251,235,47,196,98,236,81,195,117,186,237,243,36,73,254,130,8,142,56,148,241,31,172,86,117,153,199,227,242,241,71,9,183,217,26,199,72,146,252,205,112,56,0,16,169,11,124,62,254,9,0,60,82,1,129,128,178,138,8,166,
84,49,69,81,151,143,30,189,211,46,102,219,172,184,248,125,219,157,59,225,89,170,42,79,34,130,13,32,98,140,185,181,90,225,47,135,195,120,161,179,243,237,123,201,16,140,75,215,143,8,66,48,40,148,100,20,176,116,233,81,225,228,201,107,75,37,73,89,123,251,
182,111,54,17,132,132,54,144,101,25,93,93,30,89,20,157,103,52,26,225,64,56,172,124,11,184,84,0,96,12,29,233,122,51,166,202,38,147,120,51,237,34,212,235,93,207,75,18,29,80,85,122,50,147,200,68,227,156,181,232,116,108,109,56,236,188,88,80,208,88,228,118,
15,254,65,4,75,98,158,32,176,35,138,178,117,117,202,53,160,213,186,106,163,81,245,92,174,112,0,80,85,154,30,137,168,231,181,90,215,250,187,119,235,123,13,6,113,9,231,236,239,225,57,162,200,191,179,217,10,222,2,82,108,67,65,216,186,87,81,232,221,92,160,
99,198,152,177,106,213,84,148,150,90,209,209,49,128,230,230,54,244,244,248,145,151,39,238,8,135,183,212,23,21,29,52,184,221,253,85,68,170,221,96,208,180,123,189,117,173,177,218,17,2,180,218,109,27,36,73,249,48,23,120,85,85,41,142,31,95,14,147,73,23,247,
249,124,81,84,87,127,137,179,103,111,66,167,19,222,136,70,27,62,77,87,31,23,96,48,108,155,26,14,43,23,137,160,201,22,110,52,106,209,209,177,1,14,71,126,82,172,175,47,128,178,178,143,16,10,13,134,141,70,161,194,239,111,248,51,85,143,248,26,136,68,212,
143,115,129,3,192,252,249,101,41,225,0,80,88,104,68,85,213,120,16,33,47,16,80,62,72,215,131,15,253,201,142,74,85,165,57,185,192,1,160,160,192,144,49,110,183,15,197,137,176,208,98,217,53,35,173,128,72,68,126,61,87,56,0,180,182,246,102,140,183,181,253,
187,248,3,1,41,37,131,59,157,78,174,170,234,203,15,34,224,210,165,30,156,58,117,61,101,236,196,137,107,9,2,105,81,74,1,251,246,9,101,170,10,123,204,161,209,8,88,184,112,34,4,33,187,107,98,197,138,99,104,110,110,131,44,171,0,0,89,86,113,248,112,43,86,
174,252,122,68,158,162,208,227,5,5,251,138,18,235,153,193,176,125,65,40,36,127,31,115,88,173,121,240,120,54,194,100,218,137,64,64,202,74,196,80,157,30,99,199,90,208,213,229,197,189,123,145,148,57,122,189,248,66,36,178,229,167,225,62,49,18,33,115,214,
148,12,54,48,16,193,192,64,106,112,204,6,7,213,164,155,145,139,34,228,108,33,155,55,207,65,77,77,121,124,92,91,59,27,203,150,13,157,214,115,231,150,226,202,149,117,240,120,54,162,187,251,29,172,94,93,145,170,69,18,139,107,181,66,127,182,2,26,27,231,198,
183,22,0,236,218,53,47,190,21,155,154,22,193,233,60,3,155,109,55,106,106,190,194,158,61,243,147,234,117,186,100,150,104,54,179,171,193,32,136,232,225,158,103,21,21,251,161,40,132,113,227,30,195,196,137,118,232,245,35,111,122,198,152,108,177,56,174,135,
66,35,235,120,79,207,38,55,99,248,237,97,224,0,208,212,84,9,183,123,35,218,219,223,196,228,201,142,164,56,99,116,177,183,119,77,40,209,47,2,128,40,242,99,146,164,62,149,13,136,165,152,167,9,19,108,168,174,158,129,162,162,247,16,10,13,194,106,213,99,253,
250,89,35,65,34,63,38,165,216,84,34,0,152,205,194,33,183,91,174,35,226,250,88,192,229,122,17,146,164,196,19,143,30,29,154,36,34,160,162,162,8,45,45,107,208,223,31,4,0,248,253,18,116,58,17,149,149,37,112,187,195,56,125,250,53,136,34,71,73,137,5,157,157,
94,112,206,2,163,70,25,143,220,186,149,225,207,52,154,173,187,1,39,233,245,219,233,208,161,115,148,104,229,229,77,100,52,238,136,143,235,234,126,36,34,162,105,211,246,19,224,164,197,139,63,39,175,55,66,94,111,132,102,206,60,72,87,175,246,147,215,27,33,
192,73,90,173,171,33,237,140,198,62,10,11,247,230,247,247,7,91,84,149,38,101,208,153,179,113,206,126,29,63,222,250,244,141,27,27,162,25,5,0,64,126,254,182,39,194,97,229,188,170,38,191,225,30,196,24,99,119,77,38,237,179,62,223,166,27,105,5,14,31,4,131,
13,191,235,116,154,5,156,51,207,127,0,191,35,138,124,94,38,120,146,0,0,8,135,235,47,228,231,243,103,56,71,107,170,130,108,140,115,252,98,54,235,102,13,14,54,180,223,47,87,72,229,148,164,51,158,233,211,95,253,204,237,14,13,16,161,130,8,169,159,61,201,
224,94,65,224,181,138,82,190,46,26,93,59,144,77,205,125,79,191,146,18,167,190,175,79,120,69,150,105,9,145,250,156,162,96,116,172,142,49,16,231,172,155,49,252,44,138,252,120,113,177,229,68,186,197,246,192,2,18,109,202,148,189,249,221,221,17,27,99,26,42,
45,181,122,46,95,78,62,221,114,177,127,0,23,64,50,140,198,53,156,205,0,0,0,0,73,69,78,68,174,66,96,130,0,0 };

const char* lua32_png = (const char*) temp_binary_data_1;


const char* getNamedResource (const char*, int&) throw();
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) throw()
{
unsigned int hash = 0;
if (resourceNameUTF8 != 0)
while (*resourceNameUTF8 != 0)
hash = 31 * hash + (unsigned int) *resourceNameUTF8++;

switch (hash)
{
case 0x68c81707: numBytes = 337; return lua16_png;
case 0x6bf96a41: numBytes = 1391; return lua32_png;
default: break;
}

numBytes = 0;
return 0;
}

const char* namedResourceList[] =
{
"lua16_png",
"lua32_png"
};

}

+ 29
- 0
ports/protoplug/Source/BinaryData.h View File

@@ -0,0 +1,29 @@
/* =========================================================================================

This is an auto-generated file: Any edits you make may be overwritten!

*/

#ifndef BINARYDATA_H_17170897_INCLUDED
#define BINARYDATA_H_17170897_INCLUDED

namespace BinaryData
{
extern const char* lua16_png;
const int lua16_pngSize = 337;

extern const char* lua32_png;
const int lua32_pngSize = 1391;

// Points to the start of a list of resource names.
extern const char* namedResourceList[];

// Number of elements in the namedResourceList array.
const int namedResourceListSize = 2;

// If you provide the name of one of the binary resource variables above, this function will
// return the corresponding data and its size (or a null pointer if the name isn't found).
const char* getNamedResource (const char* resourceNameUTF8, int& dataSizeInBytes) throw();
}

#endif

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save