When Conditionals

Educational Vocabularies

On the index card, wrote out concepts that you’ve taught or think is useful to teach to students. For instance, coding concept could be –- coordinate system, when conditionals, etc For dancers, this may be rhythm pattern and musicality, body awareness, stage composition, etc We will review and keep enrich this vocabulary and use the index cards for future references.

Embodiment Exercise

  • Stand in the center of the room with your feet hip-distance apart and your arms relaxed at your sides.
  • Close your eyes and take a few deep breaths, focusing on your body and your breath.
  • Open your eyes and imagine that your body is a paintbrush, and the floor is a canvas.
  • Slowly begin to move your body in any way that feels natural, allowing your limbs to sweep across the floor and your torso to twist and turn.
  • As you move, imagine that you are painting a picture on the floor with your body. Experiment with different shapes and lines, using your arms, legs, and torso to create interesting patterns.
  • Or you can be very specific, be very visual with the image you are creating
  • Continue moving and painting for a few minutes, exploring different levels and directions.
  • When you’re ready, slowly come to a stop.

Reflections

  • How did you feel
  • What did you draw?
  • What orientation did your image face?

Trace Example

Move around the below code in danceON in the same way we just did in embodiment exercise.

(pose, poseHistory) => [
    {
        what: 'circle',
        where: {
            x: pastParts(poseHistory, 'leftWrist', 'x', 0, 30, 1),
            y: pastParts(poseHistory, 'leftWrist', 'y', 0, 30, 1)
        },
        how: {
            fill: "white",
        },
    } // left wrist trace
];

When Condition

In danceON, conditionals can enable some crazy interactivity for your animations. To understand when conditions in danceON, you will need to grasp two aspects: the logic of conditionals and the variety of movement states in choreography.

Exercise 1

Given the two examples, play with conditionals. Define what movement can be determined by danceON.

Example 1

(pose) => [
    // i think 
    // she thinks 
    // i think too much
    // Pinegrove - Need (https://youtu.be/9hGRSY-oRqk)
    
    // Text appears in over my head at different positions of the screen
    // No map function
    {
        what: 'text',
        when: pose.nose.x < 200,
        where: {
            x: pose.nose.x,
            y: pose.nose.y - 100,
        },
        how: {
            str: "i think",
            fill: color(255, 255, 255, 255),
        },
    }, // Move to the left
    {
        what: 'text',
        when: (pose.nose.x > 350),
        where: {
            x: pose.nose.x,
            y: pose.nose.y - 100,
        },
        how: {
            str: "she thinks",
            fill: color(255, 105, 180, 255), 
        },
    }, // Move to the right
    {
        what: 'text',
        when: pose.rightWrist.y < pose.nose.y, 
        where: {
            x: pose.nose.x,
            y: pose.nose.y - 100,
        },
        how: {
            str: "i think too much",
            fill: color(255, 255, 255, 255), 
        },
    } // Wrist above my nose
];

Example 2

There are two version of code for this example.

The first one saves the math operation of the when conditionals in variables.

(pose) => {

    // define variables and functions
    let bentOver = (abs(pose.nose.y-pose.leftHip.y))<100;
    let leanRight = pose.nose.x>pose.leftHip.x;
    let leanLeft = pose.nose.x<pose.leftHip.x
    // return objects
return [
    {
        what: 'rect',
        when:bentOver && leanLeft,
        where: {
            x: pose.nose.x+abs(pose.nose.x-pose.leftHip.x)*0.1,
            y: pose.leftHip.y-300
        },
        how: {
            fill: "#c76b67",
            h: 200,
            w: abs(pose.nose.x-pose.leftHip.x)*0.8,
        },
    },
        {
        what: 'rect',
        when: bentOver && leanRight,
        where: {
            x: pose.leftHip.x+abs(pose.nose.x-pose.leftHip.x)*0.1,
            y: pose.leftHip.y-300
        },
        how: {
            fill: "#c76b67",
            h: 200,
            w: abs(pose.nose.x-pose.leftHip.x)*0.8,
        },
    }//backing a brick whenever I bend over
];}

The second one does the math operations directly in the conditionals.

(pose) => [
    {
        what: 'rect',
        when:(abs(pose.nose.y-pose.leftHip.y))<100 && pose.nose.x<pose.leftHip.x,
        where: {
            x: pose.nose.x+abs(pose.nose.x-pose.leftHip.x)*0.1,
            y: pose.leftHip.y-300
        },
        how: {
            fill: "#c76b67",
            h: 200,
            w: abs(pose.nose.x-pose.leftHip.x)*0.8,
        },
    },
        {
        what: 'rect',
        when:(abs(pose.nose.y-pose.leftHip.y))<100 && pose.nose.x>pose.leftHip.x,
        where: {
            x: pose.leftHip.x+abs(pose.nose.x-pose.leftHip.x)*0.1,
            y: pose.leftHip.y-300
        },
        how: {
            fill: "#c76b67",
            h: 200,
            w: abs(pose.nose.x-pose.leftHip.x)*0.8,
        },
    }//backing a brick whenever I bend over
];

The two version of the code basically does the same things. The first one factored the bending movement out into two parts based on the computer logic.

  • Which one is more interdisciplinary?
  • Which one is more accessible?
  • How does the “better” example scaffold the concept of conditionals better?
  • How about the movement concepts?

Exercise 2

Currently you should have some basic understanding of shapes and how features. Think of a movement. The movement should have two significant modes of movement that you think danceON can sense. GIVE IT TO YOUR PEERS, and design a piece of code with your peer’s movement in mind.

Focus on the movement and think about what and how the code will enhance your movement. Think about how to use code to distinguish between the two modes of movement.

Co-design Workshop

Design a worksheet/example code/example movements/activities for to teach students about conditionals through a interdisciplinary lens.