Ultrashort pulse generation by molecular modulation