Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Documentation/input/alphatex/beat-effects.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TexSample: true
<p>
There are various effects that can be applied to a beat. All beat
effects are specified in braces after the beat.
<code>Beat{Effects}</code>
<code>Beat{Effects}</code> Multiple effects are simple separated by spaces like <code>3.3 {f v}</code>
</p>

<h2 id="simple-effects">Simple Effects</h2>
Expand Down Expand Up @@ -48,6 +48,9 @@ TexSample: true
|
// tremolo picking (`tp duration` where duration can be 8,16 or 32)
3.3{tp 8} 3.3{tp 16} 3.3{tp 32}
|
// Crescendo / Decrescendo
3.3{cre} 3.3{cre} 3.3{dec} 3.3{dec}
</div>
<script type="text/x-alphatab">
$('#alphaTabBeatEffects').alphaTab();
Expand Down
10 changes: 10 additions & 0 deletions Source/AlphaTab.Test/Importer/AlphaTexImporterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -967,5 +967,15 @@ public void TestDynamics()
}


[TestMethod]
public void TestCrescendo()
{
var tex = @"1.1.4{dec} 1.1{dec} 1.1{cre} 1.1{cre}";
var score = ParseTex(tex);
Assert.AreEqual(CrescendoType.Decrescendo, score.Tracks[0].Staves[0].Bars[0].Voices[0].Beats[0].Crescendo);
Assert.AreEqual(CrescendoType.Decrescendo, score.Tracks[0].Staves[0].Bars[0].Voices[0].Beats[1].Crescendo);
Assert.AreEqual(CrescendoType.Crescendo, score.Tracks[0].Staves[0].Bars[0].Voices[0].Beats[2].Crescendo);
Assert.AreEqual(CrescendoType.Crescendo, score.Tracks[0].Staves[0].Bars[0].Voices[0].Beats[3].Crescendo);
}
}
}
14 changes: 14 additions & 0 deletions Source/AlphaTab/Importer/AlphaTexImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,20 @@ private bool ApplyBeatEffect(Beat beat)
return true;
}

if (syData == "cre")
{
beat.Crescendo = CrescendoType.Crescendo;
NewSy();
return true;
}

if (syData == "dec")
{
beat.Crescendo = CrescendoType.Decrescendo;
NewSy();
return true;
}

if (syData == "tp")
{
NewSy();
Expand Down