How to use Midi_pc to set instruments by channel

ok this is the solution

# Play with the internal audio card
# you wil find the map on this page
# https://www.midi.org/specifications-old/item/gm-level-1-sound-set

midi_all_notes_off
sleep 0.5

use_midi_defaults port: "microsoft_gs_wavetable_synth_0"
midi_pc 36, channel: 2 # 	Fretless Bass
midi_pc 88, channel: 3 # 	Lead 8 (bass + lead)
sleep 0.5



use_bpm 120

# drums on channel 10
# midi note value corresponding to a specific drum instrument
# 36 > 	Acoustic Bass Drum
# 38 >	Acoustic Snare
# 42 >      Closed Hi Hat


# define boom to hear the bass_drum
define :boom do
  midi 36, channel: 10, vel_f: 0.8
end

define :tchak do
  midi 40, channel: 10, vel_f: 1
end

# define hh to hear the hithat with a v parameter to control the velocity
define :hh do |v|
  midi 42, channel:10,  vel_f: v
end


live_loop :drums do
  
  midi 55, channel: 10 if one_in 7
  boom
  hh(1)
  sleep 0.5
  hh 0.5
  sleep 0.5
  
  tchak
  hh(1)
  sleep 0.5
  hh(0.5)
  sleep 0.5
end


# bass
live_loop :bass do
  
  use_octave -2
  midi (scale :c, :augmented2).tick, sustain: 0.2, channel: 2
  sleep (ring 0.5, 2, 0.25, 0.5, 0.25,1).tick("f")
end

# 

live_loop :whatelse do
  
  use_octave +1
  midi (ring :c, :r, :e, :c2).tick, sustain: 0.8, vel_f: 0.5, channel: 3
  sleep 0.5
end



Merci @kniknoo General MIDI Electro

Cheers

2 Likes