Development of Gamelan music instruments using HC-SR04 sensor on arduino and operated using android-based applications

Gamelan is one of Indonesia’s traditional music which has become a cultural identity and has survived for a long time. Bonang is a gamelan musical instrument that is played by being hit on the protruding upper part. The importance of preserving traditional music culture makes us realize that traditional music is not lost in today’s technological era. This research is to design a virtual bonang musical instrument using the Arduino Mega2560 microcontroller and the HC-SR04 sensor as tone identification. The result of this research is a virtual bonang musical instrument prototype that can be operated via an Android-based smartphone. This prototype is also useful for introducing art as part of STEAM to students.


Introduction
Gamelan music has become the cultural identity of Indonesian society, because it has lived in a culture and has become a tradition in people's lives for a very long period of time. The name gamelan itself actually comes from two syllables "gamel" and "an". Meanwhile, "gamel" in Javanese means hitting or beating, while "an" in Javanese means a noun. So, gamelan is a beating activity carried out by ancient people which later became the name of the ensemble musical instrument. Gamelan itself is included in the type of ensemble music which is played together with other musical instruments to create melodious sounds. Gamelan consists of various instruments including kendang, bonang, demung, saron, peking, kenong, gong, rebab, and suling.
Bonang is one of the musical instruments used in Javanese gamelan. The bonang is also a prominent melodic instrument. Played by beating or beating on the top of the protruding or called pencu (pencon) by using two special beaters made of layered sticks called bindhi. This musical instrument consists of a collection of small gongs which are commonly called kettles or pots. The small gongs are placed horizontally on the strings in a wooden frame (rancak), either one or two rows wide. All kettles have a center point with the low-pitched perimeter having a flat head, while the higher ones have an arch. Each of them is played according to certain conditions. There are three types of bonang, namely the bonang penerus, bonang penembung, and bonang barung. Bonang barung is medium in size, mid to high octave, one of the leading instruments in the ensemble. Today the gamelan culture is slowly being left behind by the community especially among young people. Over time, this traditional musical instrument is no longer popular in the eyes of young people. Young people tend to be more eager to get into electronic musical instruments. In another, gamelan musical instruments are quite expensive and not easily found in every region of Indonesia, so an alternative product is needed that resembles the function of gamelan tones and can be played easily with the aim of preserving national culture.
There have been many related studies that utilize the HC-SR04 sensor or generally referred to as an ultrasonic sensor. Siregar et al. in 2016 installed an ultrasonic sensor on a prototype fire extinguisher robot which functions to prevent the robot from hitting the obstacle around the robot's motion path. The use of ultrasonic sensors works well so that the moving robot has the ability to anticipate obstacles within a distance of less than 15 cm [1]. Previously in 2007, Susanto et al. has successfully conducted research successfully made a system to alert vehicle drivers to information on the distance between cars and obstacles as well as cars and cars by utilizing ultrasonic waves. Distance reading accuracy in the range 2 -40 cm [2]. In 2018, Siregar et al. using the ultrasonic sensor on the robot prototype as a simulation of a wheelchair that is moved autonomously and is able to move from one room to another in accordance with a predetermined plan [3]. In the same year, Sitohang et al. has also conducted research to help people with visual impairments using three sets of ultrasonic sensors attached to the front, left and right of the belt worn on the user's body. Whenever an obstacle is found, the system built will emit a different tone from each sensor installed. So that the user can detect which side there is a barrier on the path that is traversed [4]. Srinivasulu and Tarun in 2020 make use of the HC-SR04 sensor, Arduino microcontroller, and SG90 servo motor for RADAR purposes. The system built is capable of realizing objects at a radius of 3 -500cm [5].

Materials and Method
The hardware materials used in this research are 12 sets of HC-SR04 sensors, 1 set of Arduino Mega2560 microcontroller, 1 set of HC-05 Bluetooth module, along with connecting cables and a 12V power supply. Meanwhile, Android Studio is used to build the application.   Figure 1 shows the general architecture in this research, where the player uses both palms to approach from the top of each HC-SR04 sensor mounted on an electronic board circuit so as to produce predetermined tones through the programming code. The sensor that gets input will send data to the microcontroller and then forward it to an Android-based application via Bluetooth communication, which in turn produces sound through the speaker on the smartphone.  The sensor code as can be seen in table 1 is the command that is registered in the Arduino program which is used to distinguish each tone that will sound. The variable used is a string. This variable will be filled in according to the HC-SR04 sensor that is approached. If the approached sensor is "A1", then the sensor code variable will contain "A1". This code will be sent to the Android-based application via the Bluetooth communication line. The codes received by the application will be checked and adjusted according to their respective tones. For example, if the code received by the application is "A1", the tone that will be sounded is the tone "n1" with the chord is "6". Likewise, if the code received by the application is "B6", the tone that will sound is the tone "n12" with the chord is "1ˬ".

Result and Discussion
This stage is a continuation of the system design stage. At this stage a minimum system is built in the form of hardware programmed using the C programming language software so that the prototype that is built can be played by the user by bringing the palm or the bat closer to the HC-SR04 sensor so that in the end the gamelan sound can be heard through the speakers on the smartphone. The communication module between Arduino and Android-based smartphone is Bluetooth. The prototype built uses 12 HC-SR04 sensors where each sensor represents each tone on the gamelan instrument. The Arduino Mega2560 is used as a microcontroller and the HC50 Bluetooth module is used as a component for wireless data transmission. The prototype that has been assembled can be seen in figure 3.  In table 2, we can see the results in the form of successful detection and delay obtained from the reading of the system against the distance from the human palm to the HC-SR04 sensor attached to produce a tone that is issued on the speaker on the smartphone. The tone of sound is heard from the speaker on the smartphone 9 Not detected -The tone of sound cannot be heard from the speaker on the smartphone The display on the smartphone application that is built, as shown in figure 4, is useful for providing information on what tones are successfully tapped via the HC-SR04 sensor installed in the electronic circuit.

Conclusion
The conclusions that can be drawn from the results of this research are as follows: Gamelan instruments can be played well when the palm is against the sensor at a distance of 1.25 to 8 cm; the gamelan prototype succeeded in sending a tone output to an Android-based smartphone with several notes in the form of a delay that occurred.