     let samplerNode = AVAudioUnitSampler()
     let channelNumberForDrum: UInt8 = 10
     
-    var bankURL: URL = URL(fileURLWithPath: Bundle.main.bundlePath)
-    var program: UInt8 = 0;
-    var bankMSB: UInt8 = 0;
-    var bankLSB: UInt8 = 0;
-    var channelNumber: UInt8 = 0;
+    let channelNumber: UInt8
     
     /// MIDI Client Reference
     var midiClient = MIDIClientRef()
     var midiOutPort = MIDIPortRef()
     
-    private init() {
+    // ドラムの場合はチャンネル10を指定すること
+    public init(channelNumber: UInt8) {
+        self.channelNumber = channelNumber
+        
         audioEngine.attach(samplerNode)
         audioEngine.connect(samplerNode,
             to: audioEngine.mainMixerNode,

        audioEngine.stop()
    }
    
    private func startAudioEngine() {
        do {
            try samplerNode.loadSoundBankInstrument(at: bankURL, program: program, bankMSB: bankMSB, bankLSB: bankLSB)
            try audioEngine.start()
        } catch {
    
        }
    }
    
    public func turnOnSustain() {

        }
        
        let center = NotificationCenter.default
        center.addObserver(forName: NSNotification.Name.AVAudioEngineConfigurationChange, object: nil, queue: OperationQueue.main) { [weak self] (notification: Notification) in
            guard let localSelf = self else { return }
            if !localSelf.audioEngine.isRunning {
                localSelf.startAudioEngine()
            }
        }
        
        startAudioEngine()
    }
    
    public convenience init() {
        self.init(channelNumber: 0)
    }
    
    deinit {
