# Midi\_cc to select bank and qsynth

**URL:** <https://in-thread.sonic-pi.net/t/midi-cc-to-select-bank-and-qsynth/3034>\
**Category:** Support, Help & Resources\
**Created:** [December 8, 2019, 10:38pm UTC](https://in-thread.sonic-pi.net/t/midi-cc-to-select-bank-and-qsynth/3034 "2019-12-08T22:38:58Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![nlb](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/nlb/32/997_2.png) [@nlb](https://in-thread.sonic-pi.net/u/nlb)\
**Post date:** [December 9, 2019, 3:30pm UTC](https://in-thread.sonic-pi.net/t/midi-cc-to-select-bank-and-qsynth/3034/4 "2019-12-09T15:30:42Z")

</div>

Hi i’m back with good news under windows 10

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/6/6ecc9f58332aca4fee257e57df26ef5f8b328e70.png)

this script is working for me

```ruby

# Testing midi and qsynth - nlb with big help from Robin Newman - 09-12-2019
# spi version : v3.1
# os : windows 10
# qsynth : 0.5.5 https://github.com/JoshuaPrzyborowski/Qsynth-Windows-Builds
# soundFont : Arachno SoundFont - Version 1.0.sf2 https://www.polyphone-soundfonts.com/en/files/27-instrument-sets/255-arachno-soundfont
# port loop midi : loopMidi 1.0.15

puts version

use_midi_defaults port: "loopmidi", channel: "4"

play 60

# the mma bank select mode is choosen in Qsynth configuration

midi_cc 0, 0 #
midi_cc 32, 0 # banque 0
sleep 0.95 #reduce this sleep to compensate for the extra one after midi_pc
## on choisit le programme 1 piano
## we send a midi program change to select the program number 1
midi_pc 1
sleep 0.85 # inserting a short sleep here seems to cure the problem
## we play a note to test
midi_note_on :c2
sleep 4

num_prg = [24, 25, 26]
num_prg.length.times do
  # midi program_change pour changer le numéro de programme dans la banque sélectionnée
  midi_pc num_prg.tick # le numero de programme doit exister attention au trou (mind the gap)
  sleep 0.15
  midi_note_on 60
  sleep 2
end

# to select the bank number 128
midi_cc 0, 1 # 1 = 128
midi_cc 32, 0 # bank selection >> 1*128 + 0 = 128
sleep 0.15

## we send a midi program change to select the program number 8
midi_pc 8
sleep 0.15

midi_note_on :c2
sleep 1
midi_note_on :g3
sleep 1

midi_all_notes_off

```

hope it helps.

---

_[View the full topic](https://in-thread.sonic-pi.net/t/midi-cc-to-select-bank-and-qsynth/3034)._
