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)
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)
(setq my-string (make-object 'mono-string))
(set-pitch my-string 'length (make-controller 'envelope 1 '((0 220.) (2 440.)) ))
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)