7745 Lab 1 2022

From CCRMA Wiki
Revision as of 18:32, 14 February 2022 by Eberdahl (Talk | contribs) (Getting Comfortable With Satellite CCRMA)

Jump to: navigation, search

Lab 1: Making Music with Pd in Satellite CCRMA

The main point of this lab is just for you to learn how to connect to your kit and to complete the exercises in the patch lab1.pd and submit it. However, the descriptions are somewhat long to try to make it easy for you to get started and in case you want to learn more about pd or check out other resources.

For this lab you need your Satellite CCRMA kit, and a computer to program it.


The Satellite CCRMA Setup (Before Adding Arduino)

Included in your kit so far you should have

- Raspberry Pi Model B (with 512MB of RAM)
- One memory card (it may already be inserted into your Raspberry Pi)
- One Ethernet cable for communication with your laptop
- One USB micro cable
- One power supply for the USB micro cable

If you are missing something, please go get it before assembling your kit. Make sure you plug the SD memory card is seated all of the way in its slot.



Powering Up For The First Time

Plug the Ethernet port of the Raspberry Pi into your laptop. Then use the USB micro cable to power up the Raspberry Pi. (If you have a USB power supply, you could use it to power the Raspberry Pi, or if not you can try using your laptop's USB connector to power the Raspberry Pi.) You should see some lights turn on, flickering every now and then. This means that the Raspberry Pi is booting up.



Connect To Satellite CCRMA

In order to see what your Satellite CCRMA kit is doing and program it, you need to log in to it. To do so, follow these instructions.

After you login, you will see the prompt ccrma@satellite:~$ This means that you are logged into a computer named "satellite" as the user "ccrma", and you are currently in the directory ~, which is the shortcut for your home directory.



Avoid Powering Down the Board Without Halting it First!

Would you take the battery out of your laptop and unplug its power adaptor without shutting down? Nope! The same goes for Satellite CCRMA, at least when you can avoid it, because it is a small computer running linux.

Now we will test the halt procedure. Run the halt command as superuser by typing sudo halt at the Satellite CCRMA prompt. Then you will again have to type in the password temppwd in order to have the privilege to run this command. Wait until about 15 seconds after you see the message "Connection to 192.168.105.106 closed by remote host," and then disconnect the power from the Raspberry Pi via the micro USB connector.



Getting Comfortable With Satellite CCRMA

  • Turn on Satellite CCRMA again using the same procedure as before. After about 30 seconds, the board should be booted up again, so you can log in again by running the command

ssh -XY ccrma@192.168.105.106

  • Run the command pwd to find out the current directory. You will find that you are in the ccrma subdirectory of the directory /home.
  • Type the ls command to see what is in the current directory. The blue items are subdirectories of the current directory. You can change directories using the cd command. For instance, to change into the pd subdirectory, you should run the command

cd pd

  • Now again type pwd to make sure that you understand where you are! Run the ls command to see what files are in here.

Starting Audio And Pd

  • A default pd patch starts running automatically when your kit finishes booting up. To stop the default pd patch from running, execute the command

stop-default

Remember that each time you boot up your kit and want to edit your patch, you should stop the default patch from running by using the command stop-default

  • Start pd now with the following command (the "space" & just means that the pd process shouldn't take over the terminal -- that way you can keep using the terminal independently of whatever pd is doing)

pd &

This time the graphical user interface (GUI) for pd should also start.

  • To start audio, click on the Compute audio checkbox.
  • Now to test audio, go to the media pull-down menu and choose Test Audio and MIDI. If you still do not hear any sound, then probably you missed one of the steps so far. If you look at the messages in the main pd window, you might find a clue.
  • Once you have audio working, close the window test audio and MIDI.
  • Choose Open from the File menu and select the patch default-patch.pd within your ~/on-startup directory.
  • Be mindful that as you edit this patch, you are changing what your kit will do when it boots up.
  • For lab 1, you should collect some of your own WAV files, move them into the ~/on-startup directory and then edit the patch so that it is playing the new wave files.
  • Demonstrate to Dr. Berdahl that you have gotten it working

~/pd/lectures

Help With Learning Pd

  • Try out the example patches in ~/pd/7745/lab1/separate-examples
  • Look at the tutorial patches in ~/pd/7745/lab1/pd_lecture_part_1
  • The patch ~/pd/examples/just-play-WAV-files/play-WAV-file.pd shows the easiest way to play a WAV file. Try it out!
  • Look at the pd lecture patches stored in ~/pd/pd-lecture (For example, see the patch 4_algorithmic_music.pd. Make sure that audio is on and increase the volume from zero in the patch.)
  • Right-click or option-click on any object to get a contextual menu including "help," which opens that object's help patch. (If you are using a Mac and don't have a right mouse button, then go to the X11 pull-down menu, select Preferences, and make sure that Emulate three button mouse is checked in the Input pane. Now, you should be able to right-click by clicking while holding down the Command key.)
  • Right-click on a blank portion of a Pd patch. Now when you select "help" you get a list of Pd's built-in objects, arranged by category.
  • In the upper right hand corner of each Pd window is a "help" menu. This accesses the Pd tutorials as well as some online reference documentation.






More Sound Synthesizer Patches

  • Try out some of the patches from Andy Farnell's book Designing Sound. These patches are installed in ~/pd/DesigningSoundBookExamples Most of the patches in there work with this version of pd, but a few patches don't! (As you try out the patches, keep in mind also that many of the patches are subpatches. That means that they are lower level patches that are used to serve some specific purpose within a higher level patch. Therefore, you may have to search around some to find the higher level patches that are easier to use to make sound.)



The Community

There is a large, dedicated, and very generous community of Pd users on the Internet. Do some web searching (e.g., with a search engine, or else starting from some more specific resources) and look for interesting externals and/or patches. Optional: Download, install, and play with at least one. Can you incorporate it into what you programmed in the previous part?

For more help in finding resources, don't forget to look on the PID Links page.



Appendix A: Troubleshooting

Tips:

  • If you are having problems with audio, make sure that compute audio is set to on.
  • If the audio is stuttering, then your processor might not be powerful enough to run all of the patches that are open. Remember, Satellite CCRMA is not as powerful as a laptop. Therefore, be careful about building complicated patches. You can monitor how much CPU you are using by running the top command in the terminal.
  • Type dmesg to see if there are any relevant messages that look like error messages.

Solutions:

  • If you are running out of space on the SD card, you can free up some space by deleting items in /usr/src. For instance, all of the files needed for building Pure Data Extended are rather large.



Appendix B: Transferring Files To and From Your Kit

  • Download CyberDuck to your laptop to make it easy to transfer files back and forth from your kit.
  • Start CyberDuck on your laptop, and then create the following new bookmark:

Bookmark.png

  • Once you have finished entering the text, close the bookmark window.
  • Then you can use CyberDuck to connect to your Satellite CCRMA kit by double clicking on the SFTP to Satellite CCRMA bookmark.
  • After you enter the password temppwd, CyberDuck will connect and open window to open up showing the files in the /home/ccrma home directory on your kit.
  • You can drag and drop files from here to move them back and forth.
  • If you move WAV files to your kit, please remember that the default sampling rate for pd is 22kHz, so you may want to resample them first. For example, Audacity can be used to resample the audio files.



Halt Your Board Properly When Finished!

  • Remember to shut down your board using

sudo halt

when you are done before powering it off!





More Pd resources





Most instructions by Edgar Berdahl, and lab patches for musical interaction description by Matt Wright and possibly others.

PID 2013