How to use Midi_pc to set instruments by channel

Hi there,

i get into some troubles with this code.
Sometimes the bass becomes the piano. How can i fix that ?
the idea is to use the internal audio card using piano and the bass

By the way, il would be nice to have a midi_all_notes_off when we press the stop button

Cheers


# Play with the internal audio card
# https://www.midi.org/specifications-old/item/gm-level-1-sound-set

midi_all_notes_off
sleep 2


use_bpm 120

# drums on channel 10



define :boom do
  midi 36, channel: 10, vel_f: 0.8
end

define :tchak do
  midi 40, channel: 10
end

define :hh do |n|
  midi_pc 114
  midi n, vel_f: 0.8
end

live_loop :drums do
  
  midi 55, channel: 10 if one_in 24
  boom
  sleep 1
  tchak
  sleep 1
end


# bass
live_loop :bass do
  
  midi_pc 34 # sélectionne la bass
  use_octave -2
  midi (scale :c, :major).tick, sustain: 0.2
  sleep 0.5
end

# voice ohoh

live_loop :piano do
  
  midi_pc 01 # piano
  use_octave -1
  midi (ring :c, :r, :e, :c2).tick, sustain: 1, vel_f: 0.5
  sleep 0.5
end

1 Like

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