Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 11, 2024
2 parents 47e05c1 + 59b25d6 commit 8f655b8
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>audio_emitter_get_pitch</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>audio_emitter_pitch</title>
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<link rel="stylesheet" href="../../../../../assets/css/default.css" type="text/css" />
<script src="../../../../../assets/scripts/main_script.js"></script>
<meta name="rh-authors" content="Mark Alexander" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,22 @@ <h1><span data-field="title" data-format="default">Audio Properties Overview</sp
<tr>
<td>Result</td>
<td style="">G<sub>asset</sub> * G<sub>group</sub> * G<sub>emitter</sub> * G<sub>instance</sub></td>
<td style="">P<sub>asset</sub> * P<sub>emitter</sub> * P<sub>instance</sub></td>
<td style="">P<sub>asset</sub> * P<sub>emitter</sub> * P<sub>instance</sub> (might be clipped, see <a data-xref="{text}" href="Audio_Properties.htm#pitch">Pitch</a>)</td>
<td>Asset-level offset unless instance-level offset is passed to the <span class="inline2">audio_play_sound_*</span> functions</td>
<td>M<sub>emitter</sub> &amp; M<sub>instance</sub> (bitwise AND, see <a data-xref="{title}" href="../../../../Additional_Information/Bitwise_Operators.htm">Bitwise Operators</a>)</td>
</tr>
</tbody>
</table>
<div data-conref="../../../../assets/snippets/Note_Audio_Device_OS_Might_Normalise_Audio.hts"> </div>
<h2>Notes</h2>
<h2 id="notes">Notes</h2>
<h3 id="gain">Gain</h3>
<div data-conref="../../../../assets/snippets/Note_Sound_Editor_Volume_Is_Asset_Gain.hts"> </div>
<p>This can still be changed in-game later by calling <span class="inline2"><a data-xref="{title}" href="audio_sound_gain.htm">audio_sound_gain</a></span> with the sound <em>asset</em> ID as the argument: </p>
<p class="code">audio_sound_gain(snd_Explode, 0, 0);  // Set the asset-level gain to 0 (new instances of this sound play muted)</p>
<p class="code">audio_sound_gain(snd_Explode, 0, 0);  // Set the asset-level gain to 0 (new and existing instances of this sound are muted)</p>
<h3 id="pitch">Pitch</h3>
<p>The resulting <em>source</em> pitch has a lower limit of <span data-keyref="Const_Audio_Pitch_Min">1/256</span> (-8 octaves) for all sounds. It has an upper limit dependent on the compression type of the sound - uncompressed sounds have an upper limit of <span data-keyref="Const_Audio_Pitch_Max_Uncompressed">256</span> (+8 octaves), but compressed sounds have a limit of <span data-keyref="Const_Audio_Pitch_Max_Compressed">4</span> (+2 octaves).</p>
<p>If the source pitch is clipped, a warning message will be printed to the console. If the source pitch is clipped on the upper bound for a compressed sound, a note will also be printed to the console pointing out that they have a lower upper limit than uncompressed sounds.</p>
<p class="note" dir="auto"><span data-conref="../../../../assets/snippets/Tag_note.hts"> </span> On HTML5, uncompressed sounds and compressed sounds have the same range of <span class="inline2"><span data-keyref="Const_Audio_Pitch_Min">1/256</span></span> to <span class="inline2"><span data-keyref="Const_Audio_Pitch_Max_HTML5">256</span></span>. Because of this, there is no specific warning for clipping a compressed sound on the upper bound.</p>
<p> </p>
<p> </p>
<div class="footer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1><span data-field="title" data-format="default">is_instanceof</span></h1>
<p class="note"><span data-conref="../../../assets/snippets/Tag_note.hts"> </span> If you use <span class="inline3_func"><a data-xref="{title}" href="static_set.htm">static_set</a></span> to replace the static chain of a struct, it will modify the behaviour of this function on that struct, as it checks the static chain to determine inheritance. Using <span class="inline3_func"><a data-xref="{title}" href="static_set.htm">static_set</a></span> is not recommended aside from deserialisation cases where an anonymous struct is loaded back as part of a hierarchy.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">is_instanceof</span>(struct, constructor_name);</p>
<p class="code"><span data-field="title" data-format="default">is_instanceof</span>(struct, constructor);</p>
<table>
<colgroup>
<col />
Expand All @@ -36,19 +36,19 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>struct</td>
<td><span data-keyref="Type_Struct"><a href="../../../../GameMaker_Language/GML_Overview/Structs.htm" target="_blank">Struct</a></span></td>
<td><span data-keyref="Type_Struct"><a href="../../GML_Overview/Structs.htm" target="_blank">Struct</a></span></td>
<td>The struct to check (the &quot;instance&quot;)</td>
</tr>
<tr>
<td>constructor_name</td>
<td><span data-keyref="Type_Function"><a href="../../../../GameMaker_Language/GML_Overview/Script_Functions.htm" target="_blank">Function</a></span></td>
<td>constructor</td>
<td><span data-keyref="Type_Function"><a href="../../GML_Overview/Script_Functions.htm" target="_blank">Function</a></span></td>
<td>The constructor to check (is the struct an <strong>instance of</strong> this constructor?)</td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Bool"><a href="../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">Boolean</a></span></p>
<p class="code"><span data-keyref="Type_Bool"><a href="../../GML_Overview/Data_Types.htm" target="_blank">Boolean</a></span></p>
<p> </p>
<h4>Example:</h4>
<div data-conref="../../../assets/snippets/is_instanceof_example.hts"> </div>
Expand All @@ -61,7 +61,7 @@ <h4>Example:</h4>
<div>Next: <a data-xref="{title}" href="static_get.htm">static_get</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
is_instanceof
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
</head>
<body>
<h1><span data-field="title" data-format="default">method_call</span></h1>
<p>This function calls a <a href="../../GML_Overview/Method_Variables.htm">method</a> with the arguments taken from an array or a range in an array.</p>
<p>If the method needs no arguments then an empty argument array <span class="inline2">[]</span> can be passed.</p>
<p class="note"><span data-conref="../../../assets/snippets/Tag_note.hts"> </span> This function works similarly to <span class="inline2"><a data-xref="{title}" href="../Asset_Management/Scripts/script_execute_ext.htm">script_execute_ext</a></span> but works with methods instead.</p>
<p>This function calls a <a href="../../GML_Overview/Method_Variables.htm">method</a> in its bound context, with the arguments taken from an array or a range in an array.</p>
<p>The <span class="inline2">array_args</span> parameter is optional and can be omitted if the method takes no arguments. If the parameter is provided, the range of elements can optionally be specified using the <span class="inline2">offset</span> and <span class="inline2">num_args</span> parameters.</p>
<p class="note"><span data-conref="../../../assets/snippets/Tag_note.hts"> </span> You can use <span class="inline3_func"><a data-xref="{title}" href="../Asset_Management/Scripts/script_execute_ext.htm">script_execute_ext</a></span> to call a method in the context of the calling instance or struct instead of the bound context of the method.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code"><span data-field="title" data-format="default">method_call</span>(method, array_args, [offset], [num_args]);</p>
<p class="code"><span data-field="title" data-format="default">method_call</span>(method, [array_args], [offset], [num_args]);</p>
<table>
<colgroup>
<col />
Expand All @@ -35,32 +35,32 @@ <h4>Syntax:</h4>
</tr>
<tr>
<td>method</td>
<td><span data-keyref="Type_Method"><a href="../../../../GameMaker_Language/GML_Overview/Method_Variables.htm" target="_blank">Method</a></span></td>
<td><span data-keyref="Type_Method"><a href="../../GML_Overview/Method_Variables.htm" target="_blank">Method</a></span></td>
<td>The method to call</td>
</tr>
<tr>
<td>array_args</td>
<td><span data-keyref="Type_Array"><a href="../../../../GameMaker_Language/GML_Overview/Arrays.htm" target="_blank">Array</a></span></td>
<td>The array containing the arguments to pass into the method</td>
<td><span data-keyref="Type_Array"><a href="../../GML_Overview/Arrays.htm" target="_blank">Array</a></span></td>
<td><span data-conref="../../../assets/snippets/Tag_optional.hts"> </span> The array containing the arguments to pass into the method</td>
</tr>
<tr>
<td>offset</td>
<td><span data-keyref="Type_Real"><a href="../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td><span data-keyref="Type_Real"><a href="../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td><span data-conref="../../../assets/snippets/Tag_optional.hts"> </span> The offset, or starting index, in the array. The item at this array index is the <em>first</em> argument for the method. Defaults to 0.<br />
Setting a negative value will count from the end of the array. The starting index will then be <span class="inline2">array_length(array) + offset</span>. See: <a data-xref="{text}" href="Array_Functions.htm#h1">Offset And Length</a></td>
Setting a negative value will count from the end of the array. The starting index will then be <span class="inline2">array_length(array_args) + offset</span>. See: <a data-xref="{text}" href="Array_Functions.htm#offset_and_length">Offset And Length</a></td>
</tr>
<tr>
<td>num_args</td>
<td><span data-keyref="Type_Real"><a href="../../../../GameMaker_Language/GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td><span data-conref="../../../assets/snippets/Tag_optional.hts"> </span> The number of elements to pass as an argument. A negative value will traverse the array backwards (i.e. in descending order of indices, e.g. 2, 1, 0 instead of 2, 3, 4). See: <a data-xref="{text}" href="Array_Functions.htm#h1">Offset And Length</a></td>
<td><span data-keyref="Type_Real"><a href="../../GML_Overview/Data_Types.htm" target="_blank">Real</a></span></td>
<td><span data-conref="../../../assets/snippets/Tag_optional.hts"> </span> The number of elements to pass as arguments. A negative value will traverse the array backwards (i.e. in descending order of indices, e.g. 2, 1, 0 instead of 2, 3, 4). See: <a data-xref="{text}" href="Array_Functions.htm#offset_and_length">Offset And Length</a></td>
</tr>
</tbody>
</table>
<p> </p>
<h4>Returns:</h4>
<p class="code"><span data-keyref="Type_Any"><a href="../../../../GameMaker_Language/GML_Overview/Data_Types.htm#variable" target="_blank">Any</a></span> (the type returned by the method)</p>
<p class="code"><span data-keyref="Type_Any"><a href="../../GML_Overview/Data_Types.htm#variable" target="_blank">Any</a></span> (the type returned by the method)</p>
<p> </p>
<h4>Example 1:</h4>
<h4>Example:</h4>
<p class="code">struct_with_a_method = <br />
{<br />
    show_message: function(message)<br />
Expand All @@ -71,7 +71,7 @@ <h4>Example 1:</h4>
var _method = struct_with_a_method.show_message;<br />
<span data-field="title" data-format="default">method_call</span>(_method, [&quot;Hello World!&quot;]);
</p>
<p>The above code first defines a struct <span class="inline2">struct_with_a_method</span> that has a method <span class="inline2">show_message</span>. The method is then assigned to a temporary variable <span class="inline2">_method</span>. Next it is called using <span class="inline2"><span data-field="title" data-format="default">method_call</span></span> with an argument array with 1 item in it: the string <span class="inline2">&quot;Hello World!&quot;</span>. The <span class="inline2">show_message</span> function calls <span class="inline2"><a data-xref="{title}" href="../Debugging/show_debug_message.htm">show_debug_message</a></span> which outputs &quot;The message is: Hello World!&quot;.</p>
<p>The above code first defines a struct <span class="inline2">struct_with_a_method</span> that has a method <span class="inline3_func">show_message</span>. The method is then assigned to a temporary variable <span class="inline2">_method</span>. Next it is called using <span class="inline3_func"><span data-field="title" data-format="default">method_call</span></span> with an argument array with 1 item in it: the string <span class="inline2">&quot;Hello World!&quot;</span>. The <span class="inline3_func">show_message</span> function calls <span class="inline3_func"><a data-xref="{title}" href="../Debugging/show_debug_message.htm">show_debug_message</a></span> which outputs <span class="inline2">&quot;The message is: Hello World!&quot;</span>.</p>
<p> </p>
<p> </p>
<div class="footer">
Expand All @@ -81,7 +81,7 @@ <h4>Example 1:</h4>
<div>Next: <a data-xref="{title}" href="variable_struct_exists.htm">struct_exists</a></div>
</div>
</div>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2023 All Rights Reserved</span></h5>
<h5><span data-keyref="Copyright Notice">© Copyright YoYo Games Ltd. 2024 All Rights Reserved</span></h5>
</div>
<!-- KEYWORDS
method_call
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h4>Zwroty:</h4>
<p> </p>
<h4>Przykład:</h4>
<p class="code">var _index = method_get_index(light_setup);<br />
if (_index != undefined) <br />
if (_index != undefined)<br />
{<br />
    show_debug_message(script_get_name(_index));<br />
}</p>
Expand Down
14 changes: 14 additions & 0 deletions Manual/contents/assets/snippets/Audio_Pitch_Description.hts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<meta name="topic-comment" content="The description of the pitch parameter" />
<title>Audio_Pitch_Description</title>
<link rel="stylesheet" type="text/css" href="../css/default.css" />
</head>
<body>
<p>The pitch multiplier. A <span>positive number. Values less than or equal to zero are clipped to the lowest positive number.</span> The default is 1.</p>
</body>
</html>
6 changes: 3 additions & 3 deletions Manual/contents/assets/snippets/audio_pitch_multiplier.hts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Adobe RoboHelp 2020" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<meta name="topic-comment" content="A short note to make clear how the pitch is calculated" />
<title>audio_pitch_multiplier</title>
<link rel="stylesheet" type="text/css" href="../css/default.css" />
</head>
<body>
<p class="note"><span data-conref="Tag_important.hts"> </span> As the pitch argument is a <i>pitch multiplier</i>, the sound instance&#39;s pitch will be multiplied by the sound asset&#39;s pitch and also by the sound emitter&#39;s pitch in case the sound was played on an emitter using <a href="../../GameMaker_Language/GML_Reference/Asset_Management/Audio/Audio_Emitters/audio_play_sound_on.htm">audio_play_sound_on</a>. The final pitch that will be heard is the original pitch of the sound multiplied by the three pitch multipliers: <br />
<p class="note"><span data-conref="Tag_important.hts"> </span> As the pitch argument is a <i>pitch multiplier</i>, the sound instance&#39;s pitch will be multiplied by the sound asset&#39;s pitch and also by the sound emitter&#39;s pitch in case the sound was played on an emitter using <a href="../../GameMaker_Language/GML_Reference/Asset_Management/Audio/Audio_Emitters/audio_play_sound_on.htm">audio_play_sound_on</a>. The final <em>source</em> pitch that will be heard is the original pitch of the sound multiplied by the three pitch multipliers: <br />
<br />
final_pitch = original sound pitch * sound asset pitch * emitter pitch * sound instance pitch.<br />
<br />
By default the three pitch multipliers are equal to 1 so that the final pitch that is heard is equal to the original sound&#39;s pitch.
By default the three pitch multipliers are equal to 1 so that the final pitch that is heard is equal to the original sound&#39;s pitch. The final pitch is clipped between a minimum value and a maximum value that depend on the compression type of the sound. See <a data-xref="{text}" href="../../GameMaker_Language/GML_Reference/Asset_Management/Audio/Audio_Properties.htm#pitch">Pitch</a>.
</p>
</body>
</html>
18 changes: 18 additions & 0 deletions Manual/contents/assets/snippets/script_execute_usage_notes.hts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Adobe RoboHelp 2022" />
<meta name="topic-comment" content="" />
<title>script_execute_usage_notes</title>
<link rel="stylesheet" type="text/css" href="../css/default.css" />
</head>
<body>
<h3>Usage Notes</h3>
<ul class="colour">
<li>This function is slow compared to calling the function/method directly and using it a lot may adversely affect performance.</li>
<li>This function will accept a <span data-keyref="Type_Asset_Script"><a href="../../The_Asset_Editors/Scripts.htm" target="_blank">Script Asset</a></span> and simply calls the script function contained within the asset that must have the same name as the script asset itself.</li>
</ul>
</body>
</html>

0 comments on commit 8f655b8

Please sign in to comment.