Skip to content

Commit

Permalink
moving over to mega maths day 2023 activity with new script
Browse files Browse the repository at this point in the history
  • Loading branch information
benjym committed Nov 21, 2023
1 parent c351402 commit 412c203
Show file tree
Hide file tree
Showing 44 changed files with 469 additions and 1 deletion.
133 changes: 133 additions & 0 deletions master/mega-maths-day-2023.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"list": [
{
"url": "menu",
"name": "Main menu"
},
{
"url": "box",
"name": "Welcome to hyperspace",
"button_delay": 40000,
"audio_track" : "mmd2023/index.mp3",
"audio_delay" : 3000
},
{
"url": "2d-rain",
"name": "Intro to 2D",
"button_delay": 24000,
"audio_track" : "mmd2023/2d-rain.mp3",
"audio_delay" : 3000
},
{
"url": "two-particle-collision",
"name": "Intro to 3D",
"button_delay": 20000,
"audio_track" : "mmd2023/two-particle-collision.mp3",
"audio_delay" : 3000
},
{
"url": "2d-billiards?boundary=square",
"name": "2D billiards in a square",
"button_delay": 20000,
"audio_track" : "mmd2023/2d-billiards-square.mp3",
"audio_delay" : 3000
},
{
"url": "2d-billiards?boundary=circle",
"name": "2D billiards in a circle",
"button_delay": 20000,
"audio_track" : "mmd2023/2d-billiards-circle.mp3",
"audio_delay" : 3000
},
{
"url": "2d-billiards?boundary=ellipse",
"name": "2D billiards in an ellipse",
"button_delay": 20000,
"audio_track" : "mmd2023/2d-billiards-ellipse.mp3",
"audio_delay" : 3000
},
{
"url": "3d-billiards?boundary=cube",
"name": "3D billiards in a cube",
"button_delay": 30000,
"audio_track" : "mmd2023/3d-billiards-cube.mp3",
"audio_delay" : 3000
},
{
"url": "3d-billiards?boundary=sphere",
"name": "3D billiards in a sphere",
"button_delay": 30000,
"audio_track" : "mmd2023/3d-billiards-sphere.mp3",
"audio_delay" : 3000
},
{
"url": "hyperspheres",
"name": "What is a hypersphere?",
"button_delay": 48000,
"audio_track" : "mmd2023/hyperspheres.mp3",
"audio_delay" : 5000
},
{
"url": "slice-3d",
"name": "Slicing space",
"button_delay": 52000,
"audio_track" : "mmd2023/slice-3d.mp3",
"audio_delay" : 3000
},
{
"url": "slice-4d",
"name": "Intro to 4D",
"button_delay": 49000,
"audio_track" : "mmd2023/slice-4d.mp3",
"audio_delay" : 3000
},
{
"url": "rotation-3d",
"name": "Rotation in 3D",
"button_delay": 33000,
"audio_track" : "mmd2023/rotation-3d.mp3",
"audio_delay" : 3000
},
{
"url": "rotation-4d",
"name": "Rotation in 4D",
"button_delay": 27000,
"audio_track" : "mmd2023/rotation-4d.mp3",
"audio_delay" : 3000
},
{
"url": "4d-billiards?boundary=hypercube",
"params" : {"boundary" : "hypercube"},
"name": "4D billiards in a hypbercube",
"button_delay": 20000,
"audio_track" : "mmd2023/4d-billiards-hypercube.mp3",
"audio_delay" : 3000
},
{
"url": "4d-billiards?boundary=hypersphere",
"name": "4D billiards in a hypersphere",
"button_delay": 30000,
"audio_track" : "mmd2023/4d-billiards-hypersphere.mp3",
"audio_delay" : 3000
},
{
"url": "3d-pool",
"name": "3D pool",
"audio_track" : "mmd2023/3d-pool.mp3",
"audio_delay" : 3000
},
{
"url": "4d-pool",
"name": "4D pool",
"audio_track" : "mmd2023/4d-pool.mp3",
"audio_delay" : 3000
},
{
"url": "tennis",
"name": "Bonus game",
"audio_track" : "mmd2023/tennis.mp3",
"audio_delay" : 3000
}
],
"current": 1
}
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ let socket = io(server);

let master;
if ( urlParams.has('master') ) { master = urlParams.get('master') }
else { master = "ISS"; }
// else { master = "ISS"; }
// else { master = "grain-days-2023"; }
else { master = "mega-maths-day-2023"; }

