Add write_samples .. generated