Home
Experimental Multimedia Channel

Wiki Updates

Audio

2 weeks 6 days ago

INTRODUCTION: Sound is .....

← Older revision Revision as of 14:32, 7 September 2021 (4 intermediate revisions by the same user not shown)Line 6: Line 6: A survey of basic concepts in each disciplineA survey of basic concepts in each discipline

Module 1: Sound-Medium Interface=== 1: [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Sound-Medium.html Sound-Medium Interface] ===

(click on the number of the module)<div style="column-count:2;-moz-column-count:2;-webkit-column-count:3"> ACOUSTIC

<div style="column-count:2;-moz-column-count:2;-webkit-column-count:3">=== 2. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Vibration1.html Vibration: Frequency and Pitch] ===   ACOUSTIC === 3. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Vibration2.html Vibration: Spectrum and Timbre] === === 2. Vibration: Frequency and Pitch ===  === 4. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Magnitude.html Magnitude: Levels and Loudness] === === 3. Vibration: Spectrum and Timbre ====== 5. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Sound-Environment.html Sound-Environment Interaction] === === 4. Magnitude: Levels and Loudness ====== 6. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/AcousticSpace.html Binaural Hearing and Acoustic Space] === === 5. Sound-Environment Interaction ====== 7. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Sound-Sound.html Sound-Sound Interaction] === === 6. Binaural Hearing and Acoustic Space ====== 8. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/SpeechAcoustics.html Speech Acoustics] === === 7. Sound-Sound Interaction ====== 9. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Audiology.html Audiology and Hearing Loss] === === 8. Speech Acoustics ====== 10. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Noise.html Effects of Noise and Noise Measurement Systems] === === 9. Audiology and Hearing Loss === === 10. Effects of Noise and Noise Measurement Systems === ELECTROACOUSTICELECTROACOUSTIC === 11. Field Recording ====== 11. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/FieldRecording.html Field Recording] === === 12 Filters and Equalization ====== 12. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Filters.html Filters and Equalization] === === 13. Modulation and Auto-Convolution ====== 13. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Modulation.html Modulation and Auto-Convolution] === === 14. Time Delays and Phasing ====== 14. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Time1.html Time Delays and Phasing] === === 15. Time Delays and Reverberati on ====== 15. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Reverberation.html Time Delays and Reverberation] === === 16. Dynamic Range and Compression ====== 16. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Dynamics.html Dynamic Range and Compressio]n === === 17. Microsound and Granular Synthesis ====== 17. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Microsound.html Microsound and Granular Synthesis] === === 18. Voice and Text-based Composition ====== 18. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Voice.html Voice and Text-based Composition] === === 19. Soundscape Composition ====== 19. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Scomp.html Soundscape Composition] === </div></div>

The Tutorial is divided into a number of modules which are designed to cover a particular topic similar to a lab-based class or a set of studio demos. They are divided into an Acoustic set and an Electroacoustic set. Subtopics in each module can be accessed separately by a link in the series A, B, C, etc.  The Tutorial is divided into a number of modules which are designed to cover a particular topic similar to a lab-based class or a set of studio demos. They are divided into an Acoustic set and an Electroacoustic set. Subtopics in each module can be accessed separately by a link in the series A, B, C, etc.

== Interdisciplinary Thematic Search Engine ==== Interdisciplinary Thematic Search Engine ==
Techbot

Audio

2 weeks 6 days ago

INTRODUCTION: Sound is .....

← Older revision Revision as of 14:32, 7 September 2021 (14 intermediate revisions by the same user not shown)Line 1: Line 1: INTRODUCTION: Sound is .....== Overview ==   This document is intended to act as a teaching tutorial for sound terminology, theory and practice, across multiple disciplines, but focusing on acoustics, psychoacoustics, environmental acoustics, electroacoustics, speech acoustics, audiology, noise and soundscape studies. In many cases, we draw comparisons between these disciplines and attempt to explain their basic models and how they differ, beginning with the Introductory module.   == INTRODUCTION: Sound is ..... == A survey of basic concepts in each disciplineA survey of basic concepts in each discipline

Module 1: Sound-Medium Interface=== 1: [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Sound-Medium.html Sound-Medium Interface] ===   <div style="column-count:2;-moz-column-count:2;-webkit-column-count:3"> ACOUSTIC

=== 2. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Vibration1.html Vibration: Frequency and Pitch] === === 3. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Vibration2.html Vibration: Spectrum and Timbre] === === 4. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Magnitude.html Magnitude: Levels and Loudness] === === 5. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Sound-Environment.html Sound-Environment Interaction] === === 6. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/AcousticSpace.html Binaural Hearing and Acoustic Space] === === 7. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Sound-Sound.html Sound-Sound Interaction] === === 8. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/SpeechAcoustics.html Speech Acoustics] === === 9. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Audiology.html Audiology and Hearing Loss] === === 10. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Noise.html Effects of Noise and Noise Measurement Systems] === ELECTROACOUSTIC === 11. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/FieldRecording.html Field Recording] === === 12. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Filters.html Filters and Equalization] === === 13. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Modulation.html Modulation and Auto-Convolution] === === 14. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Time1.html Time Delays and Phasing] === === 15. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Reverberation.html Time Delays and Reverberation] === === 16. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Dynamics.html Dynamic Range and Compressio]n === === 17. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Microsound.html Microsound and Granular Synthesis] === === 18. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Voice.html Voice and Text-based Composition] === === 19. [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Scomp.html Soundscape Composition] === </div>

