From: Mario Lang <mlang@home.delysid.org>
To: zsh-users@sunsite.dk
Subject: Backticks and other tricks
Date: 28 Mar 2001 09:22:03 +0200 [thread overview]
Message-ID: <87elviuzms.fsf@home.delysid.org> (raw)
Hi.
Can anyone cast some light on the following questions
regarding the code below:
1. Why does ${(P)...[...]} not work with subscripts of the
array? (in fucntion argsargs).
2. Why does the inclusion trick with backticks not
work (`argsargs filters`). Actually _arguments complains
about not being able to parse this option.
#compdef ecasound
typeset -A filters
filters=(\
ef1 "Resonant bandpass filter":"center frequency":Hz:"width":Hz
ef3 "Resonant lowpass filter":"cutoff frequency":Hz:resonance::gain:
ef4 "Resonant lowpass filter (3rd-order, 36dB)":"cutoff frequency":Hz:resonance:
efa "Allpass filter":"delay":samples:"feedback":percents
efb "Bandpass filter":"center frequency":Hz:"width":Hz
efc "Comb filter":"delay":samples:"radius":0-1
efh "Highpass filter":"cutoff frequency":Hz
efi "Inverse comb filter":"delay":samples:"radius":0-1
efl "Lowpass filter":"cutoff frequency":Hz
efr "Bandreject filter":"center frequency":Hz:"width":Hz
efs "Resonator (resonating bandpass filter)":"center frequency":Hz:"width":Hz\
)
argsargs () {
for i in ${(koP)1}; do
print -- "'*-${i}[${(P)1[$i]%%:*}]: :->${i}' \\"
done
}
_arguments \
'-c[Start in interactive mode]' \
'-d\:-[Debug level]:debug level' \
'-D[Print all debug information to stderr]' \
'-q[Quiet mode, no output]' \
'--help[Show help]' \
'--version[Show version information]' \
'-n\:-[Set the name of chainsetup]:chainsetup name' \
'-s\:-[Create a new chainsetup from file]:chainsetup file:_files' \
'-sr\:-[Set internal sampling rate]:Internal sampling rate:(8000 11025 22050 44100 48000)' \
'*-a\:-[Select active signal chains]:chain name' \
'-b\:-[Sets the size of buffer in samples]:buffer size:(1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536)' \
'-m\:-[Force use of specified mix mode]:Mix mode:((auto\:Automatic simple\:Only\ one\ input/cain/output normal\:Normal\ single-threaded\ mode))' \
'-r[Use realtime scheduling policy (SCHED_FIFO)]' \
'-r\:-[Use realtime scheduling policy (SCHED_FIFO)]:sched_priority' \
'-x[Truncate outputs]' \
'*-z\:-[Enable feature]:feature:->z' \
'-t\:-[Set processing time in seconds]:seconds (int/float)' \
'-tl[Enable looping]' \
'*-f\:-[Set sampling parameters for the following input/output files]: :->f' \
'*-y\:-[Set starting position for last specified input/output]:seconds' \
'*-i\:-[Specifies a new input source]:input source:->io' \
'*-o\:-[Specifies a new output source]:output source:->io' \
'*-Md\:-[Set the active MIDI-device]:device name:_files' \
'*-Mms\:-[Send MMC start/stop to MIDI device-id]:device id' \
'*-mss[Sends MIDI-sync to the selected MIDI-device]' \
'*-pf\:-[Use the first preset found from file as chain operator]:preset file:_files -g *.epp' \
'*-pn\:-[Find preset from global preset database]:preset name:->pn' \
'*-ev[Analyze sample data to find max apm value without clipping]' \
'*-ezf[Find the optimal value for DC-adjusting]' \
'*-eS\:-[Audio stamp]:stamp-id (int)' \
'*-ea\:-[Amplify signal]:amplification value (percent)' \
'*-eac\:-[Amplify signal of channel]: :->eac' \
'*-eaw\:-[Amplify singal (clipping)]: :->eaw' \
'*-eal\:-[Limits audio level]:limit (percent)' \
'*-ec\:-[Compressor (a simple one)]: :->ec' \
'*-eca\:-[A more advanced compressor]: :->eca' \
'*-enm\:-[Noise gate. (each channel is processes separately)]: :-enm' \
'*-ei\:-[Pitch shifter (modifies audio pitch by altering its length)]:pitch-shift (percent)' \
'*-epp\:-[Normal pan effect]:panning (0=left, 50=center, 100=right)' \
'*-ezx\:-[Adjusts the signal DC (use -ezf to find optimal values)]: :-ezx' \
'*-eemb\:-[Pulse gate]: :-eemb' \
'*-eemp\:-[Pulse gate (hz)]: :->eemp' \
'*-eemt\:-[Tremolo effect]: :->eemt' \
`argsargs filters` \
'*-erc\:-[Copy channel]: :->erc' \
'*-erm\:-[Mix all channels to one channel]:to channel' \
'*-etc\:-[Chorus]: :->etc' \
'*-etd\:-[Delay effect]: :->etd' \
'*-ete\:-[A more advanced reverb effect]: :-ete' \
'*-etf\:-[Fake-stereo effect]:delay time (msec)' \
'*-etl\:-[Flanger]: :->etl' \
'*-etm\:-[Multitap delay]: :->etm' \
'*-etp\:-[Phaser]: :->etp' \
'*-etr\:-[Reverb effect]: :->etr' \
'*-el\:-[LADSPA Plugin]: :->el' \
'*-eli\:-[LADSPA Plugin]: :->el' \
'*-gc\:-[Time crop gate]: :->gc' \
'*-ge\:-[Threshold gate]: :->ge' \
&& return 0
...
--
CYa,
Mario <mlang@delysid.org>
Homepage(s): http://delysid.org | http://piss.at/
"Who is General Failure and why is he reading my hard disk ?"
Microsoft spel chekar vor sail, worgs grate !!
(By leitner@inf.fu-berlin.de, Felix von Leitner)
next reply other threads:[~2001-03-28 8:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-28 7:22 Mario Lang [this message]
2001-03-28 9:00 Sven Wischnowsky
2001-03-28 15:41 ` Bart Schaefer
2001-03-28 18:06 ` Thomas Köhler
2001-03-28 23:56 ` Andre Pang
2001-03-29 3:57 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87elviuzms.fsf@home.delysid.org \
--to=mlang@home.delysid.org \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).