~ubuntu-branches/ubuntu/oneiric/denemo/oneiric

« back to all changes in this revision

Viewing changes to actions/menus/ObjectMenu/Directives/MIDI/init.scm

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-10-27 08:00:18 UTC
  • mfrom: (1.2.7 upstream) (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101027080018-suwj9ozy99d0a5a2
Tags: 0.8.16-1ubuntu1
* Merge with Debian testing (LP: #638617), Ubuntu remaining changes:
  - debian/patches/ubuntuize.diff:
    + Provide a Ubuntu-specific customization.
  - debian/patches/fix_desktop.diff:
    + Add missing trailing semicolon.
    + Add MIME types.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;;;;;;;;;;;; Midi Commands By Nils Gey 01/2010
 
2
;MenuCommand or another script call the procedure by (ChangeXXX::Set optional values) and this calls the parent function. Three steps but this avoids redundancy and makes it most easy for the user who must not be let in direct contact with midi bytes
 
3
;Either the values are given directly or the script will pop up a dialog to ask for more information which will be the cause if the command is called as menuversion.
 
4
 
 
5
;Parent function. Builds the executed function
 
6
(define* (ChangeMidi::Parent DirectiveName DirectiveDisplayName Bytes UserValue #:optional (Flags #f)) 
 
7
 
 
8
 (define (realAction)
 
9
   (d-Directive-standalone DirectiveName)
 
10
  (if Flags
 
11
   (d-DirectivePut-standalone-override DirectiveName Flags))
 
12
   (d-DirectivePut-standalone-midibytes DirectiveName (string-append Bytes " " (number->string (- (abs UserValue) 1 ))))
 
13
   (d-DirectivePut-standalone-minpixels DirectiveName 20) 
 
14
   (d-DirectivePut-standalone-display DirectiveName (string-append DirectiveDisplayName (number->string (abs UserValue) )))
 
15
   (d-DirectivePut-standalone-ty DirectiveName -20)
 
16
   (d-RefreshDisplay)
 
17
  )
 
18
  
 
19
(if  (and (number? UserValue)(> (abs UserValue) 0) )
 
20
  (realAction)
 
21
  (display (string-append "Wrong value: "UserValue ". " DirectiveName " parameter must be a non-negative number. Start with 1, not with 0.\n")))
 
22
)
 
23
;;;;;;;;;;;;;;;;;;;;;;;;;;
 
24
 
 
25
 
 
26
;;Change the Channel of a staff
 
27
(define* (ChangeChannel::Set #:optional (UserValue (string->number (d-GetUserInput "Change Midi Channel" "Please enter a channel number. Normally 1-16" "1"))))
 
28
(define override (logior DENEMO_OVERRIDE_CHANNEL DENEMO_OVERRIDE_STEP) )
 
29
(ChangeMidi::Parent "ChannelChange" "chan" "" UserValue override)
 
30
)
 
31
 
 
32
;;Change the Program of the current channel/staff
 
33
(define* (ChangeProgram::Set #:optional (UserValue (string->number (d-GetUserInput "Change Midi Program Number" "Please enter a program number. Normally 1-128" "1"))))
 
34
(ChangeMidi::Parent "ProgramChange" "prog" "0xC$" UserValue)
 
35
)
 
36
 
 
37
;;Change the Volume of a channel/staff
 
38
(define* (ChangeVolume::Set #:optional (UserValue (string->number (d-GetUserInput "Change Midi Volume" "Please enter a volume value. Normally 1-128. 1 means off" "100"))))
 
39
(ChangeMidi::Parent "VolumeChange" "vol" "0xB$ 0x07" UserValue)
 
40
)
 
41
 
 
42
;;Generic 0xB Control Change - User can give the midi bytes, too. 
 
43
(define* (ChangeGeneric::Set #:optional (UserBytes (d-GetUserInput "Generic Control Change" "Please enter the controller number in hex (0x01 for modwheel) or decimal (1 for modwheel)" "0x01") ) (UserValue (string->number (d-GetUserInput "Enter Databyte Value" "Please enter the databyte pedal value. Normally 1-128." "65"))))
 
44
(ChangeMidi::Parent "GenericChange" UserBytes (string-append "0xB$ " UserBytes) UserValue)
 
45
)
 
46
 
 
47
;;Number 1 - Change the Modwheel value of a channel/staff
 
48
(define* (ChangeModwheel::Set #:optional (UserValue (string->number (d-GetUserInput "Change Modwheel Value" "Please enter a modwheel value. Normally 1-128. 1 means off" "100"))))
 
49
(ChangeMidi::Parent "ModwheelChange" "mod" "0xB$ 0x01" UserValue)
 
50
)
 
51
 
 
52
;;Number 2 - Breath Controller Todo: 14-bit coarse/fine resolution. 0x000 to 0x3FFF where 0/1 is minimum.
 
53
;(define* (ChangeVolume::Set #:optional (UserValue (string->number (d-GetUserInput "Breath Controller Value" "Please enter a breath pressure value. Normally 1-128. 1 means off" "100"))))
 
54
;(ChangeMidi::Parent "BreathControlChanger" "mod" "0xB$ 0x02" UserValue)
 
55
;)
 
56
 
 
57
;;Number 8 - Balance. Typically used for a stereo signal tweak without changing the pan itself. Like a CD player. 
 
58
(define* (ChangeBalance::Set #:optional (UserValue (string->number (d-GetUserInput "Change Balance Value" "Please enter a balance value. Normally 1-128. 65 is center,  1 is leftmost emphasis and 128 is rightmost emphasis" "65"))))
 
59
(ChangeMidi::Parent "BalanceChange" "bal" "0xB$ 0x08" UserValue)
 
60
)
 
61
 
 
62
;;Number 10 - Pan. Where in the stereo field the channel sound will be placed.
 
63
(define* (ChangePan::Set #:optional (UserValue (string->number (d-GetUserInput "Change Pan Value" "Please enter a pan value. Normally 1-128. 65 is center,  1 is hard left and 128 is hard right" "65"))))
 
64
(ChangeMidi::Parent "PanChange" "pan" "0xB$ 0xA" UserValue)
 
65
)
 
66
 
 
67
;;Number 11 - Expression. Aka "Sub Volume" or "Percent Volume". The "real" volume. Use Volume as initial value for each staff/channel and change further cresc/desc with expression. 
 
68
(define* (ChangeExpression::Set #:optional (UserValue (string->number (d-GetUserInput "Change Expression Value" "Please enter an expression value. Normally 1-128. 65 is 50%,  1 is 0% and 128 is 100% of Volume." "128"))))
 
69
(ChangeMidi::Parent "ExpressionChange" "expr" "0xB$ 0xB" UserValue)
 
70
)
 
71
 
 
72
;;Number 64 - Hold Pedal On/Off (Right Piano Pedal)
 
73
(define* (ChangeHoldPedal::Set #:optional (UserValue (string->number (d-GetUserInput "Hold Pedal Value" "Please enter a hold pedal value. Normally 1-128. 1 to 64 is off, 65 to 128 is on" "1"))))
 
74
(ChangeMidi::Parent "HoldPedalChange" "hold" "0xB$ 0x40" UserValue)
 
75
)
 
76
 
 
77
;;Number 65 - Portamento On/Off
 
78
(define* (ChangePortamento::Set #:optional (UserValue (string->number (d-GetUserInput "Portamento Value" "Please enter a portamento value. Normally 1-128. 1 to 64 is off, 65 to 128 is on" "1"))))
 
79
(ChangeMidi::Parent "PortamentoChange" "port" "0xB$ 0x41" UserValue)
 
80
)
 
81
;;Number 5 - Portamento Time. Slides between 2 notes. Todo: 14-bit coarse/fine resolution. 0x000 to 0x3FFF where 0/1 the slowest rate. 
 
82
 
 
83
;;Number 66 - Sustenuto Pedal On/Off (Middle Grand Piano Pedal). All Notes active (without an note off yet) are taken.
 
84
(define* (ChangeHoldPedal::Set #:optional (UserValue (string->number (d-GetUserInput "Sustenuto Pedal Value" "Please enter a sustenuto pedal value. Normally 1-128. 1 to 64 is off, 65 to 128 is on" "1"))))
 
85
(ChangeMidi::Parent "SustenutoPedalChange" "hold" "0xB$ 0x42" UserValue)
 
86
)
 
87
 
 
88
;;Number 67 - Soft Pedal On/Off (Left Piano Pedal). Lowers the volume of any notes played.
 
89
(define* (ChangeSoftPedal::Set #:optional (UserValue (string->number (d-GetUserInput "Soft Pedal Value" "Please enter a soft pedal value. Normally 1-128. 1 to 64 is off, 65 to 128 is on" "1"))))
 
90
(ChangeMidi::Parent "SoftPedalChange" "hold" "0xB$ 0x43" UserValue)
 
91
)
 
92
 
 
93
;;Number 68 - Legato Pedal On/Off. Skips the attack portion of the VCA's envelope. For phrasing like wind or brass or guitar hammer-on.
 
94
(define* (ChangeLegatoPedal::Set #:optional (UserValue (string->number (d-GetUserInput "Legato Pedal Value" "Please enter a legato pedal value. Normally 1-128. 1 to 64 is off, 65 to 128 is on" "1"))))
 
95
(ChangeMidi::Parent "LegatoPedalChange" "hold" "0xB$ 0x44" UserValue)
 
96
)
 
97
 
 
98
;;Number 69 - Hold Pedal 2 On/Off. Longer release time but notes will fade out eventually.
 
99
(define* (ChangeHold2Pedal::Set #:optional (UserValue (string->number (d-GetUserInput "Hold2/Release Pedal Value" "Please enter a hold2/release pedal value. Normally 1-128. 1 to 64 is off, 65 to 128 is on" "1"))))
 
100
(ChangeMidi::Parent "Hold2PedalChange" "hold" "0xB$ 0x45" UserValue)
 
101
)