Overview
Max
The Link of Max Patch(with sound libraries):
https://drive.google.com/file/d/1ylP1ThA-mZn0tlwyI7ectMkIi0DuK2zL/view?usp=sharing
Threshold control:
Firstly, the Max patch needs to receive distance sensor values from the Arduino. These values represent the proximity, or distance, of a person to the stairs and it changes as the person goes up or down the stairs. Max patch receives distance sensor values from the Arduino, representing the proximity or distance from the person to the stairs. It compares the received distance sensor values with the threshold values 55 and 155 to determine the different states of climbing the stairs.
When a certain threshold range is reached, the sensed data is automatically detected and a different result is triggered. For example, with 55 and 155 as the two thresholds for ResultA/B, ResultA’s Playlist is triggered when the data is less than 55, ResultB’s Playlist is triggered when the data is greater than 155, and the Playlist for intermediate state sound files is triggered when the data is between 55 and 155.
When the first threshold is triggered (going up a step), the distance sensor value crosses the threshold 55 from low to high, triggering the first threshold in the patch indicating that the person is going up the stairs. This may result in a positive value being stored in the “past” object indicating the current state of the stairs. When the second threshold is triggered (returning to the intermediate state from Step up), the distance sensor value crosses the threshold 55 from a high value to a low value, triggering a second threshold indicating that the person is returning to the intermediate state from Step up. This results in a negative value being stored in the “past” object, indicating the current state from Step back to the intermediate state. When the third threshold (going down the stairs) is triggered, the distance sensor value crosses the threshold 155 from a low value to a high value, triggering the third threshold, indicating that the person is going down the stairs, storing a positive value in the “past” object, indicating the current state of going down the stairs. When the fourth threshold is triggered (returning to the middle state from the bottom of the stairs), the distance sensor value crosses the threshold 55 from the high value to the low value, triggering the fourth threshold, indicating that the person is returning to the middle state which is the middle state at the bottom of the steps, resulting in a negative value being stored in the Past object.
It is worth noting that the negative value triggered in the above step is multiplied by -1 using the multiplication object in the Max patch. this changes the sign of the value in a mathematical sense and in this case effectively indicates the opposite direction of the return to the intermediate state from the top or bottom of the step, enabling the simulation of the change of state of the person going up and down the stairs in the Max patch.
sound containers ( Random ) :
Vertically, a Playlist is created that randomly plays different fetch sound objects, i.e. containers of sound objects corresponding to the two extreme sound states of ResultA/B. Horizontally, it is necessary to create the corresponding sound containers for a range based on the actual measurement of different value intervals containing multiple transformations of the same sound file from ResultA to ResultB.
Within the framework of the above thresholds, I set up four sound playlist objects so that each time a threshold is triggered, the destination sound sample playlist can be played at random. According to the original design of the interaction-triggered sounds, the target sound playlist was broadly divided in the auditory category into realistically inclined sounds in the range of action-return states with a threshold of 55 and non-realistically inclined sounds in the range of action-return states with a threshold of 155. However, based on the results of the subsequent tests, the four sound playlists were further divided into Transient and Sustain in terms of their nature. The aim was to simulate a more realistic human speed state when walking up and down stairs.