<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://csharpgamedev.com/w/index.php?action=history&amp;feed=atom&amp;title=Loop_%28Music%29</id>
	<title>Loop (Music) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://csharpgamedev.com/w/index.php?action=history&amp;feed=atom&amp;title=Loop_%28Music%29"/>
	<link rel="alternate" type="text/html" href="https://csharpgamedev.com/w/index.php?title=Loop_(Music)&amp;action=history"/>
	<updated>2026-07-05T22:08:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://csharpgamedev.com/w/index.php?title=Loop_(Music)&amp;diff=356&amp;oldid=prev</id>
		<title>Winkio at 14:05, 14 July 2024</title>
		<link rel="alternate" type="text/html" href="https://csharpgamedev.com/w/index.php?title=Loop_(Music)&amp;diff=356&amp;oldid=prev"/>
		<updated>2024-07-14T14:05:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:05, 14 July 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A [[Loop]] is a piece of music that repeats endlessly, often found in games as [[background music]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Loop (Music)|&lt;/ins&gt;Loop]] is a piece of music that repeats endlessly, often found in games as [[background music]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Full File Loop==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Full File Loop==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Winkio</name></author>
	</entry>
	<entry>
		<id>https://csharpgamedev.com/w/index.php?title=Loop_(Music)&amp;diff=355&amp;oldid=prev</id>
		<title>Winkio: Created page with &quot;A Loop is a piece of music that repeats endlessly, often found in games as background music.  ==Full File Loop== In this implementation the music file loops from the start to the end, requiring the file to be trimmed neatly such that the start and end line up exactly.  Very few songs are available in a trimmed format like this, so the developer may need to take a song and trim it manually using audio editing software like [https://www.audacityteam.org/ Audacity]....&quot;</title>
		<link rel="alternate" type="text/html" href="https://csharpgamedev.com/w/index.php?title=Loop_(Music)&amp;diff=355&amp;oldid=prev"/>
		<updated>2024-07-14T14:05:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;A &lt;a href=&quot;/w/index.php?title=Loop&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Loop (page does not exist)&quot;&gt;Loop&lt;/a&gt; is a piece of music that repeats endlessly, often found in games as &lt;a href=&quot;/w/index.php?title=Background_music&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Background music (page does not exist)&quot;&gt;background music&lt;/a&gt;.  ==Full File Loop== In this implementation the music file loops from the start to the end, requiring the file to be trimmed neatly such that the start and end line up exactly.  Very few songs are available in a trimmed format like this, so the developer may need to take a song and trim it manually using audio editing software like [https://www.audacityteam.org/ Audacity]....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A [[Loop]] is a piece of music that repeats endlessly, often found in games as [[background music]].&lt;br /&gt;
&lt;br /&gt;
==Full File Loop==&lt;br /&gt;
In this implementation the music file loops from the start to the end, requiring the file to be trimmed neatly such that the start and end line up exactly.  Very few songs are available in a trimmed format like this, so the developer may need to take a song and trim it manually using audio editing software like [https://www.audacityteam.org/ Audacity].&lt;br /&gt;
&lt;br /&gt;
==Partial File Loop==&lt;br /&gt;
In this implementation the developer first defines a loop start and loop end within each song, and then has code that runs each frame to perform the looping.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;cs&amp;quot;&amp;gt;&lt;br /&gt;
TimeSpan LoopStart;&lt;br /&gt;
TimeSpan LoopEnd;&lt;br /&gt;
&lt;br /&gt;
void UpdateMusicLoop()&lt;br /&gt;
{&lt;br /&gt;
    TimeSpan currentPlaybackPosition = GetPlaybackPosition();&lt;br /&gt;
    if (currentPlaybackPosition &amp;gt;= LoopEnd)&lt;br /&gt;
        PlayFrom(LoopStart + currentPlaybackPosition - LoopEnd);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The advantage of this implementation is that many files do not need to be edited to loop smoothly, the developer simply needs to define the loop start and end correctly.  Make sure that the loop start and loop end are both on the same beat of the song.&lt;br /&gt;
&lt;br /&gt;
If using this approach you must not use the end of the file as the loop end, since playback expects to continue slightly past the loop end point before returning to the start of the loop.  If your file is already trimmed to the loop end, you may need to use audio editing software like [[Audacity]] to copy the first 1-2s after loop start to the end of the file in order to be safe.&lt;br /&gt;
&lt;br /&gt;
==Intro then Loop==&lt;br /&gt;
Sometimes a developer wants to play an intro once before the loop starts.  A great example of this is Zelda OoT, where pieces like Kokiri Forest and Gerudo Valley have very recognizable intros.&lt;br /&gt;
&lt;br /&gt;
This can be easily done by playing the song from the intro, and then letting it automatically continue until the loop end at which point it will loop normally.&lt;br /&gt;
&lt;br /&gt;
==Transition between Loops==&lt;br /&gt;
Sometimes a developer wants to progress from loop to loop in a file as a player makes progress in a level.  A great example of this is Celeste.&lt;br /&gt;
&lt;br /&gt;
This can be easily done by changing loop start and loop end to a different pair of values for a new loop as the player reaches new milestones in a level.&lt;/div&gt;</summary>
		<author><name>Winkio</name></author>
	</entry>
</feed>