(click on the number of the module)The Tutorial is divided into a number of modules which are designed to cover a particular topic similar to a lab-based class or a set of studio demos. They are divided into an Acoustic set and an Electroacoustic set. Subtopics in each module can be accessed separately by a link in the series A, B, C, etc. ACOUSTIC  ELECTROACOUSTIC== Interdisciplinary Thematic Search Engine == 2. Vibration: Frequency and Pitch 11. Field Recording  3. Vibration: Spectrum and TimbreThe subject matter of this document is organized according to various themes, the first five of which are traced through various subdisciplines, each of which treats the theme differently. The relevant terms for each theme and each discipline are grouped together. The themes are: 12. Filters and Equalization  4. Magnitude: Levels and Loudness=== Analytical Dimensions of Sound === 13. Modulation and Auto-Convolution==== Magnitude ==== 5. Sound-Environment Interaction==== Vibration ==== 14. Time Delays and Phasing  6. Binaural Hearing and Acoustic Space=== Levels of Acoustic Interaction === 15. Time Delays and Reverberation==== Sound - Medium Interface ==== 7. Sound-Sound Interaction==== Sound - Environment Interaction ==== 16. Dynamic Range and Compression==== Sound - Sound Interaction ==== 8. Speech Acoustics  17. Microsound and Granular Synthesis=== Specific Subdisciplines === 9. Audiology and Hearing Loss==== Audiology and Hearing Loss ==== 18. Voice and Text-based Composition==== Noise Measurement Systems ==== 10. Effects of Noise and Noise Measurement Systems==== Electroacoustic and Tape Studio Terms ==== 19. Soundscape Composition==== Linguistics and Speech Acoustics ==== ==== Communications Theory ====   The principal discipline which is the "home" for each term is indicated by an icon, as follows:   [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Acoustics.html acoustics] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Psychoacoustics.html psychoacoustics] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Soundscape.html soundscape] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Noise.html Noise] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Electro-Acoustic.html electroacoustics] [linguistics][http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Audiology.html audiology] [music] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Communication.html]   Terms that are found in more than one discipline are indicated as follows: Acoustics / Electroacoustics
Techbot

Audio

2 weeks 6 days ago

← Older revision Revision as of 14:08, 7 September 2021 (9 intermediate revisions by the same user not shown)Line 1: Line 1: INTRODUCTION: Sound is .....== Overview ==   This document is intended to act as a teaching tutorial for sound terminology, theory and practice, across multiple disciplines, but focusing on acoustics, psychoacoustics, environmental acoustics, electroacoustics, speech acoustics, audiology, noise and soundscape studies. In many cases, we draw comparisons between these disciplines and attempt to explain their basic models and how they differ, beginning with the Introductory module.   == INTRODUCTION: Sound is ..... == A survey of basic concepts in each disciplineA survey of basic concepts in each discipline

Module 1: Sound-Medium InterfaceModule 1: Sound-Medium Interface

(click on the number of the module) <div style="column-count:2;-moz-column-count:2;-webkit-column-count:3"> ACOUSTIC === 2. Vibration: Frequency and Pitch === === 3. Vibration: Spectrum and Timbre === === 4. Magnitude: Levels and Loudness === === 5. Sound-Environment Interaction === === 6. Binaural Hearing and Acoustic Space === === 7. Sound-Sound Interaction === === 8. Speech Acoustics === === 9. Audiology and Hearing Loss === === 10. Effects of Noise and Noise Measurement Systems === ELECTROACOUSTIC === 11. Field Recording === === 12 Filters and Equalization === === 13. Modulation and Auto-Convolution === === 14. Time Delays and Phasing === === 15. Time Delays and Reverberati on === === 16. Dynamic Range and Compression === === 17. Microsound and Granular Synthesis === === 18. Voice and Text-based Composition === === 19. Soundscape Composition === </div>

(click on the number of the module)The Tutorial is divided into a number of modules which are designed to cover a particular topic similar to a lab-based class or a set of studio demos. They are divided into an Acoustic set and an Electroacoustic set. Subtopics in each module can be accessed separately by a link in the series A, B, C, etc. ACOUSTIC  ELECTROACOUSTIC== Interdisciplinary Thematic Search Engine == 2. Vibration: Frequency and Pitch 11. Field Recording  3. Vibration: Spectrum and TimbreThe subject matter of this document is organized according to various themes, the first five of which are traced through various subdisciplines, each of which treats the theme differently. The relevant terms for each theme and each discipline are grouped together. The themes are: 12. Filters and Equalization  4. Magnitude: Levels and Loudness=== Analytical Dimensions of Sound === 13. Modulation and Auto-Convolution==== Magnitude ==== 5. Sound-Environment Interaction==== Vibration ==== 14. Time Delays and Phasing  6. Binaural Hearing and Acoustic Space=== Levels of Acoustic Interaction === 15. Time Delays and Reverberation==== Sound - Medium Interface ==== 7. Sound-Sound Interaction==== Sound - Environment Interaction ==== 16. Dynamic Range and Compression==== Sound - Sound Interaction ==== 8. Speech Acoustics  17. Microsound and Granular Synthesis=== Specific Subdisciplines === 9. Audiology and Hearing Loss==== Audiology and Hearing Loss ==== 18. Voice and Text-based Composition==== Noise Measurement Systems ==== 10. Effects of Noise and Noise Measurement Systems==== Electroacoustic and Tape Studio Terms ==== 19. Soundscape Composition==== Linguistics and Speech Acoustics ==== ==== Communications Theory ====   The principal discipline which is the "home" for each term is indicated by an icon, as follows:   [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Acoustics.html acoustics] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Psychoacoustics.html psychoacoustics] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Soundscape.html soundscape] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Noise.html Noise] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Electro-Acoustic.html electroacoustics] [linguistics][http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Audiology.html audiology] [music] [http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook5/handbook/Communication.html]   Terms that are found in more than one discipline are indicated as follows: Acoustics / Electroacoustics
Techbot

Audio

2 weeks 6 days ago

Created page with "INTRODUCTION: Sound is ..... A survey of basic concepts in each discipline Module 1: Sound-Medium Interface (click on the number of the module) ACOUSTIC ELECTROACOUSTIC 2..."

New page

INTRODUCTION: Sound is .....
A survey of basic concepts in each discipline

Module 1: Sound-Medium Interface


(click on the number of the module)
ACOUSTIC
ELECTROACOUSTIC
2. Vibration: Frequency and Pitch 11. Field Recording
3. Vibration: Spectrum and Timbre
12. Filters and Equalization
4. Magnitude: Levels and Loudness
13. Modulation and Auto-Convolution
5. Sound-Environment Interaction
14. Time Delays and Phasing
6. Binaural Hearing and Acoustic Space
15. Time Delays and Reverberation
7. Sound-Sound Interaction
16. Dynamic Range and Compression
8. Speech Acoustics
17. Microsound and Granular Synthesis
9. Audiology and Hearing Loss
18. Voice and Text-based Composition
10. Effects of Noise and Noise Measurement Systems
19. Soundscape Composition
Techbot

Main Page

2 weeks 6 days ago

The Topics

← Older revision Revision as of 13:35, 7 September 2021 Line 18: Line 18:

