In a sauté pan over medium heat, melt the butter.Add the mushrooms and shallots and sauté, until they begin to soften, 3-4 minutes.Add the salt and pepper.Add the garlic and rosemary, stir and cook for 2 minutes.Strain the mushroom mixture through a sieve to a bowl and allow to cool.add to a food processor.Add the ricotta and blend until smooth, taste for seasoning.Transfer to ramekins or container with a lid and refrigerate for 30 minutes until set.