Download"Jessie" image and burn to SD Card.
Now we are going to :
- Install the new kernel we downloaded.
- backup and install new kernel.
- Install Overlays & Modules.
- update the module and reboot
We will need to run the following commands.
cd ~ sudo mv /boot/gadgetkernel.tgz tar -xvzf gadgetkernel.tgz sudo mv /boot/kernel.img /boot/kernelbackup.img sudo mv tmp/boot/kernel.img /boot sudo mv tmp/boot/overlays/* /boot/overlays sudo mv tmp/boot/*dtb /boot sudo cp -R tmp/boot/modules/lib/* /lib sudo nano /etc/modulesafter the last command the text editor will show up so we we will add
g_midiand then save the file.
Done! we just need to connect PiZero to PC. Now on your computer there will be a new MIDI device . Check the Windows Device Manager.
piStudio Runs with LMMS so we need to Install this to the piZero. Open up a terminal and run the command:
sudo apt-get install lmmsand we are Done! For now.
In order to be able to use the phatDac we will need to set it up.
in order to do this we will need to:
- connect to the internet.
- bring up the terminal.
- Run this code:
curl -sS get.pimoroni.com/phatdac | bashThis will run the automated installer provided by PIMORONI.
for manual install we can follow the instruction ove at the POST " Setting up pHAT DAC".
In order to get Midi working we need to boot up the Pi, and type this in a terminal:
sudo nano /boot/config.tx
We will add these two lines:
init_uart_clock=2441406 init_uart_baud=38400now save (Ctrl+0) and exit (Ctrl+x).
Next, edit the cmdline.txt and inittab.txt to disable the Pi's shell from UART so the port is free for MIDI access. Back-up each file :
sudo cp /boot/cmdline.txt /boot/cmdline.bak sudo cp /etc/inittab /etc/inittab.bak
Lets edit the cmdline.txt:
sudo nano /boot/cmdline.txtremove any mention of ttyAMA0,115200 such as “console=ttyAMA0,115200” and “kgdboc=ttyAMA0,115200”. It should say "console=tty1" after you've edited it. Add bcm2708.uart_clock=3000000 to the first line in case it's not already there, so now it should look like this:
dwc_otg.lpm_enable=0 bcm2708.uart_clock=3000000 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Save and exit, then edit the inittab.txt
sudo nano /etc/inittab
Now look for the line at the bottom that says “ttyAMA0” and remove it or put a hash in front of it like this:
Save and exit, and then restart your Pi. Now the Pi should be able to receive and send communication at 31250 baud, but we need to install a program to handle the MIDI signals. Time to do a little ditty for TTYMidi, a bit of software that creates a serial to ALSA interface on your Pi. Type the following commands into the Pi terminal to download and install ttymidi:
sudo apt-get install libasound2-dev wget http://www.varal.org/ttymidi/ttymidi.tar.gz tar -zxvf ttymidi.tar.gz cd ttymidi/ make sudo make install
Reboot the Pi.