<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"><div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"> === [[Audio]] === The building blocks of sound and music. === [[Coding]] ===  === [[Coding]] ===   This is a coding site for musicians. Whilst experimental and electronic music does not require coding skills this site is for those techno druids that wish to go that one level deeper. However code takes second place to music. Musical perfection and purity takes precedndece over coding purity.  This is a coding site for musicians. Whilst experimental and electronic music does not require coding skills this site is for those techno druids that wish to go that one level deeper. However code takes second place to music. Musical perfection and purity takes precedndece over coding purity.  
Techbot

Composition

2 weeks 6 days ago

Soundscape

← Older revision Revision as of 13:28, 7 September 2021 (3 intermediate revisions by the same user not shown)Line 1: Line 1: == DAW Composition == * Rapid Composer * Kords * Magenta == AI [[Deep Learning]] Composition ==== AI [[Deep Learning]] Composition == * [[Automatic Music Generation]]* [[Automatic Music Generation]] * Death Metal* Death Metal * Techno* Techno == DAW Composition == * Rapid Composer * Kords * Magenta

== Generative Composition ==== Generative Composition == Line 43: Line 42:

https://intermorphic.com/sseyo/koan/  https://intermorphic.com/sseyo/koan/   == [[Game Music]] ==

== Dynamic Composition ==== Dynamic Composition == FMODFMOD

== [[Game Music]] ==== Soundscape ==   The soundscape composition is a form of electroacoustic music, characterized by the presence of recognizable environmental sounds and contexts, the purpose being to invoke the listener's experience, associations, memories and imagination related to the soundscape.   http://www.sfu.ca/sonic-studio-webdav/cmns/Handbook%20Tutorial/Scomp.html
Techbot

C++

2 weeks 6 days ago

Function Overloading

← Older revision Revision as of 10:09, 7 September 2021 Line 337: Line 337:

=== Function Overloading ====== Function Overloading === Function overloading is another feature of Cþþ. It is possible to have functions with same name in a class, as long as their arguments differ in type or in number. Function selection, then, depends on argument types at the function call. It is possible to supply more than one processing method to the structure, say to take in audio vectors for the amplitude and/Function overloading is another feature of C++. It is possible to have functions with same name in a class, as long as their arguments differ in type or in number. Function selection, then, depends on argument types at the function call. It is possible to supply more than one processing method to the structure, say to take in audio vectors for the amplitude and/ or frequency arguments (for audio rate modulation of these parameters). Because of overloading, it is possible to use the same name (Proc()) for these functions:or frequency arguments (for audio rate modulation of these parameters). Because of overloading, it is possible to use the same name (Proc()) for these functions:        Line 375: Line 375:   Osc mod(ind*fm, fm, sintab);  Osc mod(ind*fm, fm, sintab);   Osc car(amp, fc, sintab);  Osc car(amp, fc, sintab);   === Data Hiding and Encapsulation ====== Data Hiding and Encapsulation === Another feature of Cþþthat can be useful for systems design is the support for data hiding and encapsulation. This allows us to make certain bits of the data structure available only for member functions, and not for functions that are external to the data structure. One reasonAnother feature of Cþþthat can be useful for systems design is the support for data hiding and encapsulation. This allows us to make certain bits of the data structure available only for member functions, and not for functions that are external to the data structure. One reason
Techbot

Studio Technology

3 weeks 1 day ago

Mixing Desks

← Older revision Revision as of 12:29, 5 September 2021 (2 intermediate revisions by the same user not shown)Line 12: Line 12: Intonarumori is a project to explore creating sounds, rhythms and music with simulated 3D machines.  Intonarumori is a project to explore creating sounds, rhythms and music with simulated 3D machines.  

* https://github.com/EMC23/arduino-vcvrack Two way communication between an Arduino board and a VCV Rack module. * https://github.com/EMC23/Techtools* https://github.com/EMC23/Techtools Tehttps://github.com/EMC23/TrumBelachtools is a set of live performance  glitch plugins for VCVrackTehttps://github.com/EMC23/TrumBelachtools is a set of live performance  glitch plugins for VCVrack

Line 21: Line 24:

* https://github.com/hisschemoller/video-edit-3d* https://github.com/hisschemoller/video-edit-3d  * https://github.com/EMC23/collage

=== source ====== source === Line 56: Line 59: == Mixing Desks ==== Mixing Desks == * Allen & Heath QU-16* Allen & Heath QU-16 * Prosunus* Prosonus * SSL* SSL

Techbot

Studio Technology

3 weeks 1 day ago

Mixing Desks

← Older revision Revision as of 12:29, 5 September 2021 (4 intermediate revisions by the same user not shown)Line 1: Line 1: = Software == Software = == Audio Software by Members == * https://github.com/hisschemoller/music-pattern-generator Music Pattern Generator is a web app to create musical rhythm patterns. The patterns are represented by animated graphics that make it easy to create and understand complex polyrhythms. * https://github.com/hisschemoller/volca-freesound Volca-Freesound is an app to load random samples on the Korg Volca Sample. I made it to make music on the Volca Sample, of course, and to get experience developing apps with React, Redux and the React Starter Kit. * https://github.com/hisschemoller/intonarumori Intonarumori is a project to explore creating sounds, rhythms and music with simulated 3D machines. * https://github.com/EMC23/arduino-vcvrack Two way communication between an Arduino board and a VCV Rack module. * https://github.com/EMC23/Techtools Tehttps://github.com/EMC23/TrumBelachtools is a set of live performance  glitch plugins for VCVrack * https://github.com/EMC23/TrumBela TrumBela is an effects pedal for the Bela embedded audio computing platform. == Video Software by Members == * https://github.com/hisschemoller/video-edit-3d * https://github.com/EMC23/collage === source === https://www.hisschemoller.com/

== DAWs ==== DAWs == Line 31: Line 59: == Mixing Desks ==== Mixing Desks == * Allen & Heath QU-16* Allen & Heath QU-16 * Prosunus* Prosonus * SSL* SSL

Techbot

Main Page

3 weeks 1 day ago

Sound Design

← Older revision Revision as of 11:41, 5 September 2021 (2 intermediate revisions by the same user not shown)Line 34: Line 34:

=== [[Performance]] ====== [[Performance]] === Latency? What should be prerendered? How many plugins can your machine handle in a live environment. How engaging is your stage presence. Maybe your workl incvludes stage design and fasion items.Latency? What should be prerendered? How many plugins can your machine handle in a live environment. How engaging is your stage presence. Maybe your work includes stage design and fashion items.

