with this code [autowatch = 1;

// Get the matrixctrl object by its name
var matrix = this.patcher.getnamed("matrixctrl1");
// Initialize an array to store the state of the buttons
var buttonState = [];

for (var i = 0; i < 64; i++) {
 buttonState.push(0);
}

// Define a function to set the state of a button
function setcell(x, y, value) {
 matrix.setvalueof(x + y \* 8, value); // Set the state of the button in the matrixctrl object

 // Update the state in the buttonState array for the entire matrix
 buttonState = [];
 for (var i = 0; i < 64; i++) {
 buttonState.push(matrix.getvalueof(i));
 }
//post("buttonState: " + JSON.stringify(buttonState) + "\n");
post("buttonState: " + buttonState + "\n");

 // Output the current state of the buttonState array
 outlet(0, "buttonState", buttonState);
}

// Define a function to output the current state of the buttons
function bang() {
 var currentState = [];
 var matrixState = matrix.getvalueof();

 for (var i = 0; i < matrixState.length; i++) {
 if (matrixState[i] === 1) {
 var x = i % 8;
 var y = Math.floor(i / 8);
 currentState.push(x + y \* 8);
 }
 }

 // Output the current state of the buttons
 outlet(0, "Currently switched on buttons: " + currentState);
 post("Currently switched on buttons: " + currentState);

}

// Define a function to receive messages from the message object
function msg\_int(value) {
 // Parse the x and y coordinates from the message value
 var y = Math.floor(value / 8);
 var x = value % 8;

 // Toggle the state of the button
 var index = x + y \* 8;
 buttonState[index] = (buttonState[index] === 0) ? 1 : 0;
 setcell(x, y, buttonState[index]); // Update the state of the button
}

function refresh() {
 matrix.clear(); // Clear the matrixctrl object
 var matrixState = matrix.getvalueof();
 for (var i = 0; i < 64; i++) {
 buttonState[i] = matrixState[i];
 }
}

// Enable the js object to receive messages
this.autowatch = 1;
] I get this output [js: buttonState: 0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1 
] when I have the 1 and 64 button pressed, which is wrong, I should just have a 1 at the end and a 1 at the beginning and all the rest 0 right?
이 코드로 [autowatch = 1;

// 이름으로 matrixctrl 객체를 가져옵니다.
var matrix = this.patcher.getnamed("matrixctrl1");
// 버튼의 상태를 저장할 배열을 초기화합니다.
var buttonState = [];

for (var i = 0; i < 64; i++) {
 buttonState.push(0);
}

// 버튼의 상태를 설정하는 함수를 정의합니다.
함수 setcell(x, y, value) {
 matrix.setvalueof(x + y \* 8, value); // matrixctrl 객체에 버튼의 상태를 설정합니다.

 // 전체 매트릭스에 대해 buttonState 배열의 상태를 업데이트합니다.
 buttonState = [];
 for (var i = 0; i < 64; i++) {
 buttonState.push(matrix.getvalueof(i));
 }
//post("buttonState: " + JSON.stringify(buttonState) + "\n");
post("buttonState: " + buttonState + "\n");

 // 버튼 스테이트 배열의 현재 상태를 출력합니다.
 outlet(0, "buttonState", buttonState);
}

// 버튼의 현재 상태를 출력하는 함수를 정의합니다.
함수 bang() {
 var currentState = [];
 var matrixState = matrix.getvalueof();

 for (var i = 0; i < matrixState.length; i++) {
 if (matrixState[i] === 1) {
 var x = i % 8;
 var y = Math.floor(i / 8);
 currentState.push(x + y \* 8);
 }
 }

 // 버튼의 현재 상태를 출력합니다.
 outlet(0,"현재 켜진 버튼: " + currentState);
 post("현재 켜진 버튼: " + currentState);

}

// 메시지 객체에서 메시지를 수신하는 함수를 정의합니다.
function msg\_int(value) {
 // 메시지 값에서 x와 y 좌표를 구문 분석합니다.
 var y = Math.floor(value / 8);
 var x = value % 8;

 // 버튼의 상태를 토글합니다.
 var index = x + y \* 8;
 buttonState[index] = (buttonState[index] === 0) ? 1 : 0;
 setcell(x, y, buttonState[index]); // 버튼의 상태를 업데이트합니다.
}

함수 refresh() {
 matrix.clear(); // matrixctrl 객체 지우기
 var matrixState = matrix.getvalueof();
 for (var i = 0; i < 64; i++) {
 buttonState[i] = matrixState[i];
 }
}

// js 객체가 메시지를 수신하도록 활성화합니다.
this.autowatch = 1;
] 다음과 같은 출력을 얻습니다 [js: buttonState: 0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7, 1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7, 1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7, 1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1,0,0,1,7,7,1 
1과 64 버튼을 눌렀을 때 끝과 시작에 1이 있고 나머지는 모두 0이어야하는 것은 잘못된 것 맞죠?