Compose a piece of music based on the provided motif and adhering to the outlined musical structure.
X:1
L:1/8
M:4/4
K:D
['g fadf edBA fadf g2 ag f2', 'faaf dcde faaf g2'  
X:1
L:1/8
M:4/4
K:D
|: g | fadf edBA | fadf g2 ag | f2 df edBc | dcBA GAd :| g | faaf dcde | faaf g2 ge | faaf afef | 
 gfed Bcde | faaf dcde | faaf g2 ga | agaf gfed | (3Bcdef g2 ||  