Enter the [[Performance]] sectionEnter the [[Performance]] section Line 46: Line 46: The art and practice of creating sound tracks for a variety of needs. It involves specifying, acquiring or creating auditory elements using audio production techniques and tools. It is employed in a variety of disciplines including filmmaking, television production, video game development, theatre, sound recording and reproduction, live performance, sound art, post-production, radio and musical instrument development.  The art and practice of creating sound tracks for a variety of needs. It involves specifying, acquiring or creating auditory elements using audio production techniques and tools. It is employed in a variety of disciplines including filmmaking, television production, video game development, theatre, sound recording and reproduction, live performance, sound art, post-production, radio and musical instrument development.   Sound design is a combination of three specialisations: sound recording, editing and mixing, commonly involves performing and editing of previously composed or recorded audio, such as sound effects and dialogue for the purposes of the medium, but it can also involve creating sounds from scratch through synthesizers.  Sound design is a combination of three specialisations: sound recording, editing and mixing, commonly involves performing and editing of previously composed or recorded audio, such as sound effects and dialogue for the purposes of the medium, but it can also involve creating sounds from scratch through synthesizers.  

Enter the [[Sound Design]] sectionEnter the [[Sound Design]] section

=== [[Deep Learning]] ====== [[Deep Learning]] === Using Adverserial Networks, Tendorflow, Keras and numerous other tools and techniques to assist the composer, musician, producer and musiciologist. As Deep Learning becomes more and more ubiquitous, it has seen tremendous success in handling audio. With deep learning, the traditional audio processing techniques are no longer needed, and we can rely on standard data preparation without requiring a lot of manual and custom generation of features.Using Adverserial Networks, Tensorflow, Keras and numerous other tools and techniques to assist the composer, musician, producer and musiciologist. As Deep Learning becomes more and more ubiquitous, it has seen tremendous success in handling audio. With deep learning, the traditional audio processing techniques are no longer needed, and we can rely on standard data preparation without requiring a lot of manual and custom generation of features.

Enter the [[Deep Learning]] sectionEnter the [[Deep Learning]] section
Techbot

RTL-SDR

3 weeks 1 day ago

← Older revision Revision as of 11:03, 5 September 2021 (2 intermediate revisions by the same user not shown)Line 121: Line 121:

  rtl_fm -f 90100000 -M wbfm -s 200000 -r 48000 - | play -r 48000 -t s16 -L -c 1  -  rtl_fm -f 90100000 -M wbfm -s 200000 -r 48000 - | play -r 48000 -t s16 -L -c 1  - play is no longer supported by sox on windows rtl_fm.exe -M fm -s 200k -A fast -r 48k -l 0 -E deemph -f 97.29M | sox -V1 -b 16 -c 1 -e signed-integer -r 48k -t raw - -t waveaudio default

If you want to do more advanced experiments, the [[GNU Radio]] collection of tools can be used to build custom radio devices. GNU Radio can be used both from a GUI perspective in which you can drag-and-drop radio components to build a radio and also programmatically where software programs written in C or Python are created that directly reference the internal GNU Radio functions.If you want to do more advanced experiments, the [[GNU Radio]] collection of tools can be used to build custom radio devices. GNU Radio can be used both from a GUI perspective in which you can drag-and-drop radio components to build a radio and also programmatically where software programs written in C or Python are created that directly reference the internal GNU Radio functions. Line 321: Line 325:

What has been successfully tested so far is the reception of Broadcast FM and air traffic AM radio, TETRA, GMR, GSM, ADS-B and POCSAG.What has been successfully tested so far is the reception of Broadcast FM and air traffic AM radio, TETRA, GMR, GSM, ADS-B and POCSAG. = Starting Point RTL_Map = * https://github.com/orhun/rtl_map ==Installation == === Dependencies ===     libusb1.0 (development packages must be installed manually, see libusb.info)     gnuplot (must be installed manually, see installation page)     librtlsdr (cmake / automatic installation & linking)     fftw3 (cmake / automatic installation & linking) === Clone Repository === git clone https://github.com/orhun/rtl_map === Building with CMake (recommended) === cd rtl_map mkdir build cd build cmake ../ make sudo make install sudo ldconfig === Building with GCC === gcc rtl_map.c -o rtl_map -lrtlsdr -lfftw3 -lm == Usage == Command Line Arguments -d, set device index (default: 0) -s, set sample rate (default: 2048000 Hz) -f, center frequency (Hz) [mandatory argument] -g gain (0 for auto) (default: ~1-3) -n number of reads (default: int_max.) -r, refresh rate for continuous read (default: 500ms) -D, don't show gnuplot graph (default: show) -C, continuously read samples (default: off) -M, show magnitude graph (default graph: dB) -O, disable offset tuning (default: on) -T, turn off terminal log colors (default: on) -h, show help message and exit filename (a '-' dumps samples to stdout) ==Example == Print samples to file [k3@arch ~]$ rtl_map -f 88000000 -D capture.dat [01:00:26] INFO Starting rtl_map ~ [01:00:26] INFO Found 1 device(s): [01:00:26] INFO #0: Generic RTL2832U OEM Found Rafael Micro R820T tuner [01:00:27] INFO Using device: #0 [01:00:27] INFO Gain set to 14. Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 128.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 [01:00:27] INFO Center frequency set to 88000000 Hz. [01:00:27] INFO Sampling at 2048000 S/s [01:00:27] INFO Reading samples... [01:00:27] INFO Done, exiting...

= Useful Links == Useful Links =
Techbot

Main Page

3 weeks 1 day ago

Performance

← Older revision Revision as of 10:35, 5 September 2021 Line 34: Line 34:

=== [[Performance]] ====== [[Performance]] === Latency? Whatshould be prerendered? How many plugins can your machine handle in a live environment. How engaging is your stage presence. Maybe your workl incvludes stage design and fasion items.Latency? What should be prerendered? How many plugins can your machine handle in a live environment. How engaging is your stage presence. Maybe your workl incvludes stage design and fasion items.

Enter the [[Performance]] sectionEnter the [[Performance]] section
Techbot

C++

3 weeks 1 day ago

Frameworks & Libraries Supported by EMC23

