Need help with quite simple export configuration

Okey, hey and thank you for reading this post. I've planned to do list of my music collection to my homepage, but I'm not sure how to do it. I hope that you can give me some help.

Here is the result what I would like to have (don't mind that "cover image" though because I'm not sure if I want that):

And here is single block of HTML-code which of course will be multiplied

<h3>Artist <span class="extra">(Genre: Pop, Records: 2, Songs: 14)</span> </h3>

<div class="music_album">
    Album title (year)
</div>

<div class="music_songs">
    <div>Title 1</div>
    <div>Title 2</div>
    <div>Title 3</div>
    <div>Title 4</div>
    <div>Title 5</div>
    <div>Title 6</div>
    <div>Title 7</div>
</div>

And after a bit fighting with configuration, I managed to create this piece of code. The code doesn't work at all and all it does is printing "[ SYNTAX ERROR IN FORMATTING STRING ]" multiplied with amount of artists.

$filename(allmusics.php,ANSI)

$loop(%path%)

$loop(%artist%)
<h3>%artist <span class="extra">(Genre: %genre%, Songs: %total_files%, </span> </h3>

$loop(%album%)
<div class="music_album">%album% (%year%)</div>
<div class="music_songs">

$loop(%title%)
<div>%track%. %title% / %_length% / %_bitrate%</div>
$loopend()
</div>

$loopend()
$loopend()
$loopend()

I would just like to know what is the main error on my code. Than you very much.

You have a missing % at

%artist%