Recherche Google
ModalysObjects > Object Reference > String (or Rod) - Mono-directional
page précédentepage suivante

String (or Rod) - Mono-directional

Description

Any string or rod, fixed at its endpoints, that vibrates in one transverse (side-to-side) direction.

(make-object 'mono-string ... )

Lisp Syntax and Default Values

A 'mono-string can be created using the following Lisp syntax (the default values are shown for each of the physical parameters):

(make-object 'mono-string

         (modes 40)

         (length 1)

         (tension 100)

         (density 1000)

         (radius .001)

         (young 1e9)

         (freq-loss 1)

         (const-loss 1))

Parameters

The arguments for the physical parameters can be either numerical values or Modalys controllers (either dynamic or constant). If a given parameter is not supplied when using the Lisp syntax, the default parameter value will be used.

  • modes: number of modes.
  • length: in meters.
  • tension: in Newtons.
  • density: in kg/m^3. See chart of material properties for appropriate values.
  • radius: in meters.
  • young: Young's modulus, in N/m^2. See chart of material properties for appropriate values.
  • freq-loss, const-loss: loss coefficients. See General object information.
Accesses

A mono-string can be accessed in one dimension - the trans0 dimension:

(make-access my-string my-controller 'trans0)

This makes a side-to-side access at a point along the length of my-string, specified by my-controller. The value of my-controller must be between zero and one. (As the string is "fixed" at its endpoints, the actual values 0 and 1 cannot be used.) For reasons of simplicity, we can consider trans0 to be the horizontal direction, but this side-to-side vibrational direction of the mono-string could be connected to a different direction on another object (such as the up-and-down direction of a bi-string), so the trans0 label is a handy way of referring to this without specifying an actual real-world spatial direction of movement.

Mono-directional strings are, naturally, intended to be used for interactions that have only one direction of vibration, such as 'pluck, 'strike, 'felt, etc.... Although you generally want to use a bi-string for a 'bow interaction, you could alternately use two mono-strings, one to represent the "horizontal" direction and the other to represent the "vertical" direction.

Options

Controllers

The physical parameters can optionally be controllers instead of numerical values. Therefore, it is possible to modify the physical characteristics of an object, including its pitch, during synthesis. The following example creates a string which varies in length from 1 meter to 50 cm in 2 seconds:

(setq my-ctrl (make-controller 'envelope 1 '((0 1.0) (2 0.5)) ))

(make-object 'mono-string (length my-ctrl))

Tuning

A mono-string can be tuned to a specific pitch, using the (set-pitch ...) function, by adjusting one of the following physical parameters:

  • 'length
  • 'tension
  • 'density
  • 'young

For example:

(setq my-string (make-object 'mono-string))

(set-pitch my-string 'length 330)

You could also use a controller to re-adjust the pitch dynamically, however this is extremely costly in terms of CPU usage, since the entire modal object must be re-computed for every sample. The following example makes a glissando from 220Hz to 440Hz over 2 seconds:

(setq my-string (make-object 'mono-string))

(set-pitch my-string 'length (make-controller 'envelope 1 '((0 220.) (2 440.)) ))

Because of the intense amount of calculation required to compute an object based on a given pitch, hybrid objects can be used as a far more efficient way of making a continuous pitch change (glissando).

When using Modalys in real-time contexts, you can use messages to change the pitch of an object, instead of input signal controllers.

Example

The following example shows a basic use of a mono-string with a pluck interaction.

;;;-*-Mode: Lisp; Package: MODALYS -*-

;;; Modalys, simple plucked string example

;;;----------------------------------------------------------------------

;;;

;;; clear the instrument-building workspace :

(new)

;;;

;;; make objects :

(setq my-string (make-object 'mono-string))

(setq my-plectrum (make-object 'mono-two-mass))

;;;

;;; make pluck connection :

(setq my-string-plk (make-access my-string (const .6) 'trans0))

(setq my-plectrum-plk (make-access my-plectrum (const 1) 'trans0))

(make-connection 'pluck my-string-plk 0 my-plectrum-plk .1 (const 50))

;;;

;;; make position connection to push plectrum :

(setq my-plectrum-mov (make-access my-plectrum (const 0) 'trans0))

(make-connection 'position my-plectrum-mov (make-controller 'envelope 1 '((0 0.1) (1 -1))))

;;;

;;; make listening point (i.e. another access) on the string :

(setq my-string-out (make-access my-string (const .3) 'trans0))

(make-point-output my-string-out)

;;;

;;; run the synthesis and play the sound :

(run 2)

(play)

page précédentepage suivante
A propos...©IRCAM 2014Réalisé avec Scenari