Skip to content

Commit

Permalink
Merge pull request #12 from togrupe/release/2.0.0
Browse files Browse the repository at this point in the history
Release/2.0.0
  • Loading branch information
togrupe committed Jan 5, 2023
2 parents 40a19f8 + 0f8bc2a commit 31cbbb0
Show file tree
Hide file tree
Showing 22 changed files with 692 additions and 153 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,7 @@ dmypy.json
.idea

.DS_Store

#Reaper
*.rpp
*.rpp-bak
21 changes: 0 additions & 21 deletions ChannelListEntry.py

This file was deleted.

28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# dlive-midi-tools
## Description
Python and midi/tcp based tool to prepare channel lists for Allen & Heath dlive systems. Based on an excel sheet the following parameters can be preconfigured and in one or more steps be written into the dlive system via midi/tcp.
Python and midi/tcp based tool to prepare channel lists for Allen & Heath dlive systems. Based on an excel sheet the following parameters can be preconfigured and in one or more steps be written into the dlive system via midi/tcp. Additionally from the same excel sheet a DAW recording session for Reaper can be generated.
- Channel Name
- Channel Color
- 48V Phantom Power (only for mixrack local sockets 1-64)
- Channel Mute
- 48V Phantom Power & PAD (Local, DX1 & DX3)

