Différences

Cette page vous donne les différences entre la révision choisie et la version actuelle de la page.

Lien vers cette vue

bresson:m159 [2018/02/21 15:51]
Jean Bresson [— patch 3: sound synthesis (Csound)]
— (Version actuelle)
Ligne 1: Ligne 1:
-====== Music 159: (visual) programming for music ====== 
- 
-On this page you will find some hints and links to experiment with computer-aided composition processes related to my Music-159 lecture on visual programming for music. 
- 
- 
-The support slides of the class are available **[[https://nuage.ircam.fr/index.php/s/nwtoylfAqtMSPQ1|here]]** (PDF). 
- 
- 
-{{ :bresson:om.png?|}} 
-The main course materials are patches for the  **[[https://openmusic-project.github.io/|o7]]** visual programming environment. 
-**[[https://openmusic-project.github.io/|o7]]** is a work-in-progress prototype inspired from the [[http://repmus.ircam.fr/openmusic/|OpenMusic (OM)]] computer-aided composition environment.((=> If you want to do more computer-aided composition, you can also download and try out the latest [[http://forumnet.ircam.fr/shop/fr/forumnet/43-openmusic.html|OM 6.12/6.13]] releases from Ircam's ForumNet website.)) 
-It should be easy to get started and experiment with; however, do not hesitate to contact me if you have any problem with it. 
- 
-=== — download  === 
- 
-=> **o7: https://github.com/openmusic-project/o7/releases** 
- 
- 
-**Additional downloads (optional):** 
-  * **[[https://forge.ircam.fr/p/omchroma/downloads/|OMChroma library]]** 
-  * **[[http://csound.com/download.html|Csound]]** (required with OMChroma) 
-  * **[[https://forge.ircam.fr/p/OM7/downloads/695/|om-spat library]]** 
-  * **[[http://notahat.com/simplesynth/|SimpleSynth]]**: a simple, easy-to-connect MIDI synthesizer 
- 
- 
- 
-=== — doc  === 
- 
-  * **[[https://openmusic-project.github.io/pages/patch|Basics of programming in o7]]** 
-  * **[[https://openmusic-project.github.io/pages/basic-commands|Editor commands]]** 
-  * **[[https://openmusic-project.github.io/pages/libraries|How to install and use external libraries]]** 
- 
-/* 
-**Note:** <color darkred>Ther's only a macOS version available so far. I'm working at delivering a Windows version in the next few hours or days!</color> 
-*/ 
- 
- 
-===== class materials ===== 
- 
-**All o7 and Max patches are available [[https://nuage.ircam.fr/index.php/s/6j7cpzvwm52F4vl|here]]**. 
- 
- 
-=== — patch 1: basics === 
- 
-|This patch is a simple example of how to:\\ \\ - instanciate a simple midi-note object,\\ - abstract this process as a sub-patch,\\ - use this subpatch in lambda-mode to generate a sequence of notes,\\ - apply some treatments on the sequence using the same procedure.\\ |  {{ :bresson:om7:o7-basic.png?300|}} | 
- 
-=== — patch 2: sound processing === 
- 
-|This patch is an introduction to the sound processing operators in o7/OM:\\ SOUND-CUT, SOUND-FADE, SOUND-MIX, SOUND-SEQ, etc.\\ \\ We apply similar procedures to:\\ \\ - generate a small grain extracted from a source sound,\\ - abstract this process as a sub-patch,\\ - use this subpatch in lambda-mode to generate a set of grains using MAPCAR,\\ - apply a higher-order function as combinator to sequence the grains using REDUCE,\\ - save the result as a new sound file.\\ |  {{ :bresson:om7:o7-dsp.png?380 |}} | 
- 
-=== — patch 3: sound synthesis (Csound) ===  
- 
-This patch uses the CS-ARRAY object from the OMChroma library.\\ 
-=> Get OMChroma for o7 here: **https://forge.ircam.fr/p/omchroma/downloads/** 
- 
-|CS-ARRAY is a 2D-matrix matched with a Csound instrument. When first eveluated, the "source-code" and "instr-num" inputs will determine the instrument within a Csound orchestra, and the rest of the "optional" slots of the matrix will be initialized accordingly.\\ \\ The matrix will generate a number of lines (or "note statements") in a Csound score. This number is determined by the ELTS input of the object and will determine how other, optional inputs are interpreted to fill data in the matrix:\\ - A single value is duplicated <ELTS> times for each element, \\ - A list of values is read circularly until filling the <ELTS> values, \\ - A function (or lambda expression) is evaluated at each cell, \\ - A BPF is sampled in <ELTS> points, \\ - etc.\\ \\ We set these synthesis input values from times and pitch extracted from the previous PIANO-ROLL, which was just copied in this patch. Notes envelopes are determined by a an object GEN07 (a BPF defining a Csound table) that we can edit by hand.\\ \\ The CS-ARRAY is connected to CS-SYNTHESIZE, which will\\ 1) Format Csound code and write it to disk as two files (score and orchestra) \\ 2) Perform an external call to Csound.\\ \\ If the "keyword" input <RUN> is set to NIL, CS-SYNTHESIZE will not call Csound and just return the pathnames to the generated Csound files.\\ \\ **Note:** Csound must be previously installed and correctly set in the o7 **Preferences/Externals** tab.   |  {{ :bresson:om7:o7-csound.png?300 |}} | 
- 
-=== — patch 4: sound spatialization (spat) ===  
- 
-This patch is an introduction to the **om-spat** library for o7.\\   
-=> Get **om-spat** for o7 at: **https://forge.ircam.fr/p/OM7/downloads/695/**. 
- 
-|**om-spat** embeds native components from the spat~ library as graphic controllers and DSP processors for reverberation, spatialization and other sound effects.\\ \\ In this patch, an algorithm generates a 3D trajectory (lists of x, y, and z points connected to a 3DC object), and then associates this trajectory to a sound in the SPAT-SCENE object. The other important input of SPAT-SCENE is a list of (x y z) points specifying the positions of loudspeakers. Several sound sources and trajectories can also be connected together using lists (LIST function).\\ \\ In SPAT-SCENE, it is possible to set some interpolation and rendering attributes. The spatial sound scene can be rendered for instance as a stream of OSC messages, as spatialized/multichannel audio, or graphically only. \\ \\ The function SPAT-SYNTH performs a run of the trajectories in the scene, generating a N-channels audio file (N= number of speakers) from the specified sound sources. |  {{ :bresson:om7:o7-spat.png?300 |}} | 
- 
-=== — patch 5: reactive process ===  
- 
-|This patch is an introduction to reactive processes in o7. The basic part of it is just an interpolation process between two BPC objects.\\ \\ The <color darkred>red</color> patch cords and inputs/outputs are //reactive//: they can propagate notifications of changes in order to automatically update dependent parts of the functional graph. If you edit one of the curves, or the number of interpolation steps, the COLLECTION object at the bottom should automatically update. You can decide which parts of the patch are to be reactive by setting/unsetting the reactivity states of the boxes and connections. \\ \\ The number of interpolation steps can also be set using the SLIDER object, by command+click-drag, or just click-drag if the patch editor is //locked// (CMD+E).\\ \\ In a more advanced setting, we will activate the OSC-RECEIVE box (unset/reset reactive with R) in order to get this value from an external application (e.g. the Max patcher **dummy-controller.maxpat**).\\ \\ |  {{ :bresson:om7:o7-reactive.png?230 |}} | 
- 
-=== — patch 6: dynamic sequencer ===  
- 
-This patch is actually no a patch but a **maquette**: a hybrid object at the crossroad between a visual program and a sequencer that really exist only in OM/o7. 
- 
-The sequencer can be viewed as a set of superimposed musical tracks, or as a program. It also has an attached "control patch" that controls/sets its global contents. All these are viewed/hidden etc. using the buttons at the top of the sequencer view.  
- 
-This example is a pretty elaborate one. To start with, you can just play with dragging and moving objects around from the o7 patches, create embedded patches in the sequencer tracks etc. A page will be available soon on the online user manual. 
- 
-|In this example, the global execution (flash icon) will evaluate the output of the control patch on the left. This will add a first process in track #1. \\ \\  This process is reactive: it will be triggered when reached by the play cursor, and perform two actions: \\ 1) Generate qa random sequence of notes (as in Patch #1), \\ 2) Create a clone of itself and add it somewhere later into another track of the sequencer. \\ \\ The clone will then execute when reached by the cursor, and so on (indefinitely). \\ \\ In the control patch, a reactive OSC-RECEIVE can also be activated (much like in Patch #5) which will interactively change the number of notes to be generated in the next process call. \\ \\ |  {{ :bresson:om7:o7-seq.png?430 |}} | 
- 
-=== — patch 7: odot ===  
- 
-This last example illustrates the use of advanced OSC communication, through the use of //odot expressions//.  
- 
-|Curves (here, BPC objects) can be "executed" in different ways: their "action" attribute (by default, null) can be set for instance to "print", "send-as-osc", etc. It can also be programmed by the user (you!) to perform a specific task. \\ \\ Here we set the action to be a lambda function created from the sub-patch //send-point-bundle// which sends and OSC bundle containing the position of the current point, but also a number of //odot// expressions defining different ways of generating a cloud of points around this central point position. \\ \\ Note that //send-point-bundle// box is in mode LAMBDA (set/unset with L) in order to not execute, but return is corresponding lambda expression when evaluated. \\ \\ The Max patch receiving this data (**odot-spat-receive.maxpat**) also runs odot and is therefore able to evaluate these expressions in order to convert the received point-bundle to a point-cloud bundle. \\ \\ |  {{ :bresson:om7:o7-odot.png?430 |}} | 
- 
- 
  
 


bresson/m159.1519224705.txt.gz · Dernière modification: 2018/02/21 15:51 par Jean Bresson