He began to compose the book in 1924, following his research into Andalusian soul and song for the 1922 Cante Jondo (Deep Song) contest. At this time, Federico alternated his stay at the Students’ Residence in Madrid with his life in Granada, his summers in Asquerosa (Disgusting) and a short stay in Lanjarón to accompany his mother to enjoy the curative waters.

In the summer of 1924, in July, he began a notebook with this title, Romancero gitano (Gypsy Ballads), in which he first copied the Romance de la luna, luna (Ballad of the Moon, Moon, written a year earlier. On other pages, on July 30, he adds the Romance de la pena negra (Ballad of the Black Sorrow) and on August 20 La monja gitana (The Gypsy Nun) (untitled). Also from August is the Romance sonámbulo (Sleepwalking Ballad) and, perhaps, the Romance de la Guardia Civil (The Ballad of the Spanish Civil Guard) .