• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

EEG/H03-May-2022-3,2002,501

FFNet/H03-May-2022-3,2702,200

LPC/H03-May-2022-13,3729,725

artsynth/H03-May-2022-3,4812,247

dwsys/H03-May-2022-16,3639,397

dwtest/H03-May-2022-36,21435,379

dwtools/H03-May-2022-85,65865,964

external/H03-Dec-2021-848,064600,516

fon/H03-May-2022-79,63063,680

generate/Unicode/H03-Dec-2021-177172

gram/H03-May-2022-12,57010,277

kar/H03-May-2022-424,266228,904

main/H03-May-2022-823784

makefiles/H03-Dec-2021-389253

melder/H03-May-2022-26,73518,979

stat/H03-May-2022-7,6576,081

sys/H03-May-2022-59,32347,494

test/H03-Dec-2021-41,06140,269

.clang-formatH A D03-Dec-20213.2 KiB116114

MakefileH A D03-Dec-20212.2 KiB9070

README.mdH A D03-Dec-202128.2 KiB599453

makefile.defsH A D03-May-20221.3 KiB5022

README.md

1# Praat: doing phonetics by computer
2
3Welcome to Praat! Praat is a speech analysis tool used for doing phonetics by computer.
4Praat can analyse, synthesize, and manipulate speech, and create high-quality pictures for your publications.
5Praat was created by Paul Boersma and David Weenink of the Institute of Phonetics Sciences of the University of Amsterdam.
6
7Some of Praat’s most prominent features are:
8
9#### Speech analysis
10
11Praat allows you to analyze different aspects of speech including pitch, formant, intensity, and voice quality.
12You have access to spectrograms (a visual representation of sound changing over time)
13and cochleagrams (a specific type of spectrogram more closely resembling how the inner ear receives sound).
14
15#### Speech synthesis
16
17Praat allows you to generate speech from a pitch curve and filters that you create (acoustic synthesis),
18or from muscle activities (articulatory synthesis).
19
20#### Speech manipulation
21
22Praat gives you the ability to modify existing speech utterances. You can alter pitch, intensity, and duration of speech.
23
24#### Speech labelling
25
26Praat allows you to custom-label your samples using the IPA (International Phonetics Alphabet),
27and annotate your sound segments based on the particular variables you are seeking to analyze.
28Multi-language text-to-speech facilities allow you to segment the sound into words and phonemes.
29
30#### Grammar models
31
32With Praat, you can try out Optimality-Theoretic and Harmonic-Grammar learning,
33as well as seevral kinds of neural-network models.
34
35#### Statistical analysis
36
37Praat allows you to perform several statistical techniques, among which
38multidimensional scaling, principal component analysis, and discriminant analysis.
39
40For more information, consult the website [praat.org](https://praat.org), which has Praat tutorials in several languages.
41
42## 1. Binary executables
43
44While the [Praat website](https://praat.org) contains the latest executable for all platforms that we support
45(or used to support), the [releases on GitHub](https://github.com/praat/praat/releases) contain many older executables as well.
46
47The meaning of the names of binary files available on GitHub is as follows:
48
49### 1.1. Windows binaries
50- `praatXXXX_win64.zip`: zipped executable for 64-bit Windows (XP and higher)
51- `praatXXXX_win32.zip`: zipped executable for 32-bit Windows (XP and higher)
52- `praatconXXXX_win64.zip`: zipped executable for 64-bit Windows, console edition
53- `praatconXXXX_win32.zip`: zipped executable for 32-bit Windows, console edition
54- `praatconXXXX_win32sit.exe`: self-extracting StuffIt archive with executable for 32-bit Windows, console edition
55- `praatXXXX_win98.zip`: zipped executable for Windows 98
56- `praatXXXX_win98sit.exe`: self-extracting StuffIt archive with executable for Windows 98
57
58### 1.2. Mac binaries
59- `praatXXXX_mac.dmg`: disk image with universal executable for (64-bit) Intel and Apple Silicon Macs (Cocoa)
60- `praatXXXX_xcodeproj.zip`: zipped Xcode project file for the universal (64-bit) edition (Cocoa)
61- `praatXXXX_mac64.dmg`: disk image with executable for 64-bit Intel Macs (Cocoa)
62- `praatXXXX_xcodeproj64.zip`: zipped Xcode project file for the 64-bit edition (Cocoa)
63- `praatXXXX_mac32.dmg`: disk image with executable for 32-bit Intel Macs (Carbon)
64- `praatXXXX_xcodeproj32.zip`: zipped Xcode project file for the 32-bit edition (Carbon)
65- `praatXXXX_macU.dmg`: disk image with universal executable for (32-bit) PPC and Intel Macs (Carbon)
66- `praatXXXX_macU.sit`: StuffIt archive with universal executable for (32-bit) PPC and Intel Macs (Carbon)
67- `praatXXXX_macU.zip`: zipped universal executable for (32-bit) PPC and Intel Macs (Carbon)
68- `praatXXXX_macX.zip`: zipped executable for MacOS X (PPC)
69- `praatXXXX_mac9.sit`: StuffIt archive with executable for MacOS 9
70- `praatXXXX_mac9.zip`: zipped executable for MacOS 9
71- `praatXXXX_mac7.sit`: StuffIt archive with executable for MacOS 7
72
73### 1.3. Unix binaries
74- `praatXXXX_rpi_armv7.tar.gz`: gzipped tarred executable for 32-bit Linux on the Raspberry Pi 4B (GTK 2 or 3)
75- `praatXXXX_chrome64.tar.gz`: gzipped tarred executable for 64-bit Linux on Chromebooks (GTK 2 or 3)
76- `praatXXXX_linux64barren.tar.gz`: gzipped tarred executable for 64-bit Linux, without GUI or graphics
77- `praatXXXX_linux64nogui.tar.gz`: gzipped tarred executable for 64-bit Linux, without GUI but with graphics (Cairo and Pango)
78- `praatXXXX_linux64.tar.gz`: gzipped tarred executable for 64-bit Linux (GTK 2 or 3)
79- `praatXXXX_linux32.tar.gz`: gzipped tarred executable for 32-bit Linux (GTK 2)
80- `praatXXXX_linux_motif64.tar.gz`: gzipped tarred executable for 64-bit Linux (Motif)
81- `praatXXXX_linux_motif32.tar.gz`: gzipped tarred executable for 32-bit Linux (Motif)
82- `praatXXXX_solaris.tar.gz`: gzipped tarred executable for Solaris
83
84## 2. Compiling the source code
85
86You need the Praat source code only in the following cases:
87
881. you want to extend Praat’s functionality by adding C or C++ code to it; or
892. you want to understand or reuse Praat’s source code; or
903. you want to compile Praat for a computer for which we do not provide binary executables,
91e.g. Linux for some non-Intel computers, FreeBSD, HP-UX, SGI, or SPARC Solaris.
92
93Before trying to dive into Praat’s source code, you should be familiar with the working of the Praat program
94and with writing Praat scripts. The Praat program can be downloaded from https://praat.org.
95
96### 2.1. License
97
98All of the code is available on GitHub under the
99[GNU General Public License](http://www.fon.hum.uva.nl/praat/GNU_General_Public_License.txt).
100Of course, any improvements are welcomed by the authors.
101
102### 2.2. Downloading the archive
103
104To download the latest source code of Praat from GitHub,
105click on the *zip* or *tar.gz* archive at the latest release,
106or fork ("clone") the praat/praat repository at any later change.
107
108### 2.3. Steps to take if you want to extend Praat
109
110First make sure that the source code can be compiled as is.
111Then add your own buttons by editing `main/main_Praat.cpp` or `fon/praat_Fon.cpp`.
112Consult the manual page on [Programming](http://www.fon.hum.uva.nl/praat/manual/Programming_with_Praat.html).
113
114### 2.4. The programming language
115
116Most of the source code is written in C++, but some parts are written in C.
117The code requires that your compiler supports C99 and C++17.
118
119## 3. Compiling the source code on one platform
120
121### 3.1. Compiling for Windows
122
123To compile Praat's Windows edition on a 64-bit Windows computer,
124install Cygwin on that computer,
125and under Cygwin install the Devel packages mingw64-x86_64-gcc-g++ (for 64-bit targets)
126and/or mingw64-i686-gcc-g++ (for 32-bit targets).
127Move the Praat sources directory somewhere in your `/home/yourname` tree,
128e.g. as `/home/yourname/praats` and/or `/home/yourname/praats32`;
129the folders `fon` and `sys` should be visible within these folders.
130If you want to build Praat's 64-bit edition, type
131
132    cd ~/praats
133    cp makefiles/makefile.defs.mingw64 ./makefile.defs
134
135or if you want to build Praat's 32-bit edition, type
136
137    cd ~/praats32
138    cp makefiles/makefile.defs.mingw32 ./makefile.defs
139
140Then type `make` to build `Praat.exe`
141(use `make -j12` to speed this up, i.e. to use 12 processors in parallel).
142
143### 3.2. Compiling for Macintosh
144
145Extract the *praatXXXX_xcodeproj.zip* file from the [latest release](https://github.com/praat/praat/releases)
146into the directory that contains `sys`, `fon`, `dwtools` and so on.
147Then open the project `praat.xcodeproj` in Xcode 13.1 and choose Build or Run for the target `praat_mac`.
148You can compile with the 12.0 (i.e. the newest and standard) SDK, which will work as far back as macOS 10.9,
149which is our deployment target.
150
151If you get an error message like “Code Signing Identity xxx does not match any valid, non-expired,
152code-signing certificate in your keychain”, then select the target `praat_mac`, go to Info → Build,
153and switch “Code Signing Identity” to “Don’t Code Sign”,
154or sign with your own certificate if you have one as a registered Apple developer.
155
156If you get lots of errors saying “Expected unqualified-id” or “Unknown type name NSString”,
157then you may have to switch the Type of some .cpp file from “C++ Source” to “Objective-C++ Source”
158(under “Identity and Type” in the righthand sidebar).
159
160If you want to build Praat as a library instead of as an executable,
161try the target `praat_mac_a` (static) or `praat_mac_so` (dynamic).
162
163**Notarization.** If you want others to be able to use your Mac app,
164you will probably have to not only *sign* the executable, but also *notarize* it. To this end,
165do Xcode (version 13) -> Product -> Archive -> Distribute App -> Developer ID -> Upload ->
166Automatically manage signing -> Upload -> ...wait... (“Package Approved”) ...wait...
167(“Ready to distribute”) -> Export Notarized App). If your Praat.app was built into
168`~/builds/mac_products/Configuration64`, then you can save the notarized
169`Praat.app` in `~/builds/mac_products`, then drag it in the Finder to
170`~/builds/mac_products/Configuration64`, overwriting the non-notarized
171Praat.app that was already there. If on the way you receive an error
172“App Store Connect Operation Error -- You must first sign the relevant contracts online”,
173you have to log in to `developer.apple.com` and do Review Agreement -> Agree;
174you may then also have to go to App Store Connect, log in, then Agreements, Tax, and Banking
175-> View and Agree to Terms (even if you have no paid apps).
176
177### 3.3. Compiling on Linux and other Unixes
178
179To set up the required system libraries, install some graphics and sound packages:
180
181    sudo apt-get install libgtk-3-dev
182    sudo apt-get install libasound2-dev
183    sudo apt-get install libpulse-dev
184    sudo apt-get install libjack-dev
185
186To set up your source tree for Linux, go to Praat's sources directory (where the folders `fon` and `sys` are)
187and type one of the four following commands:
188
189    # on Ubuntu command line
190    cp makefiles/makefile.defs.linux.pulse ./makefile.defs
191
192    # on Ubuntu command line
193    cp makefiles/makefile.defs.linux.pulse_static ./makefile.defs
194
195    # on Chromebook command line
196    cp makefiles/makefile.defs.chrome64 ./makefile.defs
197
198    # on Raspberry Pi command line
199    cp makefiles/makefile.defs.linux.rpi ./makefile.defs
200
201    # On FreeBSD command line
202    cp makefiles/makefile.defs.freebsd.alsa ./makefile.defs
203
204To build the Praat executable, type `make` or `make -j12`.
205If your Unix isn’t Linux, you may have to edit the library names in the makefile
206(you may need pthread, gtk-3, gdk-3, atk-1.0, pangoft2-1.0, gdk_pixbuf-2.0, m, pangocairo-1.0,
207cairo-gobject, cairo, gio-2.0, pango-1.0, freetype, fontconfig, gobject-2.0, gmodule-2.0,
208gthread-2.0, rt, glib-2.0, asound, jack).
209
210When compiling Praat on an external supercomputer or so, you will not have sound.
211If you do have `libgtk-3-dev` (and its dependencies), do
212
213    cp makefiles/makefile.defs.linux.silent ./makefile.defs
214
215Then type `make` or `make -j12` to build the program. If your Unix isn’t Linux,
216you may have to edit the library names in the makefile (you may need pthread, gtk-3, gdk-3, atk-1.0,
217pangoft2-1.0, gdk_pixbuf-2.0, m, pangocairo-1.0, cairo-gobject, cairo, gio-2.0, pango-1.0,
218freetype, fontconfig, gobject-2.0, gmodule-2.0, gthread-2.0, rt, glib-2.0).
219
220When compiling Praat for use as a server for commands from your web pages, you may not need sound or a GUI. Do
221
222    cp makefiles/makefile.defs.linux.nogui ./makefile.defs
223
224which creates the executable `praat_nogui`. If you don't need graphics (e.g. PNG files) either
225(i.e. you need only Praat's computation), you can create an even lighter edition:
226
227    cp makefiles/makefile.defs.linux.barren ./makefile.defs
228
229which creates the executable `praat_barren`. Then type `make` or `make -j12` to build the program.
230If your Unix isn’t Linux, you may have to edit the library names in the makefile.
231
232## 4. Compiling the source code on all platforms simultaneously
233
234The easiest way to develop your Praat clone on all platforms simultaneously,
235is to edit the source code on a Mac (with Xcode)
236and use Parallels Desktop for Windows and Linux building and testing.
237This is how Praat is currently developed.
238Editing takes place in Xcode,
239after which building Praat involves no more than typing Command-B into Xcode
240(or Command-R to build and run)
241or `praat-build` into a Windows or Linux terminal (or `praat-run` to build and run).
242
243### 4.1. MacOS development set-up
244
245Your source code folders, such as `fon` and `sys`, will reside in a folder like `/Users/yourname/Praats/src`,
246where you also put `praat.xcodeproj`, as described above in 3.2.
247On Paul’s 2018 MacBook Pro with Xcode 13.1, building Praat with Command-B or Command-R,
248after cleaning the build folder with Shift-Command-K,
249takes 160 seconds for the x86_64 part and 150 seconds for the ARM64 part (optimization level O3).
250
251### 4.2. Windows development set-up
252
253Under Parallels Desktop 17.1 or later, install Windows 10 or Windows 11. In Windows, install Cygwin,
254and create a `praats` folder, as described above in 3.1.
255
256There are two options for your source tree: either it resides on the MacOS disk
257(which you will mount from Windows anyway), or it resides on the Windows disk.
258Compiling Praat for Windows on the MacOS disk takes 13 minutes (optimization level O3),
259whereas compiling Praat on the Windows disk takes only 4 minutes and 20 seconds.
260So we go with installing the source tree under the Cygwin home folder, as follows.
261
262You need to get the source from the MacOS disk, so you have to mount the MacOS disk
263from Cygwin. This is easy: in Parallels Desktop, choose `Windows 10 or 11` -> `Configure`,
264then `Options`, then `Sharing`, then `Share Mac`, and set `Share folders` to `Home folder only`
265(if this scares you, then use `Custom Folders` instead).
266Your MacOS home folder (i.e. `/Users/yourname`) is now visible anywhere on Windows
267as the `Z` drive (or so), and from the `Cygwin64 Terminal` you can access it as `/cygdrive/z`.
268
269When developing Praat for Windows, you just edit your files in Xcode;
270do not forget to save them (as you do e.g. by building in Xcode).
271Then, just as you use Command-B and Command-R in Xcode,
272you will be able to type `praat-build` (which only builds) or `praat-run` (which builds and runs)
273into your `Cygwin64 Terminal`. To accomplish this,
274add the following definitions into `/home/yourname/.profile` in your Cygwin home folder,
275so that the `bash` shell will automatically execute them whenever you start your `Cygwin64 Terminal`
276(you will need to have installed `rsync` and `make`):
277
278    # in Cygwin:~/.profile
279    PRAAT_SOURCES="/cygdrive/z/Praats/src"
280    PRAAT_EXCLUDES='--exclude="*.xcodeproj" --exclude="Icon*" --exclude=".*" --exclude="*kanweg*"'
281    alias praat-build="( cd ~/praats &&\
282        rsync -rptvz $PRAAT_SOURCES/ $PRAAT_EXCLUDES . &&\
283        cp makefiles/makefile.defs.mingw64 makefile.defs &&\
284        make -j12 )"
285    alias praat="~/praats/Praat.exe"
286    alias praat-run="praat-build && praat"
287
288This also defines `praat` for running Praat without first rebuilding it.
289The cycle from editing Praat on the Mac to running the new version on Windows therefore takes only two steps:
290
2911. edit and save the source code in Xcode on your Mac;
2922. type `praat-run` on your Windows 10 (under Parallels Desktop on your Mac).
293
294If you also want to develop the 32-bit edition, you add to `.profile`:
295
296    # in Cygwin:~/.profile
297    alias praat32-build="( cd ~/praats32 &&\
298        rsync -rptvz $PRAAT_SOURCES/ $PRAAT_EXCLUDES . &&\
299        cp makefiles/makefile.defs.mingw32 makefile.defs &&\
300        make -j12 )"
301    alias praat32="~/praats32/Praat.exe"
302    alias praat32-run="praat32-build && praat32"
303
304### 4.3. Linux development set-up
305
306Under Parallels Desktop 17 or later, install Ubuntu 18.04 or 20.04, and create
307a folder `praats` in your home folder, as described above in 3.3.
308
309In Parallels Desktop, choose `Ubuntu 18.04 or 20.04` -> `Configure`,
310then `Options`, then `Sharing`, then `Share Mac`, and set `Share folders` to `Home folder only`
311(or use `Custom Folders` instead).
312Your MacOS home folder (i.e. `/Users/yourname`) is now visible on the Ubuntu desktop
313as `Home`, and from the `Terminal` you can access it as `/media/psf/Home`.
314
315When developing Praat for Linux, you just edit and save your files in Xcode.
316You will be able to type `praat-build` (which only builds) or `praat-run` (which builds and runs)
317into your `Terminal` after you add the following definitions into
318`/home/parallels/.bash_aliases` in your Ubuntu home folder
319(this will be run automatically by `.bashrc` whenever you start a `Terminal` window,
320assuming that it uses the `bash` shell):
321
322    # in Ubuntu:~/.bash_aliases
323    PRAAT_SOURCES="/media/psf/Home/Praats/src"
324    PRAAT_EXCLUDES='--exclude="*.xcodeproj" --exclude="Icon*" --exclude=".*" --exclude="*kanweg*"'
325    alias praat-build="( cd ~/praats &&\
326        rsync -rptvz $PRAAT_SOURCES/ $PRAAT_EXCLUDES . &&\
327        cp makefiles/makefile.defs.linux.pulse makefile.defs &&\
328        make -j12 )"
329    alias praat="~/praats/praat"
330    alias praat-run="praat-build && praat"
331    alias praatt-build="( cd ~/praatst &&\
332        rsync -rptvz $PRAAT_SOURCES/ $PRAAT_EXCLUDES . &&\
333        cp makefiles/makefile.defs.linux.pulse_static makefile.defs &&\
334        make -j12 )"
335    alias praatt="~/praatst/praatt"
336    alias praatt-run="praatt-build && praatt"
337
338Building Praat this way takes 2 minutes and 10 seconds (optimization level O3).
339
340To build `praat_barren`, create a folder `praatsb`, and define
341
342    # in Ubuntu:~/.bash_aliases
343    alias praatb-build="( cd ~/praatsb &&\
344        rsync -rptvz $PRAAT_SOURCES/ $PRAAT_EXCLUDES . &&\
345        cp makefiles/makefile.defs.linux.barren makefile.defs &&\
346        make -j12 )"
347    alias praatb="~/praatsb/praat_barren"
348    alias praatb-run="praatb-build && praatb"
349
350You test `praat_barren` briefly by typing
351
352    # on Ubuntu command line
353    praatb --version
354
355To build `praat_nogui`, create a folder `praatsn`, and define
356
357    # in Ubuntu:~/.bash_aliases
358    alias praatn-build="( cd ~/praatsn &&\
359        rsync -rptvz $PRAAT_SOURCES/ $PRAAT_EXCLUDES . &&\
360        cp makefiles/makefile.defs.linux.nogui makefile.defs &&\
361        make -j12 )"
362    alias praatn="~/praatsn/praat_nogui"
363    alias praatn-run="praatn-build && praatn"
364
365You test `praat_nogui` briefly by typing
366
367    # on Ubuntu command line
368    praatn --version
369
370To build Praat for Chrome64 (64-bit Intel Chromebooks only),
371create a folder `praatc`, and define
372
373    # in Ubuntu:~/.bash_aliases
374    alias praatc-build="( cd ~/praatsc &&\
375        rsync -rptvz $PRAAT_SOURCES/ $PRAAT_EXCLUDES . &&\
376        cp makefiles/makefile.defs.chrome64 makefile.defs &&\
377        make -j12 )"
378    alias praatc="~/praatsc/praat"
379    alias praatc-run="praatc-build && praat"
380
381To test Praat for Chrome64, you can just run it on Ubuntu by typing `praatc`,
382or you transfer it to a Chromebook for the real test.
383
384### 4.4. Chromebook development set-up
385
386Parallels Desktop 17 has no emulator for Chrome, so the choice is between
387building Praat on a Chromebook directly or building Praat on Ubuntu 18.04 or 20.04.
388On a 2019 HP Chromebook with Intel processor, building Praat takes
389a forbidding 27 minutes.
390
391So we choose to build Praat on Ubuntu (under Parallels Desktop on the Mac),
392because building the Intel Chrome64 edition on Ubuntu 18.04 takes only
3932 minutes and 10 seconds. If you have the Linux set-up described in 4.3,
394you can do this with the `bc` command.
395
396Next, you need a way to get the executable `praat` from Mac/Ubuntu to your Chromebook.
397The distributors of Praat do this via an intermediary university computer;
398let’s call this computer-in-the-middle `fon.hum.uva.nl`
399(not coincidentally, that’s the name of the computer that hosts `praat.org`).
400If you have an account on that computer (say it’s called `yourname`),
401then you can access that account with `ssh`, and it is best to do that without
402typing your password each time. To accomplish this, type
403
404    # on Ubuntu command line
405    ssh-keygen
406
407on your Ubuntu. This gives you a file `~/.ssh/id_rsa.pub` on your Ubuntu,
408which contains your public `ssh` key. You should append the contents of this `id_rsa.pub`
409to the file `~/.ssh/authorized_keys` on your intermediary computer. From that moment on,
410your intermediary computer will accept `rsync -e ssh` calls from your Ubuntu.
411On the intermediary computer, create a folder `~/builds`, and a folder `chrome64` inside that.
412If you now define
413
414    # in Ubuntu:~/.bash_aliases
415    praatc-put="rsync -tpvz ~/praatsc/praat yourname@fon.hum.uva.nl:~/builds/chrome64"
416    praatc-mid="praatc-build && praatc-put"
417
418you can build and send Praat for Chrome to the intermediary computer by just typing
419
420    # on Ubuntu command line
421    praatc-mid
422
423On your Chromebook, start up Linux (see the Chromebook download page for details),
424create a directory `~/praats` there, and define the following:
425
426    # in Chromebook:~/.bash_aliases
427    alias praat-get="( cd ~/praats &&\
428        rsync -tpvz yourname@fon.hum.uva.nl:~/builds/chrome64/praat . )"
429    alias praat="~/praats/praat"
430    alias praat-run="praat-get && praat"
431
432From then on, you can use
433
434    # on Chromebook command line
435    praat-run
436
437to fetch Praat from the intermediary computer and run it.
438
439The cycle from editing Praat on the Mac to running it on your Chromebook therefore takes only three steps:
440
4411. edit and save the source code in Xcode on your Mac;
4422. type `praatc-mid` on your Ubuntu (under Parallels Desktop on your Mac);
4433. type `praat-run` on your Chromebook.
444
445For edits in a `cpp` file (no changes in header files), this whole cycle can be performed within 15 seconds.
446
447### 4.5. Raspberry Pi development set-up
448
449One could perhaps create the Raspberry Pi edition by cross-compiling on Ubuntu 18.04 or 20.04.
450If any reader of these lines has precise instructions, we would like to know about it
451(the main problem is how to install the GTK etc libraries in the Raspberry Pi toolchain,
452or how to get `dpkg` under Ubuntu-buster to actually find `armhf` libraries).
453
454Till then, you build on the Raspberry Pi itself. Your could do that via an intermediary computer
455(analogously to what we described above for Chromebook), but you can also do it directly
456if you include your Raspberry Pi in the same local network as your Mac and switch on SSH
457on your Raspberry Pi (via Raspberry ->  `Preferences` -> `Raspberry Pi Configuration`
458-> `Interfaces` -> `SSH` -> `Enable`. You add your Mac’s public SSH key to your Raspberry Pi with
459
460    # on Mac command line
461    ssh-keygen   # only if you have no SSH key yet
462    ssh-copy-id pi@192.168.1.2   # or whatever your Pi’s static IP address is
463
464On your Raspberry Pi, you create a folder `~/praats`,
465after which you can push the sources from your Mac to your Raspberry Pi with
466
467    # in Mac:~/.bash_profile
468    PRAAT_SOURCES="~/Praats/src"
469    PRAAT_EXCLUDES='--exclude="*.xcodeproj" --exclude="Icon*" --exclude=".*" --exclude="*kanweg*"'
470    alias praats-putpi="rsync -rptvz -e ssh $PRAAT_EXCLUDES \
471        $PRAAT_SOURCES/ pi@192.168.1.2:~/praats"
472
473On the Raspberry Pi, you define
474
475    # in RaspberryPi:~/.bash_aliases
476    alias praat-build="( cd ~/praats &&\
477        cp makefiles/makefile.defs.linux.rpi makefile.defs &&\
478        make -j4 )"
479    alias praat="~/praats/praat"
480    alias praat-run="praat-build && praat"
481
482after which you can build and run Praat with
483
484    # on Raspberry Pi command line
485    praat-run
486
487Thus, the cycle from editing Praat on the Mac to running it on your Raspberry Pi therefore takes three steps:
488
4891. edit and save the source code in Xcode on your Mac;
4902. type `praats-putpi` on your Mac;
4913. type `praat-run` on your Raspberry Pi, perhaps via `ssh -X pi@192.168.1.2` in your Mac terminal.
492
493From clean sources this takes around 19 minutes (on a Raspberry Pi 4B),
494but if no header files change, then it can be done in approximately 20 seconds.
495
496### 4.6. Distributing Praat
497
498If you want to distribute your version of Praat, you can do so on GitHub and/or on a website
499(at least, that’s how the main authors do it). Both of these venues require that you have
500all the executables in one place. The guide below refers to the creation of packages
501for all platforms for Praat version 9.9.99, although your version number will be different.
502The packages will be collected in the directory `~/Praats/www` on the Mac.
503
504If you follow the location mentioned in the `.xcodeproj` file, the Mac binary will reside
505in a place like `~/builds/mac_products/Configuration64`.
506
507After notarizing the Mac binary (see above under 3.2),
508you include the executable in a `.dmg` disk image, with the following commands:
509
510    # on Mac command line
511    PRAAT_WWW=~/Praats/www
512    PRAAT_VERSION=9999
513    cd ~/builds/mac_products/Configuration64
514    hdiutil create -fs HFS+ -ov -srcfolder Praat.app -volname Praat_${PRAAT_VERSION} praat_${PRAAT_VERSION}.dmg
515    hdiutil convert -ov -format UDZO -o ${PRAAT_WWW}/praat${PRAAT_VERSION}_mac.dmg praat_${PRAAT_VERSION}.dmg
516    rm praat_${PRAAT_VERSION}.dmg
517
518You also need to distribute the `.xcodeproj` file, which is actually a folder, so that you have to zip it:
519
520    # on Mac command line
521    PRAAT_SOURCES="~/Praats/src
522    cd $PRAAT_SOURCES
523    zip -r $PRAAT_WWW/praat$(PRAAT_VERSION)_xcodeproj.zip praat.xcodeproj
524
525The Windows executables have to be sent from your Cygwin terminal to your Mac.
526It is easiest to do this without a version number (so that you have to supply the number only once),
527so you send them to the intermediate Mac folders `~/builds/win64` and `~/builds/win32`.
528On Cygwin you can define:
529
530    # in Cygwin:~/.profile
531    alias praat-dist="praat-build && rsync -t ~/praats/Praat.exe /cygdrive/z/builds/win64"
532    alias praat32-dist="praat32-build && rsync -t ~/praats32/Praat.exe /cygdrive/z/builds/win32"
533
534so that you can “upload” the two executables to the Mac with
535
536    # on Cygwin command line
537    praat-dist
538    praat32-dist
539
540The four Linux executables have to be sent from your Ubuntu terminal to your Mac,
541namely to the folders `~/builds/linux64` (which will contain `praat`, `praat_barren` and
542`praat_nogui`) and `~/builds/chrome64` (which will contain only `praat`).
543On Ubuntu you can define
544
545    # in Ubuntu:~/.bash_aliases
546    alias praat-dist="praat-build && rsync -t ~/praats/praat /media/psf/Home/builds/linux64"
547    alias praatt-dist="praatt-build && rsync -t ~/praatst/praat_static /media/psf/Home/builds/linux64"
548    alias praatb-dist="praatb-build && rsync -t ~/praatsb/praat_barren /media/psf/Home/builds/linux64"
549    alias praatn-dist="praatn-build && rsync -t ~/praatsn/praat_nogui /media/psf/Home/builds/linux64"
550    alias praatc-dist="praatc-build && rsync -t ~/praatsc/praat /media/psf/Home/builds/chrome64"
551
552so that you can “upload” the five executables to the Mac with
553
554    # on Ubuntu command line
555    praat-dist
556    praatt-dist
557    praatb-dist
558    praatn-dist
559    praatc-dist
560
561You can fetch the Raspberry Pi edition directly from your Raspberry Pi:
562
563    # on Mac command line
564    rsync -tpvz pi@192.168.1.2:~/praats/praat ~/builds/rpi_armv7
565
566When the folders under `~/builds`, namely `win64`, `win32`, `linux64`, `chrome64` and `rpi_armv7`
567all contain enough new executables (there should be 1, 1, 3, 1 and 1, respectively),
568you can issue the following commands to create the packages and install them in `~/Praats/www`:
569
570    # on Mac command line
571    zip $PRAAT_WWW/praat$(PRAAT_VERSION)_win64.zip ~/builds/win64/Praat.exe
572    zip $PRAAT_WWW/praat$(PRAAT_VERSION)_win32.zip ~/builds/win32/Praat.exe
573    ( cd ~/builds/linux64 &&\
574      tar cvf praat$(PRAAT_VERSION)_linux64.tar praat &&\
575      gzip praat$(PRAAT_VERSION)_linux64.tar &&\
576      mv praat$(PRAAT_VERSION)_linux64.tar.gz $PRAAT_WWW )
577    ( cd ~/builds/linux64 &&\
578      tar cvf praat$(PRAAT_VERSION)_linux64static.tar praat_static &&\
579      gzip praat$(PRAAT_VERSION)_linux64static.tar &&\
580      mv praat$(PRAAT_VERSION)_linux64static.tar.gz $PRAAT_WWW )
581    ( cd ~/builds/linux64 &&\
582      tar cvf praat$(PRAAT_VERSION)_linux64barren.tar praat_barren &&\
583      gzip praat$(PRAAT_VERSION)_linux64barren.tar &&\
584      mv praat$(PRAAT_VERSION)_linux64barren.tar.gz $PRAAT_WWW )
585    ( cd ~/builds/linux64 &&\
586      tar cvf praat$(PRAAT_VERSION)_linux64nogui.tar praat_nogui &&\
587      gzip praat$(PRAAT_VERSION)_linux64nogui.tar &&\
588      mv praat$(PRAAT_VERSION)_linux64nogui.tar.gz $PRAAT_WWW )
589    ( cd ~/builds/chrome64 &&\
590      tar cvf praat$(PRAAT_VERSION)_chrome64.tar praat &&\
591      gzip praat$(PRAAT_VERSION)_chrome64.tar &&\
592      mv praat$(PRAAT_VERSION)_chrome64.tar.gz $PRAAT_WWW )
593    ( cd ~/builds/rpi_armv7 &&\
594      tar cvf praat$(PRAAT_VERSION)_rpi_armv7.tar praat &&\
595      gzip praat$(PRAAT_VERSION)_rpi_armv7.tar &&\
596      mv praat$(PRAAT_VERSION)_rpi_armv7.tar.gz $PRAAT_WWW )
597
598Finally, you can update your website and/or create a new release on GitHub.
599