function replaceQueryParam(param, newval, search) {
var regex = new RegExp("([?;&])" + param + "[^&;]*[;&]?");
Expand Down
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/2d-billiards-circle.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "Now the two-dimensional billiard ball is inside a circle. Think about what happens now that we have a different shaped billiard table. What shapes does the trajectory of the ball make? Are they different to what you saw in the previous room? What would happen if the particle started in the centre of the circle? Move on to the ellipse when you are ready."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/2d-billiards-circle.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/2d-billiards-ellipse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "How would you describe the motion of this billiard ball inside the ellipse? How is it similar or different to the motion you saw in the circle and square? When you have thought of an answer, click the button to move to three dimensions."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/2d-billiards-ellipse.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/2d-billiards-square.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "Let’s begin to study the shape of the space and the trajectory of the moving object. In front of you is a circle moving inside a square. The circle represents a billiard ball in two dimensions, the square represents the billiard table, and the line tracks the trajectory of the ball as it moves. What do you notice about the trajectory of the ball? Does it make any interesting shapes? What is special about the angles the ball makes when it bounces off the sides of the box? When you are ready, move on to the circle."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/2d-billiards-square.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/2d-rain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input": {
"text": "First we will study the shape of the moving object. In front of you is a wall of two dimensional circles in three dimensional space. You can move around using the joystick on the controller in your right hand. When you walk through the circles you can see that they have no thickness since they only exist in two dimensions. However, the concept of thickness, or depth, will become important when we move to three and four dimensions. When you are ready move on to three dimensions."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/2d-rain.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/3d-billiards-cube.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "When we study geometry in three dimensions, the ball has another dimension it can move in. This leads to more complicated behaviour. Look at the ball that is bouncing around you. In two dimensions, the ball bouncing around a square is the same as a hockey puck bouncing around an ice rink. Now that we are in three dimensions, you can picture yourself throwing the ball off the side of the cube around you. How is this ball’s trajectory different to the two dimensional ones you saw before? Is it harder to tell what shapes are made when we are working with three dimensions? In a square, we could see the angles made when the ball bounced off the boundary. Can you see what angles are made when the ball bounces off the side of the cube? Move on to the sphere when you are ready."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/3d-billiards-cube.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/3d-billiards-sphere.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "Watch how this ball moves inside a sphere. Think about how it moves differently in a three dimensional sphere compared to the two dimensional circle. What would happen if you threw the ball from the centre of the sphere? Would the same thing happen if you hit a hockey puck from the centre of a circular ice rink? When you are ready click the sign to start learning about the fourth dimension."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/3d-billiards-sphere.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/3d-pool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "Let’s practice how to use a pool cue in virtual reality by playing the regular three dimensional pool. The aim is to hit the white ball into the other coloured balls and make the coloured balls fall into the holes at the edges of the table. You are holding the cue used to hit the white ball. Aim the white tip of the cue by moving the left controller. To hit the ball, first pull your other controller towards yourself, then push it forward to hit the ball. The faster you push, the harder you hit the ball. Get some practice using the cue and when you feel ready move on to playing in four dimensions."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/3d-pool.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/4d-billiards-hypercube.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "This particle is moving in a four dimensional box. Use the toggle on your left controller to move through the fourth dimension and see the full path of the particle. Remember that the colour spectrum from red to blue lets you know where you are in the fourth dimension."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/4d-billiards-hypersphere.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input" : {
"text" : "Now the particle is moving in a four dimensional sphere. How does the trajectory differ to the four D box you saw in the previous room? Can you find any similarities between the trajectories in the 2D circle, the 3D sphere and the 4D sphere? In the next room you will study the four dimensional hypersphere as you work towards playing a game of pool."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/4d-pool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input": {
"text": "Now it is time to play four D pool! See if you can sink all the balls. Have fun!"
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/4d-pool.mp3
Binary file not shown.
16 changes: 16 additions & 0 deletions text-to-speech/mmd2023/generate_all_audio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ./make_audio.sh index.json index.mp3
# ./make_audio.sh hyperspheres.json hyperspheres.mp3
# ./make_audio.sh 2d-rain.json 2d-rain.mp3
# ./make_audio.sh slice-3d.json slice-3d.mp3
# ./make_audio.sh slice-4d.json slice-4d.mp3
# ./make_audio.sh rotation-3d.json rotation-3d.mp3
# ./make_audio.sh rotation-4d.json rotation-4d.mp3
# ./make_audio.sh pyramid.json pyramid.mp3
# ./make_audio.sh 4d-pool.json 4d-pool.mp3

for file in *.json; do
if [[ -f "$file" ]]; then
filename=$(basename "$file" .json)
./make_audio.sh ${filename}.json ${filename}.mp3
fi
done
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/hyperspheres.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input": {
"text": "In front of you are three hyperspheres. On the right is a three dimensional hypersphere. This is just a regular sphere. Every point on the surface of the sphere is a distance r from its centre. To the left of this is a circle. Again, every point on the edge of this circle is a distance r from its centre. On the left is a one dimensional hypersphere, which is just a line of length two r. Can you imagine what a four dimensional hypersphere might be like? Its surface will also all be a distance r from its centre, but now there will be more directions in which the surface extends. Let's continue and start to learn about higher dimensional spheres. Click on the Slicing space button when you're ready."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/hyperspheres.mp3
Binary file not shown.
15 changes: 15 additions & 0 deletions text-to-speech/mmd2023/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"audioConfig": {
"audioEncoding": "LINEAR16",
"pitch": 0,
"speakingRate": 0.8
},
"input": {
"text": "Welcome to Hyperspace! Today you will be using virtual reality to learn about the fourth dimension and play some four D pool. Move your head to look around. You are in a four dimensional box with four dimensional hyperspheres flying around you. To study geometry of moving objects in four dimensions we care about three things, the shape of the object that is moving, the shape of space that the object is moving within and the shapes made by the trajectory of the object. When you are ready to begin click the sign to go to the next room using the button on your right hand controller."
},
"voice": {
"languageCode": "en-au",
"name": "en-AU-Neural2-C",
"ssmlGender": "FEMALE"
}
}
Binary file added text-to-speech/mmd2023/index.mp3
Binary file not shown.
18 changes: 18 additions & 0 deletions text-to-speech/mmd2023/make_audio.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/zsh

# run with ./make_audio.sh INPUT_FILE.json OUTPUT_FILE.mp3

# on laptop
# export GOOGLE_APPLICATION_CREDENTIALS=~/Dropbox/Research/Codes/mapping-toolbox-e208680474e5.json
# on work imac
export GOOGLE_APPLICATION_CREDENTIALS=../mapping-toolbox-f7511150dc5b.json

curl -X POST \
-H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @$1 \
"https://texttospeech.googleapis.com/v1/text:synthesize" | \

python3 -c "import sys, json; print(json.load(sys.stdin)['audioContent'])" | \

base64 --decode -o $2
Loading

0 comments on commit 412c203

Please sign in to comment.