← Older revision Revision as of 10:33, 5 September 2021 (3 intermediate revisions by the same user not shown)Line 3: Line 3: C++ (pronounced cee plus plus) is a general purpose programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. It is immensely popular, particularly for applications that require speed and/or access to some low-level features. It is considered to be an intermediate level language, as it encapsulates both high and low level language features.C++ (pronounced cee plus plus) is a general purpose programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. It is immensely popular, particularly for applications that require speed and/or access to some low-level features. It is considered to be an intermediate level language, as it encapsulates both high and low level language features. Uses include [[Vst]] and [[VCVRack]] plugin development.Uses include [[Vst]] and [[VCVRack]] plugin development. == Essential Tutorials == * https://cmake.org/cmake/help/latest/guide/tutorial/index.html

== Audio Tutorials ==== Audio Tutorials == Line 14: Line 10: * Pulse Audio* Pulse Audio

== Frameworks & Libraries Supported by EMC23 ==  == Audio Frameworks & Libraries Supported by EMC23 ==   * [[PortAudio]]* [[PortAudio]] PortAudio is a free, cross-platform, open-source, audio I/O library.  It lets you write audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. It provides a very simple API for recording and/or playing sound using a simple callback function.PortAudio is a free, cross-platform, open-source, audio I/O library.  It lets you write audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. It provides a very simple API for recording and/or playing sound using a simple callback function. Line 43: Line 39:

==== [[Make]] ======== [[Make]] ==== In software development, Make is a build automation tool that automatically builds executable programs and libraries from source code by reading files called Makefiles which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems. Besides building programs, Make can be used to manage any project where some files must be updated automatically from others whenever the others change. ==== Cmake - Cross Platform compiler-independant builder ==== Make is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. Allows for the configuration of multiple build environments across different platforms, especially useful for teams that use different OS * https://cmake.org/cmake/help/latest/guide/tutorial/index.html

=== Windows ====== Windows === Line 60: Line 62: ==== Mingw-w64 - GCC runtime environment ======== Mingw-w64 - GCC runtime environment ==== The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems. Mingw-w64 is an advancement of the original mingw.org project, created to support the GCC compiler on Windows systems. It has forked it in 2007 in order to provide support for 64 bits and new APIs. It has since then gained widespread use and distribution.The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems. Mingw-w64 is an advancement of the original mingw.org project, created to support the GCC compiler on Windows systems. It has forked it in 2007 in order to provide support for 64 bits and new APIs. It has since then gained widespread use and distribution. ==== Cmake - Cross Platform compiler-independant builder ==== Make is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. Allows for the configuration of multiple build environments across different platforms, especially useful for teams that use different OS

==== [[Code Blocks]](open source)======== [[Code Blocks]](open source)====
Techbot

Make

3 weeks 1 day ago

Created page with "Getting Started Why do Makefiles exist? Makefiles are used to help decide which parts of a large program need to be recompiled. In the vast majority of cases, C or C++ files..."

New page

Getting Started
Why do Makefiles exist?

Makefiles are used to help decide which parts of a large program need to be recompiled. In the vast majority of cases, C or C++ files are compiled. Other languages typically have their own tools that serve a similar purpose as Make. It can be used beyond programs too, when you need a series of instructions to run depending on what files have changed. This tutorial will focus on the C/C++ compilation use case.

Here's an example dependency graph that you might build with Make. If any file's dependencies changes, then the file will get recompiled:
What alternatives are there to Make?

Popular C/C++ alternative build systems are SCons, CMake, Bazel, and Ninja. Some code editors like Microsoft Visual Studio have their own built in build tools. For Java, there's Ant, Maven, and Gradle. Other languages like Go and Rust have their own build tools.

Interpreted languages like Python, Ruby, and Javascript don't require an analogue to Makefiles. The goal of Makefiles is to compile whatever files need to be compiled, based on what files have changed. But when files in interpreted languages change, nothing needs to get recompiled. When the program runs, the most recent version of the file is used.
Running the Examples

To run these examples, you'll need a terminal and "make" installed. For each example, put the contents in a file called Makefile, and in that directory run the command make. Let's start with the simplest of Makefiles:

hello:
echo "hello world"

Here is the output of running the above example:

$ make
echo "hello world"
hello world

That's it! If you're a bit confused, here's a video that goes through these steps, along with describing the basic structure of Makefiles.
Makefile Syntax

A Makefile consists of a set of rules. A rule generally looks like this:

targets: prerequisites
command
command
command

The targets are file names, separated by spaces. Typically, there is only one per rule.
The commands are a series of steps typically used to make the target(s). These need to start with a tab character, not spaces.
The prerequisites are also file names, separated by spaces. These files need to exist before the commands for the target are run. These are also called dependencies

Beginner Examples

The following Makefile has three separate rules. When you run make blah in the terminal, it will build a program called blah in a series of steps:

Make is given blah as the target, so it first searches for this target
blah requires blah.o, so make searches for the blah.o target
blah.o requires blah.c, so make searches for the blah.c target
blah.c has no dependencies, so the echo command is run
The cc -c command is then run, because all of the blah.o dependencies are finished
The top cc command is run, because all the blah dependencies are finished
That's it: blah is a compiled c program

blah: blah.o
cc blah.o -o blah # Runs third

blah.o: blah.c
cc -c blah.c -o blah.o # Runs second

blah.c:
echo "int main() { return 0; }" > blah.c # Runs first

This makefile has a single target, called some_file. The default target is the first target, so in this case some_file will run.

some_file:
echo "This line will always print"

This file will make some_file the first time, and the second time notice it's already made, resulting in make: 'some_file' is up to date.

some_file:
echo "This line will only print once"
touch some_file