more information about future releases can be found in the [wiki](https://github.com/togrupe/dlive-midi-tools/wiki)

## Use Cases
* Single source for channel lists in multi console situations
* Single source (excel sheet) for channel lists in multi console situations
* Better overview on all channels during preparation phase
* Sync channel names and colors for virtual soundchecks (planned for future release)
* Sync channel names and colors between consoles and DAW for virtual soundchecks

## Used Python Libraries
* mido - Midi Library
* pandas - excel reader/writer
* reathon - Reaper Session Creator

## Overview
![Overview](overview.drawio.png)

## Input file
Excel sheet, please edit the columns: Name, Color and Phantom
Excel sheet, please have a look at the following tabs

# Channel Overview
![Channels](doc/excel_channels.png)
# 48V Phantom Power and PAD Overview
![Phantom](doc/excel_phantom.png)

![Excel](excel.png)

An example Excel file named: **dLiveChannelList.xlsx** can be found in the root folder.
By default, the channels 1-128 are available in the sheet. If you need less,
Expand Down Expand Up @@ -70,15 +78,17 @@ Prerequisites:

Afterwards the following window appears.

![Gui](gui.png)
![Gui](doc/gui.png)

1. Check the Mixrack IP and Midi Port.

2. Select the columns you want to write,

3. then click the button "Open Excel Sheet and Trigger Writing Process" to select your custom Excel sheet. Afterwards the selected action(s) start automatically.
3. If you also want to create a Reaper Template session, set the corresponding tick. The Reaper session file `recording-template.rpp` will be generated into the directory from where the tool was executed.

4. Click the button "Open Excel Sheet and Trigger Writing Process" to select your custom Excel sheet. Afterwards the selected action(s) start automatically.

4. If something goes wrong, please check the console.
5. If something goes wrong, please check the python console.

If you find any issues, please let me know.

Expand Down
File renamed without changes.
Binary file modified dLiveChannelList.xlsx
Binary file not shown.
57 changes: 57 additions & 0 deletions dawsession/SessionCreator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import logging

from reathon.nodes import Project, Track

import dliveConstants


def convert_sheet_color_to_reaper_color(color):
lower_color = color.lower()
if lower_color == "blue":
colour = dliveConstants.reaper_color_blue
elif lower_color == "red":
colour = dliveConstants.reaper_color_red
elif lower_color == "light blue":
colour = dliveConstants.reaper_color_ltblue
elif lower_color == 'purple':
colour = dliveConstants.reaper_color_purple
elif lower_color == 'green':
colour = dliveConstants.reaper_color_green
elif lower_color == 'yellow':
colour = dliveConstants.reaper_color_yellow
elif lower_color == 'black':
colour = dliveConstants.reaper_color_black
elif lower_color == 'white':
colour = dliveConstants.reaper_color_white
else:
logging.warning("Given color: " + lower_color + " is not supported, setting default color: black")
colour = dliveConstants.reaper_color_black
return colour


def create_reaper_session(sheet):
project = Project()

for item in sheet.get_channel_model():
track = Track()
name = item.get_name()

if name == 'nan':
track_name_raw = ""
else:
track_name_raw = name

track_name_combined = "{:0>3d}_{}".format(item.get_channel(), track_name_raw)
track.props = [
["NAME", track_name_combined],
["PEAKCOL", convert_sheet_color_to_reaper_color(item.get_color())],
["REC", "1 0 1 0 0 0 0 0"],
["TRACKHEIGHT", "40 0 0 0 0 0"]
]
project.add(track)

project.write("recording-template.rpp")


if __name__ == '__main__':
create_reaper_session()
1 change: 1 addition & 0 deletions dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ mido
pandas
xlrd
openpyxl
reathon
67 changes: 66 additions & 1 deletion dliveConstants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The color mappings
# The dlive color mappings
lcd_color_black = 0x00
lcd_color_red = 0x01
lcd_color_green = 0x02
Expand All @@ -12,6 +12,14 @@
phantom_power_off = 0x00
phantom_power_on = 0x7F

# The HPF on values
hpf_off = 0x00
hpf_on = 0x7F

# The PAD values
pad_off = 0x00
pad_on = 0x7F

# SysEx Header Major Version
sysex_header_major_version = 0x01
sysex_header_minor_version = 0x00
Expand All @@ -20,11 +28,68 @@
sysex_message_set_channel_name = 0x03
sysex_message_set_channel_colour = 0x06
sysex_message_set_socket_preamp_48V = 0x0C
sysex_message_set_socket_preamp_pad = 0x09

# NRPN messages
nrpn_parameter_id_hpf_on = 0x31
nrpn_parameter_id_hpf_frequency = 0x30
nrpn_parameter_id_fader_level = 0x17
nrpn_parameter_id_dca_assign = 0x40

# Note
note_off = 0x00

# DCA
dca_on_base_address = 0x40
dca_off_base_address = 0x00

# Mute
mute_on = 0x7F
mute_off = 0x3F

# Fader levels
fader_level_plus10 = 0x7F
fader_level_plus5 = 0x74
fader_level_zero = 0x6B
fader_level_minus5 = 0x61
fader_level_minus10 = 0x57
fader_level_minus15 = 0x4D
fader_level_minus20 = 0x43
fader_level_minus25 = 0x39
fader_level_minus30 = 0x2F
fader_level_minus35 = 0x25
fader_level_minus40 = 0x1B
fader_level_minus45 = 0x11
fader_level_minus_inf = 0x00

# SysEx header definitions
sysexhdrstart = [0xF0, 0x00, 0x00, 0x1A, 0x50, 0x10, sysex_header_major_version, sysex_header_minor_version]
sysexhdrend = [0xF7]

# Strings Midi Channel Selector
midi_channel_drop_down_string_1 = "1 to 5"
midi_channel_drop_down_string_2 = "2 to 6"
midi_channel_drop_down_string_3 = "3 to 7"
midi_channel_drop_down_string_4 = "4 to 8"
midi_channel_drop_down_string_5 = "5 to 9"
midi_channel_drop_down_string_6 = "6 to 10"
midi_channel_drop_down_string_7 = "7 to 11"
midi_channel_drop_down_string_8 = "8 to 12"
midi_channel_drop_down_string_9 = "9 to 13"
midi_channel_drop_down_string_10 = "10 to 14"
midi_channel_drop_down_string_11 = "11 to 15"
midi_channel_drop_down_string_12 = "12 to 16"

# The Reaper color mappings
reaper_color_black = 16777216
reaper_color_red = 17236731
reaper_color_green = 23527270
reaper_color_yellow = 23527423
reaper_color_blue = 33521679
reaper_color_purple = 30371836
reaper_color_ltblue = 33541222
reaper_color_white = 33554431

# if no dlive system is available, you can simulate the outgoing midi calls, by setting the next parameter to False
allow_network_communication = True

Expand Down
Binary file added doc/excel_channels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/excel_phantom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed excel.png
Binary file not shown.
Binary file removed gui.png
Binary file not shown.
Loading

0 comments on commit 31cbbb0

Please sign in to comment.