Query parameter for alteration to shapeLayer sound design?
Closed this issue · 4 comments
While making the sound features script, I came back around to the idea of altering the Sound Layer sound design to have the trapezoid sound play for Parallelogram, Rectangle, Rhombus, and Square. This isn't a decision that a teacher needs to make on the fly, but for their students in their curriculum before the lesson. Before load is probably ideal. Let's use a query parameter rather than a preference menu item.
Query parameter: ?trapezoidSoundLayers
Default:
const NAMED_QUADRILATERAL_TO_TRACKS_MAP = new Map( [
[ NamedQuadrilateral.CONVEX_QUADRILATERAL, [ 0 ] ],
[ NamedQuadrilateral.CONCAVE_QUADRILATERAL, [ 1 ] ],
[ NamedQuadrilateral.TRIANGLE, [] ],
[ NamedQuadrilateral.DART, [ 1, 2 ] ],
[ NamedQuadrilateral.KITE, [ 0, 2 ] ],
[ NamedQuadrilateral.TRAPEZOID, [ 0, 4 ] ],
[ NamedQuadrilateral.ISOSCELES_TRAPEZOID, [ 0, 4, 3 ] ],
[ NamedQuadrilateral.PARALLELOGRAM, [ 0, 5 ] ],
[ NamedQuadrilateral.RHOMBUS, [ 0, 2, 5, 6 ] ],
[ NamedQuadrilateral.RECTANGLE, [ 0, 3, 5, 7 ] ],
[ NamedQuadrilateral.SQUARE, [ 0, 2, 3, 5, 6, 7 ] ]
] );
with ?trapezoidSoundLayers
:
const NAMED_QUADRILATERAL_TO_TRACKS_MAP = new Map( [
[ NamedQuadrilateral.CONVEX_QUADRILATERAL, [ 0 ] ],
[ NamedQuadrilateral.CONCAVE_QUADRILATERAL, [ 1 ] ],
[ NamedQuadrilateral.TRIANGLE, [] ],
[ NamedQuadrilateral.DART, [ 1, 2 ] ],
[ NamedQuadrilateral.KITE, [ 0, 2 ] ],
[ NamedQuadrilateral.TRAPEZOID, [ 0, 4 ] ],
[ NamedQuadrilateral.ISOSCELES_TRAPEZOID, [ 0, 4, 3 ] ],
[ NamedQuadrilateral.PARALLELOGRAM, [ 0, **4**, 5 ] ],
[ NamedQuadrilateral.RHOMBUS, [ 0, 2, **4**, 5, 6 ] ],
[ NamedQuadrilateral.RECTANGLE, [ 0, 3, **4**, 5, 7 ] ],
[ NamedQuadrilateral.SQUARE, [ 0, 2, 3, **4**, 5, 6, 7 ] ]
] );
?trapezoidSoundLayer
was added, @BLFiedler can you please review?
I chatted with @amanda-phet and @catherinecarter some on Slack to make a decision on which sound design might best be set as default.
This is the common view taught (at least in the US) regarding the relationships between shapes:
This is what we had assumed for the sound design up until the addition of this query parameter. However, the inclusive approach is still valid and possibly used outside of the US, so we'll definitely want to keep this query parameter and advertise in the teacher tips/sound features video.
I realized in reviewing that I had left the isosceles trapezoid track playing in the rectangle and square in the default sound design. I removed that in the above commit. There is the added benefit of fewer tracks playing for the square for the exclusive default sound design 🙂 .
Updated track assignments below (LayerTracksSoundView.ts):
New Map( [ // design with trapezoid sound in the relevant child shapes
[ NamedQuadrilateral.CONVEX_QUADRILATERAL, [ 0 ] ],
[ NamedQuadrilateral.CONCAVE_QUADRILATERAL, [ 1 ] ],
[ NamedQuadrilateral.TRIANGLE, [] ],
[ NamedQuadrilateral.DART, [ 1, 2 ] ],
[ NamedQuadrilateral.KITE, [ 0, 2 ] ],
[ NamedQuadrilateral.TRAPEZOID, [ 0, 4 ] ],
[ NamedQuadrilateral.ISOSCELES_TRAPEZOID, [ 0, 4, 3 ] ],
[ NamedQuadrilateral.PARALLELOGRAM, [ 0, 4, 5 ] ],
[ NamedQuadrilateral.RHOMBUS, [ 0, 2, 4, 5, 6 ] ],
[ NamedQuadrilateral.RECTANGLE, [ 0, 3, 4, 5, 7 ] ],
[ NamedQuadrilateral.SQUARE, [ 0, 2, 3, 4, 5, 6, 7 ] ]
] ) :
new Map( [ // default sound design
[ NamedQuadrilateral.CONVEX_QUADRILATERAL, [ 0 ] ],
[ NamedQuadrilateral.CONCAVE_QUADRILATERAL, [ 1 ] ],
[ NamedQuadrilateral.TRIANGLE, [] ],
[ NamedQuadrilateral.DART, [ 1, 2 ] ],
[ NamedQuadrilateral.KITE, [ 0, 2 ] ],
[ NamedQuadrilateral.TRAPEZOID, [ 0, 4 ] ],
[ NamedQuadrilateral.ISOSCELES_TRAPEZOID, [ 0, 4, 3 ] ],
[ NamedQuadrilateral.PARALLELOGRAM, [ 0, 5 ] ],
[ NamedQuadrilateral.RHOMBUS, [ 0, 2, 5, 6 ] ],
[ NamedQuadrilateral.RECTANGLE, [ 0, 5, 7 ] ],
[ NamedQuadrilateral.SQUARE, [ 0, 2, 5, 6, 7 ] ]
] );
Let's rename this to ?inheritTrapezoidSound
.
And then it's good to close!
OK! Query param renamed to inheritTrapezoidSound
. Closing.