Here, the target some_file "depends" on other_file. When we run make, the default target (some_file, since it's first) will get called. It will first look at its list of dependencies, and if any of them are older, it will first run the targets for those dependencies, and then run itself. The second time this is run, neither target will run because both targets exist.

some_file: other_file
echo "This will run second, because it depends on other_file"
touch some_file

other_file:
echo "This will run first"
touch other_file

This will always run both targets, because some_file depends on other_file, which is never created.

some_file: other_file
touch some_file

other_file:
echo "nothing"

clean is often used as a target that removes the output of other targets, but it is not a special word in make.

some_file:
touch some_file

clean:
rm -f some_file

Variables

Variables can only be strings. Here's an example of using them:

files = file1 file2
some_file: $(files)
echo "Look at this variable: " $(files)
touch some_file

file1:
touch file1
file2:
touch file2

clean:
rm -f file1 file2 some_file

Reference variables using ${} or $()

x = dude

all:
echo $(x)
echo ${x}

# Bad practice, but works
echo $x

Targets
The all target

Making multiple targets and you want all of them to run? Make an all target.

all: one two three

one:
touch one
two:
touch two
three:
touch three

clean:
rm -f one two three

Multiple targets

When there are multiple targets for a rule, the commands will be run for each target
$@ is an automatic variable that contains the target name.

all: f1.o f2.o

f1.o f2.o:
echo $@
# Equivalent to:
# f1.o
# echo $@
# f2.o
# echo $@

Automatic Variables and Wildcards
* Wildcard

Both * and % are called wildcards in Make, but they mean entirely different things. * searches your filesystem for matching filenames. I suggest that you always wrap it in the wildcard function, because otherwise you may fall into a common pitfall described below. It's oddly unhelpful and I find it more confusing than useful.

# Print out file information about every .c file
print: $(wildcard *.c)
ls -la $?

* may be used in the target, prerequisites, or in the wildcard function.

Danger: * may not be directly used in a variable definitions

Danger: When * matches no files, it is left as it is (unless run in the wildcard function)

thing_wrong := *.o # Don't do this! '*' will not get expanded
thing_right := $(wildcard *.o)

all: one two three four

# Fails, because $(thing_wrong) is the string "*.o"
one: $(thing_wrong)

# Stays as *.o if there are no files that match this pattern :(
two: *.o

# Works as you would expect! In this case, it does nothing.
three: $(thing_right)

# Same as rule three
four: $(wildcard *.o)

% Wildcard

% is really useful, but is somewhat confusing because of the variety of situations it can be used in.

When used in "matching" mode, it matches one or more characters in a string. This match is called the stem.
When used in "replacing" mode, it takes the stem that was matched and replaces that in a string.
% is most often used in rule definitions and in some specific functions.

See these sections on examples of it being used:

Static Pattern Rules
Pattern Rules
String Substitution
The vpath Directive

Automatic Variables

There are many automatic variables, but often only a few show up:

hey: one two
# Outputs "hey", since this is the first target
echo $@

# Outputs all prerequisites newer than the target
echo $?

# Outputs all prerequisites
echo $^

touch hey

one:
touch one

two:
touch two

clean:
rm -f hey one two

Fancy Rules
Static Pattern Rules

Make loves c compilation. And every time it expresses its love, things get confusing. Here's the syntax for a new type of rule called a static pattern:

targets ...: target-pattern: prereq-patterns ...
commands

The essence is that the given target is matched by the target-pattern (via a % wildcard). Whatever was matched is called the stem. The stem is then substituted into the prereq-pattern, to generate the target's prereqs.

A typical use case is to compile .c files into .o files. Here's the manual way:

objects = foo.o bar.o all.o
all: $(objects)

# These files compile via implicit rules
foo.o: foo.c
bar.o: bar.c
all.o: all.c

all.c:
echo "int main() { return 0; }" > all.c

%.c:
touch $@

clean:
rm -f *.c *.o all

Here's the more efficient way, using a static pattern rule:

objects = foo.o bar.o all.o
all: $(objects)

# These files compile via implicit rules
# Syntax - targets ...: target-pattern: prereq-patterns ...
# In the case of the first target, foo.o, the target-pattern matches foo.o and sets the "stem" to be "foo".
# It then replaces the '%' in prereq-patterns with that stem
$(objects): %.o: %.c

all.c:
echo "int main() { return 0; }" > all.c

%.c:
touch $@

clean:
rm -f *.c *.o all

Static Pattern Rules and Filter

While I introduce functions later on, I'll forshadow what you can do with them. The filter function can be used in Static pattern rules to match the correct files. In this example, I made up the .raw and .result extensions.

obj_files = foo.result bar.o lose.o
src_files = foo.raw bar.c lose.c

all: $(obj_files)

$(filter %.o,$(obj_files)): %.o: %.c
echo "target: $@ prereq: $<"
$(filter %.result,$(obj_files)): %.result: %.raw
echo "target: $@ prereq: $<"

%.c %.raw:
touch $@

clean:
rm -f $(src_files)

Implicit Rules

Perhaps the most confusing part of make is the magic rules and variables that are made. Here's a list of implicit rules:

Compiling a C program: n.o is made automatically from n.c with a command of the form $(CC) -c $(CPPFLAGS) $(CFLAGS)
Compiling a C++ program: n.o is made automatically from n.cc or n.cpp with a command of the form $(CXX) -c $(CPPFLAGS) $(CXXFLAGS)
Linking a single object file: n is made automatically from n.o by running the command $(CC) $(LDFLAGS) n.o $(LOADLIBES) $(LDLIBS)

As such, the important variables used by implicit rules are:

CC: Program for compiling C programs; default cc
CXX: Program for compiling C++ programs; default G++
CFLAGS: Extra flags to give to the C compiler
CXXFLAGS: Extra flags to give to the C++ compiler
CPPFLAGS: Extra flags to give to the C preprocessor
LDFLAGS: Extra flags to give to compilers when they are supposed to invoke the linker

CC = gcc # Flag for implicit rules
CFLAGS = -g # Flag for implicit rules. Turn on debug info

# Implicit rule #1: blah is built via the C linker implicit rule
# Implicit rule #2: blah.o is built via the C compilation implicit rule, because blah.c exists
blah: blah.o

blah.c:
echo "int main() { return 0; }" > blah.c

clean:
rm -f blah*

Pattern Rules

Pattern rules are often used but quite confusing. You can look at them as two ways:

A way to define your own implicit rules
A simpler form of static pattern rules

Let's start with an example first:

# Define a pattern rule that compiles every .c file into a .o file
%.o : %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

Pattern rules contain a '%' in the target. This '%' matches any nonempty string, and the other characters match themselves. ‘%’ in a prerequisite of a pattern rule stands for the same stem that was matched by the ‘%’ in the target.

Here's another example:

# Define a pattern rule that has no pattern in the prerequisites.
# This just creates empty .c files when needed.
%.c:
touch $@

Double-Colon Rules

Double-Colon Rules are rarely used, but allow multiple rules to be defined for the same target. If these were single colons, a warning would be printed and only the second set of commands would run.

all: blah

blah::
echo "hello"

blah::
echo "hello again"

Commands and execution
Command Echoing/Silencing

Add an @ before a command to stop it from being printed
You can also run make with -s to add an @ before each line

all:
@echo "This make line will not be printed"
echo "But this will"

Command Execution

Each command is run in a new shell (or at least the effect is as such)

all:
cd ..
# The cd above does not affect this line, because each command is effectively run in a new shell
echo `pwd`

# This cd command affects the next because they are on the same line
cd ..;echo `pwd`

# Same as above
cd ..; \
echo `pwd`

Default Shell

The default shell is /bin/sh. You can change this by changing the variable SHELL:

SHELL=/bin/bash

cool:
echo "Hello from bash"

Error handling with -k, -i, and -

Add -k when running make to continue running even in the face of errors. Helpful if you want to see all the errors of Make at once.
Add a - before a command to suppress the error
Add -i to make to have this happen for every command.

one:
# This error will be printed but ignored, and make will continue to run
-false
touch one

Interrupting or killing make

Note only: If you ctrl+c make, it will delete the newer targets it just made.
Recursive use of make

To recursively call a makefile, use the special $(MAKE) instead of make because it will pass the make flags for you and won't itself be affected by them.

new_contents = "hello:\n\ttouch inside_file"
all:
mkdir -p subdir
printf $(new_contents) | sed -e 's/^ //' > subdir/makefile
cd subdir && $(MAKE)

clean:
rm -rf subdir

Use export for recursive make

The export directive takes a variable and makes it accessible to sub-make commands. In this example, cooly is exported such that the makefile in subdir can use it.

Note: export has the same syntax as sh, but they aren't related (although similar in function)

new_contents = "hello:\n\\techo \$$(cooly)"

all:
mkdir -p subdir
echo $(new_contents) | sed -e 's/^ //' > subdir/makefile
@echo "---MAKEFILE CONTENTS---"
@cd subdir && cat makefile
@echo "---END MAKEFILE CONTENTS---"
cd subdir && $(MAKE)

# Note that variables and exports. They are set/affected globally.
cooly = "The subdirectory can see me!"
export cooly
# This would nullify the line above: unexport cooly

clean:
rm -rf subdir

You need to export variables to have them run in the shell as well.

one=this will only work locally
export two=we can run subcommands with this

all:
@echo $(one)
@echo $$one
@echo $(two)
@echo $$two

.EXPORT_ALL_VARIABLES exports all variables for you.

.EXPORT_ALL_VARIABLES:
new_contents = "hello:\n\techo \$$(cooly)"

cooly = "The subdirectory can see me!"
# This would nullify the line above: unexport cooly

all:
mkdir -p subdir
echo $(new_contents) | sed -e 's/^ //' > subdir/makefile
@echo "---MAKEFILE CONTENTS---"
@cd subdir && cat makefile
@echo "---END MAKEFILE CONTENTS---"
cd subdir && $(MAKE)

clean:
rm -rf subdir

Arguments to make

There's a nice list of options that can be run from make. Check out --dry-run, --touch, --old-file.

You can have multiple targets to make, i.e. make clean run test runs the clean goal, then run, and then test.
Variables Pt. 2
Flavors and modification

There are two flavors of variables:

recursive (use =) - only looks for the variables when the command is used, not when it's defined.
simply expanded (use :=) - like normal imperative programming -- only those defined so far get expanded

# Recursive variable. This will print "later" below
one = one ${later_variable}
# Simply expanded variable. This will not print "later" below
two := two ${later_variable}

later_variable = later

all:
echo $(one)
echo $(two)

Simply expanded (using :=) allows you to append to a variable. Recursive definitions will give an infinite loop error.

one = hello
# one gets defined as a simply expanded variable (:=) and thus can handle appending
one := ${one} there

all:
echo $(one)

?= only sets variables if they have not yet been set

one = hello
one ?= will not be set
two ?= will be set

all:
echo $(one)
echo $(two)

Spaces at the end of a line are not stripped, but those at the start are. To make a variable with a single space, use $(nullstring)

with_spaces = hello # with_spaces has many spaces after "hello"
after = $(with_spaces)there

nullstring =
space = $(nullstring) # Make a variable with a single space.

all:
echo "$(after)"
echo start"$(space)"end

An undefined variable is actually an empty string!

all:
# Undefined variables are just empty strings!
echo $(nowhere)

Use += to append

foo := start
foo += more

all:
echo $(foo)

String Substitution is also a really common and useful way to modify variables. Also check out Text Functions and Filename Functions.
Command line arguments and override

You can override variables that come from the command line by using override. Here we ran make with make option_one=hi

# Overrides command line arguments
override option_one = did_override
# Does not override command line arguments
option_two = not_override
all:
echo $(option_one)
echo $(option_two)

List of commands and define

"define" is actually just a list of commands. It has nothing to do with being a function. Note here that it's a bit different than having a semi-colon between commands, because each is run in a separate shell, as expected.

one = export blah="I was set!"; echo $$blah

define two
export blah=set
echo $$blah
endef

# One and two are different.

all:
@echo "This prints 'I was set'"
@$(one)
@echo "This does not print 'I was set' because each command runs in a separate shell"
@$(two)

Target-specific variables

Variables can be assigned for specific targets

all: one = cool

all:
echo one is defined: $(one)

other:
echo one is nothing: $(one)

Pattern-specific variables

You can assign variables for specific target patterns

%.c: one = cool

blah.c:
echo one is defined: $(one)

other:
echo one is nothing: $(one)

Conditional part of Makefiles
Conditional if/else

foo = ok

all:
ifeq ($(foo), ok)
echo "foo equals ok"
else
echo "nope"
endif

Check if a variable is empty

nullstring =
foo = $(nullstring) # end of line; there is a space here

all:
ifeq ($(strip $(foo)),)
echo "foo is empty after being stripped"
endif
ifeq ($(nullstring),)
echo "nullstring doesn't even have spaces"
endif

Check if a variable is defined

ifdef does not expand variable references; it just sees if something is defined at all

bar =
foo = $(bar)

all:
ifdef foo
echo "foo is defined"
endif
ifdef bar
echo "but bar is not"
endif

$(makeflags)

This example shows you how to test make flags with findstring and MAKEFLAGS. Run this example with make -i to see it print out the echo statement.

bar =
foo = $(bar)

all:
# Search for the "-i" flag. MAKEFLAGS is just a list of single characters, one per flag. So look for "i" in this case.
ifneq (,$(findstring i, $(MAKEFLAGS)))
echo "i was passed to MAKEFLAGS"
endif

Functions
First Functions

Functions are mainly just for text processing. Call functions with $(fn, arguments) or ${fn, arguments}. You can make your own using the call builtin function. Make has a decent amount of builtin functions.

bar := ${subst not, totally, "I am not superman"}
all:
@echo $(bar)

If you want to replace spaces or commas, use variables

comma := ,
empty:=
space := $(empty) $(empty)
foo := a b c
bar := $(subst $(space),$(comma),$(foo))

all:
@echo $(bar)

Do NOT include spaces in the arguments after the first. That will be seen as part of the string.

comma := ,
empty:=
space := $(empty) $(empty)
foo := a b c
bar := $(subst $(space), $(comma) , $(foo))

all:
# Output is ", a , b , c". Notice the spaces introduced
@echo $(bar)

String Substitution

$(patsubst pattern,replacement,text) does the following:

"Finds whitespace-separated words in text that match pattern and replaces them with replacement. Here pattern may contain a ‘%’ which acts as a wildcard, matching any number of any characters within a word. If replacement also contains a ‘%’, the ‘%’ is replaced by the text that matched the ‘%’ in pattern. Only the first ‘%’ in the pattern and replacement is treated this way; any subsequent ‘%’ is unchanged." (GNU docs)

The substitution reference $(text:pattern=replacement) is a shorthand for this.

There's another shorthand that that replaces only suffixes: $(text:suffix=replacement). No % wildcard is used here.

Note: don't add extra spaces for this shorthand. It will be seen as a search or replacement term.

foo := a.o b.o l.a c.o
one := $(patsubst %.o,%.c,$(foo))
# This is a shorthand for the above
two := $(foo:%.o=%.c)
# This is the suffix-only shorthand, and is also equivalent to the above.
three := $(foo:.o=.c)

all:
echo $(one)
echo $(two)
echo $(three)

The foreach function

The foreach function looks like this: $(foreach var,list,text). It converts one list of words (separated by spaces) to another. var is set to each word in list, and text is expanded for each word.
This appends an exclamation after each word:

foo := who are you
# For each "word" in foo, output that same word with an exclamation after
bar := $(foreach wrd,$(foo),$(wrd)!)

all:
# Output is "who! are! you!"
@echo $(bar)

The if function

if checks if the first argument is nonempty. If so runs the second argument, otherwise runs the third.

foo := $(if this-is-not-empty,then!,else!)
empty :=
bar := $(if $(empty),then!,else!)

all:
@echo $(foo)
@echo $(bar)

The call function

Make supports creating basic functions. You "define" the function just by creating a variable, but use the parameters $(0), $(1), etc. You then call the function with the special call function. The syntax is $(call variable,param,param). $(0) is the variable, while $(1), $(2), etc. are the params.

sweet_new_fn = Variable Name: $(0) First: $(1) Second: $(2) Empty Variable: $(3)

all:
# Outputs "Variable Name: sweet_new_fn First: go Second: tigers Empty Variable:"
@echo $(call sweet_new_fn, go, tigers)

The shell function

shell - This calls the shell, but it replaces newlines with spaces!

all:
@echo $(shell ls -la) # Very ugly because the newlines are gone!

Other Features
Include Makefiles

The include directive tells make to read one or more other makefiles. It's a line in the makefile makefile that looks like this:

include filenames...

This is particularly useful when you use compiler flags like -M that create Makefiles based on the source. For example, if some c files includes a header, that header will be added to a Makefile that's written by gcc. I talk about this more in the Makefile Cookbook
The vpath Directive

Use vpath to specify where some set of prerequisites exist. The format is vpath <pattern> <directories, space/colon separated>
<pattern> can have a %, which matches any zero or more characters.
You can also do this globallyish with the variable VPATH

vpath %.h ../headers ../other-directory

some_binary: ../headers blah.h
touch some_binary

../headers:
mkdir ../headers

blah.h:
touch ../headers/blah.h

clean:
rm -rf ../headers
rm -f some_binary

Multiline

The backslash ("\") character gives us the ability to use multiple lines when the commands are too long

some_file:
echo This line is too long, so \
it is broken up into multiple lines

.phony

Adding .PHONY to a target will prevent make from confusing the phony target with a file name. In this example, if the file clean is created, make clean will still be run. .PHONY is great to use, but I'll skip it in the rest of the examples for simplicity.

some_file:
touch some_file
touch clean

.PHONY: clean
clean:
rm -f some_file
rm -f clean

.delete_on_error

The make tool will stop running a rule (and will propogate back to prerequisites) if a command returns a nonzero exit status.
DELETE_ON_ERROR will delete the target of a rule if the rule fails in this manner. This will happen for all targets, not just the one it is before like PHONY. It's a good idea to always use this, even though make does not for historical reasons.

.DELETE_ON_ERROR:
all: one two

one:
touch one
false

two:
touch two
false

Makefile Cookbook

Let's go through a really juicy Make example that works well for medium sized projects.

The neat thing about this makefile is it automatically determines dependencies for you. All you have to do is put your C/C++ files in the src/ folder.

# Thanks to Job Vranish (https://spin.atomicobject.com/2016/08/26/makefile-c-projects/)
TARGET_EXEC := final_program

BUILD_DIR := ./build
SRC_DIRS := ./src

# Find all the C and C++ files we want to compile
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c)

# String substitution for every C/C++ file.
# As an example, hello.cpp turns into ./build/hello.cpp.o
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)

# String substitution (suffix version without %).
# As an example, ./build/hello.cpp.o turns into ./build/hello.cpp.d
DEPS := $(OBJS:.o=.d)

# Every folder in ./src will need to be passed to GCC so that it can find header files
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
# Add a prefix to INC_DIRS. So moduleA would become -ImoduleA. GCC understands this -I flag
INC_FLAGS := $(addprefix -I,$(INC_DIRS))

# The -MMD and -MP flags together generate Makefiles for us!
# These files will have .d instead of .o as the output.
CPPFLAGS := $(INC_FLAGS) -MMD -MP

# The final build step.
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)

# Build step for C source
$(BUILD_DIR)/%.c.o: %.c
mkdir -p $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

# Build step for C++ source
$(BUILD_DIR)/%.cpp.o: %.cpp
mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@


.PHONY: clean
clean:
rm -r $(BUILD_DIR)

# Include the .d makefiles. The - at the front suppresses the errors of missing
# Makefiles. Initially, all the .d files will be missing, and we don't want those
# errors to show up.
-include $(DEPS)
Techbot
Checked
40 minutes 6 seconds ago
Track the most recent changes to the wiki in this feed.
Subscribe to Wiki Updates feed