<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.simtx.net/index.php?action=history&amp;feed=atom&amp;title=Creating_Lua_extensions</id>
	<title>Creating Lua extensions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.simtx.net/index.php?action=history&amp;feed=atom&amp;title=Creating_Lua_extensions"/>
	<link rel="alternate" type="text/html" href="https://wiki.simtx.net/index.php?title=Creating_Lua_extensions&amp;action=history"/>
	<updated>2026-08-06T11:09:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.simtx.net/index.php?title=Creating_Lua_extensions&amp;diff=565&amp;oldid=prev</id>
		<title>Clanker: Add and update user documentation for Lua extensions and the catalog</title>
		<link rel="alternate" type="text/html" href="https://wiki.simtx.net/index.php?title=Creating_Lua_extensions&amp;diff=565&amp;oldid=prev"/>
		<updated>2026-08-06T09:12:23Z</updated>

		<summary type="html">&lt;p&gt;Add and update user documentation for Lua extensions and the catalog&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A SimTX Lua extension is a folder containing an &amp;lt;code&amp;gt;extension.properties&amp;lt;/code&amp;gt; manifest and one or more Lua files. The graphical creator is the usual starting point because it produces a valid manifest and an editable example.&lt;br /&gt;
&lt;br /&gt;
== Creating a package ==&lt;br /&gt;
# Open &amp;#039;&amp;#039;&amp;#039;Extensions&amp;#039;&amp;#039;&amp;#039; in the transmitter footer.&lt;br /&gt;
# Select &amp;#039;&amp;#039;&amp;#039;Create extension&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# Enter a stable package ID, display name, semantic version, API version, entry file, types, and description.&lt;br /&gt;
# Add dependencies or exported modules when the package uses them.&lt;br /&gt;
# Select &amp;#039;&amp;#039;&amp;#039;Create&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
# Select the package in the &amp;#039;&amp;#039;&amp;#039;Installed&amp;#039;&amp;#039;&amp;#039; tab and use &amp;#039;&amp;#039;&amp;#039;Edit package&amp;#039;&amp;#039;&amp;#039;, or open the user folder in an external text editor.&lt;br /&gt;
# Select &amp;#039;&amp;#039;&amp;#039;Reload now&amp;#039;&amp;#039;&amp;#039; after saving changes. Loading errors appear in the &amp;#039;&amp;#039;&amp;#039;Problems&amp;#039;&amp;#039;&amp;#039; tab.&lt;br /&gt;
&lt;br /&gt;
The stable package ID cannot be changed in the built-in editor after creation. A new package should therefore use an identifier controlled by its author, such as &amp;lt;code&amp;gt;net.example.voice-tools&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Minimal audio add-on ==&lt;br /&gt;
The following package supplies one gain control and processes the selected audio source.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;extension.properties&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;ini&amp;quot;&amp;gt;&lt;br /&gt;
id=net.example.gain&lt;br /&gt;
name=Gain Example&lt;br /&gt;
version=1.0.0&lt;br /&gt;
api=1&lt;br /&gt;
entry=init.lua&lt;br /&gt;
types=audio-addon&lt;br /&gt;
description=Applies adjustable gain to mono audio.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;init.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
simtx.require_api(1)&lt;br /&gt;
&lt;br /&gt;
simtx.addon {&lt;br /&gt;
  name = &amp;quot;Gain&amp;quot;,&lt;br /&gt;
  description = &amp;quot;Applies adjustable gain to mono audio.&amp;quot;,&lt;br /&gt;
  controls = {&lt;br /&gt;
    simtx.controls.slider(&amp;quot;gain&amp;quot;, {&lt;br /&gt;
      label = &amp;quot;Gain&amp;quot;, unit = &amp;quot;x&amp;quot;,&lt;br /&gt;
      min = 0, max = 2, step = 0.01, default = 1,&lt;br /&gt;
    }),&lt;br /&gt;
  },&lt;br /&gt;
  process = function(audio, ctx)&lt;br /&gt;
    audio:gain(ctx:control(&amp;quot;gain&amp;quot;))&lt;br /&gt;
    audio:limit(1)&lt;br /&gt;
  end,&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Package layout ==&lt;br /&gt;
Only the file named by &amp;lt;code&amp;gt;entry&amp;lt;/code&amp;gt; is run as the package entry point. Other Lua files are modules and are loaded with &amp;lt;code&amp;gt;require&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
gain-package/&lt;br /&gt;
  extension.properties&lt;br /&gt;
  init.lua&lt;br /&gt;
  filters.lua&lt;br /&gt;
  codec/&lt;br /&gt;
    tone.lua&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within the same package, &amp;lt;code&amp;gt;require(&amp;quot;filters&amp;quot;)&amp;lt;/code&amp;gt; loads &amp;lt;code&amp;gt;filters.lua&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;require(&amp;quot;codec.tone&amp;quot;)&amp;lt;/code&amp;gt; loads &amp;lt;code&amp;gt;codec/tone.lua&amp;lt;/code&amp;gt;. A module should return its public value. A module that returns no value is treated as returning &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Development cycle ==&lt;br /&gt;
The entry file registers features when the package is loaded. Each running modulation or audio add-on session receives an isolated copy of the script state. Values declared as controls remain live, so an operator may adjust them during transmission.&lt;br /&gt;
&lt;br /&gt;
A practical development cycle is:&lt;br /&gt;
# Begin with one of the supplied examples or the generated template.&lt;br /&gt;
# Keep the manifest &amp;lt;code&amp;gt;types&amp;lt;/code&amp;gt; list consistent with the registrations in the entry file.&lt;br /&gt;
# Reload the package and inspect the &amp;#039;&amp;#039;&amp;#039;Problems&amp;#039;&amp;#039;&amp;#039; tab.&lt;br /&gt;
# Test controls and required inputs before transmitting.&lt;br /&gt;
# Use &amp;#039;&amp;#039;&amp;#039;Catalog&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Preview Selected&amp;#039;&amp;#039;&amp;#039; to review the exact shared files before or after publication.&lt;br /&gt;
&lt;br /&gt;
== Publishing ==&lt;br /&gt;
The package can be shared with &amp;#039;&amp;#039;&amp;#039;Catalog&amp;#039;&amp;#039;&amp;#039; &amp;gt; &amp;#039;&amp;#039;&amp;#039;Share Extension Folder...&amp;#039;&amp;#039;&amp;#039;. Publishing requires a linked access token in the transmitter&amp;#039;s &amp;#039;&amp;#039;&amp;#039;Token&amp;#039;&amp;#039;&amp;#039; field. [[Extension catalog]] describes publication, categories, revisions, and updates.&lt;br /&gt;
&lt;br /&gt;
== Further reference ==&lt;br /&gt;
* [[Lua extension manifest]] lists every manifest field and version range.&lt;br /&gt;
* [[Lua extension API]] lists registration tables, controls, inputs, helper functions, and aliases.&lt;br /&gt;
* [[Lua modulation API]], [[Lua audio add-on API]], [[Lua action API]], and [[Lua theme API]] describe each extension type.&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua extensions]]&lt;/div&gt;</summary>
		<author><name>Clanker</name></author>
	</entry>
</feed>