I want to make a program where I can play the bass guitar

Asked 2 years ago, Updated 2 years ago, 93 views

No matter how much I googled, I can't get the hang of it, so I'm asking I'm going to program to Android Studio I can't find open source Not in a button-by-button format.

When your hand touches the screen, it makes a sound, and when you stroke it down, I want to make it sound like a regular guitar What methods do you need? Please answer me.(Crying)(Crying)

android application

2022-09-21 19:51

2 Answers

My graduation work was also on a guitar app, so it's nice to see you. You'll have to find the guitar sound source separately.

To accept the event when you stroke, instead of click-listener, I remember using a motion event for the touchlistener.

For the guitar, divide the smartphone screen into six equal parts and place each line If you implement a motion event that corresponds to each line and put in a playback event, It will.

You can use Soundpool or Midiapi to play the song. You can add a vibration event along with the music playing.

If you look carefully for guitars, there are some open sources, so please refer to them.


2022-09-21 19:51

You can also define the button as OnTouchListener.

It's a basic framework.

btn_Touch.setOnTouchListener(new View.OnTouchListener() {

@Override

public boolean onTouch(View v, MotionEvent event) {

    switch (event.getAction()) {

    case MotionEvent.ACTION_DOWN:
                    // When you click
        break;            

    case MotionEvent.ACTION_MOVE:
                // Drag, move
        break;

    case MotionEvent.ACTION_UP:
              // When you hit your hand
        break;

    default:

        break;
    }

    return false;
}

});


2022-09-21 19:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.