Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
RowdyVoyeur authored Jun 1, 2024
1 parent c62f436 commit ad3b444
Showing 1 changed file with 84 additions and 42 deletions.
126 changes: 84 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ And here's a video showing the unit's innards and how the Lego buttons work (cli

1. Download and install [balenaEtcher](https://www.balena.io/etcher/).

2. Download and unzip [Patchbox OS 2022-05-17](https://dl.blokas.io/patchbox-os/image_2022-05-17-Patchbox.zip).
2. Download and unzip [Patchbox OS 2024-04-04](https://dl.blokas.io/patchbox-os/2024-04-04-Patchbox.zip) or [Patchbox OS 2022-05-17](https://dl.blokas.io/patchbox-os/image_2022-05-17-Patchbox.zip).

3. Insert the SD card to your computer's SD card reader and launch [balenaEtcher](https://etcher.balena.io/).

Expand All @@ -121,7 +121,7 @@ And here's a video showing the unit's innards and how the Lego buttons work (cli
ssh-keygen -R patchbox.local
ssh patch@patchbox.local
```
8. Follow the Setup Wizard instructions:
8. Follow the Setup Wizard instructions of the `Patchbox Configuration Utility`:

- If prompted, start by updating Patchbox OS;

Expand All @@ -131,22 +131,28 @@ ssh patch@patchbox.local

- Choose the boot environment `Console Autologin`;

- When prompted, disable Wi-Fi;
- When prompted, configure Wi-Fi;

- Select `None: Default Patchbox OS Environment` to disable modules.
- Select `None: Default Patchbox OS Environment` to disable modules;

9. Once the setup if finished, open the `config.txt` file to edit the display settings, disable Bluetooth and WiFi and improve boot time:
- Once the Setup Wizard is finished, don't leave the `Patchbox Configuration Utility` and stop Bluetooth, then disconnect Wi-Fi from default network and disable WiFi hotspot;

- Only if you're using Patchbox OS 2024-04-04 with a Raspberry Pi 4: Still in the `Patchbox Configuration Utility`, go to `kernel` and select `install-rt switch te current kernel to realtime one`;

- Rebbot with ```sudo reboot```.

9. Open the `config.txt` file to edit the display settings, disable Bluetooth and WiFi and improve boot time:
```
sudo nano /boot/config.txt
```
10. You may need to adjust the display settings to achieve a suitable resolution for M8C (more information [here](https://www.raspberrypi.com/documentation/computers/config_txt.html), [here](https://pimylifeup.com/raspberry-pi-screen-resolution) and [here](https://www.scribd.com/document/519276699/raspberry-pi-4-HDMI)). In my case, I had to edit the following lines in under the HDMI settings:
10. You may need to adjust the display settings to achieve a suitable resolution for M8C (more information [here](https://www.raspberrypi.com/documentation/computers/config_txt.html), [here](https://pimylifeup.com/raspberry-pi-screen-resolution) and [here](https://www.scribd.com/document/519276699/raspberry-pi-4-HDMI)). In my case, I had to edit the following lines in under the HDMI settings (this may not be necessary and/or work in Patchbox OS 2024-04-04):
```
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=2
hdmi_cvt=480p 60 6 0 0 0
```
11. If you have black borders around your display or if you cannot see the whole display, you may need to adjust `overscan`. In my case, I need to add the following so the left side of the display doesn’t go under the screen cover/protection:
11. If you have black borders around your display or if you cannot see the whole display, you may need to adjust `overscan`. In my case, I need to add the following so the left side of the display doesn’t go under the screen cover/protection (this may not be necessary and/or work in Patchbox OS 2024-04-04):
```
overscan_left=16
```
Expand All @@ -158,29 +164,24 @@ dtparam=audio=off
```
dtoverlay=vc4-kms-v3d,noaudio
```
14. Add the following under the first `[all]` ([source](https://www.animmouse.com/p/how-to-disable-wifi-and-bluetooth-on-raspberry-pi/)). To enable these options back, just comment each line. Note that you’ll need an ethernet cable from here on:
14. Disable Wi-Fi and Bluetooth by adding the following under the first `[all]` ([source](https://www.animmouse.com/p/how-to-disable-wifi-and-bluetooth-on-raspberry-pi/)). To enable these options back, just comment each line. Note that you’ll need an ethernet cable from here on:
```
dtoverlay=disable-bt
dtoverlay=disable-wifi
```
15. Exit with `ctrl + x`, save and reboot the Raspberry Pi with `sudo reboot`.
15. Exit with `ctrl + x`, save and reboot the Raspberry Pi.

16. To improve boot time, go to `raspi-config` and disable `Wait for Network on Boot`, under `System Options` and `Network at Boot`:
```
sudo raspi-config
```
17. Still in `raspi-config`, go to `Localisation Options`, then `Locale`, and select `en_US.UTF-8` only using the `spacebar`. Exit `raspi-config` and reboot.
16. Type ```sudo raspi-config``` to enter `raspi-config`. Then, disable `Splash Screen` and `Wait for Network on Boot`, under `System Options` and `Network at Boot` (some options may not be available in Patchbox OS 2024-04-04).

17. Still in `raspi-config`, go to `Localisation Options`, then `Locale`. Select `en_US.UTF-8` only, deselecting other languages (use the `spacebar` to select/deselect). Complete all the `Localisation Options`, inlcuding `Timezone` and `Wi-Fi Country`. Exit `raspi-config` and reboot.

18. Login again and finish setting the locale:
```
sudo update-locale LC_ALL="en_US.UTF-8"
sudo update-locale LANGUAGE="en_US"
sudo reboot
```
19. Login again and check that your Raspberry Pi OS locale is properly set by typing the command locale and making sure it returns the following:
```
locale
```
19. Login again and check that your Raspberry Pi OS locale is properly set by typing the command ```locale``` and making sure it returns the following:
```
LANG=en_US.UTF-8
LANGUAGE=en_US:en
Expand All @@ -198,14 +199,25 @@ LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
```
20. If you're not using [Pisound](https://blokas.io/pisound/), disable `pisound-ctl`, `pisound-btn`. If you're not using [TouchOSC2MIDI](https://github.com/velolala/touchosc2midi), disable `touchosc2midi`. You can also opt-out of [statistics program](https://blokas.io/patchbox-os/docs/telemetry), which are not necessary. All of this can be done with the following commands. More information [here](https://blokas.io/patchbox-os/docs/troubleshooting).
```
sudo systemctl disable pisound-ctl
sudo systemctl disable pisound-btn
sudo systemctl disable touchosc2midi
sudo systemctl disable wifi-hotspot.service
sudo systemctl disable --now blokas-telemetry.target
```
20. Disable Patchbox related services that are not being used. More information [here](https://blokas.io/patchbox-os/docs/troubleshooting):

- Opt-out of [statistics program](https://blokas.io/patchbox-os/docs/telemetry), and disable `Wi-Fi Hotspot`:
```
sudo systemctl disable --now blokas-telemetry.target
sudo systemctl disable wifi-hotspot.service
```

- If you're not using [TouchOSC2MIDI](https://github.com/velolala/touchosc2midi), disable `touchosc2midi`:
```
sudo systemctl disable touchosc2midi
```

- If you're not using [Pisound](https://blokas.io/pisound/), disable `pisound-ctl`, `pisound-btn`.
```
sudo systemctl disable pisound-ctl
sudo systemctl disable pisound-btn
```
21. Check if PulseAudio is running by typing `pactl list` in terminal. If PulseAudio is not necessary for your project, you can save some resources by permanently disabling it:
```
systemctl --user stop pulseaudio.socket
Expand Down Expand Up @@ -280,7 +292,7 @@ cd m8c-rpi4
cd .local/share/m8c
ls
```
33. Edit the `config.ini` file, so the `[graphics]` and `[gamepad]` sections look like [this](https://github.com/RowdyVoyeur/m8c-rpi4/blob/main/config.ini.sample). Don't forget to change `fullscreen` and `disable_cursor` to `true`.
33. Edit the `config.ini` file, so the `[graphics]` and `[gamepad]` sections look like [this](https://github.com/RowdyVoyeur/m8c-rpi4/blob/main/config.ini.sample). Check if `fullscreen` and `disable_cursor` are set to `true`.
```
sudo nano config.ini
```
Expand Down Expand Up @@ -316,27 +328,57 @@ ln -s ~/m8c-rpi4/gamecontrollerdb.txt .

## MIDI Configuration

40. [amidiauto](https://blokas.io/patchbox-os/docs/amidiauto/) is a background process of Patchbox OS, which takes care of setting up the MIDI routings automatically. Since we will use this [Patchbox module](https://github.com/RowdyVoyeur/m8c-rpi4-module), all MIDI configurations should be done [here](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf).
40. [amidiauto](https://blokas.io/patchbox-os/docs/amidiauto/) is a background process of Patchbox OS 2022-05-17, which takes care of setting up the MIDI routings automatically. However, in Patchbox OS 2024-04-04, [amidiauto](https://blokas.io/patchbox-os/docs/amidiauto/) was deprecated in favour of [amidiminder](https://github.com/mzero/amidiminder), which performs the same functions, but better.

41. In [this file](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf) you can see that MC-101 and M8 can both send and receive MIDI from each other, nanoKONTROL can send MIDI to M8 and other hardware and software is not allowed to automatically connect ports. This setup works exclusively with this [Patchbox module](https://github.com/RowdyVoyeur/m8c-rpi4-module). So, if you switch modules, these settings won't have any effect.
41. Here's how to configure MIDI if you're using Patchbox OS 2022-05-17 and [Patchbox module](https://github.com/RowdyVoyeur/m8c-rpi4-module):

42. You can configure the `amidiauto.conf` to suit your own needs. If you're using the [Patchbox module](https://github.com/RowdyVoyeur/m8c-rpi4-module), then you should edit [this file](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf) by following [these instructions](https://github.com/RowdyVoyeur/m8c-rpi4-module#midi-configuration).
- If you're using this [Patchbox module](https://github.com/RowdyVoyeur/m8c-rpi4-module), all MIDI configurations should be done [here](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf). For example, [this file](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf) should look like this if we want MC-101 and M8 sending and receiving MIDI from each other, nanoKONTROL sending MIDI to M8 and other hardware and software not being allowed to automatically connect ports:
```
[allow]
pisound <-> M8 # connects Pisound and M8 in both directions
MC-101 <-> M8 # connects MC-101 and M8 in both directions
nanoKONTROL -> M8 # connects nanoKONTROL to M8
[disallow]
* <-> * # allows automatically connecting hardware and software ports
```

43. Alternatively, you can make these settings permanent for your system by editing the Patchbox OS `amidiauto.conf`. To create a `amidiauto.conf` that makes the MIDI settings permanent to your system (instead of using the Patchbox module), you should follow the steps below:
- This setup works exclusively with this [Patchbox module](https://github.com/RowdyVoyeur/m8c-rpi4-module). So, if you switch modules, these settings won't have any effect.

- Visit [this page](https://community.blokas.io/t/midi-connection-manager/567/8) to understand how things work.
- You can configure the `amidiauto.conf` to suit your own needs. If you're using the [Patchbox module](https://github.com/RowdyVoyeur/m8c-rpi4-module), then you should edit [this file](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf) by following [these instructions](https://github.com/RowdyVoyeur/m8c-rpi4-module#midi-configuration).

- List all the connected MIDI devices to find their names with the following command:
```
aconnect -l
```
- Alternatively, you can make these settings permanent for your system by editing the Patchbox OS `amidiauto.conf`. To create a `amidiauto.conf` that makes the MIDI settings permanent to your system (instead of using the Patchbox module), you should follow the steps below:

- Visit [this page](https://community.blokas.io/t/midi-connection-manager/567/8) to understand how things work.

- Create your own version of [this file](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf) or edit the Patchbox OS `amidiauto.conf` with the following command:
```
sudo nano /etc/amidiauto.conf
```
- List all the connected MIDI devices to find their names with the following command:
```
aconnect -l
```

- Create your own version of [this file](https://github.com/RowdyVoyeur/m8c-rpi4-module/blob/main/amidiauto.conf) or edit the Patchbox OS `amidiauto.conf` with the following command:
```
sudo nano /etc/amidiauto.conf
```

42. Here's how to configure MIDI if you're using Patchbox OS 2024-04-04:

- [Amidiminder](https://github.com/mzero/amidiminder) reads its MIDI rules from the file `/etc/amidiminder.rules`.
- Therefore you need to edit this file to add your own MIDI rules:
```
sudo nano /etc/amidiminder.rules
```
- After adding your rules, you need to check if the rules are legal with the following command:
```
amidiminder -C -f /etc/amidiminder.rules
```
- And, lastly, you need to restart the service:
```
sudo systemctl restart amidiminder
```
**Optional:** You can install these [MIDI tools](https://github.com/RowdyVoyeur/midi-tools) to control parameters of M8C and Patchbox OS with an [external MIDI device](https://github.com/RowdyVoyeur/midi-tools#nanokontrol), including [switching audio routings on the fly](https://github.com/RowdyVoyeur/midi-tools#audio-routing), adjusting some `Alsamixer` volume levels and several other things.
43. This is an optional step: You can install these [MIDI tools](https://github.com/RowdyVoyeur/midi-tools) to control parameters of M8C and Patchbox OS with an [external MIDI device](https://github.com/RowdyVoyeur/midi-tools#nanokontrol), including [switching audio routings on the fly](https://github.com/RowdyVoyeur/midi-tools#audio-routing), adjusting some `Alsamixer` volume levels and several other things.
-----------
Expand Down Expand Up @@ -366,4 +408,4 @@ patchbox module activate m8c-rpi4-module
49. If the M8C starts on boot, you can see and hear the M8 audio and record onto it, sync your connected MIDI devices and shutdown with the button combination, then you're good to go.
50. Well done! Grab a cup of coffee, read the M8 [User Manual](https://dirtywave.com/pages/resources-downloads) and start saving for the actual thing ;)
50. Well done! Grab a cup of coffee, read the M8 [User Manual](https://dirtywave.com/pages/resources-downloads) and start saving for the [real deal](https://dirtywave.com/products/m8-tracker-model-02) ;)

0 comments on commit ad3b444

Please sign in to comment.