You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print "Sending program change to program %d..." % program_number
# Bank change (fine) to (program_number / 128)
midiout.send_message([
CC_CHANNEL_OFFSET + midi_channel,
0x20,
int(program_number / 128),
])
it's better to add bank_number in command line arguments like this:
recommended changes in midi_helpers.py:
def set_program_number(midiout, midi_channel, program_number, bank_number):
if bank_number is not None:
print "Sending bank change to bank %d..." % bank_number
# Bank change (fine) to bank_number % 128
midiout.send_message([
CC_CHANNEL_OFFSET + midi_channel,
0x20,
bank_number % 128,
])
if program_number is not None:
print "Sending program change to program %d..." % program_number
# Program change to program number % 128
midiout.send_message([
CHANNEL_OFFSET + midi_channel,
0xC0,
program_number % 128,
])
# All notes off, but like, a lot
for _ in xrange(0, 2):
all_notes_off(midiout, midi_channel)
time.sleep(0.5)
recommended changes in record.py
sampling_options.add_argument(
'--program-number', type=int,
help='switch to a program number before recording')
sampling_options.add_argument(
'--bank-number', type=int,
help='switch to a bank number before recording')
here:
print "Sending program change to program %d..." % program_number
# Bank change (fine) to (program_number / 128)
midiout.send_message([
CC_CHANNEL_OFFSET + midi_channel,
0x20,
int(program_number / 128),
])
it's better to add bank_number in command line arguments like this:
def set_program_number(midiout, midi_channel, program_number, bank_number):
if bank_number is not None:
print "Sending bank change to bank %d..." % bank_number
# Bank change (fine) to bank_number % 128
midiout.send_message([
CC_CHANNEL_OFFSET + midi_channel,
0x20,
bank_number % 128,
])
if program_number is not None:
print "Sending program change to program %d..." % program_number
# Program change to program number % 128
midiout.send_message([
CHANNEL_OFFSET + midi_channel,
0xC0,
program_number % 128,
])
recommended changes in record.py
sampling_options.add_argument(
'--program-number', type=int,
help='switch to a program number before recording')
sampling_options.add_argument(
'--bank-number', type=int,
help='switch to a bank number before recording')
3 recommended changes in record.py
def sample_program(
output_folder='foo',
low_key=21,
high_key=109,
max_attempts=8,
midi_channel=1,
midi_port_name=None,
midi_port_index=None,
audio_interface_name=None,
audio_interface_index=None,
cc_before=None,
program_number=None,
bank_number=None,
cc_after=None,
flac=True,
velocity_levels=VELOCITIES,
key_range=1,
cleanup_aif_files=True,
limit=None,
looping_enabled=False,
print_progress=False,
has_portamento=False,
sample_asc=False,
sample_rate=SAMPLE_RATE,
):
and
So you can change bank number as you wish with --bank_number argument.
The text was updated successfully, but these errors were encountered: