Does the Composition of Rock Near the Epicenter Affect the Effects of an Earthquake?
The soil and rock type are one factor that determines the amplification of the shaking.  In general, the softer the underlying material is the greater the shaking.  This table, from the USGS, presents the velocities of 5 soil types in the San Francisco Bay area and their shear velocities.


  Soil type A   Vs > 1500 m/sec Includes unweathered intrusive igneous
  rock. Occurs infrequently in the bay area. We consider it with type B
  (both A and B are represented by the color blue on the map). Soil
  types A and B do not contribute greatly to shaking amplification.
  
  Soil type B   1500 m/sec > Vs > 750 m/sec Includes volcanics, most
  Mesozoic bedrock, and some Franciscan bedrock. (Mesozoic rocks are
  between 245 and 64 million years old. The Franciscan Complex is a
  Mesozoic unit that is common in the Bay Area.)
  
  Soil Type C   750 m/sec > Vs > 350 m/sec  Includes some Quaternary (less
  than 1.8 million years old) sands, sandstones and mudstones, some
  Upper Tertiary (1.8 to 24 million years old) sandstones, mudstones and
  limestone, some Lower Tertiary (24 to 64 million years old) mudstones
  and sandstones, and Franciscan melange and serpentinite.
  
  Soil Type D   350 m/sec > Vs > 200 m/sec  Includes some Quaternary muds,
  sands, gravels, silts and mud. Significant amplification of shaking by
  these soils is generally expected.
  
  Soil Type E   200 m/sec > Vs  Includes water-saturated mud and artificial
  fill. The strongest amplification of shaking due is expected for this
  soil type.


The slower the shear wave velocity, the greater the shaking.  

Source: https://earthquake.usgs.gov/hazards/urban/sfbay/soiltype/

Additionally, the composition of the rock that the seismic waves are travelling through is a major factor in determining the speed of the waves.  Two rock properties that determine the speed of the waves are reflection and refraction:

Reflection

 


  When a wave encounters a change in material properties (seismic
  velocities and or density) its energy is split into reflected and
  refracted waves.


Refraction



Source: http://eqseis.geosc.psu.edu/~cammon/HTML/Classes/IntroQuakes/Notes/waves_and_interior.html

There are many factors involved in determining the magnitude of an earthquake with underlying sediments and rock being one of the major factors.  This is not an exhaustive list of all those factors but hopefully it points you in the right direction for an answer to your question.