aboutsummaryrefslogtreecommitdiff
path: root/externals/grill
diff options
context:
space:
mode:
Diffstat (limited to 'externals/grill')
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.abs.help56
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.add.help68
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.amaxq.help104
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.aminq.help92
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.beveldn.help92
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.bevelup.help92
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cdiv.help12
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cfft.help414
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.chk.help20
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cifft.help407
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cmul.help12
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cnoise.help116
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cnorm.help177
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cosc.help139
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cplus.help12
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cpowi.help166
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.crsub.help12
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.cset.help11
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.csqr.help164
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.csub.help12
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.dif.help7
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.div.help52
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.equ.help145
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.exp.help96
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.fhp.help138
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.flp.help138
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.frames.help134
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.framesd.help134
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.framesq.help25
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.gate.help166
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.gather.help65
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.geq.help128
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.gtr.help128
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.help710
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.int.help93
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.join.help31
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.leq.help128
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.list.help85
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.log.help8
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.lwr.help128
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.max.help125
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.maxq.help86
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.mbeveldn.help100
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.mbevelup.help100
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.mcosc.help144
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.min.help125
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.minmax.help149
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.minq.help86
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.mirr.help88
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.mod.help62
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.mphasor.help127
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.mul.help227
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.multi.help23
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.neq.help145
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.noise.help100
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.nonzero.help162
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.offset.help32
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.offsetd.help31
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.offsetq.help17
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.opt.help104
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.osc.help123
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.part.help30
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.peaks.help176
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.phasor.help123
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.polar.help291
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.pow.help98
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.pwrap.help6
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.radd.help168
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rect.help301
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rfft.help137
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rgate.help170
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rifft.help137
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rmax.help165
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rmaxq.help179
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rmin.help167
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rminq.help149
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.ropt.help168
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rot.help91
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rpeaks.help174
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rpow.help171
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rsub.help52
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.rvalleys.help177
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.set.help326
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.shift.help92
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.sign.help94
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.spit.help42
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.split.help31
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.sqr.help91
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.sqrt.help91
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.ssqr.help219
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.ssqrt.help219
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.sub.help67
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.sync.help164
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.tilt.help89
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.update.help41
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.valleys.help174
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.vector.help175
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.vectors.help12
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.xmirr.help169
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.xrot.help91
-rwxr-xr-xexternals/grill/vasp/max-help/vasp.xshift.help91
-rwxr-xr-xexternals/grill/vasp/max/vasp.conv30
-rwxr-xr-xexternals/grill/vasp/max/vasp.freeze24
-rwxr-xr-xexternals/grill/vasp/max/vasp.hilbert25
-rwxr-xr-xexternals/grill/vasp/max/vasp.im8
-rwxr-xr-xexternals/grill/vasp/max/vasp.lower18
-rwxr-xr-xexternals/grill/vasp/max/vasp.opt31
-rwxr-xr-xexternals/grill/vasp/max/vasp.pwrap12
-rwxr-xr-xexternals/grill/vasp/max/vasp.re8
-rwxr-xr-xexternals/grill/vasp/max/vasp.ropt31
-rwxr-xr-xexternals/grill/vasp/max/vasp.spin24
-rwxr-xr-xexternals/grill/vasp/max/vasp.upper21
-rwxr-xr-xexternals/grill/vasp/pd-ex/granular1.pd329
-rw-r--r--externals/grill/vasp/pd-help/vasp_abs.pd48
-rw-r--r--externals/grill/vasp/pd-help/vasp_add.pd54
-rw-r--r--externals/grill/vasp/pd-help/vasp_ageq.pd50
-rw-r--r--externals/grill/vasp/pd-help/vasp_agtr.pd52
-rw-r--r--externals/grill/vasp/pd-help/vasp_aleq.pd52
-rw-r--r--externals/grill/vasp/pd-help/vasp_alwr.pd52
-rw-r--r--externals/grill/vasp/pd-help/vasp_cadd.pd21
-rw-r--r--externals/grill/vasp/pd-help/vasp_cconj.pd33
-rw-r--r--externals/grill/vasp/pd-help/vasp_ccopy.pd83
-rw-r--r--externals/grill/vasp/pd-help/vasp_cdiv.pd16
-rw-r--r--externals/grill/vasp/pd-help/vasp_cdivr.pd18
-rw-r--r--externals/grill/vasp/pd-help/vasp_cfft.pd98
-rw-r--r--externals/grill/vasp/pd-help/vasp_channel.pd10
-rw-r--r--externals/grill/vasp/pd-help/vasp_check.pd26
-rw-r--r--externals/grill/vasp/pd-help/vasp_cifft.pd89
-rw-r--r--externals/grill/vasp/pd-help/vasp_cmul.pd21
-rw-r--r--externals/grill/vasp/pd-help/vasp_cnoise.pd53
-rw-r--r--externals/grill/vasp/pd-help/vasp_cnorm.pd94
-rw-r--r--externals/grill/vasp/pd-help/vasp_copy.pd70
-rw-r--r--externals/grill/vasp/pd-help/vasp_cosc.pd63
-rw-r--r--externals/grill/vasp/pd-help/vasp_cpowi.pd84
-rw-r--r--externals/grill/vasp/pd-help/vasp_crsub.pd22
-rw-r--r--externals/grill/vasp/pd-help/vasp_cset.pd20
-rw-r--r--externals/grill/vasp/pd-help/vasp_csqr.pd79
-rw-r--r--externals/grill/vasp/pd-help/vasp_csub.pd21
-rw-r--r--externals/grill/vasp/pd-help/vasp_csubr.pd21
-rw-r--r--externals/grill/vasp/pd-help/vasp_dframes.pd65
-rw-r--r--externals/grill/vasp/pd-help/vasp_dif.pd49
-rw-r--r--externals/grill/vasp/pd-help/vasp_div.pd42
-rw-r--r--externals/grill/vasp/pd-help/vasp_divr.pd37
-rw-r--r--externals/grill/vasp/pd-help/vasp_doffset.pd28
-rw-r--r--externals/grill/vasp/pd-help/vasp_dsize.pd39
-rw-r--r--externals/grill/vasp/pd-help/vasp_equ.pd53
-rw-r--r--externals/grill/vasp/pd-help/vasp_exp.pd42
-rw-r--r--externals/grill/vasp/pd-help/vasp_fhp.pd89
-rw-r--r--externals/grill/vasp/pd-help/vasp_fix.pd64
-rw-r--r--externals/grill/vasp/pd-help/vasp_flp.pd86
-rw-r--r--externals/grill/vasp/pd-help/vasp_frames.pd60
-rw-r--r--externals/grill/vasp/pd-help/vasp_gate.pd74
-rw-r--r--externals/grill/vasp/pd-help/vasp_gather.pd64
-rw-r--r--externals/grill/vasp/pd-help/vasp_geq.pd50
-rw-r--r--externals/grill/vasp/pd-help/vasp_gtr.pd52
-rw-r--r--externals/grill/vasp/pd-help/vasp_imm.pd77
-rw-r--r--externals/grill/vasp/pd-help/vasp_int.pd40
-rw-r--r--externals/grill/vasp/pd-help/vasp_iwindow.pd61
-rw-r--r--externals/grill/vasp/pd-help/vasp_join.pd26
-rw-r--r--externals/grill/vasp/pd-help/vasp_leq.pd52
-rw-r--r--externals/grill/vasp/pd-help/vasp_list.pd28
-rw-r--r--externals/grill/vasp/pd-help/vasp_log.pd50
-rw-r--r--externals/grill/vasp/pd-help/vasp_lwr.pd52
-rw-r--r--externals/grill/vasp/pd-help/vasp_max.pd51
-rw-r--r--externals/grill/vasp/pd-help/vasp_mcosc.pd68
-rw-r--r--externals/grill/vasp/pd-help/vasp_mframes.pd63
-rw-r--r--externals/grill/vasp/pd-help/vasp_min.pd51
-rw-r--r--externals/grill/vasp/pd-help/vasp_minmax.pd59
-rw-r--r--externals/grill/vasp/pd-help/vasp_mirr.pd45
-rw-r--r--externals/grill/vasp/pd-help/vasp_miwindow.pd64
-rw-r--r--externals/grill/vasp/pd-help/vasp_mod.pd48
-rw-r--r--externals/grill/vasp/pd-help/vasp_mosc.pd80
-rw-r--r--externals/grill/vasp/pd-help/vasp_mphasor.pd78
-rw-r--r--externals/grill/vasp/pd-help/vasp_msize.pd38
-rw-r--r--externals/grill/vasp/pd-help/vasp_mul.pd135
-rw-r--r--externals/grill/vasp/pd-help/vasp_multi.pd20
-rw-r--r--externals/grill/vasp/pd-help/vasp_mwindow.pd64
-rw-r--r--externals/grill/vasp/pd-help/vasp_mxwindow.pd64
-rw-r--r--externals/grill/vasp/pd-help/vasp_neq.pd52
-rw-r--r--externals/grill/vasp/pd-help/vasp_noise.pd43
-rw-r--r--externals/grill/vasp/pd-help/vasp_nonzero.pd160
-rw-r--r--externals/grill/vasp/pd-help/vasp_offset.pd30
-rw-r--r--externals/grill/vasp/pd-help/vasp_offsetd.pd28
-rw-r--r--externals/grill/vasp/pd-help/vasp_offsetq.pd25
-rw-r--r--externals/grill/vasp/pd-help/vasp_opt.pd71
-rw-r--r--externals/grill/vasp/pd-help/vasp_osc.pd63
-rw-r--r--externals/grill/vasp/pd-help/vasp_part.pd34
-rw-r--r--externals/grill/vasp/pd-help/vasp_peaks.pd89
-rw-r--r--externals/grill/vasp/pd-help/vasp_phasor.pd67
-rw-r--r--externals/grill/vasp/pd-help/vasp_polar.pd90
-rw-r--r--externals/grill/vasp/pd-help/vasp_pow.pd44
-rw-r--r--externals/grill/vasp/pd-help/vasp_qamax.pd75
-rw-r--r--externals/grill/vasp/pd-help/vasp_qamin.pd53
-rw-r--r--externals/grill/vasp/pd-help/vasp_qchannel.pd10
-rw-r--r--externals/grill/vasp/pd-help/vasp_qframes.pd27
-rw-r--r--externals/grill/vasp/pd-help/vasp_qmax.pd44
-rw-r--r--externals/grill/vasp/pd-help/vasp_qmin.pd44
-rw-r--r--externals/grill/vasp/pd-help/vasp_qoffset.pd19
-rw-r--r--externals/grill/vasp/pd-help/vasp_qrmax.pd99
-rw-r--r--externals/grill/vasp/pd-help/vasp_qrmin.pd59
-rw-r--r--externals/grill/vasp/pd-help/vasp_qsize.pd31
-rw-r--r--externals/grill/vasp/pd-help/vasp_qvector.pd13
-rw-r--r--externals/grill/vasp/pd-help/vasp_qvectors.pd17
-rw-r--r--externals/grill/vasp/pd-help/vasp_radd.pd84
-rw-r--r--externals/grill/vasp/pd-help/vasp_radio.pd28
-rw-r--r--externals/grill/vasp/pd-help/vasp_rect.pd87
-rw-r--r--externals/grill/vasp/pd-help/vasp_rfft.pd74
-rw-r--r--externals/grill/vasp/pd-help/vasp_rframes.pd63
-rw-r--r--externals/grill/vasp/pd-help/vasp_rgate.pd86
-rw-r--r--externals/grill/vasp/pd-help/vasp_rifft.pd75
-rw-r--r--externals/grill/vasp/pd-help/vasp_rmax.pd81
-rw-r--r--externals/grill/vasp/pd-help/vasp_rmin.pd84
-rw-r--r--externals/grill/vasp/pd-help/vasp_ropt.pd86
-rw-r--r--externals/grill/vasp/pd-help/vasp_rot.pd48
-rw-r--r--externals/grill/vasp/pd-help/vasp_rpeaks.pd94
-rw-r--r--externals/grill/vasp/pd-help/vasp_rpow.pd83
-rw-r--r--externals/grill/vasp/pd-help/vasp_rsize.pd37
-rw-r--r--externals/grill/vasp/pd-help/vasp_rvalleys.pd91
-rw-r--r--externals/grill/vasp/pd-help/vasp_set.pd90
-rw-r--r--externals/grill/vasp/pd-help/vasp_sframes.pd136
-rw-r--r--externals/grill/vasp/pd-help/vasp_shift.pd57
-rw-r--r--externals/grill/vasp/pd-help/vasp_sign.pd42
-rw-r--r--externals/grill/vasp/pd-help/vasp_size.pd43
-rw-r--r--externals/grill/vasp/pd-help/vasp_soffset.pd153
-rw-r--r--externals/grill/vasp/pd-help/vasp_spit.pd46
-rw-r--r--externals/grill/vasp/pd-help/vasp_split.pd27
-rw-r--r--externals/grill/vasp/pd-help/vasp_sqr.pd38
-rw-r--r--externals/grill/vasp/pd-help/vasp_sqrt.pd38
-rw-r--r--externals/grill/vasp/pd-help/vasp_ssqr.pd96
-rw-r--r--externals/grill/vasp/pd-help/vasp_ssqrt.pd96
-rw-r--r--externals/grill/vasp/pd-help/vasp_sub.pd54
-rw-r--r--externals/grill/vasp/pd-help/vasp_subr.pd48
-rw-r--r--externals/grill/vasp/pd-help/vasp_sync.pd81
-rw-r--r--externals/grill/vasp/pd-help/vasp_tilt.pd100
-rw-r--r--externals/grill/vasp/pd-help/vasp_update.pd36
-rw-r--r--externals/grill/vasp/pd-help/vasp_v.pd50
-rw-r--r--externals/grill/vasp/pd-help/vasp_valleys.pd86
-rw-r--r--externals/grill/vasp/pd-help/vasp_vector.pd31
-rw-r--r--externals/grill/vasp/pd-help/vasp_vectors.pd13
-rw-r--r--externals/grill/vasp/pd-help/vasp_window.pd62
-rw-r--r--externals/grill/vasp/pd-help/vasp_xmirr.pd86
-rw-r--r--externals/grill/vasp/pd-help/vasp_xrot.pd48
-rw-r--r--externals/grill/vasp/pd-help/vasp_xshift.pd57
-rw-r--r--externals/grill/vasp/pd-help/vasp_xtilt.pd107
-rw-r--r--externals/grill/vasp/pd-help/vasp_xwindow.pd61
-rw-r--r--externals/grill/vasp/pd/VASP-HELP.pd1155
-rw-r--r--externals/grill/vasp/pd/bass.aifbin0 -> 337210 bytes
-rw-r--r--externals/grill/vasp/pd/beat.aifbin0 -> 176468 bytes
-rw-r--r--externals/grill/vasp/pd/change2.pd25
-rw-r--r--externals/grill/vasp/pd/filelist.pd24
-rw-r--r--externals/grill/vasp/pd/filelisthandler.pd102
-rw-r--r--externals/grill/vasp/pd/filter_example.pd190
-rw-r--r--externals/grill/vasp/pd/filter_examplei.pd191
-rw-r--r--externals/grill/vasp/pd/fly.aifbin0 -> 353412 bytes
-rw-r--r--externals/grill/vasp/pd/phase-random_example.pd86
-rw-r--r--externals/grill/vasp/pd/plastic.aifbin0 -> 352518 bytes
-rw-r--r--externals/grill/vasp/pd/ringmod_example.pd63
-rw-r--r--externals/grill/vasp/pd/runden.pd27
-rw-r--r--externals/grill/vasp/pd/synchrodisplay.pd13
-rw-r--r--externals/grill/vasp/pd/vasp.clr0.pd12
-rw-r--r--externals/grill/vasp/pd/vasp.conv.pd28
-rw-r--r--externals/grill/vasp/pd/vasp.even.pd12
-rw-r--r--externals/grill/vasp/pd/vasp.freeze.pd22
-rw-r--r--externals/grill/vasp/pd/vasp.hilbert.pd28
-rw-r--r--externals/grill/vasp/pd/vasp.im.pd6
-rw-r--r--externals/grill/vasp/pd/vasp.lower.pd19
-rw-r--r--externals/grill/vasp/pd/vasp.odd.pd10
-rw-r--r--externals/grill/vasp/pd/vasp.opt.pd35
-rw-r--r--externals/grill/vasp/pd/vasp.ov.pd10
-rw-r--r--externals/grill/vasp/pd/vasp.pwrap.pd10
-rw-r--r--externals/grill/vasp/pd/vasp.re.pd6
-rw-r--r--externals/grill/vasp/pd/vasp.ropt.pd30
-rw-r--r--externals/grill/vasp/pd/vasp.spin.pd22
-rw-r--r--externals/grill/vasp/pd/vasp.upper.pd22
-rw-r--r--externals/grill/vasp/pd/vaspset_examples.pd109
-rw-r--r--externals/grill/vasp/pd/wavedisplay-select.pd617
-rw-r--r--externals/grill/vasp/pd/wavedisplay-simple.pd135
-rw-r--r--externals/grill/vasp/pd/xtilt_example.pd88
-rw-r--r--externals/grill/vasp/source/arg.cpp216
-rw-r--r--externals/grill/vasp/source/arg.h108
-rw-r--r--externals/grill/vasp/source/buflib.cpp258
-rw-r--r--externals/grill/vasp/source/buflib.h37
-rw-r--r--externals/grill/vasp/source/classes.cpp405
-rw-r--r--externals/grill/vasp/source/classes.h278
-rw-r--r--externals/grill/vasp/source/env.cpp144
-rw-r--r--externals/grill/vasp/source/env.h73
-rw-r--r--externals/grill/vasp/source/main.cpp209
-rw-r--r--externals/grill/vasp/source/main.h83
-rw-r--r--externals/grill/vasp/source/mixfft.cpp588
-rwxr-xr-xexternals/grill/vasp/source/obj_chns.cpp107
-rw-r--r--externals/grill/vasp/source/obj_frames.cpp228
-rw-r--r--externals/grill/vasp/source/obj_imm.cpp104
-rw-r--r--externals/grill/vasp/source/obj_offs.cpp174
-rw-r--r--externals/grill/vasp/source/obj_part.cpp102
-rw-r--r--externals/grill/vasp/source/obj_peaks.cpp111
-rw-r--r--externals/grill/vasp/source/obj_q.cpp121
-rw-r--r--externals/grill/vasp/source/obj_radio.cpp57
-rw-r--r--externals/grill/vasp/source/obj_size.cpp248
-rw-r--r--externals/grill/vasp/source/obj_split.cpp288
-rw-r--r--externals/grill/vasp/source/obj_sync.cpp123
-rw-r--r--externals/grill/vasp/source/obj_vasp.cpp200
-rw-r--r--externals/grill/vasp/source/obj_vecs.cpp106
-rw-r--r--externals/grill/vasp/source/opbase.cpp94
-rw-r--r--externals/grill/vasp/source/opbase.h50
-rw-r--r--externals/grill/vasp/source/opdefs.h364
-rwxr-xr-xexternals/grill/vasp/source/oploop.h38
-rw-r--r--externals/grill/vasp/source/opparam.cpp223
-rw-r--r--externals/grill/vasp/source/opparam.h128
-rw-r--r--externals/grill/vasp/source/oppermute.h121
-rw-r--r--externals/grill/vasp/source/ops.h27
-rw-r--r--externals/grill/vasp/source/ops_arith.cpp64
-rw-r--r--externals/grill/vasp/source/ops_arith.h72
-rw-r--r--externals/grill/vasp/source/ops_assign.cpp108
-rw-r--r--externals/grill/vasp/source/ops_assign.h34
-rw-r--r--externals/grill/vasp/source/ops_carith.cpp125
-rw-r--r--externals/grill/vasp/source/ops_carith.h48
-rw-r--r--externals/grill/vasp/source/ops_cmp.cpp99
-rw-r--r--externals/grill/vasp/source/ops_cmp.h86
-rw-r--r--externals/grill/vasp/source/ops_cplx.cpp85
-rw-r--r--externals/grill/vasp/source/ops_cplx.h42
-rw-r--r--externals/grill/vasp/source/ops_dft.cpp651
-rw-r--r--externals/grill/vasp/source/ops_dft.h25
-rw-r--r--externals/grill/vasp/source/ops_feature.cpp199
-rw-r--r--externals/grill/vasp/source/ops_feature.h29
-rw-r--r--externals/grill/vasp/source/ops_flt.cpp234
-rw-r--r--externals/grill/vasp/source/ops_flt.h41
-rw-r--r--externals/grill/vasp/source/ops_gate.cpp88
-rw-r--r--externals/grill/vasp/source/ops_gen.cpp265
-rw-r--r--externals/grill/vasp/source/ops_gen.h40
-rw-r--r--externals/grill/vasp/source/ops_qminmax.cpp276
-rw-r--r--externals/grill/vasp/source/ops_rearr.cpp243
-rw-r--r--externals/grill/vasp/source/ops_rearr.h34
-rw-r--r--externals/grill/vasp/source/ops_resmp.cpp266
-rw-r--r--externals/grill/vasp/source/ops_resmp.h28
-rw-r--r--externals/grill/vasp/source/ops_search.cpp187
-rw-r--r--externals/grill/vasp/source/ops_search.h29
-rw-r--r--externals/grill/vasp/source/ops_trnsc.cpp83
-rw-r--r--externals/grill/vasp/source/ops_trnsc.h47
-rw-r--r--externals/grill/vasp/source/ops_wnd.cpp191
-rw-r--r--externals/grill/vasp/source/ops_wnd.h39
-rw-r--r--externals/grill/vasp/source/opvecs.cpp630
-rw-r--r--externals/grill/vasp/source/rdx2fft.cpp82
-rw-r--r--externals/grill/vasp/source/rvfft.cpp357
-rw-r--r--externals/grill/vasp/source/util.cpp12
-rw-r--r--externals/grill/vasp/source/util.h33
-rw-r--r--externals/grill/vasp/source/vasp.cpp353
-rw-r--r--externals/grill/vasp/source/vasp.h142
-rw-r--r--externals/grill/vasp/source/vbuffer.cpp40
-rw-r--r--externals/grill/vasp/source/vbuffer.h127
-rw-r--r--externals/grill/vasp/source/vecblk.cpp49
-rw-r--r--externals/grill/vasp/source/vecblk.h105
-rw-r--r--externals/grill/vasp/todo/allgemein.txt42
-rw-r--r--externals/grill/vasp/todo/marius.txt20
-rw-r--r--externals/grill/vasp/todo/neue-objekte.txt10
-rw-r--r--externals/grill/vasp/todo/patcher-boys.txt3
-rw-r--r--externals/grill/vasp/todo/thomas.txt5
-rw-r--r--externals/grill/vasp/todo/vasp-objects.csv161
357 files changed, 34909 insertions, 0 deletions
diff --git a/externals/grill/vasp/max-help/vasp.abs.help b/externals/grill/vasp/max-help/vasp.abs.help
new file mode 100755
index 00000000..1292ea00
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.abs.help
@@ -0,0 +1,56 @@
+max v2;
+#N vpatcher 158 140 813 450;
+#P origin 0 10;
+#P message 435 237 61 196617 vasp bufabs;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 435 255 78 196617 p clear_buffers;
+#P comment 146 190 107 196617 get the absolute values;
+#P button 128 188 15 0;
+#P newex 64 188 60 196617 prepend set;
+#P newex 64 252 61 196617 vasp.update;
+#P comment 133 136 99 196617 generate a sinewave;
+#P message 64 135 61 196617 vasp bufabs;
+#P newex 64 156 80 196617 vasp.osc 22050;
+#P comment 59 63 137 196617 get absolute values of a vasp;
+#P comment 59 40 89 196622 vasp.abs;
+#P hidden message 310 114 54 196617 set bufabs;
+#P hidden newex 310 94 45 196617 loadbang;
+#P user waveform~ 310 133 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 521 255 101 196617 buffer~ bufabs 2000;
+#P newex 64 213 45 196617 vasp.abs;
+#P comment 59 79 402 196617 see also vasp.*.help for an example using vasp.abs to generate an envelope from a vasp;
+#P connect 9 0 8 0;
+#P connect 8 0 12 0;
+#P connect 12 0 1 0;
+#P fasten 13 0 1 0 133 208 69 208;
+#P connect 1 0 11 0;
+#P hidden connect 4 0 5 0;
+#P hidden connect 5 0 3 0;
+#P connect 16 0 15 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.add.help b/externals/grill/vasp/max-help/vasp.add.help
new file mode 100755
index 00000000..0da7d475
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.add.help
@@ -0,0 +1,68 @@
+max v2;
+#N vpatcher 124 137 939 457;
+#P origin 0 22;
+#P message 580 242 52 196617 vasp buf+;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 580 263 73 196617 p clear_buffer;
+#P comment 346 192 101 196617 shift all values - 0.5;
+#P comment 112 191 131 196617 shift all values + 0.5;
+#P comment 113 168 132 196617 half the amplitude;
+#P comment 285 62 205 196617 optional argument/right inlet: right operand;
+#P comment 285 45 195 196617 subtracts a value or a vasp from a vasp;
+#P comment 285 21 89 196622 vasp.-;
+#P message 288 112 52 196617 vasp buf+;
+#P newex 288 212 61 196617 vasp.update;
+#P newex 288 189 55 196617 vasp.- 0.5;
+#P newex 288 144 80 196617 vasp.osc 44100;
+#P newex 288 166 55 196617 vasp.* 0.5;
+#P message 54 112 52 196617 vasp buf+;
+#P newex 54 212 61 196617 vasp.update;
+#P newex 54 189 55 196617 vasp.+ 0.5;
+#P newex 54 144 80 196617 vasp.osc 44100;
+#P hidden message 450 112 45 196617 set buf+;
+#P hidden newex 450 91 45 196617 loadbang;
+#P user waveform~ 450 132 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 671 263 92 196617 buffer~ buf+ 2000;
+#P newex 54 166 55 196617 vasp.* 0.5;
+#P comment 52 62 205 196617 optional argument/right inlet: right operand;
+#P comment 52 45 168 196617 adds a value or a vasp to a vasp;
+#P comment 52 21 89 196622 vasp.+;
+#P comment 137 146 132 196617 generate a 1Hz sine wave;
+#P connect 12 0 9 0;
+#P connect 9 0 4 0;
+#P connect 4 0 10 0;
+#P connect 10 0 11 0;
+#P connect 17 0 14 0;
+#P connect 14 0 13 0;
+#P connect 13 0 15 0;
+#P connect 15 0 16 0;
+#P hidden connect 7 0 8 0;
+#P hidden connect 8 0 6 0;
+#P connect 25 0 24 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.amaxq.help b/externals/grill/vasp/max-help/vasp.amaxq.help
new file mode 100755
index 00000000..81e404e5
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.amaxq.help
@@ -0,0 +1,104 @@
+max v2;
+#N vpatcher 279 142 977 614;
+#P message 477 385 75 196617 vasp bufamax?;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 477 405 73 196617 p clear_buffer;
+#P hidden newex 554 368 48 196617 r 1148path;
+#P user umenu 72 105 72 196647 1 64 121 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1148path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 134 127 43 196617 p loader;
+#P comment 46 107 26 196617 read;
+#P flonum 80 229 68 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 46 61 242 196617 maximum value of the absolute values of a vasp;
+#P message 52 197 75 196617 vasp bufamax?;
+#P newex 52 262 38 196617 vasp./;
+#P newex 52 284 61 196617 vasp.update;
+#P newex 52 383 45 196617 vasp.opt;
+#P message 52 350 75 196617 vasp bufamax?;
+#P newex 52 165 84 196617 vasp.amax?;
+#P hidden message 357 142 69 196617 set bufamax?;
+#P hidden newex 357 116 45 196617 loadbang;
+#P user waveform~ 357 161 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 304 405 27 196617 stop;
+#P message 237 405 65 196617 startwindow;
+#P newex 357 383 30 196617 line~;
+#P message 357 363 72 196617 0 \, 2000 2000;
+#P newex 357 431 29 196617 dac~;
+#P newex 357 405 80 196617 play~ bufamax?;
+#P newex 52 405 61 196617 vasp.update;
+#P message 52 144 75 196617 vasp bufamax?;
+#P newex 554 405 115 196617 buffer~ bufamax? 2000;
+#P comment 128 145 221 196617 find the absolute maximum of this soundfile;
+#P comment 150 230 141 196617 -> current absolute maximum;
+#P comment 93 264 153 196617 use it to optimize buffer content;
+#P comment 46 333 179 196617 or use vasp.opt which does the same;
+#P comment 46 37 91 196622 vasp.amax?;
+#P comment 46 76 137 196617 right outlet: calculated value;
+#P connect 7 0 18 0;
+#P fasten 23 0 22 0 57 236 57 236;
+#P connect 22 0 21 0;
+#P connect 19 0 20 0;
+#P connect 20 0 8 0;
+#P fasten 18 1 25 0 131 224 85 224;
+#P connect 25 0 22 1;
+#P hidden connect 28 1 27 0;
+#P hidden fasten 6 1 17 0 664 428 675 428 675 138 362 138;
+#P hidden connect 16 0 17 0;
+#P hidden connect 17 0 15 0;
+#P connect 11 0 12 0;
+#P connect 12 0 9 0;
+#P fasten 13 0 10 0 242 426 362 426;
+#P fasten 14 0 10 0 309 426 362 426;
+#P connect 9 0 10 0;
+#P connect 9 0 10 1;
+#P connect 31 0 30 0;
+#P hidden connect 29 0 6 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.aminq.help b/externals/grill/vasp/max-help/vasp.aminq.help
new file mode 100755
index 00000000..07289028
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.aminq.help
@@ -0,0 +1,92 @@
+max v2;
+#N vpatcher 201 150 928 511;
+#P origin 0 16;
+#P message 501 272 73 196617 vasp bufamin?;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 501 292 73 196617 p clear_buffer;
+#P hidden newex 583 267 48 196617 r 1038path;
+#P user umenu 69 118 72 196647 1 64 134 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1038path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 131 140 43 196617 p loader;
+#P comment 43 120 26 196617 read;
+#P flonum 105 223 68 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 43 67 253 196617 minimum value of the absolute values of a vasp;
+#P newex 56 183 59 196617 vasp.amin?;
+#P hidden message 384 99 65 196617 set bufamin?;
+#P hidden newex 384 74 45 196617 loadbang;
+#P user waveform~ 384 124 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 331 292 27 196617 stop;
+#P message 264 292 65 196617 startwindow;
+#P newex 384 270 30 196617 line~;
+#P message 384 250 72 196617 0 \, 2000 2000;
+#P newex 384 318 29 196617 dac~;
+#P newex 384 292 75 196617 play~ bufamin?;
+#P message 56 157 73 196617 vasp bufamin?;
+#P newex 583 292 113 196617 buffer~ bufamin? 2000;
+#P comment 131 158 218 196617 find the absolute minimum of this soundfile;
+#P comment 176 225 141 196617 -> current absolute minimum;
+#P comment 43 44 91 196622 vasp.amin?;
+#P comment 43 82 137 196617 right outlet: calculated value;
+#P connect 5 0 15 0;
+#P connect 15 1 17 0;
+#P hidden connect 20 1 19 0;
+#P hidden fasten 4 1 14 0 691 311 701 311 701 95 389 95;
+#P hidden connect 13 0 14 0;
+#P hidden connect 14 0 12 0;
+#P connect 8 0 9 0;
+#P connect 9 0 6 0;
+#P fasten 10 0 7 0 269 312 389 312;
+#P fasten 11 0 7 0 336 312 389 312;
+#P connect 6 0 7 0;
+#P connect 6 0 7 1;
+#P connect 23 0 22 0;
+#P hidden connect 21 0 4 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.beveldn.help b/externals/grill/vasp/max-help/vasp.beveldn.help
new file mode 100755
index 00000000..87a58e65
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.beveldn.help
@@ -0,0 +1,92 @@
+max v2;
+#N vpatcher 89 186 867 430;
+#P message 557 185 73 196617 vasp bufbevel!;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 557 205 73 196617 p clear_buffer;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 435 24 49 196617 p wfkeys;
+#P comment 219 56 168 196617 generates a linear ramp from 1 to 0;
+#P comment 219 34 89 196622 vasp.!bevel;
+#P message 225 84 73 196617 vasp bufbevel!;
+#P newex 225 112 59 196617 vasp.!bevel;
+#P newex 225 138 61 196617 vasp.update;
+#P newex 41 112 55 196617 vasp.bevel;
+#P hidden message 435 65 65 196617 set bufbevel!;
+#P hidden newex 435 46 45 196617 loadbang;
+#P user waveform~ 435 83 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 41 138 61 196617 vasp.update;
+#P message 41 84 73 196617 vasp bufbevel!;
+#P newex 635 205 113 196617 buffer~ bufbevel! 2000;
+#P comment 38 56 168 196617 generates a linear ramp from 0 to 1;
+#P comment 38 34 89 196622 vasp.bevel;
+#P connect 3 0 8 0;
+#P connect 8 0 4 0;
+#P connect 11 0 10 0;
+#P connect 10 0 9 0;
+#P hidden connect 6 0 7 0;
+#P hidden connect 7 0 5 0;
+#P hidden connect 14 0 5 0;
+#P connect 16 0 15 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.bevelup.help b/externals/grill/vasp/max-help/vasp.bevelup.help
new file mode 100755
index 00000000..61e5ab2e
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.bevelup.help
@@ -0,0 +1,92 @@
+max v2;
+#N vpatcher 141 224 919 475;
+#P message 562 189 70 196617 vasp bufbevel;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 562 209 73 196617 p clear_buffer;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 438 29 49 196617 p wfkeys;
+#P comment 222 59 168 196617 generates a linear ramp from 1 to 0;
+#P comment 222 37 89 196622 vasp.!bevel;
+#P message 228 87 70 196617 vasp bufbevel;
+#P newex 228 115 59 196617 vasp.!bevel;
+#P newex 228 141 61 196617 vasp.update;
+#P newex 44 115 55 196617 vasp.bevel;
+#P hidden message 438 69 63 196617 set bufbevel;
+#P hidden newex 438 50 45 196617 loadbang;
+#P user waveform~ 438 86 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 44 141 61 196617 vasp.update;
+#P message 44 87 70 196617 vasp bufbevel;
+#P newex 640 209 110 196617 buffer~ bufbevel 2000;
+#P comment 41 59 168 196617 generates a linear ramp from 0 to 1;
+#P comment 41 37 89 196622 vasp.bevel;
+#P connect 3 0 8 0;
+#P connect 8 0 4 0;
+#P connect 11 0 10 0;
+#P connect 10 0 9 0;
+#P hidden connect 6 0 7 0;
+#P hidden connect 7 0 5 0;
+#P hidden connect 14 0 5 0;
+#P connect 16 0 15 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cdiv.help b/externals/grill/vasp/max-help/vasp.cdiv.help
new file mode 100755
index 00000000..820a1d4f
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cdiv.help
@@ -0,0 +1,12 @@
+max v2;
+#N vpatcher 227 188 626 430;
+#P comment 43 141 118 196617 c \, d ... right operand;
+#P comment 43 126 118 196617 a \, b ... left operand;
+#P comment 43 111 102 196617 e \, f ... target buffers;
+#P newex 229 79 43 196617 vasp.c/;
+#P comment 43 184 300 196617 differences in lengths are adjusted to smaller vector of each pair;
+#P comment 43 81 98 196617 e+if=(a+ib)/(c+id);
+#P comment 43 42 89 196622 vasp.c/;
+#P comment 43 168 302 196617 vasp.c/ needs 2 vectors per operand which are treated as pairs;
+#P comment 43 65 109 196617 complex division;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cfft.help b/externals/grill/vasp/max-help/vasp.cfft.help
new file mode 100755
index 00000000..d72d0030
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cfft.help
@@ -0,0 +1,414 @@
+max v2;
+#N vpatcher 146 162 914 644;
+#P origin 0 8;
+#P message 546 392 84 196617 vasp bufre bufim;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 546 413 78 196617 p clear_buffers;
+#P hidden newex 631 367 54 196617 r 1061path1;
+#P user umenu 255 103 72 196647 1 64 119 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 54 196617 s 1061path1;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 1 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 317 133 43 196617 p loader;
+#P comment 229 105 26 196617 read;
+#P comment 140 319 217 196617 inverse cfft to transform back to time domain;
+#P newex 54 367 61 196617 vasp.update;
+#P message 54 318 84 196617 vasp bufre bufim;
+#P newex 54 346 52 196617 vasp.c!fft;
+#N vpatcher 122 59 923 629;
+#P origin 0 12;
+#P comment 100 398 152 196617 set selected samples to 0;
+#P user umenu 259 107 72 196647 1 64 123 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 344 681;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1061path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 1 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 321 137 43 196617 p loader;
+#P message 566 469 95 196617 vasp bufre1 bufim1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 566 489 78 196617 p clear_buffers;
+#P hidden newex 662 447 48 196617 r 1061path;
+#P comment 230 108 26 196617 read;
+#P comment 148 206 53 196617 transform;
+#P comment 311 323 21 196617 and;
+#P comment 283 323 17 196617 Hz;
+#P flonum 224 321 59 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P hidden newex 554 406 27 196617 - 0.;
+#P hidden newex 554 385 27 196617 t b f;
+#P newex 51 489 61 196617 vasp.update;
+#P comment 150 448 54 196617 invers cfft;
+#P message 51 447 95 196617 vasp bufre1 bufim1;
+#P newex 51 467 52 196617 vasp.c!fft;
+#P comment 115 269 207 196617 clear upper (mirrored frequencies);
+#P newex 51 287 61 196617 vasp.update;
+#P newex 51 267 45 196617 vasp.= 0;
+#P button 334 321 15 0;
+#P newex 51 417 61 196617 vasp.update;
+#P newex 51 396 45 196617 vasp.= 0;
+#P message 67 373 158 196617 set vasp \$1 bufre1 \$2 bufim1 \$2;
+#N vpatcher 139 82 551 321;
+#P origin 0 107;
+#N comlet length and offset as a list;
+#P outlet 99 199 15 0;
+#P comment 161 182 194 196617 2nd element of the list offset of the vasp;
+#N comlet loop startpoint;
+#P inlet 69 24 15 0;
+#N comlet loop endpoint;
+#P inlet 99 24 15 0;
+#P newex 99 94 27 196617 - 0.;
+#P newex 99 73 27 196617 t b f;
+#P comment 181 117 72 196617 msec to samps;
+#P comment 136 93 118 196617 <<< end - start = length;
+#P newex 255 135 87 196617 * 44.099998;
+#P newex 99 114 71 196617 * 44.099998;
+#P newex 99 162 50 196617 pack 0 0;
+#P comment 162 165 194 196617 1st element of the list lenght of the vasp;
+#P fasten 9 0 6 0 74 61 104 61;
+#P fasten 8 0 7 0 104 52 89 52 89 92 104 92;
+#P connect 6 0 7 0;
+#P connect 7 0 2 0;
+#P connect 2 0 1 0;
+#P connect 1 0 11 0;
+#P connect 6 1 7 1;
+#P fasten 3 0 1 1 260 157 144 157;
+#P fasten 9 0 3 0 74 61 260 61;
+#P pop;
+#P newobj 67 346 64 196617 p looptovasp;
+#P comment 452 365 71 196617 selection from;
+#P comment 668 365 17 196617 Hz;
+#P comment 586 365 17 196617 to;
+#P flonum 606 363 59 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P flonum 525 363 59 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P hidden newex 606 342 27 196617 / 4.;
+#P hidden newex 525 342 27 196617 / 4.;
+#P hidden newex 606 325 67 196617 * 44.099998;
+#P hidden newex 525 324 66 196617 * 44.099998;
+#P comment 737 318 42 196617 44.1kHz;
+#P comment 451 319 35 196617 0 Hz;
+#P newex 51 246 55 196617 vasp.upper;
+#P comment 714 202 49 196617 imaginary;
+#P message 51 205 95 196617 vasp bufre1 bufim1;
+#P newex 51 226 49 196617 vasp.cfft;
+#P hidden message 452 198 55 196617 set bufim1;
+#P user waveform~ 452 216 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 662 489 102 196617 buffer~ bufim1 4000;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 452 33 49 196617 p wfkeys;
+#P message 411 490 27 196617 stop;
+#P message 343 490 65 196617 startwindow;
+#P newex 452 516 29 196617 dac~;
+#P newex 452 464 30 196617 line~;
+#P message 452 441 72 196617 0 \, 4000 4000;
+#P newex 452 489 65 196617 play~ bufre1;
+#P hidden message 452 76 55 196617 set bufre1;
+#P hidden newex 452 55 45 196617 loadbang;
+#P user waveform~ 452 95 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 51 149 55 196617 vasp.* 0.5;
+#P newex 51 171 61 196617 vasp.update;
+#P message 51 107 62 196617 vasp bufre1;
+#P newex 662 469 102 196617 buffer~ bufre1 4000;
+#P newex 51 127 55 196617 vasp.noise;
+#P comment 45 60 242 196617 clear a region in the frequency domain to get a filter;
+#P comment 45 38 144 196622 filter_example;
+#P comment 115 108 112 196617 generate white noise or;
+#P comment 739 82 26 196617 real;
+#P comment 115 289 207 196617 now time is frequency and frequency is time;
+#P comment 594 317 35 196617 sr/2;
+#P comment 132 348 286 196617 this patcher scales a wavedraw selection into the vasp format;
+#P comment 67 323 152 196617 select a region ( frequency band);
+#P connect 10 0 8 0;
+#P connect 8 0 12 0;
+#P connect 12 0 11 0;
+#P connect 27 0 26 0;
+#P connect 26 0 29 0;
+#P connect 29 0 46 0;
+#P connect 46 0 47 0;
+#P connect 42 0 43 0;
+#P fasten 45 0 43 0 339 342 56 342;
+#P lcolor 15;
+#P connect 43 0 44 0;
+#P connect 50 0 49 0;
+#P connect 49 0 52 0;
+#P hidden fasten 24 2 41 0 577 318 72 318;
+#P connect 41 0 42 0;
+#P hidden fasten 24 3 41 1 637 318 126 318;
+#P hidden fasten 54 0 55 0 559 425 426 425 426 318 229 318;
+#P hidden connect 64 1 63 0;
+#P hidden connect 14 0 15 0;
+#P hidden fasten 9 1 15 0 759 486 774 486 774 75;
+#P hidden connect 22 0 13 0;
+#P hidden connect 15 0 13 0;
+#P hidden fasten 14 0 25 0 457 198 457 198;
+#P hidden connect 25 0 24 0;
+#P hidden fasten 22 0 24 0 457 91 457 91;
+#P connect 17 0 18 0;
+#P connect 18 0 16 0;
+#P fasten 21 0 19 0 416 509 457 509;
+#P fasten 20 0 19 0 348 509 457 509;
+#P connect 16 0 19 0;
+#P connect 16 0 19 1;
+#P hidden fasten 24 2 32 0 577 323 530 323;
+#P hidden connect 32 0 34 0;
+#P hidden connect 34 0 36 0;
+#P hidden fasten 36 0 53 0 530 382 559 382;
+#P hidden fasten 37 0 54 0 611 404 559 404;
+#P hidden connect 53 0 54 0;
+#P connect 62 0 61 0;
+#P hidden connect 53 1 54 1;
+#P hidden fasten 24 3 33 0 637 323 611 323;
+#P hidden connect 33 0 35 0;
+#P hidden connect 35 0 37 0;
+#P hidden connect 60 0 9 0;
+#P hidden fasten 24 5 13 4 757 346 757 346 757 73 757 73;
+#P hidden connect 13 5 24 4;
+#P pop;
+#P newobj 54 411 83 196617 p filter_example;
+#P comment 699 315 42 196617 44.1kHz;
+#P comment 413 316 35 196617 0 Hz;
+#P newex 54 272 61 196617 vasp.update;
+#P comment 677 198 49 196617 imaginary;
+#P message 54 223 84 196617 vasp bufre bufim;
+#P newex 54 244 49 196617 vasp.cfft;
+#P hidden message 414 195 50 196617 set bufim;
+#P user waveform~ 414 213 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 631 412 95 196617 buffer~ bufim 4000;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 414 30 49 196617 p wfkeys;
+#P message 373 413 27 196617 stop;
+#P message 305 413 65 196617 startwindow;
+#P newex 414 439 29 196617 dac~;
+#P newex 414 387 30 196617 line~;
+#P message 414 364 72 196617 0 \, 4000 4000;
+#P newex 414 412 60 196617 play~ bufre;
+#P hidden message 414 73 49 196617 set bufre;
+#P hidden newex 414 52 45 196617 loadbang;
+#P user waveform~ 414 92 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 55 158 55 196617 vasp.* 0.5;
+#P newex 55 180 61 196617 vasp.update;
+#P message 55 104 55 196617 vasp bufre;
+#P newex 631 392 95 196617 buffer~ bufre 4000;
+#P newex 55 136 55 196617 vasp.noise;
+#P comment 53 58 182 196617 complex fourier transformation;
+#P comment 53 35 89 196622 vasp.cfft;
+#P comment 113 105 115 196617 generate white noise or;
+#P comment 53 73 105 196617 cfft needs two buffers;
+#P comment 703 78 26 196617 real;
+#P comment 119 275 207 196617 now time is frequency and frequency is time;
+#P comment 556 314 35 196617 sr/2;
+#P connect 26 0 25 0;
+#P connect 25 0 28 0;
+#P connect 33 0 32 0;
+#P connect 32 0 34 0;
+#P connect 9 0 7 0;
+#P connect 7 0 11 0;
+#P connect 11 0 10 0;
+#P hidden connect 38 1 37 0;
+#P hidden connect 13 0 14 0;
+#P hidden fasten 8 1 14 0 721 408 737 408 737 72;
+#P hidden connect 21 0 12 0;
+#P hidden connect 14 0 12 0;
+#P hidden fasten 13 0 24 0 419 195 419 195;
+#P hidden connect 24 0 23 0;
+#P hidden fasten 21 0 23 0 419 88 419 88;
+#P connect 16 0 17 0;
+#P connect 17 0 15 0;
+#P connect 15 0 18 0;
+#P fasten 19 0 18 0 310 432 419 432;
+#P fasten 20 0 18 0 378 432 419 432;
+#P connect 15 0 18 1;
+#P connect 41 0 40 0;
+#P hidden connect 39 0 8 0;
+#P hidden fasten 23 5 12 4 719 343 745 343 745 70 719 70;
+#P hidden connect 12 5 23 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.chk.help b/externals/grill/vasp/max-help/vasp.chk.help
new file mode 100755
index 00000000..37412227
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.chk.help
@@ -0,0 +1,20 @@
+max v2;
+#N vpatcher 215 115 767 458;
+#P hidden message 411 138 22 196617 set;
+#P hidden newex 411 104 45 196617 loadbang;
+#P comment 237 127 150 196617 buffer length = 88200 samples;
+#P comment 237 272 253 196617 corrected vasp with maximum length at offset 44100;
+#P newex 70 246 60 196617 prepend set;
+#P message 70 170 135 196617 vasp 88200 bufchk 44100 0;
+#P newex 70 194 45 196617 vasp.chk;
+#P newex 70 125 101 196617 buffer~ bufchk 2000;
+#P comment 59 77 272 196617 checks the dimensions of a vasp and corrects them;
+#P comment 59 55 89 196622 vasp.chk;
+#P comment 237 171 150 196617 vasp with impossible dimensions;
+#P message 70 271 165 196617;
+#P connect 6 0 5 0;
+#P connect 5 0 7 0;
+#P connect 7 0 0 0;
+#P hidden fasten 11 0 0 0 416 266 75 266;
+#P hidden connect 10 0 11 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cifft.help b/externals/grill/vasp/max-help/vasp.cifft.help
new file mode 100755
index 00000000..0912ba43
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cifft.help
@@ -0,0 +1,407 @@
+max v2;
+#N vpatcher 153 83 876 572;
+#P origin 0 10;
+#P user umenu 80 104 72 196647 1 64 120 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 344 681;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 54 196617 s 1063path1;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 4 0 1 0;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 142 125 43 196617 p loader;
+#P message 501 400 90 196617 vasp bufre! bufim!;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 501 420 78 196617 p clear_buffers;
+#P hidden newex 593 370 54 196617 r 1063path1;
+#P comment 53 106 26 196617 read;
+#P comment 154 312 214 196617 inverse cfft to transform back to time domain;
+#P newex 62 360 61 196617 vasp.update;
+#P message 62 311 90 196617 vasp bufre! bufim!;
+#P newex 62 339 52 196617 vasp.c!fft;
+#N vpatcher 155 102 963 712;
+#P origin 0 7;
+#P user umenu 262 101 72 196647 1 64 117 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 344 681;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1063path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 1 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 324 123 43 196617 p loader;
+#P message 558 519 102 196617 vasp bufre1! bufim1!;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 558 539 78 196617 p clear_buffers;
+#P hidden newex 662 492 48 196617 r 1063path;
+#P comment 235 103 26 196617 read;
+#P flonum 367 323 33 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 157 201 148 196617 transform to frequency domain;
+#P comment 288 325 79 196617 Hz \, a gainfactor;
+#P flonum 227 323 59 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P hidden newex 557 401 27 196617 - 0.;
+#P hidden newex 557 380 27 196617 t b f;
+#P newex 54 539 61 196617 vasp.update;
+#P comment 159 498 177 196617 invers cfft to get back to time domain;
+#P message 54 497 102 196617 vasp bufre1! bufim1!;
+#P newex 54 517 52 196617 vasp.c!fft;
+#P comment 105 264 167 196617 clear upper (mirrored frequencies);
+#P newex 54 282 61 196617 vasp.update;
+#P newex 54 262 45 196617 vasp.= 0;
+#P button 97 342 15 0;
+#P newex 54 467 61 196617 vasp.update;
+#P newex 54 446 51 196617 vasp.* 1.;
+#P message 64 399 164 196617 set vasp \$1 bufre1! \$2 bufim1! \$2;
+#N vpatcher 139 82 551 321;
+#P origin 0 107;
+#N comlet length and offset as a list;
+#P outlet 99 199 15 0;
+#P comment 161 182 194 196617 2nd element of the list offset of the vasp;
+#N comlet loop startpoint;
+#P inlet 69 24 15 0;
+#N comlet loop endpoint;
+#P inlet 99 24 15 0;
+#P newex 99 94 27 196617 - 0.;
+#P newex 99 73 27 196617 t b f;
+#P comment 181 117 72 196617 msec to samps;
+#P comment 136 93 118 196617 <<< end - start = length;
+#P newex 255 135 87 196617 * 44.099998;
+#P newex 99 114 71 196617 * 44.099998;
+#P newex 99 162 50 196617 pack 0 0;
+#P comment 162 165 194 196617 1st element of the list lenght of the vasp;
+#P fasten 9 0 6 0 74 61 104 61;
+#P connect 6 0 7 0;
+#P fasten 8 0 7 0 104 52 89 52 89 92 104 92;
+#P connect 7 0 2 0;
+#P connect 2 0 1 0;
+#P connect 1 0 11 0;
+#P connect 6 1 7 1;
+#P fasten 3 0 1 1 260 157 144 157;
+#P fasten 9 0 3 0 74 61 260 61;
+#P pop;
+#P newobj 64 371 64 196617 p looptovasp;
+#P comment 455 360 71 196617 selection from;
+#P comment 671 360 17 196617 Hz;
+#P comment 589 360 17 196617 to;
+#P flonum 609 358 59 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P flonum 528 358 59 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P hidden newex 609 337 27 196617 / 4.;
+#P hidden newex 528 337 27 196617 / 4.;
+#P hidden newex 609 320 67 196617 * 44.099998;
+#P hidden newex 528 319 66 196617 * 44.099998;
+#P comment 740 313 42 196617 44.1kHz;
+#P comment 454 314 35 196617 0 Hz;
+#P newex 54 241 55 196617 vasp.upper;
+#P comment 717 197 49 196617 imaginary;
+#P message 54 200 102 196617 vasp bufre1! bufim1!;
+#P newex 54 221 49 196617 vasp.cfft;
+#P hidden message 455 193 59 196617 set bufim1!;
+#P user waveform~ 455 211 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 662 539 105 196617 buffer~ bufim1! 4000;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 455 28 49 196617 p wfkeys;
+#P message 414 541 27 196617 stop;
+#P message 346 541 65 196617 startwindow;
+#P newex 455 567 29 196617 dac~;
+#P newex 455 515 30 196617 line~;
+#P message 455 492 72 196617 0 \, 4000 4000;
+#P newex 455 539 69 196617 play~ bufre1!;
+#P hidden message 455 71 58 196617 set bufre1!;
+#P hidden newex 455 50 45 196617 loadbang;
+#P user waveform~ 455 90 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 54 144 55 196617 vasp.* 0.5;
+#P newex 54 166 61 196617 vasp.update;
+#P message 54 102 65 196617 vasp bufre1!;
+#P newex 662 519 105 196617 buffer~ bufre1! 4000;
+#P newex 54 122 55 196617 vasp.noise;
+#P comment 48 55 339 196617 change gain of a region in the frequency domain to filter a buffer content;
+#P comment 48 33 144 196622 filter_example;
+#P comment 120 103 114 196617 generate white noise or;
+#P comment 744 77 26 196617 real;
+#P comment 597 312 35 196617 sr/2;
+#P comment 129 369 174 196617 this patcher scales a wavedraw selection into the vasp format;
+#P comment 70 325 152 196617 select a region ( frequency band);
+#P comment 70 343 25 196617 and;
+#P connect 10 0 8 0;
+#P connect 8 0 12 0;
+#P connect 12 0 11 0;
+#P connect 27 0 26 0;
+#P connect 26 0 29 0;
+#P connect 29 0 46 0;
+#P connect 46 0 47 0;
+#P fasten 42 0 43 0 69 430 59 430;
+#P fasten 45 0 43 0 102 363 59 363;
+#P connect 43 0 44 0;
+#P connect 50 0 49 0;
+#P connect 49 0 52 0;
+#P hidden fasten 24 2 41 0 580 313 69 313;
+#P connect 41 0 42 0;
+#P fasten 58 0 43 1 372 428 100 428;
+#P hidden fasten 24 3 41 1 640 313 123 313;
+#P hidden fasten 54 0 55 0 562 420 429 420 429 313 232 313;
+#P hidden connect 64 1 63 0;
+#P hidden connect 14 0 15 0;
+#P hidden fasten 9 1 15 0 762 537 774 537 774 70;
+#P hidden connect 22 0 13 0;
+#P hidden connect 15 0 13 0;
+#P hidden fasten 14 0 25 0 460 193 460 193;
+#P hidden fasten 22 0 24 0 460 86 460 86;
+#P hidden connect 25 0 24 0;
+#P connect 17 0 18 0;
+#P connect 18 0 16 0;
+#P connect 16 0 19 0;
+#P fasten 20 0 19 0 351 561 460 561;
+#P fasten 21 0 19 0 419 561 460 561;
+#P connect 16 0 19 1;
+#P hidden fasten 24 2 32 0 580 315 533 315;
+#P hidden connect 32 0 34 0;
+#P hidden connect 34 0 36 0;
+#P hidden fasten 36 0 53 0 533 377 562 377;
+#P hidden connect 53 0 54 0;
+#P hidden fasten 37 0 54 0 614 399 562 399;
+#P connect 62 0 61 0;
+#P hidden connect 53 1 54 1;
+#P hidden fasten 24 3 33 0 640 315 614 315;
+#P hidden connect 33 0 35 0;
+#P hidden connect 35 0 37 0;
+#P hidden fasten 60 0 9 0 667 512 667 512;
+#P hidden fasten 24 5 13 4 760 341 760 341 760 68 760 68;
+#P hidden connect 13 5 24 4;
+#P pop;
+#P newobj 62 420 85 196617 p filter_example!;
+#P comment 666 312 42 196617 44.1kHz;
+#P comment 380 312 35 196617 0 Hz;
+#P newex 62 192 61 196617 vasp.update;
+#P comment 644 193 49 196617 imaginary;
+#P message 62 143 90 196617 vasp bufre! bufim!;
+#P newex 62 171 49 196617 vasp.cfft;
+#P hidden message 381 190 53 196617 set bufim!;
+#P user waveform~ 381 208 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 593 420 100 196617 buffer~ bufim! 4000;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 381 25 49 196617 p wfkeys;
+#P message 340 421 27 196617 stop;
+#P message 272 421 65 196617 startwindow;
+#P newex 381 447 29 196617 dac~;
+#P newex 381 395 30 196617 line~;
+#P message 381 372 72 196617 0 \, 4000 4000;
+#P newex 381 420 63 196617 play~ bufre!;
+#P hidden message 381 68 52 196617 set bufre!;
+#P hidden newex 381 47 45 196617 loadbang;
+#P user waveform~ 381 87 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 593 400 100 196617 buffer~ bufre! 4000;
+#P comment 49 58 218 196617 inverse complex fourier transformation;
+#P comment 49 35 89 196622 vasp.c!fft;
+#P comment 49 73 123 196617 c!fft needs two buffers;
+#P comment 670 73 26 196617 real;
+#P comment 127 195 207 196617 now time is frequency and frequency is time;
+#P comment 524 312 35 196617 sr/2;
+#P comment 62 243 249 196617 to get back to the source file in time domain either use 3 more times vasp.cfft or just vasp.c!fft !!;
+#P comment 155 144 146 196617 transform to frequency domain;
+#P connect 23 0 22 0;
+#P connect 22 0 25 0;
+#P connect 30 0 29 0;
+#P connect 29 0 31 0;
+#P hidden connect 38 1 37 0;
+#P hidden connect 10 0 11 0;
+#P hidden fasten 8 1 11 0 688 417 701 417 701 67;
+#P hidden connect 18 0 9 0;
+#P hidden connect 11 0 9 0;
+#P hidden fasten 10 0 21 0 386 190 386 190;
+#P hidden fasten 18 0 20 0 386 83 386 83;
+#P hidden connect 21 0 20 0;
+#P connect 13 0 14 0;
+#P connect 14 0 12 0;
+#P connect 12 0 15 0;
+#P fasten 17 0 15 0 345 440 386 440;
+#P fasten 16 0 15 0 277 440 386 440;
+#P connect 12 0 15 1;
+#P connect 36 0 35 0;
+#P hidden connect 34 0 8 0;
+#P hidden fasten 20 5 9 4 686 338 686 338 686 65 686 65;
+#P hidden connect 9 5 20 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cmul.help b/externals/grill/vasp/max-help/vasp.cmul.help
new file mode 100755
index 00000000..25d92f2e
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cmul.help
@@ -0,0 +1,12 @@
+max v2;
+#N vpatcher 258 153 655 401;
+#P comment 45 142 118 196617 c \, d ... right operand;
+#P comment 45 127 118 196617 a \, b ... left operand;
+#P comment 45 112 102 196617 e \, f ... target buffers;
+#P newex 239 97 44 196617 vasp.c*;
+#P comment 45 187 300 196617 differences in lengths are adjusted to smaller vector of each pair;
+#P comment 45 80 98 196617 e+if=(a+ib)*(c+id);
+#P comment 45 41 89 196622 vasp.c*;
+#P comment 45 171 302 196617 vasp.c* needs 2 vectors per operand which are treated as pairs;
+#P comment 45 64 109 196617 complex multiplication;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cnoise.help b/externals/grill/vasp/max-help/vasp.cnoise.help
new file mode 100755
index 00000000..8cdf423a
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cnoise.help
@@ -0,0 +1,116 @@
+max v2;
+#N vpatcher 130 121 812 507;
+#P message 391 318 131 196617 vasp bufcnoise1 bufcnoise2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 391 338 73 196617 p clear_buffer;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 332 25 49 196617 p wfkeys;
+#P comment 527 196 117 196617 imaginary part of cnoise;
+#P message 45 125 131 196617 vasp bufcnoise1 bufcnoise2;
+#P hidden message 332 190 73 196617 set bufcnoise2;
+#P user waveform~ 332 211 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 524 338 120 196617 buffer~ bufcnoise2 2000;
+#P hidden message 332 64 73 196617 set bufcnoise1;
+#P hidden newex 332 44 45 196617 loadbang;
+#P user waveform~ 332 84 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 45 180 55 196617 vasp.* 0.5;
+#P newex 45 205 61 196617 vasp.update;
+#P newex 524 318 120 196617 buffer~ bufcnoise1 2000;
+#P newex 45 156 60 196617 vasp.cnoise;
+#P comment 45 63 168 196617 vasp complex noise generator;
+#P comment 45 41 89 196622 vasp.cnoise;
+#P comment 107 158 197 196617 generate a complex noise into two buffers;
+#P comment 538 68 106 196617 real part of the cnoise;
+#P comment 45 81 85 196617 needs 2 buffers;
+#P connect 15 0 5 0;
+#P connect 5 0 8 0;
+#P connect 8 0 7 0;
+#P hidden connect 10 0 11 0;
+#P hidden connect 17 0 9 0;
+#P hidden connect 11 0 9 0;
+#P hidden fasten 10 0 14 0 337 54 337 54;
+#P hidden fasten 14 0 13 0 337 206 337 206;
+#P hidden connect 17 0 13 0;
+#P connect 19 0 18 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cnorm.help b/externals/grill/vasp/max-help/vasp.cnorm.help
new file mode 100755
index 00000000..23d44f30
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cnorm.help
@@ -0,0 +1,177 @@
+max v2;
+#N vpatcher 176 110 856 641;
+#P origin 0 8;
+#P message 434 416 131 196617 vasp bufcnorm1 bufcnorm2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 434 483 78 196617 p clear_buffers;
+#P hidden newex 519 440 54 196617 r #01path;
+#P user umenu 89 115 72 196647 1 64 131 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 54 196617 s #01path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 151 140 43 196617 p loader;
+#P newex 62 368 63 196617 vasp.* 0.05;
+#P comment 195 240 101 196617 set all samples to 1;
+#P newex 62 288 61 196617 vasp.update;
+#P message 62 239 131 196617 vasp bufcnorm1 bufcnorm2;
+#P newex 62 263 60 196617 vasp.cnorm;
+#P comment 194 324 72 196617 inverse cfft;
+#P newex 62 392 61 196617 vasp.update;
+#P message 62 323 131 196617 vasp bufcnorm1 bufcnorm2;
+#P newex 62 344 52 196617 vasp.c!fft;
+#P comment 612 327 42 196617 44.1kHz;
+#P comment 326 328 35 196617 0 Hz;
+#P newex 62 207 61 196617 vasp.update;
+#P comment 590 210 49 196617 imaginary;
+#P message 62 158 131 196617 vasp bufcnorm1 bufcnorm2;
+#P newex 62 179 49 196617 vasp.cfft;
+#P hidden message 327 207 73 196617 set bufcnorm2;
+#P user waveform~ 327 225 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 519 483 120 196617 buffer~ bufcnorm2 4000;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 327 42 49 196617 p wfkeys;
+#P message 286 465 27 196617 stop;
+#P message 218 465 65 196617 startwindow;
+#P newex 327 484 29 196617 dac~;
+#P newex 327 439 30 196617 line~;
+#P message 327 416 72 196617 0 \, 4000 4000;
+#P newex 327 465 84 196617 play~ bufcnorm1;
+#P hidden message 327 85 73 196617 set bufcnorm1;
+#P hidden newex 327 64 45 196617 loadbang;
+#P user waveform~ 327 104 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 519 464 120 196617 buffer~ bufcnorm1 4000;
+#P comment 58 69 218 196617 sets complex radius of samples to unity;
+#P comment 58 47 89 196622 vasp.cnorm;
+#P comment 58 84 105 196617 needs two buffers;
+#P comment 616 90 26 196617 real;
+#P comment 194 159 26 196617 cfft;
+#P comment 469 326 35 196617 sr/2;
+#P comment 127 370 172 196617 reduce gain (safe your loudspeakers);
+#P comment 64 117 25 196617 read;
+#P connect 23 0 22 0;
+#P connect 22 0 25 0;
+#P connect 33 0 32 0;
+#P connect 32 0 34 0;
+#P connect 29 0 28 0;
+#P connect 28 0 36 0;
+#P connect 36 0 30 0;
+#P hidden connect 38 1 37 0;
+#P hidden connect 10 0 11 0;
+#P hidden fasten 8 1 11 0 634 481 655 481 655 84;
+#P hidden connect 18 0 9 0;
+#P hidden connect 11 0 9 0;
+#P hidden fasten 10 0 21 0 332 207 332 207;
+#P hidden fasten 18 0 20 0 332 100 332 100;
+#P hidden connect 21 0 20 0;
+#P connect 13 0 14 0;
+#P connect 14 0 12 0;
+#P connect 12 0 15 0;
+#P fasten 16 0 15 0 223 484 332 484;
+#P fasten 17 0 15 0 291 484 332 484;
+#P connect 12 0 15 1;
+#P connect 41 0 40 0;
+#P hidden connect 39 0 8 0;
+#P hidden fasten 20 5 9 4 632 327 650 327 650 101 632 101;
+#P hidden connect 9 5 20 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cosc.help b/externals/grill/vasp/max-help/vasp.cosc.help
new file mode 100755
index 00000000..6432d8f1
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cosc.help
@@ -0,0 +1,139 @@
+max v2;
+#N vpatcher 162 250 877 640;
+#P message 451 318 115 196617 vasp bufcosc1 bufcosc2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 451 338 78 196617 p clear_buffers;
+#N vpatcher 169 125 534 375;
+#P flonum 70 179 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 125 27 196617 t b f;
+#P message 309 151 27 196617 stop;
+#P message 243 151 65 196617 startwindow;
+#P newex 243 173 29 196617 dac~;
+#P comment 141 175 83 196617 period length in samples (float);
+#P flonum 88 97 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 147 27 196617 / 1.;
+#P flonum 68 73 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 54 49 53 196617 dspstate~;
+#P comment 133 98 100 196617 frequency in Hz;
+#P connect 1 1 2 0;
+#P fasten 4 0 9 0 93 118 75 118;
+#P connect 9 0 3 0;
+#P fasten 2 0 3 0 73 115 54 115 54 145 75 145;
+#P connect 3 0 10 0;
+#P connect 9 1 3 1;
+#P connect 7 0 6 0;
+#P fasten 8 0 6 0 314 169 248 169;
+#P pop;
+#P newobj 46 338 109 196617 p Hz_to_period_length;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 375 30 49 196617 p wfkeys;
+#P comment 579 197 108 196617 imaginary part of cosc;
+#P message 46 156 115 196617 vasp bufcosc1 bufcosc2;
+#P hidden message 375 191 65 196617 set bufcosc2;
+#P user waveform~ 375 212 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 575 338 112 196617 buffer~ bufcosc2 2000;
+#P hidden message 375 69 65 196617 set bufcosc1;
+#P hidden newex 375 50 45 196617 loadbang;
+#P user waveform~ 375 87 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 46 214 55 196617 vasp.* 0.5;
+#P newex 46 239 61 196617 vasp.update;
+#P newex 575 318 112 196617 buffer~ bufcosc1 2000;
+#P comment 45 79 312 196617 optional argument/right inlet: frequency in period length in samples;
+#P newex 46 189 85 196617 vasp.cosc 44100;
+#P comment 45 64 168 196617 vasp complex sine wave generator;
+#P comment 45 41 89 196622 vasp.cosc;
+#P comment 172 156 136 196617 generate a complex sinewave at 1Hz into two buffers;
+#P comment 588 72 100 196617 real part of the cosc;
+#P comment 45 94 78 196617 needs 2 buffers;
+#P connect 16 0 5 0;
+#P connect 5 0 9 0;
+#P connect 9 0 8 0;
+#P hidden connect 11 0 12 0;
+#P hidden connect 18 0 10 0;
+#P hidden connect 12 0 10 0;
+#P hidden fasten 11 0 15 0 380 50 380 50;
+#P hidden connect 18 0 14 0;
+#P hidden connect 15 0 14 0;
+#P connect 21 0 20 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cplus.help b/externals/grill/vasp/max-help/vasp.cplus.help
new file mode 100755
index 00000000..7f4e999d
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cplus.help
@@ -0,0 +1,12 @@
+max v2;
+#N vpatcher 258 153 663 403;
+#P comment 49 142 118 196617 c \, d ... right operand;
+#P comment 49 127 118 196617 a \, b ... left operand;
+#P comment 49 112 102 196617 e \, f ... target buffers;
+#P newex 238 88 43 196617 vasp.c+;
+#P comment 49 190 300 196617 differences in lengths are adjusted to smaller vector of each pair;
+#P comment 49 81 98 196617 e+if=(a+ib)+(c+id);
+#P comment 49 42 89 196622 vasp.c+;
+#P comment 49 174 302 196617 vasp.c+ needs 2 vectors per operand which are treated as pairs;
+#P comment 49 65 100 196617 complex addition;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cpowi.help b/externals/grill/vasp/max-help/vasp.cpowi.help
new file mode 100755
index 00000000..d008f65c
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cpowi.help
@@ -0,0 +1,166 @@
+max v2;
+#N vpatcher 218 95 852 551;
+#P hidden newex 507 347 48 196617 r 1141path;
+#P user umenu 63 136 72 196647 1 64 152 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1141path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 125 158 43 196617 p loader;
+#P message 353 344 125 196617 vasp bufcpowi1 bufcpowi2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 353 392 73 196617 p clear_buffer;
+#P comment 38 61 151 196617 complex integer power function;
+#P comment 38 113 132 196617 argument: exponent (int);
+#P newex 44 392 61 196617 vasp.update;
+#P message 44 253 125 196617 vasp bufcpowi1 bufcpowi2;
+#P message 228 392 27 196617 stop;
+#P message 160 392 65 196617 startwindow;
+#P newex 269 419 29 196617 dac~;
+#P newex 269 367 30 196617 line~;
+#P message 269 344 72 196617 0 \, 8000 8000;
+#P newex 269 392 82 196617 play~ bufcpowi1;
+#P hidden message 269 198 71 196617 set bufcpowi2;
+#P user waveform~ 269 216 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 466 392 118 196617 buffer~ bufcpowi2 8000;
+#P newex 44 370 45 196617 vasp.opt;
+#P message 44 325 125 196617 vasp bufcpowi1 bufcpowi2;
+#P newex 44 346 52 196617 vasp.c!fft;
+#P comment 38 77 93 196617 complex sample^n;
+#P newex 44 273 65 196617 vasp.cpowi 2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 269 31 49 196617 p wfkeys;
+#P hidden message 269 76 71 196617 set bufcpowi1;
+#P hidden newex 269 50 45 196617 loadbang;
+#P user waveform~ 269 97 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 44 223 61 196617 vasp.update;
+#P newex 44 295 61 196617 vasp.update;
+#P message 44 177 125 196617 vasp bufcpowi1 bufcpowi2;
+#P newex 466 371 118 196617 buffer~ bufcpowi1 8000;
+#P newex 44 199 49 196617 vasp.cfft;
+#P comment 38 34 89 196622 vasp.cpowi;
+#P comment 38 95 100 196617 needs two vectors;
+#P comment 38 137 33 196617 read;
+#P connect 5 0 3 0;
+#P connect 3 0 7 0;
+#P connect 26 0 12 0;
+#P connect 12 0 6 0;
+#P connect 15 0 14 0;
+#P connect 14 0 16 0;
+#P connect 16 0 27 0;
+#P hidden connect 33 1 32 0;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 4 1 10 0 579 390 597 390 597 72 274 72;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 19 0;
+#P hidden connect 19 0 18 0;
+#P connect 21 0 22 0;
+#P connect 22 0 20 0;
+#P fasten 25 0 23 0 233 412 274 412;
+#P fasten 24 0 23 0 165 412 274 412;
+#P connect 20 0 23 0;
+#P connect 20 0 23 1;
+#P connect 31 0 30 0;
+#P hidden connect 34 0 4 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.crsub.help b/externals/grill/vasp/max-help/vasp.crsub.help
new file mode 100755
index 00000000..a0fbf9ba
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.crsub.help
@@ -0,0 +1,12 @@
+max v2;
+#N vpatcher 258 153 663 391;
+#P newex 238 90 45 196617 vasp.c!-;
+#P comment 49 188 300 196617 differences in lengths are adjusted to smaller vector of each pair;
+#P comment 49 142 118 196617 c \, d ... right operand;
+#P comment 49 127 118 196617 a \, b ... left operand;
+#P comment 49 83 98 196617 e+if=(c+id)-(a+ib);
+#P comment 49 112 102 196617 e \, f ... target buffers;
+#P comment 49 44 89 196622 vasp.c!-;
+#P comment 49 172 302 196617 vasp.c- needs 2 vectors per operand which are treated as pairs;
+#P comment 49 67 147 196617 complex inverse substraction;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.cset.help b/externals/grill/vasp/max-help/vasp.cset.help
new file mode 100755
index 00000000..d898e914
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.cset.help
@@ -0,0 +1,11 @@
+max v2;
+#N vpatcher 228 183 631 425;
+#P newex 234 82 43 196617 vasp.c/;
+#P comment 48 169 300 196617 differences in lengths are adjusted to smaller vector of each pair;
+#P comment 48 124 118 196617 c \, d is the target;
+#P comment 48 109 118 196617 a \, b is the source;
+#P comment 48 84 98 196617 (a+ib)=(c+id);
+#P comment 48 45 89 196622 vasp.c=;
+#P comment 48 153 302 196617 vasp.c= needs 2 vectors per operand which are treated as pairs;
+#P comment 48 68 59 196617 complex =;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.csqr.help b/externals/grill/vasp/max-help/vasp.csqr.help
new file mode 100755
index 00000000..6724d738
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.csqr.help
@@ -0,0 +1,164 @@
+max v2;
+#N vpatcher 188 93 824 584;
+#P user umenu 80 109 72 196647 1 64 125 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1143path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 142 131 43 196617 p loader;
+#P message 365 388 115 196617 vasp bufcsqr1 bufcsqr2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 365 409 78 196617 p clear_buffers;
+#P hidden newex 481 367 48 196617 r 1143path;
+#P comment 53 110 26 196617 read;
+#P newex 64 362 61 196617 vasp.update;
+#P message 64 223 115 196617 vasp bufcsqr1 bufcsqr2;
+#P message 243 410 27 196617 stop;
+#P message 175 410 65 196617 startwindow;
+#P newex 284 436 29 196617 dac~;
+#P newex 284 384 30 196617 line~;
+#P message 284 361 72 196617 0 \, 8000 8000;
+#P newex 284 409 75 196617 play~ bufcsqr1;
+#P hidden message 284 215 65 196617 set bufcsqr2;
+#P user waveform~ 284 233 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 481 409 112 196617 buffer~ bufcsqr2 8000;
+#P newex 64 340 45 196617 vasp.opt;
+#P message 64 295 115 196617 vasp bufcsqr1 bufcsqr2;
+#P newex 64 316 52 196617 vasp.c!fft;
+#P comment 53 60 93 196617 complex sample^2;
+#P newex 64 243 52 196617 vasp.csqr;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 284 48 49 196617 p wfkeys;
+#P hidden message 284 93 65 196617 set bufcsqr1;
+#P hidden newex 284 67 45 196617 loadbang;
+#P user waveform~ 284 114 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 64 193 61 196617 vasp.update;
+#P newex 64 265 61 196617 vasp.update;
+#P message 64 147 115 196617 vasp bufcsqr1 bufcsqr2;
+#P newex 481 388 112 196617 buffer~ bufcsqr1 8000;
+#P newex 64 169 49 196617 vasp.cfft;
+#P comment 53 36 89 196622 vasp.csqr;
+#P comment 53 75 100 196617 needs two vectors;
+#P connect 4 0 2 0;
+#P connect 2 0 6 0;
+#P connect 25 0 11 0;
+#P connect 11 0 5 0;
+#P connect 14 0 13 0;
+#P connect 13 0 15 0;
+#P connect 15 0 26 0;
+#P hidden connect 32 1 31 0;
+#P hidden connect 8 0 9 0;
+#P hidden fasten 3 1 9 0 588 407 612 407 612 89 289 89;
+#P hidden connect 9 0 7 0;
+#P hidden connect 10 0 7 0;
+#P hidden connect 8 0 18 0;
+#P hidden connect 18 0 17 0;
+#P connect 20 0 21 0;
+#P connect 21 0 19 0;
+#P fasten 23 0 22 0 180 429 289 429;
+#P fasten 24 0 22 0 248 429 289 429;
+#P connect 19 0 22 0;
+#P connect 19 0 22 1;
+#P connect 30 0 29 0;
+#P hidden connect 28 0 3 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.csub.help b/externals/grill/vasp/max-help/vasp.csub.help
new file mode 100755
index 00000000..2ee0998f
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.csub.help
@@ -0,0 +1,12 @@
+max v2;
+#N vpatcher 258 153 659 407;
+#P comment 52 147 118 196617 c \, d ... right operand;
+#P comment 52 132 118 196617 a \, b ... left operand;
+#P comment 52 117 102 196617 e \, f ... target buffers;
+#P newex 241 94 42 196617 vasp.c-;
+#P comment 52 192 300 196617 differences in lengths are adjusted to smaller vector of each pair;
+#P comment 52 87 98 196617 e+if=(a+ib)-(c+id);
+#P comment 52 48 89 196622 vasp.c-;
+#P comment 52 176 302 196617 vasp.c- needs 2 vectors per operand which are treated as pairs;
+#P comment 52 71 100 196617 complex subtraction;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.dif.help b/externals/grill/vasp/max-help/vasp.dif.help
new file mode 100755
index 00000000..c6b68ea1
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.dif.help
@@ -0,0 +1,7 @@
+max v2;
+#N vpatcher 256 153 557 315;
+#P comment 44 79 225 196617 argument/right inlet: repetition count(default 1);
+#P comment 44 38 89 196622 vasp.dif;
+#P newex 116 103 44 196617 vasp.dif;
+#P comment 44 62 124 196617 vasp differential function;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.div.help b/externals/grill/vasp/max-help/vasp.div.help
new file mode 100755
index 00000000..60ec8c13
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.div.help
@@ -0,0 +1,52 @@
+max v2;
+#N vpatcher 147 233 787 552;
+#P message 426 243 52 196617 vasp buf/;
+#N vpatcher 40 55 241 186;
+#P newex 19 84 61 196617 vasp.update;
+#P newex 19 60 50 196617 vasp.= 0.;
+#N comlet vasp to clear in;
+#P inlet 19 31 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 426 263 73 196617 p clear_buffer;
+#P comment 110 135 147 196617 generate a sine wave at 1Hz;
+#P newex 52 263 61 196617 vasp.update;
+#P message 52 134 52 196617 vasp buf/;
+#P newex 52 169 80 196617 vasp.osc 44100;
+#P comment 45 74 189 196617 optional argument/right inlet: divisor;
+#P flonum 87 202 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 45 59 168 196617 vasp division;
+#P comment 45 36 89 196622 vasp./;
+#P newex 501 263 92 196617 buffer~ buf/ 2000;
+#P hidden message 284 106 45 196617 set buf/;
+#P hidden newex 284 80 45 196617 loadbang;
+#P user waveform~ 284 130 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 52 223 45 196617 vasp./ 2;
+#P connect 10 0 9 0;
+#P connect 9 0 0 0;
+#P connect 0 0 11 0;
+#P connect 7 0 0 1;
+#P hidden connect 2 0 3 0;
+#P hidden connect 3 0 1 0;
+#P connect 14 0 13 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.equ.help b/externals/grill/vasp/max-help/vasp.equ.help
new file mode 100755
index 00000000..0c2a0178
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.equ.help
@@ -0,0 +1,145 @@
+max v2;
+#N vpatcher 82 103 798 578;
+#P message 482 408 99 196617 vasp buf==1 buf==2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 482 428 73 196617 p clear_buffer;
+#P newex 71 393 61 196617 vasp.== -1.;
+#P comment 332 310 43 196617 false/0;
+#P message 71 123 64 196617 vasp buf==1;
+#P newex 155 247 55 196617 vasp.= -1.;
+#P newex 92 247 55 196617 vasp.= 0.3;
+#P newex 218 214 55 196617 vasp.upper;
+#P newex 155 214 58 196617 vasp.lower;
+#P newex 218 247 59 196617 vasp.!bevel;
+#P newex 92 214 55 196617 vasp.upper;
+#P newex 31 214 58 196617 vasp.lower;
+#P newex 121 302 61 196617 vasp.update;
+#P newex 31 247 55 196617 vasp.bevel;
+#P newex 182 187 55 196617 vasp.upper;
+#P newex 71 187 58 196617 vasp.lower;
+#P newex 71 154 121 196617 vasp.m 2;
+#P newex 71 368 73 196617 vasp.= buf==1;
+#P message 71 338 64 196617 vasp buf==2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 375 80 49 196617 p wfkeys;
+#P hidden message 375 241 55 196617 set buf==2;
+#P user waveform~ 375 262 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 583 428 104 196617 buffer~ buf==2 2000;
+#P hidden message 375 119 55 196617 set buf==1;
+#P hidden newex 375 100 45 196617 loadbang;
+#P user waveform~ 375 137 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 71 428 61 196617 vasp.update;
+#P newex 583 408 104 196617 buffer~ buf==1 2000;
+#P comment 45 80 147 196617 argument/right inlet: value;
+#P comment 45 65 45 196617 equal;
+#P comment 45 41 71 196622 vasp.==;
+#P comment 176 125 92 196617 generate a function;
+#P comment 334 267 40 196617 true/1;
+#P comment 148 396 216 196617 test if a part of the function is equal to -1.;
+#P fasten 18 0 22 0 76 209 36 209;
+#P connect 22 0 20 0;
+#P connect 29 0 17 0;
+#P connect 17 0 18 0;
+#P connect 15 0 16 0;
+#P connect 16 0 31 0;
+#P connect 31 0 7 0;
+#P fasten 18 0 23 0 76 209 97 209;
+#P connect 23 0 27 0;
+#P fasten 24 0 21 0 223 283 126 283;
+#P fasten 20 0 21 0 36 283 126 283;
+#P fasten 27 0 21 0 97 283 126 283;
+#P fasten 28 0 21 0 160 283 126 283;
+#P fasten 19 0 25 0 187 209 160 209;
+#P connect 25 0 28 0;
+#P connect 17 1 19 0;
+#P fasten 19 0 26 0 187 209 223 209;
+#P connect 26 0 24 0;
+#P hidden connect 9 0 10 0;
+#P hidden connect 14 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden fasten 9 0 13 0 380 100 380 100;
+#P hidden connect 13 0 12 0;
+#P hidden connect 14 0 12 0;
+#P connect 33 0 32 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.exp.help b/externals/grill/vasp/max-help/vasp.exp.help
new file mode 100755
index 00000000..fa00c09d
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.exp.help
@@ -0,0 +1,96 @@
+max v2;
+#N vpatcher 248 135 854 471;
+#P message 400 259 62 196617 vasp bufexp;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 400 282 73 196617 p clear_buffer;
+#P newex 41 282 61 196617 vasp.update;
+#P newex 41 164 55 196617 vasp.* 0.5;
+#P newex 41 185 61 196617 vasp.update;
+#P comment 38 58 85 196617 e^sample;
+#P message 41 210 62 196617 vasp bufexp;
+#P newex 41 233 48 196617 vasp.exp;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 268 54 49 196617 p wfkeys;
+#P hidden message 268 100 55 196617 set bufexp;
+#P hidden newex 268 76 45 196617 loadbang;
+#P user waveform~ 268 126 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 41 259 45 196617 vasp.opt;
+#P message 41 116 62 196617 vasp bufexp;
+#P newex 477 282 102 196617 buffer~ bufexp 2000;
+#P newex 41 143 80 196617 vasp.osc 22050;
+#P comment 38 34 89 196622 vasp.exp;
+#P comment 106 117 123 196617 generate a 1hz sine wave;
+#P comment 38 73 100 196617 exponential function;
+#P connect 5 0 3 0;
+#P connect 3 0 15 0;
+#P connect 15 0 14 0;
+#P connect 12 0 11 0;
+#P connect 11 0 6 0;
+#P connect 6 0 16 0;
+#P hidden connect 8 0 9 0;
+#P hidden connect 9 0 7 0;
+#P hidden connect 10 0 7 0;
+#P connect 18 0 17 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.fhp.help b/externals/grill/vasp/max-help/vasp.fhp.help
new file mode 100755
index 00000000..2f76a6cc
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.fhp.help
@@ -0,0 +1,138 @@
+max v2;
+#N vpatcher 228 129 899 595;
+#P message 466 372 55 196617 vasp bufhp;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 466 392 73 196617 p clear_buffer;
+#P comment 196 241 44 196617 q-faktor;
+#N vpatcher 169 125 534 375;
+#P flonum 70 179 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 125 27 196617 t b f;
+#P message 309 151 27 196617 stop;
+#P message 243 151 65 196617 startwindow;
+#P newex 243 173 29 196617 dac~;
+#P comment 141 175 83 196617 period length in samples (float);
+#P flonum 88 97 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 147 27 196617 / 1.;
+#P flonum 68 73 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 54 49 53 196617 dspstate~;
+#P comment 133 98 100 196617 frequency in Hz;
+#P connect 1 1 2 0;
+#P fasten 4 0 9 0 93 118 75 118;
+#P fasten 2 0 3 0 73 115 54 115 54 145 75 145;
+#P connect 9 0 3 0;
+#P connect 3 0 10 0;
+#P connect 9 1 3 1;
+#P fasten 8 0 6 0 314 169 248 169;
+#P connect 7 0 6 0;
+#P pop;
+#P newobj 45 391 109 196617 p Hz_to_period_length;
+#P number 195 255 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P flonum 137 255 45 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 137 276 68 196617 pack 0 0;
+#P comment 38 88 266 196617 second argument: q-factor from 1 - ° (integer) default 1;
+#P newex 45 322 61 196617 vasp.update;
+#P message 45 255 55 196617 vasp bufhp;
+#P newex 45 301 65 196617 vasp.fhp 220;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 328 100 49 196617 p wfkeys;
+#P message 287 392 27 196617 stop;
+#P message 219 392 65 196617 startwindow;
+#P newex 328 418 29 196617 dac~;
+#P newex 328 366 30 196617 line~;
+#P message 328 343 72 196617 0 \, 2000 2000;
+#P newex 328 391 60 196617 play~ bufhp;
+#P hidden message 328 142 49 196617 set bufhp;
+#P hidden newex 328 122 45 196617 loadbang;
+#P user waveform~ 328 162 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 45 194 55 196617 vasp.* 0.5;
+#P newex 45 216 61 196617 vasp.update;
+#P message 45 151 55 196617 vasp bufhp;
+#P newex 544 391 95 196617 buffer~ bufhp 2000;
+#P newex 45 172 55 196617 vasp.noise;
+#P comment 38 58 136 196617 vasp high pass filter (FIR);
+#P comment 38 34 89 196622 vasp.fhp;
+#P comment 109 152 99 196617 generate white noise;
+#P comment 38 73 224 196617 first argument: cutoff frequency in period length;
+#P comment 137 241 36 196617 cutoff;
+#P comment 38 103 185 196617 right inlet: cutoff and q-factor (list);
+#P connect 8 0 6 0;
+#P connect 6 0 10 0;
+#P connect 10 0 9 0;
+#P connect 22 0 21 0;
+#P connect 21 0 23 0;
+#P fasten 25 0 21 1 142 297 105 297;
+#P connect 26 0 25 0;
+#P connect 27 0 25 1;
+#P hidden connect 12 0 13 0;
+#P hidden connect 20 0 11 0;
+#P hidden connect 13 0 11 0;
+#P connect 15 0 16 0;
+#P connect 16 0 14 0;
+#P connect 14 0 17 0;
+#P fasten 19 0 17 0 292 410 333 410;
+#P fasten 18 0 17 0 224 410 333 410;
+#P connect 14 0 17 1;
+#P connect 31 0 30 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.flp.help b/externals/grill/vasp/max-help/vasp.flp.help
new file mode 100755
index 00000000..89a88590
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.flp.help
@@ -0,0 +1,138 @@
+max v2;
+#N vpatcher 176 195 828 655;
+#P message 458 375 54 196617 vasp buflp;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 458 394 73 196617 p clear_buffer;
+#P comment 214 247 44 196617 q-faktor;
+#N vpatcher 169 125 534 375;
+#P flonum 70 179 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 125 27 196617 t b f;
+#P message 309 151 27 196617 stop;
+#P message 243 151 65 196617 startwindow;
+#P newex 243 173 29 196617 dac~;
+#P comment 141 175 83 196617 period length in samples (float);
+#P flonum 88 97 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 147 27 196617 / 1.;
+#P flonum 68 73 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 54 49 53 196617 dspstate~;
+#P comment 133 98 100 196617 frequency in Hz;
+#P connect 1 1 2 0;
+#P fasten 4 0 9 0 93 118 75 118;
+#P fasten 2 0 3 0 73 115 54 115 54 145 75 145;
+#P connect 9 0 3 0;
+#P connect 3 0 10 0;
+#P connect 9 1 3 1;
+#P fasten 8 0 6 0 314 169 248 169;
+#P connect 7 0 6 0;
+#P pop;
+#P newobj 51 394 109 196617 p Hz_to_period_length;
+#P number 213 261 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P flonum 155 261 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 155 280 68 196617 pack 0. 0;
+#P comment 46 90 266 196617 second argument: q-factor from 1 - ° (integer) default 1;
+#P newex 54 329 61 196617 vasp.update;
+#P message 54 261 54 196617 vasp buflp;
+#P newex 54 307 65 196617 vasp.flp 220;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 318 95 49 196617 p wfkeys;
+#P message 277 396 27 196617 stop;
+#P message 209 396 65 196617 startwindow;
+#P newex 318 421 29 196617 dac~;
+#P newex 318 369 30 196617 line~;
+#P message 318 346 72 196617 0 \, 2000 2000;
+#P newex 318 394 58 196617 play~ buflp;
+#P hidden message 318 137 45 196617 set buflp;
+#P hidden newex 318 117 45 196617 loadbang;
+#P user waveform~ 318 157 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 54 197 55 196617 vasp.* 0.5;
+#P newex 54 219 61 196617 vasp.update;
+#P message 54 154 54 196617 vasp buflp;
+#P newex 536 394 94 196617 buffer~ buflp 2000;
+#P newex 54 175 55 196617 vasp.noise;
+#P comment 46 60 136 196617 vasp low pass filter (FIR);
+#P comment 46 36 89 196622 vasp.flp;
+#P comment 114 155 99 196617 generate white noise;
+#P comment 46 75 225 196617 first argument: cutoff frequency in period length;
+#P comment 155 247 36 196617 cutoff;
+#P comment 46 105 185 196617 right inlet: cutoff and q-factor (list);
+#P connect 8 0 6 0;
+#P connect 6 0 10 0;
+#P connect 10 0 9 0;
+#P connect 22 0 21 0;
+#P connect 21 0 23 0;
+#P fasten 25 0 21 1 160 303 114 303;
+#P connect 26 0 25 0;
+#P connect 27 0 25 1;
+#P hidden connect 12 0 13 0;
+#P hidden connect 20 0 11 0;
+#P hidden connect 13 0 11 0;
+#P connect 15 0 16 0;
+#P connect 16 0 14 0;
+#P connect 14 0 17 0;
+#P fasten 19 0 17 0 282 416 323 416;
+#P fasten 18 0 17 0 214 416 323 416;
+#P connect 14 0 17 1;
+#P connect 31 0 30 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.frames.help b/externals/grill/vasp/max-help/vasp.frames.help
new file mode 100755
index 00000000..c0820a2a
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.frames.help
@@ -0,0 +1,134 @@
+max v2;
+#N vpatcher 130 118 966 571;
+#P message 575 384 119 196617 vasp buffram1 buffram2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 575 404 78 196617 p clear_buffers;
+#P hidden message 447 180 22 196617 set;
+#P hidden message 500 229 65 196617 set buffram2;
+#P newex 251 332 61 196617 vasp.update;
+#P newex 251 310 80 196617 vasp.osc 22050;
+#P user waveform~ 500 248 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 500 69 49 196617 p wfkeys;
+#P hidden message 500 110 65 196617 set buffram1;
+#P hidden newex 500 89 45 196617 loadbang;
+#P user waveform~ 500 127 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 64 332 61 196617 vasp.update;
+#P newex 64 310 80 196617 vasp.osc 22050;
+#P number 336 197 47 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 698 404 114 196617 buffer~ buffram2 2000;
+#P newex 698 384 114 196617 buffer~ buffram1 2000;
+#P message 262 275 222 196617;
+#P newex 262 243 60 196617 prepend set;
+#P message 251 170 152 196617 vasp buffram1 buffram2 11050;
+#P newex 251 218 95 196617 vasp.frames 22050;
+#P message 75 275 137 196617;
+#P newex 75 243 60 196617 prepend set;
+#P message 64 170 74 196617 vasp buffram1;
+#P newex 64 218 95 196617 vasp.frames 30000;
+#P comment 59 90 182 196617 argument/right inlet: value in samples;
+#P comment 59 75 178 196617 set the number of frames to a vasp;
+#P comment 59 50 116 196622 vasp.frames;
+#P comment 59 105 265 196617 !!!all vectors of a vasp have the same framesize/length!!!;
+#P connect 5 0 4 0;
+#P connect 4 0 15 0;
+#P connect 15 0 16 0;
+#P fasten 4 0 6 0 69 239 80 239;
+#P hidden fasten 25 0 7 0 452 263 80 263;
+#P connect 6 0 7 0;
+#P connect 9 0 8 0;
+#P connect 8 0 22 0;
+#P connect 22 0 23 0;
+#P fasten 8 0 10 0 256 239 267 239;
+#P hidden fasten 25 0 11 0 452 264 267 264;
+#P connect 10 0 11 0;
+#P connect 14 0 8 1;
+#P hidden fasten 18 0 25 0 505 132 452 132;
+#P hidden connect 18 0 19 0;
+#P hidden connect 19 0 17 0;
+#P hidden connect 20 0 17 0;
+#P hidden connect 18 0 24 0;
+#P hidden connect 24 0 21 0;
+#P connect 27 0 26 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.framesd.help b/externals/grill/vasp/max-help/vasp.framesd.help
new file mode 100755
index 00000000..ac6bf358
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.framesd.help
@@ -0,0 +1,134 @@
+max v2;
+#N vpatcher 82 104 939 544;
+#P message 593 369 113 196617 vasp buffram buffram+;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 593 389 78 196617 p clear_buffers;
+#P hidden message 449 191 22 196617 set;
+#P hidden message 514 223 65 196617 set buffram+;
+#P newex 253 325 61 196617 vasp.update;
+#P newex 253 304 80 196617 vasp.osc 22050;
+#P user waveform~ 514 241 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 514 60 49 196617 p wfkeys;
+#P hidden message 514 104 61 196617 set buffram;
+#P hidden newex 514 82 45 196617 loadbang;
+#P user waveform~ 514 122 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 66 325 61 196617 vasp.update;
+#P newex 66 304 80 196617 vasp.osc 22050;
+#P number 346 191 47 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 711 389 114 196617 buffer~ buffram+ 2000;
+#P newex 711 369 114 196617 buffer~ buffram 2000;
+#P message 264 269 222 196617;
+#P newex 264 237 60 196617 prepend set;
+#P message 253 164 179 196617 vasp 20000 buffram buffram+ 44100;
+#P newex 253 212 103 196617 vasp.frames+ 22050;
+#P message 77 269 137 196617;
+#P newex 77 237 60 196617 prepend set;
+#P message 66 164 101 196617 vasp 20000 buffram;
+#P newex 66 212 103 196617 vasp.frames+ 30000;
+#P comment 59 89 182 196617 argument/right inlet: value in samples;
+#P comment 59 75 255 196617 change the number of frames of a vasp (incrementally);
+#P comment 59 50 111 196622 vasp.frames+;
+#P comment 59 104 265 196617 !!!all vectors of a vasp have the same framesize/length!!!;
+#P connect 5 0 4 0;
+#P connect 4 0 15 0;
+#P connect 15 0 16 0;
+#P fasten 4 0 6 0 71 233 82 233;
+#P hidden fasten 25 0 7 0 454 260 82 260;
+#P connect 6 0 7 0;
+#P connect 9 0 8 0;
+#P connect 8 0 22 0;
+#P connect 22 0 23 0;
+#P fasten 8 0 10 0 258 233 269 233;
+#P hidden fasten 25 0 11 0 454 259 269 259;
+#P connect 10 0 11 0;
+#P connect 14 0 8 1;
+#P hidden fasten 18 0 25 0 519 120 454 120;
+#P hidden connect 18 0 19 0;
+#P hidden connect 20 0 17 0;
+#P hidden connect 19 0 17 0;
+#P hidden connect 18 0 24 0;
+#P hidden connect 24 0 21 0;
+#P connect 27 0 26 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.framesq.help b/externals/grill/vasp/max-help/vasp.framesq.help
new file mode 100755
index 00000000..a546e86d
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.framesq.help
@@ -0,0 +1,25 @@
+max v2;
+#N vpatcher 203 190 781 540;
+#P comment 45 129 101 196617 get the vasps length;
+#P comment 334 129 206 196617 get the maximum vasp length of both buffers;
+#P message 334 154 125 196617 vasp buffram? buffram?1;
+#P number 334 210 42 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 334 180 70 196617 vasp.frames?;
+#P newex 418 296 120 196617 buffer~ buffram?1 1000;
+#P number 192 210 42 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P number 45 210 42 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 418 273 120 196617 buffer~ buffram? 2000;
+#P message 192 154 74 196617 vasp buffram?;
+#P newex 192 180 70 196617 vasp.frames?;
+#P message 45 154 115 196617 vasp 400 buffram? 300;
+#P newex 45 180 70 196617 vasp.frames?;
+#P comment 42 75 216 196617 get a vasp«s frame count (length) in samples;
+#P comment 42 51 130 196622 vasp.frames?;
+#P comment 192 129 101 196617 get the buffer length;
+#P connect 4 0 3 0;
+#P connect 3 0 8 0;
+#P connect 6 0 5 0;
+#P connect 5 0 9 0;
+#P connect 13 0 11 0;
+#P connect 11 0 12 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.gate.help b/externals/grill/vasp/max-help/vasp.gate.help
new file mode 100755
index 00000000..0ab025a2
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.gate.help
@@ -0,0 +1,166 @@
+max v2;
+#N vpatcher 181 114 885 642;
+#P message 429 422 113 196617 vasp bufgate1 bufgate2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 429 442 78 196617 p clear_buffers;
+#P hidden newex 549 391 48 196617 r 1159path;
+#P user umenu 80 139 72 196647 1 64 155 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1159path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 142 161 43 196617 p loader;
+#P comment 52 141 26 196617 read;
+#P comment 163 349 32 196617 value;
+#P comment 139 321 112 196617 gate the buffer content;
+#P newex 66 225 61 196617 vasp.update;
+#P newex 66 404 61 196617 vasp.update;
+#P flonum 125 348 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P message 66 320 71 196617 vasp bufgate2;
+#P newex 66 375 69 196617 vasp.gate 0.2;
+#P message 308 443 27 196617 stop;
+#P message 240 443 65 196617 startwindow;
+#P newex 349 467 29 196617 dac~;
+#P newex 349 422 30 196617 line~;
+#P message 349 387 72 196617 0 \, 2000 2000;
+#P newex 349 442 75 196617 play~ bufgate2;
+#P message 66 181 71 196617 vasp bufgate2;
+#P newex 66 202 104 196617 vasp.= vasp bufgate1;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 349 92 49 196617 p wfkeys;
+#P hidden message 349 247 64 196617 set bufgate2;
+#P user waveform~ 349 265 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 549 442 111 196617 buffer~ bufgate2 2000;
+#P hidden message 349 127 64 196617 set bufgate1;
+#P hidden newex 349 109 45 196617 loadbang;
+#P user waveform~ 349 145 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 549 422 111 196617 buffer~ bufgate1 2000;
+#P comment 52 87 369 196617 optional argument/right inlet: value (usualy from 0-1) to gate the soundfile;
+#P comment 52 70 168 196617 gate a buffer content with a value;
+#P comment 52 48 89 196622 vasp.gate;
+#P comment 141 181 161 196617 copy from buffgate1 to buffgate2;
+#P connect 13 0 12 0;
+#P connect 12 0 24 0;
+#P connect 21 0 20 0;
+#P connect 20 0 23 0;
+#P connect 22 0 20 1;
+#P hidden connect 29 1 28 0;
+#P hidden fasten 6 0 7 0 354 108 354 108;
+#P hidden fasten 4 1 7 0 655 440 680 440 680 123 354 123;
+#P hidden connect 11 0 5 0;
+#P hidden connect 7 0 5 0;
+#P hidden fasten 6 0 10 0 354 108 354 108;
+#P hidden fasten 8 1 10 0 655 461 680 461 680 252 354 252;
+#P hidden connect 10 0 9 0;
+#P hidden connect 11 0 9 0;
+#P connect 15 0 16 0;
+#P connect 16 0 14 0;
+#P connect 14 0 17 0;
+#P fasten 18 0 17 0 245 461 354 461;
+#P fasten 19 0 17 0 313 461 354 461;
+#P connect 14 0 17 1;
+#P connect 32 0 31 0;
+#P hidden connect 30 0 4 0;
+#P hidden fasten 9 5 5 4 654 368 665 368 665 139 654 139;
+#P hidden connect 5 5 9 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.gather.help b/externals/grill/vasp/max-help/vasp.gather.help
new file mode 100755
index 00000000..e1942f69
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.gather.help
@@ -0,0 +1,65 @@
+max v2;
+#N vpatcher 167 74 879 653;
+#P origin 0 5;
+#P hidden message 615 229 22 196617 set;
+#P hidden newex 615 195 45 196617 loadbang;
+#P message 406 242 81 196617 vasp bufgather4;
+#P message 393 221 81 196617 vasp bufgather3;
+#P button 342 178 15 0;
+#P message 381 201 81 196617 vasp bufgather2;
+#P message 342 314 341 196617;
+#P newex 342 291 60 196617 prepend set;
+#P newex 342 267 61 196617 vasp.gather;
+#P message 371 178 81 196617 vasp bufgather1;
+#P comment 336 160 276 196617 gather as many vasps as you want and put them out (bang);
+#P message 138 450 81 196617 vasp bufgather4;
+#P newex 562 522 121 196617 buffer~ bufgather4 2000;
+#P message 179 178 81 196617 vasp bufgather2;
+#P button 65 178 15 0;
+#P message 65 314 252 196617;
+#P newex 65 291 60 196617 prepend set;
+#P newex 65 267 61 196617 vasp.gather;
+#P message 87 178 81 196617 vasp bufgather1;
+#P message 125 429 81 196617 vasp bufgather3;
+#P button 65 386 15 0;
+#P message 113 409 81 196617 vasp bufgather2;
+#P newex 562 501 121 196617 buffer~ bufgather3 2000;
+#P newex 562 479 121 196617 buffer~ bufgather2 2000;
+#P newex 562 458 121 196617 buffer~ bufgather1 1000;
+#P message 65 522 258 196617;
+#P newex 65 499 60 196617 prepend set;
+#P newex 65 475 70 196617 vasp.gather 2;
+#P comment 59 74 137 196617 gather several vasps into one;
+#P message 103 386 81 196617 vasp bufgather1;
+#P comment 59 50 89 196622 vasp.gather;
+#P comment 59 90 190 196617 argument: vasps to gather before output;
+#P comment 59 121 241 196617 right inlet: stores the different vasps;
+#P comment 59 106 419 196617 left inlet: outputs a vasp immediately \, causes output of vasps gathered in right inlet (bang);
+#P comment 59 160 196 196617 use vasp.gather like the int/float object;
+#P comment 59 366 227 196617 gather two vasps (opt. argument) an put them out;
+#P comment 360 377 243 196617 !vasps can have more vectors \, but just one length!;
+#P comment 360 393 245 196617 gather will always take the length from the shortest of all gathered vasps for the new one!;
+#P fasten 19 0 20 0 92 260 70 260;
+#P fasten 23 0 20 0 70 217 70 217;
+#P connect 20 0 21 0;
+#P hidden fasten 37 0 22 0 620 310 70 310;
+#P connect 21 0 22 0;
+#P connect 17 0 10 0;
+#P connect 10 0 11 0;
+#P hidden fasten 37 0 12 0 620 336 314 336 314 519 70 519;
+#P connect 11 0 12 0;
+#P fasten 24 0 20 1 184 259 121 259;
+#P connect 18 0 10 1;
+#P fasten 16 0 10 1 118 469 130 469;
+#P fasten 8 0 10 1 108 469 130 469;
+#P fasten 26 0 10 1 143 469 130 469;
+#P connect 33 0 29 0;
+#P connect 29 0 30 0;
+#P connect 30 0 31 0;
+#P hidden fasten 37 0 31 0 620 311 347 311;
+#P connect 34 0 29 1;
+#P fasten 32 0 29 1 386 262 398 262;
+#P fasten 28 0 29 1 376 262 398 262;
+#P fasten 35 0 29 1 411 262 398 262;
+#P hidden connect 36 0 37 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.geq.help b/externals/grill/vasp/max-help/vasp.geq.help
new file mode 100755
index 00000000..0a8912b6
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.geq.help
@@ -0,0 +1,128 @@
+max v2;
+#N vpatcher 188 104 857 525;
+#P message 437 352 91 196617 vasp buf>= buf>=1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 437 373 78 196617 p clear_buffers;
+#P newex 59 327 61 196617 vasp.update;
+#P flonum 149 272 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 274 286 48 196617 0/false;
+#P comment 129 145 148 196617 generate a sine wave at 1Hz;
+#P message 59 145 55 196617 vasp buf>=;
+#P newex 59 191 61 196617 vasp.update;
+#P newex 59 168 80 196617 vasp.osc 44100;
+#P comment 129 228 100 196617 copy to new buffer;
+#P hidden message 321 219 55 196617 set buf>=1;
+#P user waveform~ 321 237 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 530 373 103 196617 buffer~ buf>=1 2000;
+#P comment 52 86 188 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 50 196617 set buf>=;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 296 65 196617 vasp.>= -0.4;
+#P message 59 228 63 196617 vasp buf>=1;
+#P newex 530 352 103 196617 buffer~ buf>= 2000;
+#P newex 59 249 65 196617 vasp.= buf>=;
+#P comment 52 71 83 196617 sample >= value;
+#P comment 52 48 89 196622 vasp.>=;
+#P comment 598 103 44 196617 source;
+#P comment 277 244 44 196617 1/true;
+#P connect 19 0 17 0;
+#P connect 17 0 18 0;
+#P connect 6 0 4 0;
+#P connect 4 0 7 0;
+#P connect 7 0 23 0;
+#P fasten 22 0 7 1 154 292 119 292;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 628 371 638 371 638 94 326 94;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 15 0;
+#P hidden connect 11 0 14 0;
+#P hidden connect 15 0 14 0;
+#P connect 25 0 24 0;
+#P hidden fasten 14 5 8 4 626 340 638 340 638 94 626 94;
+#P hidden connect 8 5 14 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.gtr.help b/externals/grill/vasp/max-help/vasp.gtr.help
new file mode 100755
index 00000000..d3614b83
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.gtr.help
@@ -0,0 +1,128 @@
+max v2;
+#N vpatcher 40 55 709 476;
+#P message 446 353 79 196617 vasp buf> buf>1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 446 373 78 196617 p clear_buffers;
+#P newex 59 327 61 196617 vasp.update;
+#P flonum 149 272 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 274 286 48 196617 0/false;
+#P comment 114 145 148 196617 generate a sine wave at 1Hz;
+#P message 59 145 51 196617 vasp buf>;
+#P newex 59 191 61 196617 vasp.update;
+#P newex 59 168 80 196617 vasp.osc 44100;
+#P comment 118 228 100 196617 copy to new buffer;
+#P hidden message 321 219 50 196617 set buf>1;
+#P user waveform~ 321 237 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 538 373 95 196617 buffer~ buf>1 2000;
+#P comment 52 86 134 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 44 196617 set buf>;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 296 60 196617 vasp.> -0.4;
+#P message 59 228 55 196617 vasp buf>1;
+#P newex 538 353 95 196617 buffer~ buf> 2000;
+#P newex 59 249 60 196617 vasp.= buf>;
+#P comment 52 71 83 196617 sample > value;
+#P comment 52 48 89 196622 vasp.>;
+#P comment 598 103 44 196617 source;
+#P comment 277 244 44 196617 1/true;
+#P connect 19 0 17 0;
+#P connect 17 0 18 0;
+#P connect 6 0 4 0;
+#P connect 4 0 7 0;
+#P connect 7 0 23 0;
+#P fasten 22 0 7 1 154 292 114 292;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 628 371 638 371 638 94 326 94;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 15 0;
+#P hidden connect 11 0 14 0;
+#P hidden connect 15 0 14 0;
+#P connect 25 0 24 0;
+#P hidden fasten 14 5 8 4 626 340 638 340 638 94 626 94;
+#P hidden connect 8 5 14 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.help b/externals/grill/vasp/max-help/vasp.help
new file mode 100755
index 00000000..a03f562b
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.help
@@ -0,0 +1,710 @@
+max v2;
+#N vpatcher 20 50 720 450;
+#P origin 32 21;
+#P hidden message 456 87 200 196617 window size 20 50 720 450 \, window exec;
+#N thispatcher;
+#Q end;
+#P hidden newobj 511 108 59 196617 thispatcher;
+#P hidden newex 409 28 45 196617 loadbang;
+#P hidden message 409 51 84 196617 read vasplogo.tif;
+#P user fpic 488 21 186 57 vasplogo.tif 0 0 0 0. 0 0 0;
+#N vpatcher 93 94 908 393;
+#P comment 443 224 237 196617 don't miss that!;
+#P comment 134 257 166 196617 http://www.canto-crudo.com/;
+#P comment 443 190 237 196617 comparable (but more extensive) functionality;
+#P comment 64 52 50 196617 about fft:;
+#P comment 134 190 255 196617 http://www.bath.ac.uk/~masjpf/CDP/CDP.htm;
+#P comment 84 190 28 196617 CDP:;
+#P comment 134 113 255 196617 http://sepwww.stanford.edu/oldsep/hale/FftLab.html;
+#P comment 443 113 73 196617 very useful;
+#P comment 134 151 225 196617 http://www.fftw.org/links.html;
+#P comment 443 151 92 196617 more fft links;
+#P comment 443 80 95 196617 introduction to fft;
+#P comment 134 80 225 196617 http://www.eptools.com/tn/T0001/INDEX.HTM;
+#P comment 20 224 92 196617 Numerical Recipes:;
+#P comment 134 224 272 196617 http://www.nr.com/;
+#P comment 443 49 305 196617 the author (marius schebella) also handles the documentation for the pure data port of vasp;
+#P comment 134 52 299 196617 http://www.parasitaere-kapazitaeten.net/Pd/fft_und_pd.htm;
+#P comment 44 257 68 196617 gŸnther rabl :;
+#P comment 28 22 107 196622 vasp_links;
+#P pop;
+#P newobj 570 248 35 196617 p links;
+#P comment 509 250 59 196617 useful links;
+#P comment 45 136 469 196617 consisting of functions to generate and modify buffer content in a non-realtime context.;
+#P comment 386 250 55 196617 vasps units;
+#N vpatcher 71 356 541 680;
+#N vpatcher 442 226 781 479;
+#P comment 114 90 102 196617 current sampling rate;
+#P flonum 68 194 54 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 68 141 27 196617 t b f;
+#P message 267 140 27 196617 stop;
+#P message 201 140 65 196617 startwindow;
+#P newex 201 163 29 196617 dac~;
+#P comment 126 195 64 196617 period length;
+#P flonum 68 113 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 68 163 27 196617 / 1.;
+#P flonum 56 89 54 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 42 65 53 196617 dspstate~;
+#P comment 126 115 80 196617 frequency in Hz;
+#P comment 20 21 170 196622 Hz_to_period_length;
+#P connect 2 1 3 0;
+#P fasten 5 0 10 0 73 134 73 134;
+#P fasten 3 0 4 0 61 108 61 108 61 160 73 160;
+#P connect 10 0 4 0;
+#P connect 4 0 11 0;
+#P connect 10 1 4 1;
+#P fasten 9 0 7 0 272 159 206 159;
+#P connect 8 0 7 0;
+#P pop;
+#P newobj 123 280 109 196617 p Hz_to_period_length;
+#P comment 103 262 301 196617 sample rate/frequency in Hz = frequency in period length (float);
+#P comment 60 245 234 196617 - frequencies are always defined in period lengths;
+#P message 122 197 125 196617 vasp 44100 buf1 22050 0;
+#P comment 103 171 305 196617 e.g: vasp message with an offset of 0.5 sec. and a length of 1 sec. (sr 44100);
+#P comment 60 155 366 196617 - lengths and offsets are always defined in samples (depending on sample rate);
+#P message 123 102 125 196617 vasp 44100 buf1 22050 0;
+#P comment 60 69 182 196617 - vasp index counting starts from 0;
+#P comment 38 24 106 196622 vasp_units;
+#P comment 103 84 313 196617 e.g: channel 0 in a vasp message means first channel in the buffer;
+#P pop;
+#P newobj 446 248 38 196617 p units;
+#P comment 218 250 78 196617 the vasp objects;
+#P comment 45 250 83 196617 the vasp message;
+#N vpatcher 740 49 953 357;
+#N vpatcher 119 475 293 627;
+#P origin 0 23;
+#P newex 21 21 39 196617 r ohelp;
+#P newex 21 41 78 196617 prepend symbol;
+#P newex 21 92 45 196617 pcontrol;
+#P message 21 67 41 196617 help \$1;
+#P connect 3 0 2 0;
+#P connect 2 0 0 0;
+#P connect 0 0 1 0;
+#P pop;
+#P hidden newobj 60 274 54 196617 p openhelp;
+#N vpatcher 306 143 730 390;
+#P comment 132 137 195 196617 rotate buffer content symmetrically;
+#P message 67 137 52 196617 vasp.xrot;
+#P message 67 193 59 196617 vasp.xmirr;
+#P message 67 164 53 196617 vasp.mirr;
+#P message 67 110 45 196617 vasp.rot;
+#P message 67 81 59 196617 vasp.xshift;
+#P message 67 52 53 196617 vasp.shift;
+#P hidden newex 319 205 39 196617 s ohelp;
+#P comment 132 193 171 196617 mirrors a vasp symmetrically;
+#P comment 131 81 228 196617 shifts the buffer content symetrically;
+#P comment 132 164 171 196617 mirrors a vasp;
+#P comment 132 52 222 196617 shifts the buffer content;
+#P comment 132 110 100 196617 rotate buffer content;
+#P comment 43 23 131 196622 vasp.displace;
+#P hidden connect 11 0 6 0;
+#P hidden connect 10 0 6 0;
+#P hidden connect 9 0 6 0;
+#P hidden connect 8 0 6 0;
+#P hidden connect 7 0 6 0;
+#P hidden connect 12 0 6 0;
+#P pop;
+#P newobj 60 178 75 196617 p vasp.displace;
+#N vpatcher 531 93 1020 661;
+#P origin 0 41;
+#P hidden newex 413 514 39 196617 s ohelp;
+#P message 62 522 51 196617 vasp.part;
+#P message 62 496 61 196617 vasp.gather;
+#P message 62 470 49 196617 vasp.spit;
+#P message 62 444 49 196617 vasp.join;
+#P message 62 418 52 196617 vasp.split;
+#P message 62 392 70 196617 vasp.frames?;
+#P message 62 366 70 196617 vasp.frames+;
+#P message 62 340 64 196617 vasp.frames;
+#P message 62 314 55 196617 vasp.offs?;
+#P message 62 288 55 196617 vasp.offs+;
+#P message 62 262 50 196617 vasp.offs;
+#P message 62 236 43 196617 vasp.n?;
+#P message 62 210 35 196617 vasp.n;
+#P message 62 184 40 196617 vasp.m;
+#P message 62 158 61 196617 vasp.update;
+#P message 62 132 53 196617 vasp.sync;
+#P message 62 106 45 196617 vasp.chk;
+#P message 62 80 44 196617 vasp.??;
+#P message 62 54 38 196617 vasp.?;
+#P comment 134 80 225 196617 output all non zero samples of a vasp as list;
+#P comment 134 496 252 196617 gather several vasps into one;
+#P comment 134 418 252 196617 split a vasp into its vectors;
+#P comment 134 470 252 196617 spit out vectors of a vasp (one vector after the other);
+#P comment 134 444 252 196617 join several vasps into one;
+#P comment 134 392 252 196617 get a vasps frame count;
+#P comment 134 366 252 196617 raise/lower a vasps frame count;
+#P comment 134 340 252 196617 set a vasps frame count;
+#P comment 134 314 252 196617 get a single vectored vasp«s offset(s) into the buffer;
+#P comment 134 288 252 196617 shift a vasp«s offset(s) into the vector buffers;
+#P comment 134 262 252 196617 set a vasp«s offset(s) into the vector buffers;
+#P comment 134 236 252 196617 get the number vectors of a vasp;
+#P comment 134 210 252 196617 get a vector of a vasp;
+#P comment 134 184 252 196617 output a vasp multiply;
+#P comment 134 54 186 196617 output the samples of a vasp as list;
+#P comment 134 106 110 196617 check vasp dimensions;
+#P comment 134 132 246 196617 sync 2 or more vasps;
+#P comment 134 158 252 196617 update the graphics of a patcher (e.g. waveform);
+#P comment 134 522 238 196617 output vasps with different lengths and offsets;
+#P comment 27 22 135 196622 define_vasps;
+#P hidden connect 22 0 39 0;
+#P hidden connect 38 0 39 0;
+#P hidden connect 37 0 39 0;
+#P hidden connect 36 0 39 0;
+#P hidden connect 35 0 39 0;
+#P hidden connect 34 0 39 0;
+#P hidden connect 33 0 39 0;
+#P hidden connect 32 0 39 0;
+#P hidden connect 31 0 39 0;
+#P hidden connect 30 0 39 0;
+#P hidden connect 29 0 39 0;
+#P hidden connect 28 0 39 0;
+#P hidden connect 27 0 39 0;
+#P hidden connect 26 0 39 0;
+#P hidden connect 25 0 39 0;
+#P hidden connect 24 0 39 0;
+#P hidden connect 23 0 39 0;
+#P hidden connect 21 0 39 0;
+#P hidden connect 20 0 39 0;
+#P pop;
+#P newobj 60 65 75 196617 p define_vasps;
+#N vpatcher 463 267 1141 534;
+#P message 63 228 52 196617 vasp.xtilt;
+#P comment 130 229 165 196617 symmetrical resampling;
+#P message 64 204 45 196617 vasp.tilt;
+#P comment 129 205 165 196617 resampling;
+#P message 279 81 60 196617 vasp.cnorm;
+#P message 483 109 70 196617 vasp.rvalleys;
+#P message 483 137 62 196617 vasp.rpeaks;
+#P message 483 81 51 196617 vasp.ropt;
+#P comment 559 109 83 196617 radius valleys;
+#P comment 559 137 83 196617 radius peaks;
+#P comment 559 81 83 196617 radius optimize;
+#P message 483 53 55 196617 vasp.rgate;
+#P comment 559 53 83 196617 radius gate;
+#P hidden newex 304 187 39 196617 s ohelp;
+#P message 64 165 60 196617 vasp.pwrap;
+#P message 64 137 55 196617 vasp.peaks;
+#P message 64 109 65 196617 vasp.valleys;
+#P message 64 81 45 196617 vasp.opt;
+#P message 64 53 51 196617 vasp.gate;
+#P comment 129 165 165 196617 wraps value from 0-2¹ to -¹ to ¹;
+#P comment 129 137 100 196617 local peaks of a vasp;
+#P comment 129 109 123 196617 local minima of a vasp;
+#P comment 129 81 134 196617 optimize buffer content;
+#P comment 129 53 171 196617 gates vasp under a value (amplitude);
+#P comment 26 25 144 196622 vasp_utilities;
+#P comment 341 81 125 196617 sets complex radius of all samples to unity;
+#P hidden connect 25 0 12 0;
+#P hidden connect 23 0 12 0;
+#P hidden connect 20 0 12 0;
+#P hidden connect 19 0 12 0;
+#P hidden connect 18 0 12 0;
+#P hidden connect 14 0 12 0;
+#P hidden connect 10 0 12 0;
+#P hidden connect 9 0 12 0;
+#P hidden connect 8 0 12 0;
+#P hidden connect 7 0 12 0;
+#P hidden connect 21 0 12 0;
+#P hidden connect 11 0 12 0;
+#P pop;
+#P newobj 60 246 75 196617 p vasp.utilities;
+#N vpatcher 195 285 765 547;
+#P origin 0 24;
+#P message 352 208 53 196617 vasp.rmin;
+#P message 352 182 55 196617 vasp.rmax;
+#P comment 426 208 83 196617 radius minimum;
+#P comment 426 182 83 196617 radius maximum;
+#P hidden newex 309 229 39 196617 s ohelp;
+#P message 63 208 48 196617 vasp.min;
+#P message 63 182 51 196617 vasp.max;
+#P message 63 156 55 196617 vasp.max?;
+#P message 63 130 54 196617 vasp.min?;
+#P message 63 104 62 196617 vasp.amax?;
+#P message 63 78 59 196617 vasp.amin?;
+#P message 352 156 62 196617 vasp.rmax?;
+#P message 352 130 59 196617 vasp.rmin?;
+#P message 63 52 65 196617 vasp.minmax;
+#P comment 139 208 171 196617 minimum of vasp and argument;
+#P comment 139 182 171 196617 maximum of vasp and argument;
+#P comment 139 130 131 196617 output min. value of a vasp;
+#P comment 139 156 131 196617 output max. value of a vasp;
+#P comment 139 104 172 196617 output max. absolute value of a vasp;
+#P comment 139 78 204 196617 output min. absolute value of a vasp;
+#P comment 426 156 99 196617 radius max. value;
+#P comment 426 130 96 196617 radius min. value;
+#P comment 139 54 228 196617 splits a vasp into minimum and maximum values;
+#P comment 27 23 140 196622 vasp_minmax_etc.;
+#P hidden connect 23 0 19 0;
+#P hidden connect 22 0 19 0;
+#P hidden connect 18 0 19 0;
+#P hidden connect 17 0 19 0;
+#P hidden connect 16 0 19 0;
+#P hidden connect 15 0 19 0;
+#P hidden connect 14 0 19 0;
+#P hidden connect 13 0 19 0;
+#P hidden connect 12 0 19 0;
+#P hidden connect 11 0 19 0;
+#P hidden connect 10 0 19 0;
+#P pop;
+#P newobj 60 223 98 196617 p vasp.minmax_etc.;
+#N vpatcher 480 321 1117 575;
+#P origin 0 27;
+#P comment 292 137 98 196617 complex sample^2;
+#P comment 292 112 148 196617 complex integer power function;
+#P comment 121 162 98 196617 square root;
+#P comment 121 188 87 196617 signed sample^2;
+#P message 230 112 58 196617 vasp.cpowi;
+#P message 230 137 52 196617 vasp.csqr;
+#P message 61 214 55 196617 vasp.ssqrt;
+#P message 61 188 52 196617 vasp.ssqr;
+#P message 61 162 51 196617 vasp.sqrt;
+#P message 61 137 45 196617 vasp.sqr;
+#P message 61 112 50 196617 vasp.pow;
+#P comment 121 214 98 196617 signed square root;
+#P comment 121 112 48 196617 samps^x;
+#P comment 121 137 70 196617 sample^2;
+#P message 448 112 55 196617 vasp.rpow;
+#P comment 504 112 112 196617 radius power function;
+#P hidden newex 346 206 39 196617 s ohelp;
+#P message 61 85 45 196617 vasp.log;
+#P message 61 55 48 196617 vasp.exp;
+#P comment 121 85 86 196617 logarithm;
+#P comment 121 55 84 196617 exponential;
+#P comment 27 22 143 196622 vasp_transcendent;
+#P hidden connect 3 0 5 0;
+#P hidden connect 4 0 5 0;
+#P hidden connect 11 0 5 0;
+#P hidden connect 12 0 5 0;
+#P hidden connect 13 0 5 0;
+#P hidden connect 14 0 5 0;
+#P hidden connect 15 0 5 0;
+#P hidden connect 17 0 5 0;
+#P hidden connect 16 0 5 0;
+#P hidden connect 7 0 5 0;
+#P pop;
+#P newobj 60 201 98 196617 p vasp.transcendent;
+#N vpatcher 508 79 1002 585;
+#P origin 0 26;
+#P message 251 114 45 196617 vasp.c!-;
+#P comment 125 112 100 196617 reverse subtraction;
+#P message 62 112 40 196617 vasp.!-;
+#P comment 126 439 100 196617 integral function;
+#P comment 126 462 100 196617 differential function;
+#P message 63 462 44 196617 vasp.dif;
+#P message 63 439 44 196617 vasp.int;
+#P message 336 70 43 196617 vasp.r+;
+#P comment 385 70 83 196617 radius offset;
+#P message 252 182 45 196617 vasp.c!/;
+#P comment 126 181 100 196617 reverse division;
+#P message 63 181 41 196617 vasp.!/;
+#P message 252 205 43 196617 vasp.c=;
+#P message 252 160 43 196617 vasp.c/;
+#P message 252 136 44 196617 vasp.c*;
+#P message 251 92 42 196617 vasp.c-;
+#P message 251 70 43 196617 vasp.c+;
+#P hidden newex 417 333 39 196617 s ohelp;
+#P message 63 416 50 196617 vasp.sign;
+#P message 63 394 41 196617 vasp.%;
+#P message 63 373 45 196617 vasp.abs;
+#P message 63 350 41 196617 vasp.!=;
+#P message 63 327 44 196617 vasp.==;
+#P message 63 304 43 196617 vasp.>=;
+#P message 63 280 43 196617 vasp.<=;
+#P message 63 256 35 196617 vasp.>;
+#P message 63 232 35 196617 vasp.<;
+#P message 63 207 38 196617 vasp.=;
+#P message 63 159 38 196617 vasp./;
+#P message 63 135 39 196617 vasp.*;
+#P message 62 92 35 196617 vasp.-;
+#P message 62 70 38 196617 vasp.+;
+#P comment 126 304 100 196617 vasp >= x;
+#P comment 126 280 100 196617 vasp >= x;
+#P comment 126 256 100 196617 vasp > x;
+#P comment 126 232 100 196617 vasp < x;
+#P comment 126 327 58 196617 equal to;
+#P comment 126 135 100 196617 multiplication;
+#P comment 126 159 100 196617 division;
+#P comment 125 92 100 196617 subtraction;
+#P comment 126 350 58 196617 not equal to;
+#P comment 126 394 158 196617 modulo (remainder of a division);
+#P comment 126 373 128 196617 absolute value of a vasp;
+#P comment 125 70 100 196617 addition;
+#P comment 251 49 73 196617 complex ....;
+#P comment 27 24 151 196622 vasp_arithmetic;
+#P comment 126 207 100 196617 vasp = x;
+#P comment 126 416 204 196617 values < 0 become -1 | values > 0 become 1;
+#P comment 336 49 100 196617 radius ....;
+#P hidden connect 43 0 31 0;
+#P hidden connect 42 0 31 0;
+#P hidden connect 41 0 31 0;
+#P hidden connect 39 0 31 0;
+#P hidden connect 37 0 31 0;
+#P hidden connect 36 0 31 0;
+#P hidden connect 35 0 31 0;
+#P hidden connect 34 0 31 0;
+#P hidden connect 33 0 31 0;
+#P hidden connect 32 0 31 0;
+#P hidden connect 30 0 31 0;
+#P hidden connect 29 0 31 0;
+#P hidden connect 28 0 31 0;
+#P hidden connect 27 0 31 0;
+#P hidden connect 26 0 31 0;
+#P hidden connect 25 0 31 0;
+#P hidden connect 23 0 31 0;
+#P hidden connect 21 0 31 0;
+#P hidden connect 19 0 31 0;
+#P hidden connect 18 0 31 0;
+#P hidden connect 17 0 31 0;
+#P hidden connect 20 0 31 0;
+#P hidden connect 22 0 31 0;
+#P hidden connect 24 0 31 0;
+#P hidden connect 46 0 31 0;
+#P hidden connect 48 0 31 0;
+#P pop;
+#P newobj 60 109 85 196617 p vasp.arithmetic;
+#N vpatcher 528 390 958 618;
+#P origin 25 0;
+#P message 234 86 52 196617 vasp.r!fft;
+#P message 234 59 49 196617 vasp.rfft;
+#P message 64 133 55 196617 vasp.polar;
+#P message 64 86 52 196617 vasp.c!fft;
+#P message 64 59 49 196617 vasp.cfft;
+#P hidden newex 309 192 39 196617 s ohelp;
+#P comment 121 133 238 196617 changes between cartesian and polar representation;
+#P comment 287 86 114 196617 inverse real fft;
+#P comment 121 59 100 196617 complex fft;
+#P comment 121 86 100 196617 inverse complex fft;
+#P comment 287 59 100 196617 real fft;
+#P comment 26 22 135 196622 vasp_fftobjects;
+#P comment 121 177 238 196617 changes between polar and cartesian representation;
+#P message 64 177 51 196617 vasp.rect;
+#P hidden fasten 11 0 8 0 69 161 314 161;
+#P hidden fasten 10 0 8 0 69 113 314 113;
+#P hidden fasten 9 0 8 0 69 78 314 78;
+#P hidden fasten 0 0 8 0 69 198 314 198;
+#P hidden fasten 12 0 8 0 239 113 314 113;
+#P hidden fasten 13 0 8 0 239 77 314 77;
+#P pop;
+#P newobj 60 87 85 196617 p vasp.fftobjects;
+#N vpatcher 506 170 738 299;
+#P origin 0 12;
+#P hidden newex 149 90 39 196617 s ohelp;
+#P message 65 79 44 196617 vasp.flp;
+#P message 65 53 45 196617 vasp.fhp;
+#P comment 116 79 100 196617 low pass;
+#P comment 116 53 100 196617 high pass;
+#P comment 24 21 117 196622 vasp_filters;
+#P hidden connect 4 0 5 0;
+#P hidden connect 3 0 5 0;
+#P pop;
+#P newobj 60 155 69 196617 p vasp.filters;
+#N vpatcher 193 174 800 440;
+#P origin 0 -227;
+#P hidden newex 371 208 39 196617 s ohelp;
+#P message 422 192 59 196617 vasp.*cosc;
+#P message 422 169 65 196617 vasp.*!bevel;
+#P message 422 146 63 196617 vasp.*bevel;
+#P message 422 100 69 196617 vasp.*phasor;
+#P message 422 77 54 196617 vasp.*osc;
+#P message 60 214 60 196617 vasp.cnoise;
+#P message 60 191 52 196617 vasp.cosc;
+#P message 60 168 59 196617 vasp.!bevel;
+#P message 60 145 55 196617 vasp.bevel;
+#P message 60 122 55 196617 vasp.noise;
+#P message 60 99 62 196617 vasp.phasor;
+#P message 60 76 45 196617 vasp.osc;
+#P comment 60 56 126 196617 generate .....;
+#P comment 128 169 120 196617 vasp ramp from 1- 0;
+#P comment 128 145 120 196617 vasp ramp from 0 - 1;
+#P comment 128 121 120 196617 vasp noise generator;
+#P comment 128 98 120 196617 vasp saw tooth generator;
+#P comment 128 75 126 196617 vasp sine wave generator;
+#P comment 292 59 283 196617 multiplies a buffer content with the oscillator functions ...;
+#P comment 128 217 140 196617 complex noise;
+#P comment 128 192 140 196617 complex sine wave;
+#P comment 26 22 138 196622 vasp_generators;
+#P hidden connect 21 0 22 0;
+#P hidden connect 20 0 22 0;
+#P hidden connect 19 0 22 0;
+#P hidden connect 18 0 22 0;
+#P hidden connect 17 0 22 0;
+#P hidden connect 16 0 22 0;
+#P hidden connect 15 0 22 0;
+#P hidden connect 14 0 22 0;
+#P hidden connect 13 0 22 0;
+#P hidden connect 12 0 22 0;
+#P hidden connect 11 0 22 0;
+#P hidden connect 10 0 22 0;
+#P pop;
+#P newobj 60 132 89 196617 p vasp.generators;
+#P comment 25 23 121 196622 vasp_objects;
+#P pop;
+#P newobj 301 248 49 196617 p objects;
+#P comment 45 152 478 196617 vasp objects are using a specialized message syntax for all objects to refer to a buffer or a part of it.;
+#N vpatcher 120 60 880 570;
+#P origin 0 97;
+#P comment 104 1341 139 196617 set all samples of buf5/6 to 0;
+#P message 246 1340 75 196617 vasp buf5 buf6;
+#P newex 246 1382 61 196617 vasp.update;
+#P newex 246 1360 45 196617 vasp.= 0;
+#P comment 38 1289 207 196617 and modulate the noise with a 4Hz sine wave;
+#P newex 246 1206 55 196617 vasp.* 0.5;
+#P hidden newex 494 37 45 196617 loadbang;
+#P comment 725 1385 13 196620 |||;
+#P newex 517 1384 92 196617 buffer~ buf6 2000;
+#P newex 517 1364 92 196617 buffer~ buf5 2000;
+#P newex 518 1122 92 196617 buffer~ buf4 2000;
+#P newex 504 848 92 196617 buffer~ buf3 2000;
+#P newex 504 828 92 196617 buffer~ buf2 2000;
+#P newex 501 414 92 196617 buffer~ buf1 2000;
+#P hidden newex 373 599 45 196617 loadbang;
+#P hidden message 494 57 205 196617 window size 120 60 880 570 \, window exec;
+#N thispatcher;
+#Q end;
+#P hidden newobj 494 75 59 196617 thispatcher;
+#P comment 555 1273 63 196617 buffer buf6;
+#P comment 554 1180 63 196617 buffer buf5;
+#P comment 94 1158 37 196617 - to:;
+#P comment 115 1076 127 196617 set all samples of buf1 to 0;
+#P comment 553 1030 63 196617 buffer buf4;
+#P message 246 1268 115 196617 to vasp buf6 \, vasp buf5;
+#P newex 246 1311 61 196617 vasp.update;
+#P newex 246 1287 85 196617 vasp.*osc 11025;
+#P newex 246 1228 61 196617 vasp.update;
+#P newex 246 1184 55 196617 vasp.noise;
+#P message 246 1074 52 196617 vasp buf4;
+#P newex 246 1116 61 196617 vasp.update;
+#P newex 246 1094 45 196617 vasp.= 0;
+#P hidden message 387 1271 45 196617 set buf6;
+#P user waveform~ 387 1287 223 74 3 9;
+#W mode none;
+#W mouseoutput none;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P hidden newex 387 1158 45 196617 loadbang;
+#P hidden message 387 1177 45 196617 set buf5;
+#P user waveform~ 387 1195 223 74 3 9;
+#W mode none;
+#W mouseoutput none;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P button 193 993 15 0;
+#P hidden newex 387 1002 45 196617 loadbang;
+#P hidden message 387 1029 45 196617 set buf4;
+#P newex 246 1049 61 196617 vasp.update;
+#P newex 246 1024 80 196617 vasp.osc 22050;
+#P user waveform~ 387 1045 223 74 3 9;
+#W mode none;
+#W mouseoutput none;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P comment 539 737 63 196617 buffer buf3;
+#P comment 534 644 63 196617 buffer buf2;
+#P comment 536 324 57 196617 buffer buf1;
+#P comment 117 748 112 196617 set all samples of buf1 and buf2 to 0;
+#P message 231 750 75 196617 vasp buf2 buf3;
+#P newex 231 788 61 196617 vasp.update;
+#P newex 231 768 45 196617 vasp.= 0;
+#P newex 228 705 61 196617 vasp.update;
+#P newex 228 680 80 196617 vasp.osc 22050;
+#P comment 92 375 127 196617 set all samples of buf1 to 0;
+#P comment 92 320 135 196617 generate a sine wave at 2Hz;
+#P message 229 376 55 196617 vasp buf1;
+#P newex 229 414 61 196617 vasp.update;
+#P newex 229 394 45 196617 vasp.= 0;
+#P hidden message 373 734 45 196617 set buf3;
+#P user waveform~ 373 751 223 74 3 9;
+#W mode none;
+#W mouseoutput none;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P hidden message 373 641 45 196617 set buf2;
+#P hidden newex 373 620 35 196617 del 10;
+#P user waveform~ 373 659 223 74 3 9;
+#W mode none;
+#W mouseoutput none;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 228 343 61 196617 vasp.update;
+#P newex 228 318 80 196617 vasp.osc 22050;
+#P hidden message 370 319 45 196617 set buf1;
+#P hidden newex 370 299 45 196617 loadbang;
+#P user waveform~ 370 338 223 74 3 9;
+#W mode none;
+#W mouseoutput none;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P comment 117 1270 127 196617 sets the target buffer buf6;
+#P message 246 1158 52 196617 vasp buf5;
+#P comment 379 202 117 196617 (default 0);
+#P comment 351 993 214 196617 sets the message \, bang triggers the operation;
+#P comment 63 958 198 196622 additional vasp messages:;
+#P message 246 993 102 196617 set vasp 44100 buf4;
+#P comment 130 868 502 196617 a vasp message can contain as many vectors as you like \, but all vectors have the same length;
+#P comment 391 570 281 196617 refering to buffer buf1 from 0 sec to 1 sec on channel 0 and buffer buf2 from 0.5 sec to 1.5 sec on channel 0;
+#P message 228 573 159 196617 vasp 44100 buf2 0 0 buf3 22050;
+#P comment 92 574 135 196617 two vectored vasp message:;
+#P comment 92 527 395 196617 all vectors have the same length \, but the vectors can differ in the buffers and offsets;
+#P comment 74 497 269 196617 - if a vasp message contains more than one vector:;
+#P comment 296 226 117 196617 (default 0);
+#P comment 354 270 284 196617 refering to buffer buf1 from 0.5 sec to 1.5 sec on channel 0;
+#P message 228 269 125 196617 vasp 44100 buf1 22050 0;
+#P comment 92 271 135 196617 one vectored vasp message:;
+#P comment 379 153 141 196617 which does the same.;
+#P message 336 151 43 196617 vasp -1;
+#P comment 92 153 192 196617 if missing \, it refers to the whole buffer;
+#P message 169 225 125 196617 vasp 44100 buf1 22050 0;
+#P comment 92 226 75 196617 and the channel;
+#P message 258 201 118 196617 vasp 44100 buf1 22050;
+#P comment 92 202 138 196617 an optional offset in samples;
+#P message 258 179 85 196617 vasp 44100 buf1;
+#P comment 92 180 164 196617 the name of the buffer it refers to;
+#P message 271 131 62 196617 vasp 44100;
+#P comment 92 134 173 196617 followed by the length in samples;
+#P message 214 110 31 196617 vasp;
+#P comment 63 43 158 196622 the vasp message:;
+#P comment 63 1 124 196622 vasp_syntax;
+#P comment 74 85 362 196617 - a vasp message is structured by the following parts:;
+#P comment 92 112 113 196617 it always starts with;
+#P comment 291 153 41 196617 or type;
+#P comment 94 993 37 196617 - set:;
+#P comment 725 473 14 196620 |;
+#P comment 725 934 13 196620 ||;
+#P connect 21 0 39 0;
+#P connect 39 0 40 0;
+#P connect 27 0 51 0;
+#P connect 51 0 52 0;
+#P connect 48 0 46 0;
+#P connect 46 0 47 0;
+#P connect 55 0 53 0;
+#P connect 53 0 54 0;
+#P connect 30 0 61 0;
+#P fasten 65 0 61 0 198 1014 251 1014;
+#P connect 61 0 62 0;
+#P connect 73 0 71 0;
+#P connect 71 0 72 0;
+#P connect 34 0 74 0;
+#P connect 74 0 95 0;
+#P connect 95 0 75 0;
+#P connect 78 0 76 0;
+#P connect 76 0 77 0;
+#P connect 99 0 97 0;
+#P connect 97 0 98 0;
+#P hidden connect 37 0 38 0;
+#P hidden connect 38 0 36 0;
+#P hidden connect 86 0 42 0;
+#P hidden connect 42 0 43 0;
+#P hidden connect 43 0 41 0;
+#P hidden connect 42 0 45 0;
+#P hidden connect 45 0 44 0;
+#P hidden connect 64 0 63 0;
+#P hidden connect 63 0 60 0;
+#P hidden connect 68 0 67 0;
+#P hidden connect 67 0 66 0;
+#P hidden connect 68 0 70 0;
+#P hidden connect 70 0 69 0;
+#P hidden connect 94 0 85 0;
+#P hidden connect 85 0 84 0;
+#P pop;
+#P newobj 134 248 45 196617 p syntax;
+#P comment 25 41 148 196622 vasp_modular.help;
+#P comment 45 120 354 196617 vasp is a library of objects for max/msp and pd \,;
+#P comment 45 348 432 196617 inspired by gŸnther rabl«s fft-box and tool-box. find gŸnther rabl at www.canto-crudo.com;
+#P comment 45 75 362 196620 vasp modular - vector assembling signal processor ©2002 thomas grill;
+#P comment 45 365 470 196617 vasp.help patches by florian bogner and oliver grimm - ©2002 patcherboys - www.patcherboys.com;
+#P comment 45 168 570 196617 these help patches should give you an idea of what is possible. feel free to combine different patches to more complex ones.;
+#P hidden connect 18 0 20 0;
+#P hidden connect 17 0 16 0;
+#P hidden connect 20 0 19 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.int.help b/externals/grill/vasp/max-help/vasp.int.help
new file mode 100755
index 00000000..255494e2
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.int.help
@@ -0,0 +1,93 @@
+max v2;
+#N vpatcher 270 159 881 476;
+#P newex 46 237 45 196617 vasp.opt;
+#P message 404 216 58 196617 vasp bufint;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 404 237 73 196617 p clear_buffer;
+#P comment 38 75 131 196617 argument: repetition count;
+#P newex 46 158 61 196617 vasp.update;
+#P comment 38 58 131 196617 vasp integral function;
+#P message 46 188 58 196617 vasp bufint;
+#P newex 46 211 44 196617 vasp.int;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 268 31 49 196617 p wfkeys;
+#P hidden message 268 77 51 196617 set bufint;
+#P hidden newex 268 53 45 196617 loadbang;
+#P user waveform~ 268 104 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 46 262 61 196617 vasp.update;
+#P message 46 104 58 196617 vasp bufint;
+#P newex 482 237 98 196617 buffer~ bufint 2000;
+#P newex 46 131 55 196617 vasp.bevel;
+#P comment 38 34 89 196622 vasp.int;
+#P connect 3 0 1 0;
+#P connect 1 0 12 0;
+#P connect 10 0 9 0;
+#P connect 9 0 16 0;
+#P connect 16 0 4 0;
+#P hidden connect 6 0 7 0;
+#P hidden connect 8 0 5 0;
+#P hidden connect 7 0 5 0;
+#P connect 15 0 14 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.join.help b/externals/grill/vasp/max-help/vasp.join.help
new file mode 100755
index 00000000..ba53ca5c
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.join.help
@@ -0,0 +1,31 @@
+max v2;
+#N vpatcher 235 91 615 568;
+#P hidden message 310 213 22 196617 set;
+#P hidden newex 310 186 45 196617 loadbang;
+#P message 182 159 149 196617 vasp bufjoin1 bufjoin2 bufjoin3;
+#P newex 239 431 109 196617 buffer~ bufjoin3 2000;
+#P newex 239 409 109 196617 buffer~ bufjoin2 2000;
+#P newex 239 388 109 196617 buffer~ bufjoin1 2000;
+#P newex 111 215 60 196617 prepend set;
+#P message 111 239 237 196617;
+#P message 61 329 287 196617;
+#P newex 61 305 60 196617 prepend set;
+#P newex 61 191 61 196617 vasp.split 2;
+#P newex 61 282 58 196617 vasp.join 2;
+#P comment 51 62 137 196617 join several vasps into one;
+#P message 61 159 109 196617 vasp bufjoin1 bufjoin2;
+#P comment 51 39 89 196622 vasp.join;
+#P comment 51 78 164 196617 argument: number of vasps to join;
+#P comment 51 95 138 196617 left inlet triggers the output;
+#P fasten 14 0 6 0 187 179 66 179;
+#P connect 3 0 6 0;
+#P connect 6 0 5 0;
+#P connect 5 0 7 0;
+#P hidden fasten 16 0 8 0 315 326 66 326;
+#P connect 7 0 8 0;
+#P fasten 6 1 5 1 91 274 114 274;
+#P connect 6 2 10 0;
+#P connect 10 0 9 0;
+#P hidden fasten 16 0 9 0 315 234 116 234;
+#P hidden connect 15 0 16 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.leq.help b/externals/grill/vasp/max-help/vasp.leq.help
new file mode 100755
index 00000000..ab0aee34
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.leq.help
@@ -0,0 +1,128 @@
+max v2;
+#N vpatcher 188 104 857 525;
+#P message 437 350 91 196617 vasp buf<= buf<=1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 437 373 78 196617 p clear_buffers;
+#P newex 59 327 61 196617 vasp.update;
+#P flonum 149 272 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 274 286 48 196617 0/false;
+#P comment 137 145 148 196617 generate a sine wave at 1Hz;
+#P message 59 145 55 196617 vasp buf<=;
+#P newex 59 191 61 196617 vasp.update;
+#P newex 59 168 80 196617 vasp.osc 44100;
+#P comment 137 229 100 196617 copy to new buffer;
+#P hidden message 321 219 55 196617 set buf<=1;
+#P user waveform~ 321 237 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 530 373 103 196617 buffer~ buf<=1 2000;
+#P comment 52 86 188 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 50 196617 set buf<=;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 296 65 196617 vasp.<= -0.4;
+#P message 59 228 63 196617 vasp buf<=1;
+#P newex 530 350 103 196617 buffer~ buf<= 2000;
+#P newex 59 249 65 196617 vasp.= buf<=;
+#P comment 52 71 83 196617 sample <= value;
+#P comment 52 48 89 196622 vasp.<=;
+#P comment 598 103 44 196617 source;
+#P comment 277 244 44 196617 1/true;
+#P connect 19 0 17 0;
+#P connect 17 0 18 0;
+#P connect 6 0 4 0;
+#P connect 4 0 7 0;
+#P connect 7 0 23 0;
+#P fasten 22 0 7 1 154 292 119 292;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 628 371 638 371 638 94 326 94;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 15 0;
+#P hidden connect 11 0 14 0;
+#P hidden connect 15 0 14 0;
+#P connect 25 0 24 0;
+#P hidden fasten 14 5 8 4 626 340 638 340 638 94 626 94;
+#P hidden connect 8 5 14 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.list.help b/externals/grill/vasp/max-help/vasp.list.help
new file mode 100755
index 00000000..77081652
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.list.help
@@ -0,0 +1,85 @@
+max v2;
+#N vpatcher 89 186 906 488;
+#P origin 0 3;
+#P hidden message 380 52 22 196617 set;
+#P hidden newex 380 22 45 196617 loadbang;
+#P message 42 228 598 196617;
+#P newex 42 200 60 196617 prepend set;
+#P newex 42 172 38 196617 vasp.?;
+#P comment 39 54 238 196617 outputs the values of all samples of a vasp as list;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 435 21 49 196617 p wfkeys;
+#P newex 42 113 55 196617 vasp.bevel;
+#P hidden message 435 62 45 196617 set buf?;
+#P hidden newex 435 43 45 196617 loadbang;
+#P user waveform~ 435 80 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 42 139 61 196617 vasp.update;
+#P message 42 85 52 196617 vasp buf?;
+#P newex 664 228 83 196617 buffer~ buf? 0.3;
+#P comment 39 30 89 196622 vasp.?;
+#P connect 2 0 7 0;
+#P connect 7 0 3 0;
+#P connect 3 0 10 0;
+#P connect 10 0 11 0;
+#P connect 11 0 12 0;
+#P hidden fasten 14 0 12 0 385 220 47 220;
+#P hidden connect 13 0 14 0;
+#P hidden connect 5 0 6 0;
+#P hidden connect 6 0 4 0;
+#P hidden connect 8 0 4 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.log.help b/externals/grill/vasp/max-help/vasp.log.help
new file mode 100755
index 00000000..a9d784e7
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.log.help
@@ -0,0 +1,8 @@
+max v2;
+#N vpatcher 200 142 489 314;
+#P origin 0 2;
+#P newex 124 111 45 196617 vasp.log;
+#P comment 45 57 189 196617 natural logarithm;
+#P comment 45 34 89 196622 vasp.log;
+#P comment 45 73 100 196617 ln(sample);
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.lwr.help b/externals/grill/vasp/max-help/vasp.lwr.help
new file mode 100755
index 00000000..a0d95c38
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.lwr.help
@@ -0,0 +1,128 @@
+max v2;
+#N vpatcher 147 90 816 511;
+#P message 451 352 84 196617 vasp buf<a buf<1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 451 373 78 196617 p clear_buffers;
+#P newex 59 327 61 196617 vasp.update;
+#P flonum 149 272 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 274 286 48 196617 0/false;
+#P comment 137 145 148 196617 generate a sine wave at 1Hz;
+#P message 59 145 51 196617 vasp buf<;
+#P newex 59 191 61 196617 vasp.update;
+#P newex 59 168 80 196617 vasp.osc 44100;
+#P comment 137 229 100 196617 copy to new buffer;
+#P hidden message 321 219 50 196617 set buf<1;
+#P user waveform~ 321 237 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 538 373 95 196617 buffer~ buf<1 2000;
+#P comment 52 86 188 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 44 196617 set buf<;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 296 60 196617 vasp.< -0.4;
+#P message 59 228 55 196617 vasp buf<1;
+#P newex 538 352 95 196617 buffer~ buf< 2000;
+#P newex 59 249 60 196617 vasp.= buf<;
+#P comment 52 71 83 196617 sample < value;
+#P comment 52 48 89 196622 vasp.<;
+#P comment 598 103 44 196617 source;
+#P comment 277 244 44 196617 1/true;
+#P connect 19 0 17 0;
+#P connect 17 0 18 0;
+#P connect 6 0 4 0;
+#P connect 4 0 7 0;
+#P connect 7 0 23 0;
+#P fasten 22 0 7 1 154 292 114 292;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 628 371 638 371 638 94 326 94;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 15 0;
+#P hidden connect 15 0 14 0;
+#P hidden connect 11 0 14 0;
+#P connect 25 0 24 0;
+#P hidden fasten 14 5 8 4 626 340 638 340 638 94 626 94;
+#P hidden connect 8 5 14 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.max.help b/externals/grill/vasp/max-help/vasp.max.help
new file mode 100755
index 00000000..4bb318de
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.max.help
@@ -0,0 +1,125 @@
+max v2;
+#N vpatcher 257 116 926 537;
+#P message 411 353 105 196617 vasp bufmax bufmax1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 411 373 78 196617 p clear_buffers;
+#P comment 140 145 148 196617 generate a sine wave at 1Hz;
+#P message 59 145 65 196617 vasp bufmax;
+#P newex 59 191 61 196617 vasp.update;
+#P newex 59 168 80 196617 vasp.osc 44100;
+#P newex 59 271 45 196617 vasp.abs;
+#P comment 140 229 100 196617 copy to new buffer;
+#P hidden message 321 219 64 196617 set bufmax1;
+#P user waveform~ 321 237 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 521 373 111 196617 buffer~ bufmax1 2000;
+#P comment 52 87 188 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 58 196617 set bufmax;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 297 69 196617 vasp.max 0.4;
+#P message 59 228 71 196617 vasp bufmax1;
+#P newex 521 353 111 196617 buffer~ bufmax 2000;
+#P newex 59 249 74 196617 vasp.= bufmax;
+#P comment 52 71 244 196617 take maximum of vasp and argument;
+#P comment 52 48 89 196622 vasp.max;
+#P comment 140 273 100 196617 find absolute values;
+#P comment 598 103 44 196617 source;
+#P connect 20 0 18 0;
+#P connect 18 0 19 0;
+#P connect 6 0 4 0;
+#P connect 4 0 17 0;
+#P connect 17 0 7 0;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 627 371 638 371 638 94 326 94;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 15 0;
+#P hidden connect 11 0 14 0;
+#P hidden connect 15 0 14 0;
+#P connect 23 0 22 0;
+#P hidden fasten 14 5 8 4 626 340 638 340 638 94 626 94;
+#P hidden connect 8 5 14 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.maxq.help b/externals/grill/vasp/max-help/vasp.maxq.help
new file mode 100755
index 00000000..bd33265f
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.maxq.help
@@ -0,0 +1,86 @@
+max v2;
+#N vpatcher 257 116 917 432;
+#P message 59 223 75 196617 vasp buffmax?;
+#P newex 59 182 55 196617 vasp.* 0.5;
+#P comment 168 274 100 196617 >>>> maximum value;
+#P flonum 104 274 60 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 52 101 188 196617 right outlet: max value;
+#P comment 140 139 148 196617 generate a sine wave at 1Hz;
+#P message 59 139 75 196617 vasp buffmax?;
+#P newex 59 201 61 196617 vasp.update;
+#P newex 59 162 80 196617 vasp.osc 44100;
+#P comment 52 86 188 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 73 49 196617 p wfkeys;
+#P hidden message 321 119 68 196617 set buffmax?;
+#P hidden newex 321 95 45 196617 loadbang;
+#P user waveform~ 321 139 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 245 55 196617 vasp.max?;
+#P newex 507 274 120 196617 buffer~ buffmax? 2000;
+#P comment 52 71 200 196617 get maximum sample value of a vasp;
+#P comment 52 48 89 196622 vasp.max?;
+#P connect 11 0 9 0;
+#P connect 9 0 16 0;
+#P connect 16 0 10 0;
+#P connect 17 0 3 0;
+#P connect 3 1 14 0;
+#P hidden connect 5 0 6 0;
+#P hidden fasten 2 1 6 0 622 299 638 299 638 115 326 115;
+#P hidden connect 7 0 4 0;
+#P hidden connect 6 0 4 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.mbeveldn.help b/externals/grill/vasp/max-help/vasp.mbeveldn.help
new file mode 100755
index 00000000..c44f378a
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.mbeveldn.help
@@ -0,0 +1,100 @@
+max v2;
+#N vpatcher 171 80 847 440;
+#P message 450 292 75 196617 vasp buf*bevel;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 450 312 73 196617 p clear_buffer;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 408 127 49 196617 p wfkeys;
+#P newex 41 245 61 196617 vasp.update;
+#P newex 332 150 61 196617 vasp.update;
+#P comment 483 103 150 196617 generate a 500 ms fade out;
+#P message 332 102 143 196617 vasp 22050 buf*bevel 66150;
+#P newex 332 127 65 196617 vasp.*!bevel;
+#P newex 41 155 55 196617 vasp.* 0.5;
+#P comment 160 199 142 196617 generate a 500 ms fade in;
+#P message 41 197 110 196617 vasp 22050 buf*bevel;
+#P newex 41 129 62 196617 vasp.osc 44;
+#P comment 332 53 215 196617 multiplies a linear ramp from 1 to 0 to a vasp;
+#P comment 332 29 126 196622 vasp.*!bevel;
+#P newex 41 222 63 196617 vasp.*bevel;
+#P hidden message 408 167 70 196617 set buf*bevel;
+#P hidden newex 408 150 45 196617 loadbang;
+#P user waveform~ 332 187 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 41 100 75 196617 vasp buf*bevel;
+#P newex 529 312 115 196617 buffer~ buf*bevel 2000;
+#P comment 38 53 213 196617 multiplies a linear ramp from 0 to 1 to a vasp;
+#P comment 38 29 125 196622 vasp.*bevel;
+#P comment 127 102 142 196617 generate a sine wave at 1kHz;
+#P connect 4 0 11 0;
+#P connect 11 0 14 0;
+#P connect 12 0 8 0;
+#P connect 8 0 19 0;
+#P connect 16 0 15 0;
+#P connect 15 0 18 0;
+#P hidden fasten 7 0 5 0 413 184 337 184;
+#P hidden fasten 20 0 5 0 413 186 337 186;
+#P hidden connect 6 0 7 0;
+#P connect 22 0 21 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.mbevelup.help b/externals/grill/vasp/max-help/vasp.mbevelup.help
new file mode 100755
index 00000000..5d36531e
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.mbevelup.help
@@ -0,0 +1,100 @@
+max v2;
+#N vpatcher 180 143 862 501;
+#P message 454 290 75 196617 vasp buf*bevel;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 454 310 73 196617 p clear_buffer;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 409 127 49 196617 p wfkeys;
+#P newex 41 245 61 196617 vasp.update;
+#P newex 332 150 61 196617 vasp.update;
+#P comment 483 104 150 196617 generate a 500 ms fade out;
+#P message 332 102 143 196617 vasp 22050 buf*bevel 66150;
+#P newex 332 127 65 196617 vasp.*!bevel;
+#P newex 41 155 55 196617 vasp.* 0.5;
+#P comment 160 199 142 196617 generate a 500 ms fade in;
+#P message 41 197 110 196617 vasp 22050 buf*bevel;
+#P newex 41 129 62 196617 vasp.osc 44;
+#P comment 332 53 215 196617 multiplies a linear ramp from 1 to 0 to a vasp;
+#P comment 332 29 126 196622 vasp.*!bevel;
+#P newex 41 222 63 196617 vasp.*bevel;
+#P hidden message 409 168 70 196617 set buf*bevel;
+#P hidden newex 409 150 45 196617 loadbang;
+#P user waveform~ 332 185 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 41 100 75 196617 vasp buf*bevel;
+#P newex 529 310 115 196617 buffer~ buf*bevel 2000;
+#P comment 38 53 213 196617 multiplies a linear ramp from 0 to 1 to a vasp;
+#P comment 38 29 112 196622 vasp.*bevel;
+#P comment 127 102 144 196617 generate a sine wave at 1khz;
+#P connect 4 0 11 0;
+#P connect 11 0 14 0;
+#P connect 12 0 8 0;
+#P connect 8 0 19 0;
+#P connect 16 0 15 0;
+#P connect 15 0 18 0;
+#P hidden fasten 20 0 5 0 414 184 337 184;
+#P hidden fasten 7 0 5 0 414 183 337 183;
+#P hidden connect 6 0 7 0;
+#P connect 22 0 21 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.mcosc.help b/externals/grill/vasp/max-help/vasp.mcosc.help
new file mode 100755
index 00000000..b5b65b66
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.mcosc.help
@@ -0,0 +1,144 @@
+max v2;
+#N vpatcher 132 131 841 556;
+#P message 429 357 129 196617 vasp buf*cosc3 buf*cosc4;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 429 378 78 196617 p clear_buffers;
+#P comment 193 195 114 196617 multiply the ramp with a complex sine wave;
+#P newex 56 173 61 196617 vasp.update;
+#P message 56 127 129 196617 vasp buf*cosc3 buf*cosc4;
+#P newex 56 148 55 196617 vasp.bevel;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 366 54 49 196617 p wfkeys;
+#N vpatcher 169 125 534 375;
+#P flonum 70 179 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 125 27 196617 t b f;
+#P message 309 151 27 196617 stop;
+#P message 243 151 65 196617 startwindow;
+#P newex 243 173 29 196617 dac~;
+#P comment 141 175 83 196617 period length in samples (float);
+#P flonum 88 97 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 147 27 196617 / 1.;
+#P flonum 68 73 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 54 49 53 196617 dspstate~;
+#P comment 133 98 100 196617 frequency in Hz;
+#P connect 1 1 2 0;
+#P fasten 4 0 9 0 93 118 75 118;
+#P connect 9 0 3 0;
+#P fasten 2 0 3 0 73 115 54 115 54 145 75 145;
+#P connect 3 0 10 0;
+#P connect 9 1 3 1;
+#P connect 7 0 6 0;
+#P fasten 8 0 6 0 314 169 248 169;
+#P pop;
+#P newobj 53 378 109 196617 p Hz_to_period_length;
+#P comment 567 229 119 196617 *imaginary part of cosc;
+#P message 56 198 129 196617 vasp buf*cosc3 buf*cosc4;
+#P hidden message 366 221 72 196617 set buf*cosc4;
+#P user waveform~ 367 246 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 559 378 119 196617 buffer~ buf*cosc4 2000;
+#P hidden message 366 94 72 196617 set buf*cosc3;
+#P hidden newex 366 75 45 196617 loadbang;
+#P user waveform~ 366 112 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 56 246 55 196617 vasp.* 0.5;
+#P newex 56 271 61 196617 vasp.update;
+#P newex 559 357 119 196617 buffer~ buf*cosc3 2000;
+#P comment 45 79 316 196617 argument/right inlet: frequency in period length in samples;
+#P newex 56 222 92 196617 vasp.*cosc 44100;
+#P comment 45 64 293 196617 multiplies a complex buffer content with a complex sine wave;
+#P comment 45 41 89 196622 vasp.*cosc;
+#P comment 192 128 137 196617 generate a ramp from 0 to 1;
+#P comment 575 96 108 196617 *real part of the cosc;
+#P connect 20 0 19 0;
+#P connect 19 0 21 0;
+#P connect 15 0 4 0;
+#P connect 4 0 8 0;
+#P connect 8 0 7 0;
+#P hidden connect 10 0 11 0;
+#P hidden connect 18 0 9 0;
+#P hidden connect 11 0 9 0;
+#P hidden fasten 10 0 14 0 371 82 371 82;
+#P hidden fasten 14 0 13 0 371 237 372 237;
+#P hidden connect 18 0 13 0;
+#P connect 24 0 23 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.min.help b/externals/grill/vasp/max-help/vasp.min.help
new file mode 100755
index 00000000..bfeef086
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.min.help
@@ -0,0 +1,125 @@
+max v2;
+#N vpatcher 129 80 798 501;
+#P message 421 352 101 196617 vasp bufmin bufmin1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 421 372 78 196617 p clear_buffers;
+#P comment 123 146 148 196617 generate a sine wave at 1Hz;
+#P message 57 145 62 196617 vasp bufmin;
+#P newex 57 191 61 196617 vasp.update;
+#P newex 57 168 80 196617 vasp.osc 44100;
+#P newex 57 271 45 196617 vasp.abs;
+#P comment 128 229 148 196617 copy to new buffer;
+#P hidden message 321 219 61 196617 set bufmin1;
+#P user waveform~ 321 237 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 525 372 108 196617 buffer~ bufmin1 2000;
+#P comment 52 86 188 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 55 196617 set bufmin;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 57 294 65 196617 vasp.min 0.4;
+#P message 57 228 68 196617 vasp bufmin1;
+#P newex 525 352 108 196617 buffer~ bufmin 2000;
+#P newex 57 249 71 196617 vasp.= bufmin;
+#P comment 52 70 167 196617 take minimum of vasp and argument;
+#P comment 52 48 89 196622 vasp.min;
+#P comment 106 273 100 196617 find absolute values;
+#P comment 598 103 44 196617 source;
+#P connect 20 0 18 0;
+#P connect 18 0 19 0;
+#P connect 6 0 4 0;
+#P connect 4 0 17 0;
+#P connect 17 0 7 0;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 628 371 638 371 638 94 326 94;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 15 0;
+#P hidden connect 11 0 14 0;
+#P hidden connect 15 0 14 0;
+#P connect 23 0 22 0;
+#P hidden fasten 14 5 8 4 626 340 638 340 638 94 626 94;
+#P hidden connect 8 5 14 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.minmax.help b/externals/grill/vasp/max-help/vasp.minmax.help
new file mode 100755
index 00000000..f111101f
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.minmax.help
@@ -0,0 +1,149 @@
+max v2;
+#N vpatcher 164 76 829 634;
+#P message 374 478 145 196617 vasp bufmm1 bufmm2 bufmm3;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 374 501 78 196617 p clear_buffers;
+#P comment 561 329 73 196617 positive values;
+#P newex 53 395 61 196617 vasp.update;
+#P hidden message 321 324 61 196617 set bufmm3;
+#P user waveform~ 321 343 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 521 501 108 196617 buffer~ bufmm3 2000;
+#P comment 131 154 148 196617 generate a sine wave at 1Hz;
+#P message 53 154 68 196617 vasp bufmm1;
+#P newex 53 210 61 196617 vasp.update;
+#P newex 53 189 80 196617 vasp.osc 44100;
+#P comment 172 319 99 196617 copy to new buffer;
+#P hidden message 321 202 61 196617 set bufmm2;
+#P user waveform~ 321 220 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 521 478 108 196617 buffer~ bufmm2 2000;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 35 49 196617 p wfkeys;
+#P hidden message 321 81 61 196617 set bufmm1;
+#P hidden newex 321 57 45 196617 loadbang;
+#P user waveform~ 321 101 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 53 374 65 196617 vasp.minmax;
+#P message 53 318 105 196617 vasp bufmm2 bufmm3;
+#P newex 521 457 108 196617 buffer~ bufmm1 2000;
+#P newex 53 352 75 196617 vasp.= bufmm1;
+#P comment 44 71 242 196617 splits a vasp pairs into smaller and larger values;
+#P comment 44 48 102 196622 vasp.minmax;
+#P comment 598 86 44 196617 source;
+#P comment 559 206 75 196617 negative values;
+#P connect 18 0 16 0;
+#P connect 16 0 17 0;
+#P connect 6 0 4 0;
+#P connect 4 0 7 0;
+#P connect 7 0 23 0;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 624 475 638 475 638 77 326 77;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 14 0;
+#P hidden connect 11 0 13 0;
+#P hidden connect 14 0 13 0;
+#P hidden connect 9 0 22 0;
+#P hidden connect 22 0 21 0;
+#P connect 26 0 25 0;
+#P hidden fasten 13 5 8 4 626 323 638 323 638 77 626 77;
+#P hidden connect 8 5 13 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.minq.help b/externals/grill/vasp/max-help/vasp.minq.help
new file mode 100755
index 00000000..3b3eb2e6
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.minq.help
@@ -0,0 +1,86 @@
+max v2;
+#N vpatcher 257 116 917 432;
+#P message 59 223 68 196617 vasp bufmin?;
+#P newex 59 182 55 196617 vasp.* 0.5;
+#P comment 167 274 100 196617 >>>> minimum value;
+#P flonum 103 274 60 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 52 101 188 196617 right outlet: max value;
+#P comment 140 139 148 196617 generate a sine wave at 1Hz;
+#P message 59 139 68 196617 vasp bufmin?;
+#P newex 59 201 61 196617 vasp.update;
+#P newex 59 162 80 196617 vasp.osc 44100;
+#P comment 52 86 188 196617 argument/right inlet: value;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 73 49 196617 p wfkeys;
+#P hidden message 321 119 61 196617 set bufmin?;
+#P hidden newex 321 95 45 196617 loadbang;
+#P user waveform~ 321 139 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 245 54 196617 vasp.min?;
+#P newex 526 274 108 196617 buffer~ bufmin? 2000;
+#P comment 52 71 200 196617 get minimum sample value of a vasp;
+#P comment 52 48 89 196622 vasp.min?;
+#P connect 11 0 9 0;
+#P connect 9 0 16 0;
+#P connect 16 0 10 0;
+#P connect 17 0 3 0;
+#P connect 3 1 14 0;
+#P hidden fasten 2 1 6 0 629 299 638 299 638 115 326 115;
+#P hidden connect 5 0 6 0;
+#P hidden connect 6 0 4 0;
+#P hidden connect 7 0 4 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.mirr.help b/externals/grill/vasp/max-help/vasp.mirr.help
new file mode 100755
index 00000000..2e09c2c4
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.mirr.help
@@ -0,0 +1,88 @@
+max v2;
+#N vpatcher 159 193 741 563;
+#P message 359 278 65 196617 vasp bufmirr;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 359 298 73 196617 p clear_buffer;
+#P hidden newex 442 270 48 196617 r 1128path;
+#P user umenu 82 116 72 196647 1 64 132 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1128path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 144 138 43 196617 p loader;
+#P comment 56 118 26 196617 read;
+#P message 194 300 27 196617 stop;
+#P message 126 300 65 196617 startwindow;
+#P newex 235 325 29 196617 dac~;
+#P newex 235 273 30 196617 line~;
+#P message 235 250 72 196617 0 \, 2000 2000;
+#P newex 235 298 71 196617 play~ bufmirr;
+#P newex 61 222 61 196617 vasp.update;
+#P message 61 156 65 196617 vasp bufmirr;
+#P newex 61 200 53 196617 vasp.mirr;
+#P comment 51 67 75 196617 mirrors a vasp;
+#P comment 51 43 96 196622 vasp.mirr;
+#P hidden message 235 102 60 196617 set bufmirr;
+#P hidden newex 235 77 45 196617 loadbang;
+#P user waveform~ 235 121 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 442 299 105 196617 buffer~ bufmirr 2000;
+#P connect 7 0 6 0;
+#P connect 6 0 8 0;
+#P hidden connect 17 1 16 0;
+#P hidden fasten 0 1 3 0 542 318 551 318 551 98 240 98;
+#P hidden connect 2 0 3 0;
+#P hidden connect 3 0 1 0;
+#P connect 10 0 11 0;
+#P connect 11 0 9 0;
+#P connect 9 0 12 0;
+#P fasten 13 0 12 0 131 318 240 318;
+#P fasten 14 0 12 0 199 318 240 318;
+#P connect 9 0 12 1;
+#P connect 20 0 19 0;
+#P hidden connect 18 0 0 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.mod.help b/externals/grill/vasp/max-help/vasp.mod.help
new file mode 100755
index 00000000..45fdd08e
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.mod.help
@@ -0,0 +1,62 @@
+max v2;
+#N vpatcher 200 142 915 479;
+#P message 511 273 55 196617 vasp buf%;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 511 292 73 196617 p clear_buffer;
+#P comment 271 127 75 196617 ramp from 0-1;
+#P newex 215 173 61 196617 vasp.update;
+#P newex 50 173 61 196617 vasp.update;
+#P message 83 219 55 196617 vasp buf%;
+#P newex 215 147 55 196617 vasp.bevel;
+#P message 215 126 55 196617 vasp buf%;
+#P comment 108 127 107 196617 a sine wave at 1Hz or;
+#P newex 83 292 61 196617 vasp.update;
+#P message 50 126 55 196617 vasp buf%;
+#P newex 50 146 80 196617 vasp.osc 44100;
+#P comment 45 77 189 196617 optional argument/right inlet: divisor;
+#P flonum 138 237 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 45 60 195 196617 modulo function / remainder of a division;
+#P comment 45 36 89 196622 vasp.%;
+#P newex 590 292 95 196617 buffer~ buf% 2000;
+#P hidden message 377 114 48 196617 set buf%;
+#P hidden newex 377 88 45 196617 loadbang;
+#P user waveform~ 377 138 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 83 258 65 196617 vasp.% 0.25;
+#P comment 156 260 59 196617 modulo;
+#P connect 11 0 10 0;
+#P connect 10 0 17 0;
+#P connect 16 0 1 0;
+#P connect 1 0 12 0;
+#P connect 8 0 1 1;
+#P connect 14 0 15 0;
+#P connect 15 0 18 0;
+#P hidden connect 3 0 4 0;
+#P hidden connect 4 0 2 0;
+#P connect 21 0 20 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.mphasor.help b/externals/grill/vasp/max-help/vasp.mphasor.help
new file mode 100755
index 00000000..0a21a23f
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.mphasor.help
@@ -0,0 +1,127 @@
+max v2;
+#N vpatcher 159 224 859 578;
+#P message 465 263 83 196617 vasp buf*phasor;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 465 283 73 196617 p clear_buffer;
+#N vpatcher 169 125 534 375;
+#P flonum 70 179 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 125 27 196617 t b f;
+#P message 309 151 27 196617 stop;
+#P message 243 151 65 196617 startwindow;
+#P newex 243 173 29 196617 dac~;
+#P comment 141 175 83 196617 period length in samples (float);
+#P flonum 88 97 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 147 27 196617 / 1.;
+#P flonum 68 73 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 54 49 53 196617 dspstate~;
+#P comment 133 98 100 196617 frequency in Hz;
+#P connect 1 1 2 0;
+#P fasten 4 0 9 0 93 118 75 118;
+#P connect 9 0 3 0;
+#P fasten 2 0 3 0 73 115 54 115 54 145 75 145;
+#P connect 3 0 10 0;
+#P connect 9 1 3 1;
+#P connect 7 0 6 0;
+#P fasten 8 0 6 0 314 169 248 169;
+#P pop;
+#P newobj 41 283 109 196617 p Hz_to_period_length;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 355 34 49 196617 p wfkeys;
+#P message 314 283 27 196617 stop;
+#P message 246 283 65 196617 startwindow;
+#P comment 38 69 311 196617 argument/right inlet: frequency in period length in samples;
+#P newex 355 260 30 196617 line~;
+#P message 355 233 72 196617 0 \, 2000 2000;
+#P newex 355 307 29 196617 dac~;
+#P newex 355 283 85 196617 play~ buf*phasor;
+#P newex 41 255 61 196617 vasp.update;
+#P newex 41 168 55 196617 vasp.* 0.5;
+#P comment 128 208 192 196617 generate a amplitude modulation with 2Hz;
+#P message 41 207 83 196617 vasp buf*phasor;
+#P newex 41 144 55 196617 vasp.noise;
+#P newex 41 232 102 196617 vasp.*phasor 22050;
+#P hidden message 355 76 75 196617 set buf*phasor;
+#P hidden newex 355 57 45 196617 loadbang;
+#P user waveform~ 355 95 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 41 121 83 196617 vasp buf*phasor;
+#P newex 542 283 123 196617 buffer~ buf*phasor 2000;
+#P comment 38 53 229 196617 multiplies a saw tooth ramp with a buffer content;
+#P comment 38 29 109 196622 vasp.*phasor;
+#P comment 128 122 100 196617 generate white noise;
+#P connect 4 0 9 0;
+#P connect 9 0 12 0;
+#P connect 10 0 8 0;
+#P connect 8 0 13 0;
+#P hidden connect 6 0 7 0;
+#P hidden connect 21 0 5 0;
+#P hidden connect 7 0 5 0;
+#P connect 16 0 17 0;
+#P connect 17 0 14 0;
+#P fasten 20 0 15 0 319 303 360 303;
+#P fasten 19 0 15 0 251 303 360 303;
+#P connect 14 0 15 0;
+#P connect 14 0 15 1;
+#P connect 24 0 23 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.mul.help b/externals/grill/vasp/max-help/vasp.mul.help
new file mode 100755
index 00000000..c3eabaa8
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.mul.help
@@ -0,0 +1,227 @@
+max v2;
+#N vpatcher 194 184 786 554;
+#P origin 45 0;
+#P message 387 294 53 196617 vasp buf*;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 387 315 73 196617 p clear_buffer;
+#N vpatcher 197 137 868 621;
+#P newex 58 280 61 196617 vasp.update;
+#P comment 600 218 37 196617 buf*b;
+#P user umenu 78 79 72 196647 1 64 95 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 355 682;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1074path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 140 100 43 196617 p loader;
+#P message 433 395 85 196617 vasp buf*a buf*b;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 433 416 78 196617 p clear_buffers;
+#P newex 58 159 61 196617 vasp.update;
+#P hidden newex 526 367 48 196617 r 1074path;
+#P comment 52 81 26 196617 read;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 325 50 49 196617 p wfkeys;
+#P comment 126 313 157 196617 multiplie noise with the envelope;
+#P comment 126 119 100 196617 generate noise;
+#P comment 109 259 100 196617 normalize the vasp;
+#P comment 133 231 149 196617 filter the values with a lowpass to get the envelope (2Hz);
+#P message 58 312 58 196617 vasp buf*a;
+#P newex 58 333 68 196617 vasp.* buf*b;
+#P message 292 417 27 196617 stop;
+#P message 224 417 65 196617 startwindow;
+#P newex 325 441 29 196617 dac~;
+#P newex 325 389 30 196617 line~;
+#P message 325 360 72 196617 0 \, 2000 2000;
+#P newex 325 415 62 196617 play~ buf*a;
+#P newex 58 360 61 196617 vasp.update;
+#P newex 58 257 45 196617 vasp.opt;
+#P newex 58 234 71 196617 vasp.flp 2205;
+#P message 58 188 58 196617 vasp buf*b;
+#P newex 58 210 45 196617 vasp.abs;
+#P message 58 118 58 196617 vasp buf*a;
+#P newex 58 137 55 196617 vasp.noise;
+#P hidden message 325 215 51 196617 set buf*b;
+#P user waveform~ 325 233 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P hidden message 325 93 51 196617 set buf*a;
+#P hidden newex 325 69 45 196617 loadbang;
+#P user waveform~ 325 113 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 539 415 98 196617 buffer~ buf*b 2000;
+#P newex 539 390 98 196617 buffer~ buf*a 2000;
+#P comment 125 189 100 196617 get absolute values;
+#P comment 52 43 336 196622 use vasp.* to multiplie an envelope to noise;
+#P comment 150 81 100 196617 into buffer buf*b;
+#P comment 600 98 37 196617 buf*a;
+#P connect 12 0 11 0;
+#P connect 11 0 33 0;
+#P connect 14 0 13 0;
+#P connect 13 0 15 0;
+#P connect 15 0 16 0;
+#P connect 16 0 39 0;
+#P connect 25 0 24 0;
+#P connect 24 0 17 0;
+#P hidden connect 37 1 36 0;
+#P hidden connect 7 0 8 0;
+#P hidden connect 30 0 6 0;
+#P hidden connect 8 0 6 0;
+#P hidden connect 7 0 10 0;
+#P hidden fasten 5 1 10 0 632 436 644 436 644 213 330 213;
+#P hidden connect 10 0 9 0;
+#P hidden connect 30 0 9 0;
+#P connect 19 0 20 0;
+#P connect 20 0 18 0;
+#P connect 18 0 21 0;
+#P fasten 22 0 21 0 229 438 330 438;
+#P fasten 23 0 21 0 297 438 330 438;
+#P connect 18 0 21 1;
+#P connect 35 0 34 0;
+#P hidden fasten 32 0 5 0 531 413 544 413;
+#P pop;
+#P newobj 45 315 98 196617 p envelope_example;
+#P comment 103 141 76 196617 generate noise;
+#P newex 45 263 61 196617 vasp.update;
+#P message 45 140 53 196617 vasp buf*;
+#P newex 45 175 55 196617 vasp.noise;
+#P comment 39 74 189 196617 optional argument/right inlet: multiplier;
+#P flonum 90 208 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 39 59 97 196617 multiplies a vasp;
+#P comment 39 36 66 196622 vasp.*;
+#P newex 463 315 93 196617 buffer~ buf* 2000;
+#P hidden message 246 120 45 196617 set buf*;
+#P hidden newex 246 94 45 196617 loadbang;
+#P user waveform~ 246 144 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 45 229 55 196617 vasp.* 0.5;
+#P comment 129 210 59 196617 change gain;
+#P connect 11 0 10 0;
+#P connect 10 0 1 0;
+#P connect 1 0 12 0;
+#P connect 8 0 1 1;
+#P hidden connect 3 0 4 0;
+#P hidden connect 4 0 2 0;
+#P connect 16 0 15 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.multi.help b/externals/grill/vasp/max-help/vasp.multi.help
new file mode 100755
index 00000000..64ee9b09
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.multi.help
@@ -0,0 +1,23 @@
+max v2;
+#N vpatcher 262 131 701 451;
+#P hidden message 303 155 22 196617 set;
+#P hidden newex 303 123 45 196617 loadbang;
+#P message 223 257 162 196617;
+#P newex 223 232 60 196617 prepend set;
+#P comment 51 80 138 196617 argument: number of outlets;
+#P message 56 257 162 196617;
+#P newex 56 232 60 196617 prepend set;
+#P message 56 156 129 196617 vasp 22050 bufm 44100 0;
+#P newex 56 180 49 196617 vasp.m 2;
+#P newex 56 111 94 196617 buffer~ bufm 2000;
+#P comment 51 63 151 196617 outputs a vasp multiple times;
+#P comment 51 41 89 196622 vasp.m;
+#P connect 4 0 3 0;
+#P connect 3 0 5 0;
+#P hidden fasten 11 0 6 0 308 253 61 253;
+#P connect 5 0 6 0;
+#P fasten 3 1 8 0 100 214 228 214;
+#P hidden fasten 11 0 9 0 308 254 228 254;
+#P connect 8 0 9 0;
+#P hidden connect 10 0 11 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.neq.help b/externals/grill/vasp/max-help/vasp.neq.help
new file mode 100755
index 00000000..6a533cdd
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.neq.help
@@ -0,0 +1,145 @@
+max v2;
+#N vpatcher 82 103 798 578;
+#P message 490 408 93 196617 vasp buf!=1 buf!=2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 490 428 78 196617 p clear_buffers;
+#P newex 79 393 58 196617 vasp.!= -1.;
+#P comment 332 310 43 196617 false/0;
+#P message 71 123 61 196617 vasp buf!=1;
+#P newex 155 247 55 196617 vasp.= -1.;
+#P newex 92 247 55 196617 vasp.= 0.3;
+#P newex 224 214 55 196617 vasp.upper;
+#P newex 155 214 58 196617 vasp.lower;
+#P newex 224 247 59 196617 vasp.!bevel;
+#P newex 92 214 55 196617 vasp.upper;
+#P newex 31 214 58 196617 vasp.lower;
+#P newex 121 302 61 196617 vasp.update;
+#P newex 30 247 55 196617 vasp.bevel;
+#P newex 182 187 55 196617 vasp.upper;
+#P newex 71 187 58 196617 vasp.lower;
+#P newex 71 154 121 196617 vasp.m 2;
+#P newex 79 368 70 196617 vasp.= buf!=1;
+#P message 79 338 61 196617 vasp buf!=2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 375 80 49 196617 p wfkeys;
+#P hidden message 375 241 54 196617 set buf!=2;
+#P user waveform~ 375 262 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 586 428 101 196617 buffer~ buf!=2 2000;
+#P hidden message 375 119 54 196617 set buf!=1;
+#P hidden newex 375 100 45 196617 loadbang;
+#P user waveform~ 375 137 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 79 428 61 196617 vasp.update;
+#P newex 586 408 101 196617 buffer~ buf!=1 2000;
+#P comment 45 80 147 196617 argument/right inlet: value;
+#P comment 45 63 59 196617 not equal;
+#P comment 45 41 89 196622 vasp.!=;
+#P comment 176 125 92 196617 generate a function;
+#P comment 334 267 40 196617 true/1;
+#P comment 148 396 216 196617 test if a part of the function is not equal to -1.;
+#P connect 22 0 20 0;
+#P fasten 18 0 22 0 76 209 36 209;
+#P connect 29 0 17 0;
+#P connect 17 0 18 0;
+#P connect 15 0 16 0;
+#P connect 16 0 31 0;
+#P connect 31 0 7 0;
+#P fasten 18 0 23 0 76 209 97 209;
+#P connect 23 0 27 0;
+#P fasten 28 0 21 0 160 283 126 283;
+#P fasten 27 0 21 0 97 283 126 283;
+#P fasten 20 0 21 0 35 283 126 283;
+#P fasten 24 0 21 0 229 283 126 283;
+#P fasten 19 0 25 0 187 209 160 209;
+#P connect 25 0 28 0;
+#P connect 17 1 19 0;
+#P fasten 19 0 26 0 187 209 229 209;
+#P connect 26 0 24 0;
+#P hidden connect 9 0 10 0;
+#P hidden connect 14 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden fasten 9 0 13 0 380 100 380 100;
+#P hidden connect 14 0 12 0;
+#P hidden connect 13 0 12 0;
+#P connect 33 0 32 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.noise.help b/externals/grill/vasp/max-help/vasp.noise.help
new file mode 100755
index 00000000..8200fdbc
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.noise.help
@@ -0,0 +1,100 @@
+max v2;
+#N vpatcher 184 116 763 458;
+#P message 358 248 69 196617 vasp bufnoise;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 358 268 73 196617 p clear_buffer;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 236 40 49 196617 p wfkeys;
+#P message 195 269 27 196617 stop;
+#P message 127 269 65 196617 startwindow;
+#P newex 236 295 29 196617 dac~;
+#P newex 236 243 30 196617 line~;
+#P message 236 220 72 196617 0 \, 2000 2000;
+#P newex 236 268 73 196617 play~ bufnoise;
+#P hidden message 236 82 62 196617 set bufnoise;
+#P hidden newex 236 62 45 196617 loadbang;
+#P user waveform~ 236 102 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 41 146 55 196617 vasp.* 0.5;
+#P newex 41 168 61 196617 vasp.update;
+#P message 41 103 69 196617 vasp bufnoise;
+#P newex 437 268 109 196617 buffer~ bufnoise 2000;
+#P newex 41 124 55 196617 vasp.noise;
+#P comment 38 56 136 196617 vasp noise generator;
+#P comment 38 34 89 196622 vasp.noise;
+#P comment 116 104 99 196617 generate white noise;
+#P connect 5 0 3 0;
+#P connect 3 0 7 0;
+#P connect 7 0 6 0;
+#P hidden connect 9 0 10 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 17 0 8 0;
+#P connect 12 0 13 0;
+#P connect 13 0 11 0;
+#P connect 11 0 14 0;
+#P fasten 15 0 14 0 132 288 241 288;
+#P fasten 16 0 14 0 200 288 241 288;
+#P connect 11 0 14 1;
+#P connect 19 0 18 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.nonzero.help b/externals/grill/vasp/max-help/vasp.nonzero.help
new file mode 100755
index 00000000..652ce582
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.nonzero.help
@@ -0,0 +1,162 @@
+max v2;
+#N vpatcher 73 92 960 655;
+#P hidden newex 737 368 48 196617 r 1042path;
+#P message 633 391 93 196617 vasp buf?? buf??1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 633 410 78 196617 p clear_buffers;
+#P user umenu 59 141 72 196647 1 64 157 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1042path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 121 160 43 196617 p loader;
+#P hidden message 448 239 22 196617 set;
+#P comment 133 448 100 196617 sample values;
+#P message 20 463 794 196617;
+#P newex 20 434 60 196617 prepend set;
+#P message 20 399 528 196617;
+#P comment 52 101 133 196617 right outlet: sample value;
+#P newex 59 364 60 196617 prepend set;
+#P newex 59 265 44 196617 vasp.??;
+#P comment 811 222 44 196617 peaks;
+#P comment 132 182 148 196617 copy to new buffer \, find peaks;
+#P hidden message 529 220 55 196617 set buf??1;
+#P user waveform~ 529 237 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 737 410 104 196617 buffer~ buf??1 1000;
+#P comment 52 86 134 196617 left outlet: sample index;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 529 52 49 196617 p wfkeys;
+#P hidden message 529 98 51 196617 set buf??;
+#P hidden newex 529 74 45 196617 loadbang;
+#P user waveform~ 529 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 227 93 196617 vasp.peaks 0.0004;
+#P message 59 180 64 196617 vasp buf??1;
+#P newex 737 391 104 196617 buffer~ buf?? 1000;
+#P newex 59 201 65 196617 vasp.= buf??;
+#P comment 52 71 259 196617 outputs all samples of a vasp that are unequal to zero;
+#P comment 52 48 89 196622 vasp.??;
+#P comment 806 103 44 196617 source;
+#P comment 131 382 100 196617 sample index;
+#P hidden fasten 25 0 21 0 453 390 25 390;
+#P fasten 19 0 21 0 64 390 25 390;
+#P fasten 18 1 22 0 98 302 9 302 9 424 25 424;
+#P hidden fasten 25 0 23 0 453 457 25 457;
+#P connect 22 0 23 0;
+#P connect 6 0 4 0;
+#P connect 4 0 7 0;
+#P connect 7 0 18 0;
+#P connect 18 0 19 0;
+#P hidden connect 27 1 26 0;
+#P hidden fasten 9 0 25 0 531 91 453 91;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 5 1 10 0 836 406 846 406 846 94 534 94;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P hidden connect 9 0 15 0;
+#P hidden connect 15 0 14 0;
+#P hidden connect 11 0 14 0;
+#P connect 29 0 28 0;
+#P hidden connect 30 0 5 0;
+#P hidden fasten 14 5 8 4 834 340 846 340 846 94 834 94;
+#P hidden connect 8 5 14 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.offset.help b/externals/grill/vasp/max-help/vasp.offset.help
new file mode 100755
index 00000000..2a7c16eb
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.offset.help
@@ -0,0 +1,32 @@
+max v2;
+#N vpatcher 188 145 681 517;
+#P hidden message 424 146 22 196617 set;
+#P hidden newex 424 116 45 196617 loadbang;
+#P number 306 175 47 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P number 119 175 47 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 344 323 110 196617 buffer~ bufoffs2 2000;
+#P newex 344 303 110 196617 buffer~ bufoffs1 2000;
+#P message 245 254 209 196617;
+#P newex 245 221 60 196617 prepend set;
+#P message 245 148 153 196617 vasp bufoffs1 220 bufoffs2 100;
+#P newex 245 196 80 196617 vasp.offset 300;
+#P message 58 254 180 196617;
+#P newex 58 221 60 196617 prepend set;
+#P message 58 148 70 196617 vasp bufoffs1;
+#P newex 58 196 80 196617 vasp.offset 300;
+#P comment 55 83 135 196617 argument/right inlet: value;
+#P comment 55 69 204 196617 set the offset of a vasp (into a buffer);
+#P comment 55 45 89 196622 vasp.offs;
+#P comment 55 98 253 196617 ---! vasp.offs sets all vectors to the same offset !---;
+#P connect 5 0 4 0;
+#P connect 4 0 6 0;
+#P hidden fasten 17 0 7 0 429 246 63 246;
+#P connect 6 0 7 0;
+#P connect 14 0 4 1;
+#P connect 9 0 8 0;
+#P connect 8 0 10 0;
+#P hidden fasten 17 0 11 0 429 246 250 246;
+#P connect 10 0 11 0;
+#P connect 15 0 8 1;
+#P hidden connect 16 0 17 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.offsetd.help b/externals/grill/vasp/max-help/vasp.offsetd.help
new file mode 100755
index 00000000..59b71516
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.offsetd.help
@@ -0,0 +1,31 @@
+max v2;
+#N vpatcher 191 100 695 451;
+#P hidden message 438 125 22 196617 set;
+#P hidden newex 438 97 45 196617 loadbang;
+#P newex 359 305 115 196617 buffer~ bufoffs+2 2000;
+#P newex 359 284 115 196617 buffer~ bufoffs+1 2000;
+#P number 310 151 45 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P number 123 151 45 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P message 245 234 229 196617;
+#P newex 245 201 60 196617 prepend set;
+#P message 245 128 165 196617 vasp bufoffs+1 220 bufoffs+2 100;
+#P newex 245 172 75 196617 vasp.offs+ 300;
+#P message 58 234 171 196617;
+#P newex 58 201 60 196617 prepend set;
+#P message 58 128 75 196617 vasp bufoffs+1;
+#P newex 58 172 75 196617 vasp.offs+ 300;
+#P comment 55 80 135 196617 argument/right inlet: value;
+#P comment 55 63 189 196617 change the offset to a vasp (relatively);
+#P comment 55 39 89 196622 vasp.offs+;
+#P connect 4 0 3 0;
+#P connect 3 0 5 0;
+#P hidden fasten 16 0 6 0 443 228 63 228;
+#P connect 5 0 6 0;
+#P connect 11 0 3 1;
+#P connect 8 0 7 0;
+#P connect 7 0 9 0;
+#P hidden fasten 16 0 10 0 443 227 250 227;
+#P connect 9 0 10 0;
+#P connect 12 0 7 1;
+#P hidden connect 15 0 16 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.offsetq.help b/externals/grill/vasp/max-help/vasp.offsetq.help
new file mode 100755
index 00000000..8a01e618
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.offsetq.help
@@ -0,0 +1,17 @@
+max v2;
+#N vpatcher 243 134 660 396;
+#P number 202 162 42 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P number 45 162 42 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 278 221 114 196617 buffer~ buffoffs? 2000;
+#P message 202 106 161 196617 vasp buffoffs? 220 buffoffs? 300;
+#P newex 202 127 65 196617 vasp.offset?;
+#P message 45 106 115 196617 vasp 200 buffoffs? 300;
+#P newex 45 127 65 196617 vasp.offset?;
+#P comment 42 59 167 196617 get a single vectored vasp«s offset;
+#P comment 42 35 89 196622 vasp.offs?;
+#P comment 199 89 190 196617 more than 1 vector. watch max window!;
+#P connect 4 0 3 0;
+#P connect 3 0 8 0;
+#P connect 6 0 5 0;
+#P connect 5 0 9 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.opt.help b/externals/grill/vasp/max-help/vasp.opt.help
new file mode 100755
index 00000000..45a976bf
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.opt.help
@@ -0,0 +1,104 @@
+max v2;
+#N vpatcher 158 141 801 655;
+#P message 441 425 60 196617 vasp bufopt;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 441 446 73 196617 p clear_buffer;
+#P user umenu 73 119 72 196647 1 64 135 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1160path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 135 141 43 196617 p loader;
+#P comment 46 120 26 196617 read;
+#P hidden newex 519 425 48 196617 r 1160path;
+#P flonum 120 208 44 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P flonum 137 353 68 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 46 67 177 196617 otptimize a vasp (aka normalize);
+#P message 64 352 60 196617 vasp bufopt;
+#P newex 85 380 38 196617 vasp./;
+#P newex 85 403 61 196617 vasp.update;
+#P newex 85 188 45 196617 vasp.opt;
+#P message 85 160 60 196617 vasp bufopt;
+#P newex 85 319 62 196617 vasp.amax?;
+#P hidden message 302 131 53 196617 set bufopt;
+#P hidden newex 302 106 45 196617 loadbang;
+#P user waveform~ 302 156 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 240 446 27 196617 stop;
+#P message 173 446 65 196617 startwindow;
+#P newex 293 425 30 196617 line~;
+#P message 293 404 72 196617 0 \, 2000 2000;
+#P newex 293 472 29 196617 dac~;
+#P newex 293 446 64 196617 play~ bufopt;
+#P newex 85 228 61 196617 vasp.update;
+#P message 85 297 60 196617 vasp bufopt;
+#P newex 519 446 100 196617 buffer~ bufopt 2000;
+#P comment 210 355 141 196617 -> current absolute maximum;
+#P comment 83 279 210 196617 or use vasp.amax? to optimize buffer content;
+#P comment 46 44 95 196622 vasp.opt;
+#P comment 46 82 204 196617 right outlet: the original maximum value;
+#P connect 17 0 18 0;
+#P connect 18 0 6 0;
+#P connect 5 0 16 0;
+#P fasten 21 0 20 0 69 373 90 373;
+#P connect 20 0 19 0;
+#P fasten 23 0 20 1 142 374 118 374;
+#P connect 18 1 24 0;
+#P hidden connect 28 1 27 0;
+#P fasten 16 1 23 0 142 344 142 344;
+#P connect 9 0 10 0;
+#P connect 10 0 7 0;
+#P connect 7 0 8 0;
+#P fasten 11 0 8 0 178 466 298 466;
+#P fasten 12 0 8 0 245 466 298 466;
+#P hidden fasten 4 1 15 0 614 94 295 94 295 162 307 162;
+#P hidden connect 14 0 15 0;
+#P hidden connect 15 0 13 0;
+#P connect 7 0 8 1;
+#P connect 30 0 29 0;
+#P hidden connect 25 0 4 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.osc.help b/externals/grill/vasp/max-help/vasp.osc.help
new file mode 100755
index 00000000..33e26427
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.osc.help
@@ -0,0 +1,123 @@
+max v2;
+#N vpatcher 201 127 842 502;
+#P message 428 281 61 196617 vasp bufosc;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 428 301 73 196617 p clear_buffer;
+#N vpatcher 169 125 534 375;
+#P flonum 70 179 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 125 27 196617 t b f;
+#P message 309 151 27 196617 stop;
+#P message 243 151 65 196617 startwindow;
+#P newex 243 173 29 196617 dac~;
+#P comment 141 175 83 196617 period length in samples (float);
+#P flonum 88 97 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 147 27 196617 / 1.;
+#P flonum 68 73 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 54 49 53 196617 dspstate~;
+#P comment 133 98 100 196617 frequency in Hz;
+#P connect 1 1 2 0;
+#P fasten 4 0 9 0 93 118 75 118;
+#P fasten 2 0 3 0 73 115 54 115 54 145 75 145;
+#P connect 9 0 3 0;
+#P connect 3 0 10 0;
+#P connect 9 1 3 1;
+#P fasten 8 0 6 0 314 169 248 169;
+#P connect 7 0 6 0;
+#P pop;
+#P newobj 56 301 109 196617 p Hz_to_period_length;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 301 79 49 196617 p wfkeys;
+#P message 260 303 27 196617 stop;
+#P message 192 303 65 196617 startwindow;
+#P newex 301 328 29 196617 dac~;
+#P newex 301 276 30 196617 line~;
+#P message 301 253 72 196617 0 \, 2000 2000;
+#P newex 301 301 65 196617 play~ bufosc;
+#P hidden message 301 115 54 196617 set bufosc;
+#P hidden newex 301 97 45 196617 loadbang;
+#P user waveform~ 301 133 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 56 183 55 196617 vasp.* 0.5;
+#P newex 56 205 61 196617 vasp.update;
+#P message 56 129 61 196617 vasp bufosc;
+#P newex 512 301 101 196617 buffer~ bufosc 2000;
+#P comment 51 76 314 196617 optional argument/right inlet: frequency in period length in samples;
+#P newex 56 161 123 196617 vasp.osc 44.099998;
+#P comment 51 61 168 196617 vasp sine wave generator;
+#P comment 51 38 89 196622 vasp.osc;
+#P comment 126 130 142 196617 generate a sine wave at 1kHz;
+#P connect 6 0 3 0;
+#P connect 3 0 8 0;
+#P connect 8 0 7 0;
+#P hidden connect 10 0 11 0;
+#P hidden connect 18 0 9 0;
+#P hidden connect 11 0 9 0;
+#P connect 13 0 14 0;
+#P connect 14 0 12 0;
+#P fasten 17 0 15 0 265 321 306 321;
+#P fasten 16 0 15 0 197 321 306 321;
+#P connect 12 0 15 0;
+#P connect 12 0 15 1;
+#P connect 21 0 20 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.part.help b/externals/grill/vasp/max-help/vasp.part.help
new file mode 100755
index 00000000..686ebd02
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.part.help
@@ -0,0 +1,30 @@
+max v2;
+#N vpatcher 214 79 812 563;
+#P newex 103 380 52 196617 print rest;
+#P newex 62 380 30 196617 print;
+#P comment 56 93 316 196617 left inlet: a vasp to define the buffername and the maximum lenght;
+#P comment 56 140 344 196617 right outlet: a vasp with remaining length (if there is one) of the input vasp;
+#P message 62 176 81 196617 vasp buffpart11;
+#P comment 159 382 271 196617 so there are just 4 vasps and no rest.... watch maxwindow;
+#P message 221 314 131 196617 100 200 300 500 100 200;
+#P newex 62 344 51 196617 vasp.part;
+#P message 62 289 148 196617 vasp 1100 buffpart1 buffpart2;
+#P newex 166 239 52 196617 print rest;
+#P newex 62 238 30 196617 print;
+#P comment 56 125 214 196617 left outlet: the new vasps one after the other;
+#P newex 437 444 115 196617 buffer~ buffpart2 2000;
+#P newex 437 423 115 196617 buffer~ buffpart1 2000;
+#P newex 62 208 114 196617 vasp.part 100 100 100;
+#P comment 56 77 260 196617 generates vasps with certain lenghts;
+#P comment 56 53 89 196622 vasp.part;
+#P comment 56 109 197 196617 argument/ right inlet: vasps lenghts (list);
+#P comment 144 177 225 196617 vasp.part generates 3 new vasps and a rest vasp;
+#P comment 211 290 323 196617 the input vasp defines the maximum lengths of the vasps at the output;
+#P connect 15 0 5 0;
+#P connect 5 0 9 0;
+#P connect 11 0 12 0;
+#P connect 12 0 18 0;
+#P fasten 13 0 12 1 226 336 108 336;
+#P connect 12 1 19 0;
+#P connect 5 1 10 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.peaks.help b/externals/grill/vasp/max-help/vasp.peaks.help
new file mode 100755
index 00000000..6e2068d3
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.peaks.help
@@ -0,0 +1,176 @@
+max v2;
+#N vpatcher 120 75 805 582;
+#P comment 172 313 92 196617 = number of peaks;
+#P number 134 311 35 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 59 258 44 196617 vasp.??;
+#P flonum 134 259 71 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 134 283 51 196617 * 88200.;
+#P comment 52 101 162 196617 outlet: current density value 0-1;
+#P message 417 419 109 196617 vasp bufpeak bufpeak1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 417 442 73 196617 p clear_buffer;
+#P hidden newex 538 396 48 196617 r 1164path;
+#P user umenu 78 135 72 196647 1 64 151 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1164path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 140 157 43 196617 p loader;
+#P comment 52 137 26 196617 read;
+#P comment 619 254 44 196617 peaks;
+#P comment 165 181 148 196617 copy to new buffer \, find peaks;
+#P message 59 357 72 196617 vasp bufpeak1;
+#P newex 59 380 45 196617 vasp.opt;
+#P hidden message 337 251 65 196617 set bufpeak1;
+#P user waveform~ 337 269 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 538 442 112 196617 buffer~ bufpeak1 2000;
+#P comment 52 86 188 196617 argument/right inlet: density value 0-1;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 337 84 49 196617 p wfkeys;
+#P message 296 442 27 196617 stop;
+#P message 227 442 65 196617 startwindow;
+#P newex 337 468 29 196617 dac~;
+#P newex 337 419 30 196617 line~;
+#P message 337 398 72 196617 0 \, 2000 2000;
+#P newex 337 442 75 196617 play~ bufpeak1;
+#P hidden message 337 130 59 196617 set bufpeak;
+#P hidden newex 337 106 45 196617 loadbang;
+#P user waveform~ 337 150 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 59 231 85 196617 vasp.peaks 0.001;
+#P newex 59 406 61 196617 vasp.update;
+#P message 59 180 105 196617 vasp 88200 bufpeak1;
+#P newex 538 419 112 196617 buffer~ bufpeak 2000;
+#P newex 59 201 75 196617 vasp.= bufpeak;
+#P comment 52 72 218 196617 find the local maxima of the buffer samples;
+#P comment 52 48 89 196622 vasp.peaks;
+#P comment 133 358 111 196617 optimize buffer content;
+#P comment 614 135 44 196617 source;
+#P comment 206 262 100 196617 current density;
+#P comment 189 285 100 196617 * lenght of the vasp;
+#P connect 8 0 6 0;
+#P connect 6 0 10 0;
+#P connect 10 0 38 0;
+#P connect 26 0 25 0;
+#P connect 25 0 9 0;
+#P connect 10 1 37 0;
+#P connect 37 0 36 0;
+#P connect 36 0 39 0;
+#P hidden connect 31 1 30 0;
+#P hidden connect 12 0 13 0;
+#P hidden fasten 7 1 13 0 645 438 654 438 654 126 342 126;
+#P hidden connect 20 0 11 0;
+#P hidden connect 13 0 11 0;
+#P hidden connect 12 0 24 0;
+#P hidden connect 20 0 23 0;
+#P hidden connect 24 0 23 0;
+#P connect 15 0 16 0;
+#P connect 16 0 14 0;
+#P fasten 19 0 17 0 301 461 342 461;
+#P fasten 18 0 17 0 232 461 342 461;
+#P connect 14 0 17 0;
+#P connect 14 0 17 1;
+#P connect 34 0 33 0;
+#P hidden connect 32 0 7 0;
+#P hidden fasten 23 5 11 4 642 372 654 372 654 126 642 126;
+#P hidden connect 11 5 23 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.phasor.help b/externals/grill/vasp/max-help/vasp.phasor.help
new file mode 100755
index 00000000..3f246eee
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.phasor.help
@@ -0,0 +1,123 @@
+max v2;
+#N vpatcher 152 239 816 612;
+#P message 441 281 75 196617 vasp bufphasor;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 441 300 73 196617 p clear_buffer;
+#N vpatcher 169 125 534 375;
+#P flonum 70 179 61 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 125 27 196617 t b f;
+#P message 309 151 27 196617 stop;
+#P message 243 151 65 196617 startwindow;
+#P newex 243 173 29 196617 dac~;
+#P comment 141 175 83 196617 period length in samples (float);
+#P flonum 88 97 43 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 70 147 27 196617 / 1.;
+#P flonum 68 73 54 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 54 49 53 196617 dspstate~;
+#P comment 133 98 100 196617 frequency in Hz;
+#P connect 1 1 2 0;
+#P fasten 4 0 9 0 93 118 75 118;
+#P connect 9 0 3 0;
+#P fasten 2 0 3 0 73 115 54 115 54 145 75 145;
+#P connect 3 0 10 0;
+#P connect 9 1 3 1;
+#P connect 7 0 6 0;
+#P fasten 8 0 6 0 314 169 248 169;
+#P pop;
+#P newobj 54 300 109 196617 p Hz_to_period_length;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 327 66 49 196617 p wfkeys;
+#P message 286 301 27 196617 stop;
+#P message 218 301 65 196617 startwindow;
+#P newex 327 327 29 196617 dac~;
+#P newex 327 275 30 196617 line~;
+#P message 327 252 72 196617 0 \, 2000 2000;
+#P newex 327 300 80 196617 play~ bufphasor;
+#P hidden message 327 104 69 196617 set bufphasor;
+#P hidden newex 327 83 45 196617 loadbang;
+#P user waveform~ 327 122 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 54 175 55 196617 vasp.* 0.5;
+#P newex 54 197 61 196617 vasp.update;
+#P message 54 127 75 196617 vasp bufphasor;
+#P newex 524 300 115 196617 buffer~ bufphasor 2000;
+#P comment 46 76 311 196617 optional argument/right inlet: frequency in period length in samples;
+#P newex 54 153 89 196617 vasp.phasor 2205;
+#P comment 46 61 168 196617 vasp saw tooth ramp generator;
+#P comment 46 38 111 196622 vasp.phasor;
+#P comment 139 128 129 196617 generate saw tooth at 20Hz;
+#P connect 6 0 3 0;
+#P connect 3 0 8 0;
+#P connect 8 0 7 0;
+#P hidden connect 10 0 11 0;
+#P hidden connect 18 0 9 0;
+#P hidden connect 11 0 9 0;
+#P connect 13 0 14 0;
+#P connect 14 0 12 0;
+#P connect 12 0 15 0;
+#P fasten 17 0 15 0 291 320 332 320;
+#P fasten 16 0 15 0 223 320 332 320;
+#P connect 12 0 15 1;
+#P connect 21 0 20 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.polar.help b/externals/grill/vasp/max-help/vasp.polar.help
new file mode 100755
index 00000000..c2dbdf2c
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.polar.help
@@ -0,0 +1,291 @@
+max v2;
+#N vpatcher 209 148 932 603;
+#P origin 0 27;
+#P user umenu 79 131 72 196647 1 64 147 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 347 671;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 54 196617 s 1067path1;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 4 0 1 0;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 141 153 43 196617 p loader;
+#P message 487 360 101 196617 vasp bufpol1 bufpol2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 487 380 78 196617 p clear_buffers;
+#P hidden newex 589 336 54 196617 r 1067path1;
+#P comment 52 133 26 196617 read;
+#P newex 60 216 61 196617 vasp.update;
+#N vpatcher 148 79 912 552;
+#P origin 0 14;
+#P user umenu 83 71 72 196647 1 64 87 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 344 681;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1067path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 1 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 145 89 43 196617 p loader;
+#P message 521 380 101 196617 vasp bufpol3 bufpol4;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 521 399 78 196617 p clear_buffers;
+#P hidden newex 624 341 48 196617 r 1067path;
+#P comment 56 72 26 196617 read;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 421 101 49 196617 p wfkeys;
+#P hidden message 421 145 58 196617 set bufpol3;
+#P hidden newex 421 121 45 196617 loadbang;
+#P user waveform~ 421 163 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 380 400 27 196617 stop;
+#P message 312 400 65 196617 startwindow;
+#P newex 421 425 29 196617 dac~;
+#P newex 421 375 30 196617 line~;
+#P message 421 352 72 196617 0 \, 4000 4000;
+#P newex 421 399 69 196617 play~ bufpol3;
+#P newex 61 399 61 196617 vasp.freeze;
+#P comment 119 294 190 196617 polar to cartesian coordinate conversion;
+#P comment 178 238 81 196617 scale to 0 - 2¹;
+#P comment 146 215 68 196617 random phase;
+#P comment 130 184 116 196617 split amplitude and phase;
+#P comment 130 157 193 196617 cartesian to polar coordinate conversion;
+#P newex 624 399 105 196617 buffer~ bufpol4 4000;
+#P newex 624 378 105 196617 buffer~ bufpol3 4000;
+#P message 61 109 101 196617 vasp bufpol3 bufpol4;
+#P newex 61 338 61 196617 vasp.update;
+#P newex 61 315 52 196617 vasp.c!fft;
+#P newex 61 292 51 196617 vasp.rect;
+#P newex 61 269 58 196617 vasp.join 2;
+#P newex 86 237 86 196617 vasp.* 3.141593;
+#P newex 86 213 55 196617 vasp.noise;
+#P newex 61 181 61 196617 vasp.split 2;
+#P newex 61 155 55 196617 vasp.polar;
+#P newex 61 133 49 196617 vasp.cfft;
+#P comment 129 135 151 196617 complex fourier transmormation;
+#P comment 56 31 193 196622 phase random_example;
+#P comment 127 401 170 196617 is an abstraction that does the same;
+#P connect 12 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 8 0;
+#P connect 8 0 9 0;
+#P connect 9 0 10 0;
+#P connect 10 0 11 0;
+#P connect 5 1 6 0;
+#P connect 6 0 7 0;
+#P fasten 7 0 8 1 91 261 114 261;
+#P hidden connect 36 1 35 0;
+#P hidden connect 28 0 29 0;
+#P hidden fasten 13 1 29 0 724 396 740 396 740 103 426 103;
+#P hidden connect 30 0 27 0;
+#P hidden connect 29 0 27 0;
+#P connect 22 0 23 0;
+#P connect 23 0 21 0;
+#P connect 21 0 24 0;
+#P fasten 26 0 24 0 385 420 426 420;
+#P fasten 25 0 24 0 317 420 426 420;
+#P connect 21 0 24 1;
+#P connect 34 0 33 0;
+#P hidden fasten 32 0 13 0 629 372 629 372;
+#P pop;
+#P newobj 60 380 115 196617 p phaserandom_example;
+#P comment 173 258 173 196617 real-> amplitude / imaginary-> phase;
+#P comment 173 174 179 196617 transform into real and imaginary part;
+#P message 60 257 101 196617 vasp bufpol1 bufpol2;
+#P message 60 173 101 196617 vasp bufpol1 bufpol2;
+#P newex 60 277 55 196617 vasp.polar;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 382 43 49 196617 p wfkeys;
+#P comment 607 215 86 196617 phase / imaginary;
+#P hidden message 382 209 58 196617 set bufpol2;
+#P user waveform~ 382 230 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 589 380 105 196617 buffer~ bufpol2 2000;
+#P hidden message 382 87 58 196617 set bufpol1;
+#P hidden newex 382 63 45 196617 loadbang;
+#P user waveform~ 382 105 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 60 193 49 196617 vasp.cfft;
+#P newex 60 304 61 196617 vasp.update;
+#P newex 589 359 105 196617 buffer~ bufpol1 2000;
+#P comment 52 59 192 196617 cartesian to polar coordinate conversion;
+#P comment 52 36 89 196622 vasp.polar;
+#P comment 617 90 78 196617 amplitude / real;
+#P connect 15 0 5 0;
+#P connect 5 0 20 0;
+#P connect 16 0 14 0;
+#P connect 14 0 4 0;
+#P hidden connect 26 1 25 0;
+#P hidden connect 7 0 8 0;
+#P hidden fasten 3 1 8 0 689 377 699 377 699 82 387 82;
+#P hidden connect 13 0 6 0;
+#P hidden connect 8 0 6 0;
+#P hidden fasten 7 0 11 0 387 68 387 68;
+#P hidden connect 13 0 10 0;
+#P hidden connect 11 0 10 0;
+#P connect 24 0 23 0;
+#P hidden connect 22 0 3 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.pow.help b/externals/grill/vasp/max-help/vasp.pow.help
new file mode 100755
index 00000000..496b0468
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.pow.help
@@ -0,0 +1,98 @@
+max v2;
+#N vpatcher 201 127 816 493;
+#P newex 55 196 61 196617 vasp.update;
+#P message 404 291 64 196617 vasp bufpow;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 404 312 73 196617 p clear_buffer;
+#P flonum 134 257 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 50 67 66 196617 sample^x;
+#P message 55 235 64 196617 vasp bufpow;
+#P newex 55 280 68 196617 vasp.pow 0.1;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 280 65 49 196617 p wfkeys;
+#P hidden message 280 111 55 196617 set bufpow;
+#P hidden newex 280 87 45 196617 loadbang;
+#P user waveform~ 280 137 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 55 174 55 196617 vasp.* 0.2;
+#P newex 55 312 61 196617 vasp.update;
+#P message 55 123 64 196617 vasp bufpow;
+#P newex 487 312 104 196617 buffer~ bufpow 2000;
+#P comment 50 97 155 196617 argument/right inlet: exponent;
+#P newex 55 152 80 196617 vasp.osc 44100;
+#P comment 50 82 168 196617 power function;
+#P comment 50 43 89 196622 vasp.pow;
+#P comment 171 258 52 196617 exponent;
+#P comment 141 153 123 196617 generate a 1Hz sine wave;
+#P connect 7 0 4 0;
+#P connect 4 0 9 0;
+#P connect 9 0 20 0;
+#P connect 15 0 14 0;
+#P connect 14 0 8 0;
+#P fasten 17 0 14 1 139 275 118 275;
+#P hidden connect 11 0 12 0;
+#P hidden connect 12 0 10 0;
+#P hidden connect 13 0 10 0;
+#P connect 19 0 18 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.pwrap.help b/externals/grill/vasp/max-help/vasp.pwrap.help
new file mode 100755
index 00000000..ddc11a81
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.pwrap.help
@@ -0,0 +1,6 @@
+max v2;
+#N vpatcher 256 153 557 315;
+#P comment 44 38 89 196622 vasp.pwrap;
+#P newex 116 103 60 196617 vasp.pwrap;
+#P comment 44 62 179 196617 wraps value from 0-2¹ to -¹ to ¹;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.radd.help b/externals/grill/vasp/max-help/vasp.radd.help
new file mode 100755
index 00000000..af2abb0f
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.radd.help
@@ -0,0 +1,168 @@
+max v2;
+#N vpatcher 196 126 817 622;
+#P message 393 402 95 196617 vasp bufr+1 bufr+2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 393 423 78 196617 p clear_buffers;
+#P hidden newex 492 383 48 196617 r 1108path;
+#P user umenu 73 129 72 196647 1 64 145 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1108path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 135 151 43 196617 p loader;
+#P comment 46 131 26 196617 read;
+#P comment 190 244 30 196617 value;
+#P newex 53 287 61 196617 vasp.update;
+#P newex 53 367 61 196617 vasp.update;
+#P newex 53 213 61 196617 vasp.update;
+#P flonum 153 243 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 46 89 137 196617 needs two vectors;
+#P newex 53 346 52 196617 vasp.c!fft;
+#P message 53 325 95 196617 vasp bufr+1 bufr+2;
+#P newex 53 191 49 196617 vasp.cfft;
+#P message 53 169 95 196617 vasp bufr+1 bufr+2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 283 74 49 196617 p wfkeys;
+#P hidden message 283 246 55 196617 set bufr+2;
+#P user waveform~ 283 264 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 492 423 103 196617 buffer~ bufr+2 2000;
+#P comment 46 60 170 196617 add a value to the complex radius;
+#P newex 53 267 65 196617 vasp.r+ 0.05;
+#P hidden message 283 122 55 196617 set bufr+1;
+#P hidden newex 283 95 45 196617 loadbang;
+#P user waveform~ 283 143 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 230 423 27 196617 stop;
+#P message 163 423 65 196617 startwindow;
+#P newex 283 401 30 196617 line~;
+#P message 283 381 72 196617 0 \, 2000 2000;
+#P newex 283 449 29 196617 dac~;
+#P newex 283 423 65 196617 play~ bufr+1;
+#P message 53 243 95 196617 vasp bufr+1 bufr+2;
+#P newex 492 402 103 196617 buffer~ bufr+1 2000;
+#P comment 46 37 78 196622 vasp.r+;
+#P comment 46 74 168 196617 argument/right inlet: value (offset);
+#P connect 19 0 20 0;
+#P connect 20 0 25 0;
+#P connect 3 0 13 0;
+#P connect 13 0 27 0;
+#P connect 21 0 22 0;
+#P connect 22 0 26 0;
+#P fasten 24 0 13 1 158 263 113 263;
+#P hidden connect 31 1 30 0;
+#P hidden connect 11 0 12 0;
+#P hidden fasten 2 1 12 0 590 421 601 421 601 116 288 116;
+#P hidden connect 18 0 10 0;
+#P hidden connect 12 0 10 0;
+#P hidden connect 11 0 17 0;
+#P hidden fasten 15 1 17 0 590 444 601 444 601 243 288 243;
+#P hidden connect 18 0 16 0;
+#P hidden connect 17 0 16 0;
+#P connect 6 0 7 0;
+#P connect 7 0 4 0;
+#P fasten 9 0 5 0 235 443 288 443;
+#P fasten 8 0 5 0 168 443 288 443;
+#P connect 4 0 5 0;
+#P connect 4 0 5 1;
+#P connect 34 0 33 0;
+#P hidden connect 32 0 2 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rect.help b/externals/grill/vasp/max-help/vasp.rect.help
new file mode 100755
index 00000000..f03d5187
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rect.help
@@ -0,0 +1,301 @@
+max v2;
+#N vpatcher 213 143 951 665;
+#P user umenu 84 105 72 196647 1 64 121 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 347 671;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 54 196617 s 1069path1;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 4 0 1 0;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 146 127 43 196617 p loader;
+#P message 467 441 113 196617 vasp bufrect1 bufrect2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 467 460 78 196617 p clear_buffers;
+#P hidden newex 582 414 54 196617 r 1069path1;
+#P comment 57 107 26 196617 read;
+#P comment 187 376 179 196617 tranform with invers cfft to original;
+#P newex 63 416 61 196617 vasp.update;
+#P message 63 375 113 196617 vasp bufrect1 bufrect2;
+#P newex 63 395 52 196617 vasp.c!fft;
+#P newex 63 186 61 196617 vasp.update;
+#P message 63 297 113 196617 vasp bufrect1 bufrect2;
+#P newex 63 317 51 196617 vasp.rect;
+#P newex 63 339 61 196617 vasp.update;
+#P comment 187 221 173 196617 real-> amplitude / imaginary-> phase;
+#N vpatcher 148 168 892 640;
+#P user umenu 83 67 72 196647 1 64 83 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 347 671;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1069path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P fasten 0 0 1 0 143 134 64 134;
+#P connect 4 0 1 0;
+#P connect 3 1 0 0;
+#P pop;
+#P hidden newobj 145 89 43 196617 p loader;
+#P message 591 355 113 196617 vasp bufrect3 bufrect4;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 591 374 78 196617 p clear_buffers;
+#P hidden newex 544 395 48 196617 r 1069path;
+#P comment 56 68 26 196617 read;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 394 60 49 196617 p wfkeys;
+#P hidden message 394 104 64 196617 set bufrect3;
+#P hidden newex 394 80 45 196617 loadbang;
+#P user waveform~ 394 122 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 394 395 27 196617 stop;
+#P message 326 395 65 196617 startwindow;
+#P newex 435 421 29 196617 dac~;
+#P newex 435 369 30 196617 line~;
+#P message 435 346 72 196617 0 \, 4000 4000;
+#P newex 435 394 75 196617 play~ bufrect3;
+#P newex 61 395 61 196617 vasp.freeze;
+#P comment 118 290 190 196617 polar to cartesian coordinate conversion;
+#P comment 178 235 81 196617 scale to 0 - 2¹;
+#P comment 149 211 68 196617 random phase;
+#P comment 128 180 116 196617 split amplitude and phase;
+#P comment 123 153 193 196617 cartesian to polar coordinate conversion;
+#P newex 591 416 111 196617 buffer~ bufrect4 4000;
+#P newex 591 394 111 196617 buffer~ bufrect3 4000;
+#P message 61 105 113 196617 vasp bufrect3 bufrect4;
+#P newex 61 334 61 196617 vasp.update;
+#P newex 61 311 52 196617 vasp.c!fft;
+#P newex 61 288 51 196617 vasp.rect;
+#P newex 61 265 58 196617 vasp.join 2;
+#P newex 86 233 86 196617 vasp.* 3.141593;
+#P newex 86 209 55 196617 vasp.noise;
+#P newex 61 177 61 196617 vasp.split 2;
+#P newex 61 151 55 196617 vasp.polar;
+#P newex 61 129 49 196617 vasp.cfft;
+#P comment 122 131 151 196617 complex fourier transformation;
+#P comment 56 35 177 196622 phase random_example;
+#P comment 127 397 170 196617 is an abstraction that does the same;
+#P connect 12 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 8 0;
+#P connect 8 0 9 0;
+#P connect 9 0 10 0;
+#P connect 10 0 11 0;
+#P connect 5 1 6 0;
+#P connect 6 0 7 0;
+#P fasten 7 0 8 1 91 257 114 257;
+#P hidden connect 36 1 35 0;
+#P hidden fasten 13 1 29 0 697 413 713 413 713 99 399 99;
+#P hidden connect 28 0 29 0;
+#P hidden connect 29 0 27 0;
+#P hidden connect 30 0 27 0;
+#P connect 22 0 23 0;
+#P connect 23 0 21 0;
+#P connect 21 0 24 0;
+#P fasten 25 0 24 0 331 414 440 414;
+#P fasten 26 0 24 0 399 414 440 414;
+#P connect 21 0 24 1;
+#P connect 34 0 33 0;
+#P hidden fasten 32 0 13 0 549 388 596 388;
+#P pop;
+#P newobj 63 460 115 196617 p phaserandom_example;
+#P comment 187 298 180 196617 amplitude-> real / phase-> imaginary;
+#P comment 187 146 179 196617 tranform with cfft to real / imaginary;
+#P message 63 220 113 196617 vasp bufrect1 bufrect2;
+#P message 63 145 113 196617 vasp bufrect1 bufrect2;
+#P newex 63 240 55 196617 vasp.polar;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 385 85 49 196617 p wfkeys;
+#P comment 611 257 86 196617 imaginary / phase;
+#P hidden message 385 251 64 196617 set bufrect2;
+#P user waveform~ 385 272 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 582 460 111 196617 buffer~ bufrect2 2000;
+#P hidden message 385 129 64 196617 set bufrect1;
+#P hidden newex 385 105 45 196617 loadbang;
+#P user waveform~ 385 147 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 63 165 49 196617 vasp.cfft;
+#P newex 63 262 61 196617 vasp.update;
+#P newex 582 441 111 196617 buffer~ bufrect1 2000;
+#P comment 54 71 192 196617 polar to cartesian coordinate conversion;
+#P comment 54 48 76 196622 vasp.rect;
+#P comment 620 132 83 196617 real / amplitude;
+#P connect 15 0 5 0;
+#P connect 5 0 24 0;
+#P connect 16 0 14 0;
+#P connect 14 0 4 0;
+#P connect 23 0 22 0;
+#P connect 22 0 21 0;
+#P connect 26 0 25 0;
+#P connect 25 0 27 0;
+#P hidden connect 34 1 33 0;
+#P hidden connect 7 0 8 0;
+#P hidden fasten 3 1 8 0 688 458 702 458 702 74 390 74;
+#P hidden connect 13 0 6 0;
+#P hidden connect 8 0 6 0;
+#P hidden fasten 7 0 11 0 390 110 390 110;
+#P hidden connect 11 0 10 0;
+#P hidden connect 13 0 10 0;
+#P connect 32 0 31 0;
+#P hidden connect 30 0 3 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rfft.help b/externals/grill/vasp/max-help/vasp.rfft.help
new file mode 100755
index 00000000..4508d4da
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rfft.help
@@ -0,0 +1,137 @@
+max v2;
+#N vpatcher 424 101 1093 481;
+#P comment 120 291 78 196617 inverse real fft;
+#P comment 122 211 43 196617 real fft;
+#P message 281 312 27 196617 stop;
+#P message 213 312 65 196617 startwindow;
+#P newex 322 338 29 196617 dac~;
+#P newex 322 286 30 196617 line~;
+#P message 322 263 72 196617 0 \, 2000 2000;
+#P newex 322 312 65 196617 play~ bufrfft;
+#P hidden newex 522 292 48 196617 r 1065path;
+#P user umenu 86 140 72 196647 1 64 156 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1065path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 148 162 43 196617 p loader;
+#P message 439 292 63 196617 vasp bufrfft;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 439 312 73 196617 p clear_buffer;
+#P newex 65 312 61 196617 vasp.update;
+#P message 65 267 63 196617 vasp bufrfft;
+#P newex 65 288 52 196617 vasp.r!fft;
+#P newex 65 232 61 196617 vasp.update;
+#P comment 51 105 254 196617 the imaginary part of the fft is assumed to be zero;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 55 196617 set bufrfft;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 65 187 63 196617 vasp bufrfft;
+#P newex 522 312 103 196617 buffer~ bufrfft 2000;
+#P newex 65 208 49 196617 vasp.rfft;
+#P comment 52 70 167 196617 real fft;
+#P comment 52 48 89 196622 vasp.rfft;
+#P comment 598 103 44 196617 source;
+#P comment 52 88 254 196617 opposite to cfft there is only one real input buffer;
+#P comment 54 142 31 196617 read;
+#P connect 7 0 5 0;
+#P connect 5 0 13 0;
+#P connect 15 0 14 0;
+#P connect 14 0 16 0;
+#P hidden connect 20 1 19 0;
+#P hidden connect 9 0 10 0;
+#P hidden fasten 6 1 10 0 620 333 638 333 638 94 326 94;
+#P hidden connect 10 0 8 0;
+#P hidden connect 11 0 8 0;
+#P connect 23 0 24 0;
+#P connect 24 0 22 0;
+#P fasten 27 0 25 0 286 331 327 331;
+#P fasten 26 0 25 0 218 331 327 331;
+#P connect 22 0 25 0;
+#P connect 22 0 25 1;
+#P connect 18 0 17 0;
+#P hidden connect 21 0 6 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rgate.help b/externals/grill/vasp/max-help/vasp.rgate.help
new file mode 100755
index 00000000..ce5a6a4e
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rgate.help
@@ -0,0 +1,170 @@
+max v2;
+#N vpatcher 180 112 873 652;
+#P message 425 400 123 196617 vasp bufrgate1 bufrgate2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 425 455 78 196617 p clear_buffers;
+#P hidden newex 539 406 48 196617 r 1170path;
+#P user umenu 78 143 72 196647 1 64 159 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1170path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 140 165 43 196617 p loader;
+#P comment 52 145 26 196617 read;
+#P comment 52 101 172 196617 needs two vectors (real/imaginary);
+#P newex 63 404 61 196617 vasp.update;
+#P message 63 360 123 196617 vasp bufrgate1 bufrgate2;
+#P newex 63 381 52 196617 vasp.c!fft;
+#P comment 165 287 32 196617 value;
+#P newex 63 227 61 196617 vasp.update;
+#P newex 63 324 61 196617 vasp.update;
+#P flonum 127 285 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P message 63 261 123 196617 vasp bufrgate1 bufrgate2;
+#P newex 63 304 74 196617 vasp.rgate 0.2;
+#P message 301 456 27 196617 stop;
+#P message 233 456 65 196617 startwindow;
+#P newex 342 480 29 196617 dac~;
+#P newex 342 429 30 196617 line~;
+#P message 342 400 72 196617 0 \, 2000 2000;
+#P newex 342 455 80 196617 play~ bufrgate1;
+#P message 63 183 123 196617 vasp bufrgate1 bufrgate2;
+#P newex 63 204 49 196617 vasp.cfft;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 342 85 49 196617 p wfkeys;
+#P hidden message 342 255 69 196617 set bufrgate2;
+#P user waveform~ 342 273 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 539 455 115 196617 buffer~ bufrgate2 2000;
+#P hidden message 342 135 69 196617 set bufrgate1;
+#P hidden newex 342 107 45 196617 loadbang;
+#P user waveform~ 342 153 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 539 434 115 196617 buffer~ bufrgate1 2000;
+#P comment 52 86 303 196617 argument/right inlet: value (usualy from 0-1) to gate the radius;
+#P comment 52 71 257 196617 gate the radius of a complex buffer content with a value;
+#P comment 52 48 89 196622 vasp.rgate;
+#P connect 12 0 11 0;
+#P connect 11 0 23 0;
+#P connect 20 0 19 0;
+#P connect 19 0 22 0;
+#P connect 26 0 25 0;
+#P connect 25 0 27 0;
+#P connect 21 0 19 1;
+#P hidden connect 31 1 30 0;
+#P hidden fasten 5 0 6 0 347 116 347 116;
+#P hidden fasten 3 1 6 0 649 452 673 452 673 131 347 131;
+#P hidden connect 10 0 4 0;
+#P hidden connect 6 0 4 0;
+#P hidden fasten 5 0 9 0 347 116 347 116;
+#P hidden fasten 7 1 9 0 649 474 673 474 673 260 347 260;
+#P hidden connect 9 0 8 0;
+#P hidden connect 10 0 8 0;
+#P connect 14 0 15 0;
+#P connect 15 0 13 0;
+#P connect 13 0 16 0;
+#P fasten 17 0 16 0 238 474 347 474;
+#P fasten 18 0 16 0 306 474 347 474;
+#P connect 13 0 16 1;
+#P connect 34 0 33 0;
+#P hidden connect 32 0 3 0;
+#P hidden fasten 8 5 4 4 647 376 658 376 658 147 647 147;
+#P hidden connect 4 5 8 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rifft.help b/externals/grill/vasp/max-help/vasp.rifft.help
new file mode 100755
index 00000000..019a9aad
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rifft.help
@@ -0,0 +1,137 @@
+max v2;
+#N vpatcher 308 211 977 591;
+#P comment 120 291 78 196617 inverse real fft;
+#P comment 122 211 43 196617 real fft;
+#P message 281 312 27 196617 stop;
+#P message 213 312 65 196617 startwindow;
+#P newex 322 338 29 196617 dac~;
+#P newex 322 286 30 196617 line~;
+#P message 322 263 72 196617 0 \, 2000 2000;
+#P newex 322 312 65 196617 play~ bufrfft;
+#P hidden newex 522 292 48 196617 r 1066path;
+#P user umenu 83 140 72 196647 1 64 156 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1066path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 145 162 43 196617 p loader;
+#P message 442 292 63 196617 vasp bufrfft;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 442 312 73 196617 p clear_buffer;
+#P newex 65 312 61 196617 vasp.update;
+#P message 65 267 63 196617 vasp bufrfft;
+#P newex 65 288 52 196617 vasp.r!fft;
+#P newex 65 232 61 196617 vasp.update;
+#P comment 52 100 254 196617 the imaginary part of the fft is assumed to be zero;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 321 52 49 196617 p wfkeys;
+#P hidden message 321 98 55 196617 set bufrfft;
+#P hidden newex 321 74 45 196617 loadbang;
+#P user waveform~ 321 118 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 65 187 63 196617 vasp bufrfft;
+#P newex 522 312 103 196617 buffer~ bufrfft 2000;
+#P newex 65 208 49 196617 vasp.rfft;
+#P comment 52 70 96 196617 inverse real fft;
+#P comment 52 48 89 196622 vasp.r!fft;
+#P comment 598 103 44 196617 source;
+#P comment 52 85 254 196617 opposite to cfft there is only one real input buffer;
+#P comment 52 142 31 196617 read;
+#P connect 7 0 5 0;
+#P connect 5 0 13 0;
+#P connect 15 0 14 0;
+#P connect 14 0 16 0;
+#P hidden connect 20 1 19 0;
+#P hidden fasten 6 1 10 0 620 333 638 333 638 94 326 94;
+#P hidden connect 9 0 10 0;
+#P hidden connect 11 0 8 0;
+#P hidden connect 10 0 8 0;
+#P connect 23 0 24 0;
+#P connect 24 0 22 0;
+#P connect 22 0 25 0;
+#P fasten 26 0 25 0 218 331 327 331;
+#P fasten 27 0 25 0 286 331 327 331;
+#P connect 22 0 25 1;
+#P connect 18 0 17 0;
+#P hidden connect 21 0 6 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rmax.help b/externals/grill/vasp/max-help/vasp.rmax.help
new file mode 100755
index 00000000..029cff9b
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rmax.help
@@ -0,0 +1,165 @@
+max v2;
+#N vpatcher 185 142 812 630;
+#P message 374 374 123 196617 vasp bufrmax1 bufrmax2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 374 416 78 196617 p clear_buffers;
+#P hidden newex 549 375 48 196617 r 1157path;
+#P user umenu 75 127 72 196647 1 64 143 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1157path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 137 149 43 196617 p loader;
+#P comment 49 128 26 196617 read;
+#P newex 53 356 61 196617 vasp.update;
+#P flonum 180 250 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 46 90 137 196617 needs two vectors;
+#P newex 53 335 52 196617 vasp.c!fft;
+#P message 53 314 123 196617 vasp bufrmax1 bufrmax2;
+#P newex 53 189 49 196617 vasp.cfft;
+#P message 53 167 123 196617 vasp bufrmax1 bufrmax2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 287 76 49 196617 p wfkeys;
+#P hidden message 287 239 69 196617 set bufrmax2;
+#P user waveform~ 287 256 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 484 416 115 196617 buffer~ bufrmax2 2000;
+#P comment 46 60 314 196617 compares the complex radius of buffer pairs and takes maximum;
+#P newex 53 274 74 196617 vasp.rmax 0.2;
+#P hidden message 287 118 69 196617 set bufrmax1;
+#P hidden newex 287 97 45 196617 loadbang;
+#P user waveform~ 287 136 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 234 416 27 196617 stop;
+#P message 167 416 65 196617 startwindow;
+#P newex 287 394 30 196617 line~;
+#P message 287 374 72 196617 0 \, 2000 2000;
+#P newex 287 442 29 196617 dac~;
+#P newex 287 416 80 196617 play~ bufrmax1;
+#P message 53 250 123 196617 vasp bufrmax1 bufrmax2;
+#P newex 484 394 115 196617 buffer~ bufrmax1 2000;
+#P comment 46 37 78 196622 vasp.rmax;
+#P comment 46 75 137 196617 argument/right inlet: value;
+#P newex 53 213 61 196617 vasp.update;
+#P connect 20 0 21 0;
+#P connect 21 0 0 0;
+#P connect 4 0 14 0;
+#P connect 22 0 23 0;
+#P connect 23 0 26 0;
+#P fasten 25 0 14 1 185 269 122 269;
+#P hidden connect 29 1 28 0;
+#P hidden connect 12 0 13 0;
+#P hidden fasten 3 1 13 0 594 413 605 413 605 115 292 115;
+#P hidden connect 19 0 11 0;
+#P hidden connect 13 0 11 0;
+#P hidden fasten 16 1 18 0 594 436 605 436 605 237 292 237;
+#P hidden connect 12 0 18 0;
+#P hidden connect 19 0 17 0;
+#P hidden connect 18 0 17 0;
+#P connect 7 0 8 0;
+#P connect 8 0 5 0;
+#P fasten 10 0 6 0 239 436 292 436;
+#P fasten 9 0 6 0 172 436 292 436;
+#P connect 5 0 6 0;
+#P connect 5 0 6 1;
+#P connect 32 0 31 0;
+#P hidden connect 30 0 3 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rmaxq.help b/externals/grill/vasp/max-help/vasp.rmaxq.help
new file mode 100755
index 00000000..0e49d689
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rmaxq.help
@@ -0,0 +1,179 @@
+max v2;
+#N vpatcher 180 75 870 686;
+#P message 437 500 135 196617 vasp bufrmax?1 bufrmax?2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 437 542 78 196617 p clear_buffers;
+#P newex 59 452 61 196617 vasp.update;
+#P newex 59 210 61 196617 vasp.update;
+#P hidden newex 535 500 48 196617 r 1155path;
+#P user umenu 78 127 72 196647 1 64 143 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1155path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 140 149 43 196617 p loader;
+#P comment 52 129 26 196617 read;
+#P comment 46 90 137 196617 needs two vectors;
+#P newex 59 430 52 196617 vasp.c!fft;
+#P message 59 409 135 196617 vasp bufrmax?1 bufrmax?2;
+#P newex 59 189 49 196617 vasp.cfft;
+#P message 59 167 135 196617 vasp bufrmax?1 bufrmax?2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 344 97 49 196617 p wfkeys;
+#P hidden message 344 278 75 196617 set bufrmax?2;
+#P user waveform~ 344 299 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 534 542 122 196617 buffer~ bufrmax?2 2000;
+#P flonum 92 321 68 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 46 60 286 196617 maximum of the radius values of a complex vasp;
+#P message 59 293 135 196617 vasp bufrmax?1 bufrmax?2;
+#P newex 59 350 43 196617 vasp.c/;
+#P newex 59 372 61 196617 vasp.update;
+#P newex 58 522 51 196617 vasp.ropt;
+#P message 58 498 135 196617 vasp bufrmax?1 bufrmax?2;
+#P newex 59 260 62 196617 vasp.rmax?;
+#P hidden message 344 145 75 196617 set bufrmax?1;
+#P hidden newex 344 118 45 196617 loadbang;
+#P user waveform~ 344 166 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 291 542 27 196617 stop;
+#P message 224 542 65 196617 startwindow;
+#P newex 344 520 30 196617 line~;
+#P message 344 500 72 196617 0 \, 2000 2000;
+#P newex 344 568 29 196617 dac~;
+#P newex 344 542 85 196617 play~ bufrmax?1;
+#P newex 58 542 61 196617 vasp.update;
+#P message 59 241 135 196617 vasp bufrmax?1 bufrmax?2;
+#P newex 534 521 122 196617 buffer~ bufrmax?1 2000;
+#P comment 163 322 141 196617 -> current maximum;
+#P comment 106 351 181 196617 use the maximum to optimize radius;
+#P comment 52 482 179 196617 or use vasp.ropt which does the same;
+#P comment 46 37 92 196622 vasp.rmax?;
+#P comment 46 75 137 196617 right outlet: calculated value;
+#P connect 18 0 19 0;
+#P connect 19 0 7 0;
+#P connect 29 0 30 0;
+#P connect 30 0 38 0;
+#P connect 6 0 17 0;
+#P connect 22 0 21 0;
+#P connect 21 0 20 0;
+#P connect 31 0 32 0;
+#P connect 32 0 39 0;
+#P fasten 17 1 24 0 116 283 200 283 200 314 97 314;
+#P connect 24 0 21 1;
+#P hidden connect 36 1 35 0;
+#P hidden connect 15 0 16 0;
+#P hidden fasten 5 1 16 0 651 540 662 540 662 139 349 139;
+#P hidden connect 28 0 14 0;
+#P hidden connect 16 0 14 0;
+#P hidden fasten 25 1 27 0 651 561 662 561 662 272 349 272;
+#P hidden connect 15 0 27 0;
+#P hidden connect 27 0 26 0;
+#P hidden connect 28 0 26 0;
+#P connect 10 0 11 0;
+#P connect 11 0 8 0;
+#P fasten 12 0 9 0 229 562 349 562;
+#P fasten 13 0 9 0 296 562 349 562;
+#P connect 8 0 9 0;
+#P connect 8 0 9 1;
+#P connect 41 0 40 0;
+#P hidden connect 37 0 5 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rmin.help b/externals/grill/vasp/max-help/vasp.rmin.help
new file mode 100755
index 00000000..9544d81c
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rmin.help
@@ -0,0 +1,167 @@
+max v2;
+#N vpatcher 239 143 840 647;
+#P newex 53 362 61 196617 vasp.update;
+#P newex 53 286 61 196617 vasp.update;
+#P newex 53 211 61 196617 vasp.update;
+#P message 359 391 115 196617 vasp bufrmin1 bufrmin2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 359 433 78 196617 p clear_buffers;
+#P user umenu 72 129 72 196647 1 64 145 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 54 196617 s #01path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 134 151 43 196617 p loader;
+#P comment 46 130 26 196617 read;
+#P hidden newex 459 389 54 196617 r #01path;
+#P flonum 173 242 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 46 90 137 196617 needs two vectors;
+#P newex 53 342 52 196617 vasp.c!fft;
+#P message 53 321 115 196617 vasp bufrmin1 bufrmin2;
+#P newex 53 189 49 196617 vasp.cfft;
+#P message 53 169 115 196617 vasp bufrmin1 bufrmin2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 260 63 49 196617 p wfkeys;
+#P hidden message 260 244 65 196617 set bufrmin2;
+#P user waveform~ 260 265 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 459 433 113 196617 buffer~ bufrmin2 2000;
+#P comment 46 60 310 196617 compares the complex radius of buffer pairs and takes minimum;
+#P newex 53 266 75 196617 vasp.rmin 0.05;
+#P hidden message 260 111 65 196617 set bufrmin1;
+#P hidden newex 260 84 45 196617 loadbang;
+#P user waveform~ 260 132 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 207 433 27 196617 stop;
+#P message 140 433 65 196617 startwindow;
+#P newex 260 412 30 196617 line~;
+#P message 260 391 72 196617 0 \, 2000 2000;
+#P newex 260 459 29 196617 dac~;
+#P newex 260 433 75 196617 play~ bufrmin1;
+#P message 53 242 115 196617 vasp bufrmin1 bufrmin2;
+#P newex 459 412 113 196617 buffer~ bufrmin1 2000;
+#P comment 46 37 78 196622 vasp.rmin;
+#P comment 46 75 137 196617 argument/right inlet:;
+#P connect 19 0 20 0;
+#P connect 20 0 31 0;
+#P connect 3 0 13 0;
+#P connect 13 0 32 0;
+#P connect 21 0 22 0;
+#P connect 22 0 33 0;
+#P fasten 24 0 13 1 178 261 123 261;
+#P hidden connect 28 1 27 0;
+#P hidden connect 11 0 12 0;
+#P hidden fasten 2 1 12 0 567 430 578 430 578 105 265 105;
+#P hidden connect 18 0 10 0;
+#P hidden connect 12 0 10 0;
+#P hidden fasten 15 1 17 0 567 452 578 452 578 238 265 238;
+#P hidden connect 11 0 17 0;
+#P hidden connect 18 0 16 0;
+#P hidden connect 17 0 16 0;
+#P connect 6 0 7 0;
+#P connect 7 0 4 0;
+#P fasten 9 0 5 0 212 453 265 453;
+#P fasten 8 0 5 0 145 453 265 453;
+#P connect 4 0 5 0;
+#P connect 4 0 5 1;
+#P connect 30 0 29 0;
+#P hidden connect 25 0 2 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rminq.help b/externals/grill/vasp/max-help/vasp.rminq.help
new file mode 100755
index 00000000..d3c472e0
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rminq.help
@@ -0,0 +1,149 @@
+max v2;
+#N vpatcher 211 115 858 569;
+#P message 365 381 129 196617 vasp bufrmin?1 bufrmin?2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 365 402 73 196617 p clear_buffer;
+#P newex 53 213 61 196617 vasp.update;
+#P hidden newex 496 362 48 196617 r 1154path;
+#P user umenu 72 128 72 196647 1 64 144 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1154path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 134 150 43 196617 p loader;
+#P comment 46 130 26 196617 read;
+#P comment 46 89 137 196617 needs two vectors;
+#P newex 53 191 49 196617 vasp.cfft;
+#P message 53 169 129 196617 vasp bufrmin?1 bufrmin?2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 303 79 49 196617 p wfkeys;
+#P hidden message 303 245 72 196617 set bufrmin?2;
+#P user waveform~ 303 263 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 496 402 119 196617 buffer~ bufrmin?2 2000;
+#P flonum 102 297 68 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 46 61 232 196617 min-value of the radius values of a complex vasp;
+#P newex 53 259 59 196617 vasp.rmin?;
+#P hidden message 303 121 72 196617 set bufrmin?1;
+#P hidden newex 303 100 45 196617 loadbang;
+#P user waveform~ 303 140 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 53 240 129 196617 vasp bufrmin?1 bufrmin?2;
+#P newex 496 381 119 196617 buffer~ bufrmin?1 2000;
+#P comment 173 298 99 196617 -> current minimum;
+#P comment 46 37 98 196622 vasp.rmin?;
+#P comment 46 74 137 196617 right outlet: calculated value;
+#P connect 15 0 16 0;
+#P connect 16 0 22 0;
+#P connect 4 0 8 0;
+#P connect 8 1 10 0;
+#P hidden connect 20 1 19 0;
+#P hidden connect 6 0 7 0;
+#P hidden fasten 3 1 7 0 610 399 621 399 621 118 308 118;
+#P hidden connect 14 0 5 0;
+#P hidden connect 7 0 5 0;
+#P hidden fasten 11 1 13 0 610 423 621 423 621 242 308 242;
+#P hidden connect 6 0 13 0;
+#P hidden connect 14 0 12 0;
+#P hidden connect 13 0 12 0;
+#P connect 24 0 23 0;
+#P hidden connect 21 0 3 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.ropt.help b/externals/grill/vasp/max-help/vasp.ropt.help
new file mode 100755
index 00000000..176df949
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.ropt.help
@@ -0,0 +1,168 @@
+max v2;
+#N vpatcher 220 112 892 639;
+#P message 416 408 113 196617 vasp bufropt1 bufropt2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 416 450 73 196617 p clear_buffer;
+#P hidden newex 532 403 48 196617 r 1171path;
+#P user umenu 72 129 72 196647 1 64 145 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1171path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 134 151 43 196617 p loader;
+#P comment 46 131 26 196617 read;
+#P comment 168 336 131 196617 transform to time domain;
+#P comment 167 170 155 196617 transform to frequency domain;
+#P comment 170 258 47 196617 optimize;
+#P newex 53 215 61 196617 vasp.update;
+#P newex 53 297 61 196617 vasp.update;
+#P comment 46 90 95 196617 needs two vectors;
+#P newex 53 356 52 196617 vasp.c!fft;
+#P message 53 335 113 196617 vasp bufropt1 bufropt2;
+#P newex 53 191 49 196617 vasp.cfft;
+#P message 53 169 113 196617 vasp bufropt1 bufropt2;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 331 67 49 196617 p wfkeys;
+#P hidden message 331 248 64 196617 set bufropt2;
+#P user waveform~ 331 269 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 532 450 111 196617 buffer~ bufropt2 2000;
+#P comment 46 60 222 196617 optimize the radius of a complex buffer content;
+#P newex 53 276 51 196617 vasp.ropt;
+#P hidden message 331 115 64 196617 set bufropt1;
+#P hidden newex 331 88 45 196617 loadbang;
+#P user waveform~ 331 136 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 280 450 27 196617 stop;
+#P message 213 450 65 196617 startwindow;
+#P newex 333 428 30 196617 line~;
+#P message 333 408 72 196617 0 \, 2000 2000;
+#P newex 333 476 29 196617 dac~;
+#P newex 333 450 75 196617 play~ bufropt1;
+#P newex 53 379 61 196617 vasp.update;
+#P message 53 257 113 196617 vasp bufropt1 bufropt2;
+#P newex 532 428 111 196617 buffer~ bufropt1 2000;
+#P comment 46 37 78 196622 vasp.ropt;
+#P comment 46 75 171 196617 right outlet: the previous maximum;
+#P connect 20 0 21 0;
+#P connect 21 0 26 0;
+#P connect 3 0 14 0;
+#P connect 14 0 25 0;
+#P connect 22 0 23 0;
+#P connect 23 0 4 0;
+#P hidden connect 32 1 31 0;
+#P hidden connect 12 0 13 0;
+#P hidden fasten 2 1 13 0 638 446 649 446 649 109 336 109;
+#P hidden connect 19 0 11 0;
+#P hidden connect 13 0 11 0;
+#P hidden fasten 16 1 18 0 638 471 649 471 649 242 336 242;
+#P hidden connect 12 0 18 0;
+#P hidden connect 19 0 17 0;
+#P hidden connect 18 0 17 0;
+#P connect 7 0 8 0;
+#P connect 8 0 5 0;
+#P fasten 10 0 6 0 285 470 338 470;
+#P fasten 9 0 6 0 218 470 338 470;
+#P connect 5 0 6 0;
+#P connect 5 0 6 1;
+#P connect 35 0 34 0;
+#P hidden connect 33 0 2 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rot.help b/externals/grill/vasp/max-help/vasp.rot.help
new file mode 100755
index 00000000..e78b227c
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rot.help
@@ -0,0 +1,91 @@
+max v2;
+#N vpatcher 199 239 788 608;
+#P message 380 279 60 196617 vasp bufrot;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 380 299 73 196617 p clear_buffer;
+#P hidden newex 458 273 48 196617 r 1126path;
+#P user umenu 85 121 72 196647 1 64 137 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1126path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 147 143 43 196617 p loader;
+#P comment 59 123 26 196617 read;
+#P comment 57 82 187 196617 optional argument/right inlet: value;
+#P message 205 299 27 196617 stop;
+#P message 137 299 65 196617 startwindow;
+#P newex 246 325 29 196617 dac~;
+#P newex 246 273 30 196617 line~;
+#P message 246 250 72 196617 0 \, 2000 2000;
+#P newex 246 298 64 196617 play~ bufrot;
+#P number 133 179 64 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 64 230 61 196617 vasp.update;
+#P message 64 152 60 196617 vasp bufrot;
+#P newex 64 202 79 196617 vasp.rot 10000;
+#P comment 57 67 101 196617 rotate buffer content;
+#P comment 57 43 96 196622 vasp.rot;
+#P hidden message 246 102 53 196617 set bufrot;
+#P hidden newex 246 77 45 196617 loadbang;
+#P user waveform~ 246 121 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 458 298 100 196617 buffer~ bufrot 2000;
+#P connect 7 0 6 0;
+#P connect 6 0 8 0;
+#P connect 9 0 6 1;
+#P hidden connect 19 1 18 0;
+#P hidden connect 2 0 3 0;
+#P hidden fasten 0 1 3 0 553 318 562 318 562 98 251 98;
+#P hidden connect 3 0 1 0;
+#P connect 11 0 12 0;
+#P connect 12 0 10 0;
+#P fasten 14 0 13 0 142 318 251 318;
+#P fasten 15 0 13 0 210 318 251 318;
+#P connect 10 0 13 0;
+#P connect 10 0 13 1;
+#P connect 22 0 21 0;
+#P hidden connect 20 0 0 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rpeaks.help b/externals/grill/vasp/max-help/vasp.rpeaks.help
new file mode 100755
index 00000000..4a4860d5
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rpeaks.help
@@ -0,0 +1,174 @@
+max v2;
+#N vpatcher 248 88 903 607;
+#P flonum 133 327 61 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 52 102 197 196617 right outlet: current peaks density (0-1);
+#P message 393 394 135 196617 vasp bufrpeaks1 bufrpeaks2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 393 449 73 196617 p clear_buffer;
+#P hidden newex 495 403 48 196617 r 1175path;
+#P user umenu 78 142 72 196647 1 64 158 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1175path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 140 164 43 196617 p loader;
+#P comment 52 143 26 196617 read;
+#P comment 52 115 172 196617 needs two vectors (real/imaginary);
+#P newex 58 402 61 196617 vasp.update;
+#P message 58 358 135 196617 vasp bufrpeaks1 bufrpeaks2;
+#P newex 58 379 52 196617 vasp.c!fft;
+#P comment 180 285 43 196617 density;
+#P newex 58 225 61 196617 vasp.update;
+#P newex 58 322 61 196617 vasp.update;
+#P flonum 133 283 45 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P message 58 259 135 196617 vasp bufrpeaks1 bufrpeaks2;
+#P newex 58 302 85 196617 vasp.rpeaks 0.05;
+#P message 264 450 27 196617 stop;
+#P message 196 450 65 196617 startwindow;
+#P newex 305 474 29 196617 dac~;
+#P newex 305 423 30 196617 line~;
+#P message 305 394 72 196617 0 \, 2000 2000;
+#P newex 305 449 85 196617 play~ bufrpeaks1;
+#P message 58 181 135 196617 vasp bufrpeaks1 bufrpeaks2;
+#P newex 58 202 49 196617 vasp.cfft;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 305 72 49 196617 p wfkeys;
+#P hidden message 305 242 75 196617 set bufrpeaks2;
+#P user waveform~ 305 260 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 495 449 122 196617 buffer~ bufrpeaks2 2000;
+#P hidden message 305 122 75 196617 set bufrpeaks1;
+#P hidden newex 305 94 45 196617 loadbang;
+#P user waveform~ 305 140 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 495 427 122 196617 buffer~ bufrpeaks1 2000;
+#P comment 52 87 197 196617 argument/right inlet: peaks density (0-1);
+#P comment 52 72 177 196617 find radius peaks of a complex vasp;
+#P comment 52 48 108 196622 vasp.rpeaks;
+#P comment 194 328 68 196617 current peaks;
+#P connect 13 0 12 0;
+#P connect 12 0 24 0;
+#P connect 21 0 20 0;
+#P connect 20 0 23 0;
+#P connect 27 0 26 0;
+#P connect 26 0 28 0;
+#P connect 22 0 20 1;
+#P connect 20 1 37 0;
+#P hidden connect 32 1 31 0;
+#P hidden fasten 6 0 7 0 310 103 310 103;
+#P hidden fasten 4 1 7 0 612 446 636 446 636 118 310 118;
+#P hidden connect 11 0 5 0;
+#P hidden connect 7 0 5 0;
+#P hidden fasten 6 0 10 0 310 103 310 103;
+#P hidden fasten 8 1 10 0 612 468 636 468 636 255 310 255;
+#P hidden connect 11 0 9 0;
+#P hidden connect 10 0 9 0;
+#P connect 15 0 16 0;
+#P connect 16 0 14 0;
+#P connect 14 0 17 0;
+#P fasten 18 0 17 0 201 468 310 468;
+#P fasten 19 0 17 0 269 468 310 468;
+#P connect 14 0 17 1;
+#P connect 35 0 34 0;
+#P hidden connect 33 0 4 0;
+#P hidden fasten 9 5 5 4 610 363 621 363 621 134 610 134;
+#P hidden connect 5 5 9 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rpow.help b/externals/grill/vasp/max-help/vasp.rpow.help
new file mode 100755
index 00000000..408a28ce
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rpow.help
@@ -0,0 +1,171 @@
+max v2;
+#N vpatcher 172 126 831 625;
+#P message 398 362 121 196617 vasp bufrpow1 bufrpow2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 398 417 78 196617 p clear_buffers;
+#P hidden newex 506 373 48 196617 r 1145path;
+#P user umenu 84 143 72 196647 1 64 159 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 373 689;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1145path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 146 165 43 196617 p loader;
+#P comment 58 144 26 196617 read;
+#P comment 51 65 49 196617 radius^x;
+#P comment 51 110 172 196617 needs two vectors (real/imaginary);
+#P newex 64 404 61 196617 vasp.update;
+#P message 64 360 121 196617 vasp bufrpow1 bufrpow2;
+#P newex 64 381 52 196617 vasp.c!fft;
+#P comment 156 287 46 196617 exponent;
+#P newex 64 227 61 196617 vasp.update;
+#P newex 64 324 61 196617 vasp.update;
+#P flonum 118 285 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P message 64 261 121 196617 vasp bufrpow1 bufrpow2;
+#P newex 64 304 64 196617 vasp.rpow 2;
+#P message 273 418 27 196617 stop;
+#P message 205 418 65 196617 startwindow;
+#P newex 314 442 29 196617 dac~;
+#P newex 314 391 30 196617 line~;
+#P message 314 362 72 196617 0 \, 2000 2000;
+#P newex 314 417 79 196617 play~ bufrpow1;
+#P message 64 183 121 196617 vasp bufrpow1 bufrpow2;
+#P newex 64 204 49 196617 vasp.cfft;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 313 56 49 196617 p wfkeys;
+#P hidden message 313 221 68 196617 set bufrpow2;
+#P user waveform~ 313 239 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 506 417 115 196617 buffer~ bufrpow2 2000;
+#P hidden message 313 101 68 196617 set bufrpow1;
+#P hidden newex 313 78 45 196617 loadbang;
+#P user waveform~ 313 119 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 506 394 115 196617 buffer~ bufrpow1 2000;
+#P comment 51 95 152 196617 argument/right inlet: exponent;
+#P comment 51 80 257 196617 power function for the radius values of a complex vasp;
+#P comment 51 42 89 196622 vasp.rpow;
+#P connect 12 0 11 0;
+#P connect 11 0 23 0;
+#P connect 20 0 19 0;
+#P connect 19 0 22 0;
+#P connect 26 0 25 0;
+#P connect 25 0 27 0;
+#P connect 21 0 19 1;
+#P hidden connect 32 1 31 0;
+#P hidden fasten 5 0 6 0 318 82 318 82;
+#P hidden fasten 3 1 6 0 616 413 644 413 644 97 318 97;
+#P hidden connect 10 0 4 0;
+#P hidden connect 6 0 4 0;
+#P hidden fasten 7 1 9 0 616 438 644 438 644 220 318 220;
+#P hidden fasten 5 0 9 0 318 82 318 82;
+#P hidden connect 9 0 8 0;
+#P hidden connect 10 0 8 0;
+#P connect 14 0 15 0;
+#P connect 15 0 13 0;
+#P fasten 17 0 16 0 210 436 319 436;
+#P fasten 18 0 16 0 278 436 319 436;
+#P connect 13 0 16 0;
+#P connect 13 0 16 1;
+#P connect 35 0 34 0;
+#P hidden connect 33 0 3 0;
+#P hidden fasten 8 5 4 4 618 342 629 342 629 113 618 113;
+#P hidden connect 4 5 8 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rsub.help b/externals/grill/vasp/max-help/vasp.rsub.help
new file mode 100755
index 00000000..cdc8edab
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rsub.help
@@ -0,0 +1,52 @@
+max v2;
+#N vpatcher 189 164 749 507;
+#P message 357 275 54 196617 vasp buf!-;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 357 295 73 196617 p clear_buffer;
+#P comment 49 91 205 196617 optional argument/right inlet: right operand;
+#P comment 49 76 214 196617 subtracts a value or a vasp from a vasp;
+#P comment 49 37 89 196622 vasp.!-;
+#P message 52 136 54 196617 vasp buf!-;
+#P newex 52 236 61 196617 vasp.update;
+#P newex 52 213 58 196617 vasp.!- 0.2;
+#P newex 52 168 80 196617 vasp.osc 44100;
+#P newex 52 191 55 196617 vasp.* 0.5;
+#P hidden message 214 136 45 196617 set buf!-;
+#P hidden newex 214 115 45 196617 loadbang;
+#P user waveform~ 214 156 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 432 295 94 196617 buffer~ buf!- 2000;
+#P comment 49 60 100 196617 reverse subtraction;
+#P connect 9 0 6 0;
+#P connect 6 0 5 0;
+#P connect 5 0 7 0;
+#P connect 7 0 8 0;
+#P hidden connect 3 0 4 0;
+#P hidden connect 4 0 2 0;
+#P connect 14 0 13 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.rvalleys.help b/externals/grill/vasp/max-help/vasp.rvalleys.help
new file mode 100755
index 00000000..0c805c6f
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.rvalleys.help
@@ -0,0 +1,177 @@
+max v2;
+#N vpatcher 247 96 939 616;
+#P newex 58 434 55 196617 vasp.* 0.5;
+#P newex 58 411 45 196617 vasp.opt;
+#P flonum 142 331 72 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 53 98 170 196617 right outlet: current density (0-1);
+#P message 442 405 159 196617 vasp buffrvalleys1 buffrvalleys2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 442 460 78 196617 p clear_buffers;
+#P hidden newex 521 415 48 196617 r 1173path;
+#P user umenu 79 143 72 196647 1 64 159 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1173path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 141 165 43 196617 p loader;
+#P flonum 181 285 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P comment 53 113 172 196617 needs two vectors (real/imaginary);
+#P newex 58 459 61 196617 vasp.update;
+#P message 58 363 159 196617 vasp buffrvalleys1 buffrvalleys2;
+#P newex 58 384 52 196617 vasp.c!fft;
+#P newex 58 230 61 196617 vasp.update;
+#P newex 58 328 61 196617 vasp.update;
+#P message 58 264 159 196617 vasp buffrvalleys1 buffrvalleys2;
+#P newex 58 308 94 196617 vasp.rvalleys 0.05;
+#P message 302 461 27 196617 stop;
+#P message 234 461 65 196617 startwindow;
+#P newex 343 485 29 196617 dac~;
+#P newex 343 434 30 196617 line~;
+#P message 343 405 72 196617 0 \, 2000 2000;
+#P newex 343 460 98 196617 play~ buffrvalleys1;
+#P message 58 186 159 196617 vasp buffrvalleys1 buffrvalleys2;
+#P newex 58 207 49 196617 vasp.cfft;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 343 87 49 196617 p wfkeys;
+#P hidden message 343 253 85 196617 set buffrvalleys2;
+#P user waveform~ 343 271 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 521 460 134 196617 buffer~ buffrvalleys2 2000;
+#P hidden message 343 133 85 196617 set buffrvalleys1;
+#P hidden newex 343 109 45 196617 loadbang;
+#P user waveform~ 343 151 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 521 440 134 196617 buffer~ buffrvalleys1 2000;
+#P comment 53 82 170 196617 argument/right inlet: density (0-1);
+#P comment 53 67 177 196617 find radius valleys of a complex vasp;
+#P comment 53 44 138 196622 vasp.rvalleys;
+#P comment 53 145 33 196617 read;
+#P comment 217 333 78 196617 current density;
+#P connect 14 0 13 0;
+#P connect 13 0 24 0;
+#P connect 22 0 21 0;
+#P connect 21 0 23 0;
+#P connect 26 0 25 0;
+#P connect 25 0 37 0;
+#P connect 37 0 38 0;
+#P connect 38 0 27 0;
+#P hidden connect 31 1 30 0;
+#P fasten 29 0 21 1 186 304 147 304;
+#P connect 21 1 36 0;
+#P hidden fasten 7 0 8 0 348 114 348 114;
+#P hidden fasten 5 1 8 0 650 459 674 459 674 129 348 129;
+#P hidden connect 12 0 6 0;
+#P hidden connect 8 0 6 0;
+#P hidden fasten 7 0 11 0 348 114 348 114;
+#P hidden fasten 9 1 11 0 650 480 674 480 674 251 348 251;
+#P hidden connect 12 0 10 0;
+#P hidden connect 11 0 10 0;
+#P connect 16 0 17 0;
+#P connect 17 0 15 0;
+#P connect 15 0 18 0;
+#P fasten 19 0 18 0 239 479 348 479;
+#P fasten 20 0 18 0 307 479 348 479;
+#P connect 15 0 18 1;
+#P connect 34 0 33 0;
+#P hidden connect 32 0 5 0;
+#P hidden fasten 10 5 6 4 648 374 659 374 659 145 648 145;
+#P hidden connect 6 5 10 4;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.set.help b/externals/grill/vasp/max-help/vasp.set.help
new file mode 100755
index 00000000..7d3a4a3e
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.set.help
@@ -0,0 +1,326 @@
+max v2;
+#N vpatcher 241 84 852 554;
+#P message 396 398 52 196617 vasp buf=;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 396 419 73 196617 p clear_buffer;
+#N vpatcher 113 336 466 586;
+#P newex 152 160 27 196617 t b f;
+#P newex 67 98 27 196617 - 0.;
+#P newex 67 76 27 196617 t b i;
+#P comment 226 139 72 196617 msec to samps;
+#P comment 107 80 118 196617 <<< end - start = length;
+#P newex 152 137 71 196617 * 44.099998;
+#P newex 67 137 67 196617 * 44.099998;
+#P newex 67 190 50 196617 pack 0 0;
+#N comlet endpoint in ms;
+#P inlet 152 32 15 0;
+#N comlet startpoint in ms;
+#P inlet 67 32 15 0;
+#N comlet length and offset in samples (list);
+#P outlet 67 215 15 0;
+#P comment 151 98 75 196617 start = offset;
+#P connect 2 0 9 0;
+#P connect 3 0 10 0;
+#P connect 9 0 10 0;
+#P connect 10 0 5 0;
+#P fasten 11 0 4 0 157 180 72 180;
+#P connect 5 0 4 0;
+#P connect 4 0 1 0;
+#P connect 9 1 10 1;
+#P fasten 11 1 4 1 174 183 112 183;
+#P connect 2 0 6 0;
+#P connect 6 0 11 0;
+#P pop;
+#P newobj 362 281 115 196617 p loop_to_length/offset;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 261 89 49 196617 p wfkeys;
+#P comment 114 298 136 196617 set selected samples to zero;
+#P button 95 297 15 0;
+#P newex 55 219 61 196617 vasp.update;
+#P newex 55 193 55 196617 vasp.* 0.5;
+#P message 362 327 99 196617 set vasp \$1 buf= \$2;
+#P comment 114 147 70 196617 generate noise;
+#N vpatcher 278 163 996 630;
+#P user umenu 86 119 72 196647 1 64 135 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 355 682;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1077path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 148 140 43 196617 p loader;
+#P message 504 394 85 196617 vasp buf=a buf=b;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 504 415 78 196617 p clear_buffers;
+#P hidden newex 637 374 48 196617 r 1077path;
+#P comment 59 121 26 196617 read;
+#N vpatcher 113 336 466 586;
+#N comlet length in ms out;
+#P outlet 11 215 15 0;
+#P newex 152 160 27 196617 t b f;
+#P newex 67 98 27 196617 - 0.;
+#P newex 67 76 27 196617 t b i;
+#P comment 226 139 72 196617 msec to samps;
+#P comment 107 80 118 196617 <<< end - start = length;
+#P newex 152 137 71 196617 * 44.099998;
+#P newex 67 137 67 196617 * 44.099998;
+#P newex 67 190 50 196617 pack 0 0;
+#N comlet endpoint in ms;
+#P inlet 152 32 15 0;
+#N comlet startpoint in ms;
+#P inlet 67 32 15 0;
+#N comlet length and offset in samples (list);
+#P outlet 67 215 15 0;
+#P comment 151 98 75 196617 start = offset;
+#P connect 10 0 12 0;
+#P connect 2 0 9 0;
+#P connect 9 0 10 0;
+#P connect 3 0 10 0;
+#P connect 10 0 5 0;
+#P connect 5 0 4 0;
+#P fasten 11 0 4 0 157 180 72 180;
+#P connect 4 0 1 0;
+#P connect 9 1 10 1;
+#P fasten 11 1 4 1 174 183 112 183;
+#P connect 2 0 6 0;
+#P connect 6 0 11 0;
+#P pop;
+#P newobj 214 233 115 196617 p loop_to_length/offset;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 375 51 49 196617 p wfkeys;
+#P newex 73 289 27 196617 t f f;
+#P message 593 376 41 196617 size \$1;
+#P newex 73 323 74 196617 * 44.099998;
+#P newex 73 264 27 196617 f;
+#P button 73 200 15 0;
+#P message 168 348 85 196617 vasp \$1 buf=a \$2;
+#P message 73 349 72 196617 vasp \$1 buf=b;
+#P newex 73 378 38 196617 vasp.=;
+#P comment 359 235 14 196617 B;
+#P newex 73 408 61 196617 vasp.update;
+#P hidden message 375 214 50 196617 set buf=b;
+#P user waveform~ 375 233 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P hidden message 375 92 50 196617 set buf=a;
+#P hidden newex 375 71 45 196617 loadbang;
+#P user waveform~ 374 112 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 593 394 95 196617 buffer~ buf=b 2000;
+#P newex 593 414 95 196617 buffer~ buf=a 2000;
+#P comment 359 114 14 196617 A;
+#P comment 90 200 124 196617 copy selection from a to b;
+#P comment 73 160 162 196617 choose a selection from buffer a;
+#P comment 36 49 326 196622 use vasp.= to copy from buffer a to buffer b;
+#P comment 358 363 100 196617 resize the buffer with selectionlength;
+#P connect 17 0 18 0;
+#P connect 18 0 21 0;
+#P connect 21 0 19 0;
+#P connect 19 0 15 0;
+#P connect 15 0 14 0;
+#P connect 14 0 12 0;
+#P fasten 23 0 18 1 219 256 95 256;
+#P fasten 16 0 14 1 173 371 106 371;
+#P hidden connect 29 1 28 0;
+#P fasten 23 1 16 0 324 283 173 283;
+#P fasten 7 2 23 0 499 219 219 219;
+#P fasten 7 3 23 1 559 225 324 225;
+#P hidden connect 22 0 7 0;
+#P hidden connect 9 0 7 0;
+#P hidden fasten 5 1 9 0 683 434 694 434 694 88 380 88;
+#P hidden connect 8 0 9 0;
+#P hidden connect 8 0 11 0;
+#P hidden connect 11 0 10 0;
+#P hidden connect 22 0 10 0;
+#P connect 27 0 26 0;
+#P fasten 21 1 20 0 95 317 357 317 357 362 598 362;
+#P fasten 20 0 6 0 598 389 598 389;
+#P hidden connect 25 0 5 0;
+#P pop;
+#P newobj 55 419 85 196617 p more_examples;
+#P message 55 146 52 196617 vasp buf=;
+#P newex 55 167 55 196617 vasp.noise;
+#P newex 55 378 61 196617 vasp.update;
+#P message 55 272 52 196617 vasp buf=;
+#P newex 55 354 45 196617 vasp.= 0;
+#P comment 52 81 195 196617 optional argument/right inlet: value/vasp;
+#P comment 52 66 102 196617 set a vasp to a value;
+#P comment 52 43 89 196622 vasp.=;
+#P hidden message 261 129 45 196617 set buf=;
+#P hidden newex 261 109 45 196617 loadbang;
+#P user waveform~ 261 148 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P comment 114 273 110 196617 set all samples to zero;
+#P newex 481 419 92 196617 buffer~ buf= 2000;
+#P comment 55 121 131 196617 use vasp.= to clear a buffer;
+#P connect 13 0 12 0;
+#P connect 12 0 17 0;
+#P connect 17 0 18 0;
+#P fasten 16 0 9 0 367 346 60 346;
+#P fasten 19 0 9 0 100 346 60 346;
+#P connect 10 0 9 0;
+#P connect 9 0 11 0;
+#P hidden connect 4 0 5 0;
+#P hidden connect 21 0 3 0;
+#P hidden connect 5 0 3 0;
+#P fasten 3 2 22 0 386 264 367 264;
+#P connect 22 0 16 0;
+#P connect 24 0 23 0;
+#P fasten 3 3 22 1 446 264 472 264;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.shift.help b/externals/grill/vasp/max-help/vasp.shift.help
new file mode 100755
index 00000000..80acf8b4
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.shift.help
@@ -0,0 +1,92 @@
+max v2;
+#N vpatcher 179 197 765 568;
+#P origin 0 20;
+#P message 376 267 65 196617 vasp bufshift;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 376 287 73 196617 p clear_buffer;
+#P hidden newex 456 257 48 196617 r 1124path;
+#P user umenu 84 105 72 196647 1 64 121 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1124path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 146 127 43 196617 p loader;
+#P comment 58 107 26 196617 read;
+#P comment 55 71 187 196617 optional argument/right inlet: value;
+#P message 207 288 27 196617 stop;
+#P message 139 288 65 196617 startwindow;
+#P newex 249 314 29 196617 dac~;
+#P newex 249 262 30 196617 line~;
+#P message 249 239 72 196617 0 \, 2000 2000;
+#P newex 249 287 71 196617 play~ bufshift;
+#P number 138 173 64 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 63 224 61 196617 vasp.update;
+#P message 63 146 65 196617 vasp bufshift;
+#P newex 63 196 85 196617 vasp.shift 10000;
+#P comment 55 56 128 196617 shifts the buffer content;
+#P comment 55 33 96 196622 vasp.shift;
+#P hidden message 249 91 60 196617 set bufshift;
+#P hidden newex 249 66 45 196617 loadbang;
+#P user waveform~ 249 110 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 456 287 105 196617 buffer~ bufshift 2000;
+#P connect 7 0 6 0;
+#P connect 6 0 8 0;
+#P connect 9 0 6 1;
+#P hidden connect 19 1 18 0;
+#P hidden fasten 0 1 3 0 556 307 565 307 565 87 254 87;
+#P hidden connect 2 0 3 0;
+#P hidden connect 3 0 1 0;
+#P connect 11 0 12 0;
+#P connect 12 0 10 0;
+#P connect 10 0 13 0;
+#P fasten 15 0 13 0 212 307 254 307;
+#P fasten 14 0 13 0 144 307 254 307;
+#P connect 10 0 13 1;
+#P connect 22 0 21 0;
+#P hidden connect 20 0 0 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.sign.help b/externals/grill/vasp/max-help/vasp.sign.help
new file mode 100755
index 00000000..236417cf
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.sign.help
@@ -0,0 +1,94 @@
+max v2;
+#N vpatcher 228 161 880 523;
+#P comment 58 96 192 196617 samples == 0 stay 0;
+#P message 420 284 64 196617 vasp bufsign;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 420 305 73 196617 p clear_buffer;
+#P comment 58 81 192 196617 samples < 0 become -1;
+#P newex 60 195 61 196617 vasp.update;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 304 52 49 196617 p wfkeys;
+#P newex 60 305 61 196617 vasp.update;
+#P comment 58 236 256 196617 use sign to generate a square wave out of a sine wave;
+#P message 60 257 64 196617 vasp bufsign;
+#P newex 60 148 80 196617 vasp.osc 44100;
+#P newex 60 282 50 196617 vasp.sign;
+#P hidden message 304 90 55 196617 set bufsign;
+#P hidden newex 304 71 45 196617 loadbang;
+#P user waveform~ 304 109 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P message 60 127 64 196617 vasp bufsign;
+#P newex 508 305 104 196617 buffer~ bufsign 2000;
+#P comment 58 66 192 196617 samples > 0 become 1;
+#P comment 58 43 109 196622 vasp.sign;
+#P comment 135 128 100 196617 generate a sine wave;
+#P connect 4 0 9 0;
+#P connect 9 0 14 0;
+#P connect 10 0 8 0;
+#P connect 8 0 12 0;
+#P hidden connect 6 0 7 0;
+#P hidden connect 7 0 5 0;
+#P hidden connect 13 0 5 0;
+#P connect 17 0 16 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.spit.help b/externals/grill/vasp/max-help/vasp.spit.help
new file mode 100755
index 00000000..17903423
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.spit.help
@@ -0,0 +1,42 @@
+max v2;
+#N vpatcher 250 84 747 648;
+#P comment 158 430 219 196617 if more vectors than outlets \, see what it does!;
+#P comment 194 307 245 196617 spits out one vector after the other from right to left;
+#P newex 101 458 38 196617 print b;
+#P newex 62 458 38 196617 print a;
+#P message 62 399 149 196617 vasp bufspit1 bufspit2 bufspit3;
+#P newex 62 428 88 196617 vasp.spit 2;
+#P newex 140 458 59 196617 print ready;
+#P newex 101 335 38 196617 print b;
+#P newex 62 335 38 196617 print a;
+#P newex 62 305 127 196617 vasp.spit 3;
+#P message 62 271 109 196617 vasp bufspit1 bufspit2;
+#P newex 140 335 38 196617 print c;
+#P newex 179 335 59 196617 print ready;
+#P newex 101 220 38 196617 print b;
+#P newex 62 220 38 196617 print a;
+#P comment 56 106 171 196617 most right outlet: bang when ready;
+#P message 62 160 149 196617 vasp bufspit1 bufspit2 bufspit3;
+#P newex 348 469 109 196617 buffer~ bufspit1 2000;
+#P newex 62 190 49 196617 vasp.spit;
+#P comment 56 76 260 196617 spit out vectors of a vasp (one vector after the other);
+#P comment 56 53 89 196622 vasp.spit;
+#P comment 56 91 344 196617 argument: number of outlets ( if more than 1 \, outputs from right to left );
+#P comment 119 192 235 196617 spits out one vector after the other out of 1 outlet;
+#P message 187 271 149 196617 vasp bufspit1 bufspit2 bufspit3;
+#P newex 348 490 109 196617 buffer~ bufspit2 2000;
+#P newex 348 512 109 196617 buffer~ bufspit3 2000;
+#P fasten 9 0 7 0 67 178 67 178;
+#P connect 7 0 11 0;
+#P connect 15 0 16 0;
+#P fasten 2 0 16 0 192 293 67 293;
+#P connect 16 0 17 0;
+#P fasten 21 0 20 0 67 416 67 416;
+#P connect 20 0 22 0;
+#P connect 7 1 12 0;
+#P fasten 16 1 18 0 106 328 106 328;
+#P fasten 20 1 23 0 106 451 106 451;
+#P connect 16 2 14 0;
+#P connect 20 2 19 0;
+#P connect 16 3 13 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.split.help b/externals/grill/vasp/max-help/vasp.split.help
new file mode 100755
index 00000000..088f8aba
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.split.help
@@ -0,0 +1,31 @@
+max v2;
+#N vpatcher 217 175 685 652;
+#P hidden message 386 189 22 196617 set;
+#P hidden newex 386 160 45 196617 loadbang;
+#P comment 56 100 374 196617 most right outlet: rest (if there is one) of vectors in a new vasp \, otherwise: bang;
+#P message 190 153 158 196617 vasp bufsplit1 bufsplit2 bufsplit3;
+#P newex 319 423 112 196617 buffer~ bufsplit3 2000;
+#P newex 319 380 112 196617 buffer~ bufsplit1 2000;
+#P newex 113 217 60 196617 prepend set;
+#P message 113 241 208 196617;
+#P message 63 339 258 196617;
+#P newex 63 310 60 196617 prepend set;
+#P newex 63 187 61 196617 vasp.split 2;
+#P newex 63 278 58 196617 vasp.join 2;
+#P comment 56 70 137 196617 split a vasp into its vectors;
+#P message 63 153 119 196617 vasp bufsplit1 buffsplit2;
+#P comment 56 47 89 196622 vasp.split;
+#P comment 56 85 174 196617 argument: number of vectors to split;
+#P newex 319 401 112 196617 buffer~ bufsplit2 2000;
+#P connect 3 0 6 0;
+#P fasten 13 0 6 0 195 175 68 175;
+#P connect 6 0 5 0;
+#P connect 5 0 7 0;
+#P hidden fasten 16 0 8 0 391 332 68 332;
+#P connect 7 0 8 0;
+#P fasten 6 1 5 1 93 266 116 266;
+#P connect 6 2 10 0;
+#P connect 10 0 9 0;
+#P hidden fasten 16 0 9 0 391 236 118 236;
+#P hidden connect 15 0 16 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.sqr.help b/externals/grill/vasp/max-help/vasp.sqr.help
new file mode 100755
index 00000000..ecb11e25
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.sqr.help
@@ -0,0 +1,91 @@
+max v2;
+#N vpatcher 195 123 811 458;
+#P message 407 267 61 196617 vasp bufsqr;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 407 288 73 196617 p clear_buffer;
+#P newex 56 182 61 196617 vasp.update;
+#P comment 53 70 66 196617 sample^2;
+#P message 56 241 61 196617 vasp bufsqr;
+#P newex 56 266 45 196617 vasp.sqr;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 277 67 49 196617 p wfkeys;
+#P hidden message 277 109 54 196617 set bufsqr;
+#P hidden newex 277 89 45 196617 loadbang;
+#P user waveform~ 277 128 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 56 288 61 196617 vasp.update;
+#P message 56 130 61 196617 vasp bufsqr;
+#P newex 484 288 101 196617 buffer~ bufsqr 2000;
+#P newex 56 160 80 196617 vasp.osc 44100;
+#P comment 53 47 89 196622 vasp.sqr;
+#P comment 126 130 123 196617 generate a 1Hz sine wave;
+#P connect 4 0 2 0;
+#P connect 2 0 13 0;
+#P connect 11 0 10 0;
+#P connect 10 0 5 0;
+#P hidden connect 7 0 8 0;
+#P hidden connect 9 0 6 0;
+#P hidden connect 8 0 6 0;
+#P connect 15 0 14 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.sqrt.help b/externals/grill/vasp/max-help/vasp.sqrt.help
new file mode 100755
index 00000000..7df082a9
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.sqrt.help
@@ -0,0 +1,91 @@
+max v2;
+#N vpatcher 247 135 857 466;
+#P message 398 255 65 196617 vasp bufsqrt;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 398 276 73 196617 p clear_buffer;
+#P newex 54 165 61 196617 vasp.update;
+#P comment 51 63 81 196617 square root;
+#P message 54 225 65 196617 vasp bufsqrt;
+#P newex 54 255 51 196617 vasp.sqrt;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 270 39 49 196617 p wfkeys;
+#P hidden message 270 85 58 196617 set bufsqrt;
+#P hidden newex 270 61 45 196617 loadbang;
+#P user waveform~ 270 111 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 54 276 61 196617 vasp.update;
+#P message 54 114 65 196617 vasp bufsqrt;
+#P newex 476 276 105 196617 buffer~ bufsqrt 2000;
+#P newex 54 144 80 196617 vasp.osc 44100;
+#P comment 51 40 89 196622 vasp.sqrt;
+#P comment 125 115 123 196617 generate a 1hz sine wave;
+#P connect 4 0 2 0;
+#P connect 2 0 13 0;
+#P connect 11 0 10 0;
+#P connect 10 0 5 0;
+#P hidden connect 7 0 8 0;
+#P hidden connect 9 0 6 0;
+#P hidden connect 8 0 6 0;
+#P connect 15 0 14 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.ssqr.help b/externals/grill/vasp/max-help/vasp.ssqr.help
new file mode 100755
index 00000000..0dac0545
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.ssqr.help
@@ -0,0 +1,219 @@
+max v2;
+#N vpatcher 213 206 826 598;
+#P message 398 317 65 196617 vasp bufssqr;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 398 338 73 196617 p clear_buffer;
+#N vpatcher 339 132 955 467;
+#P message 396 232 72 196617 vasp bufssqr1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 396 252 73 196617 p clear_buffer;
+#P user umenu 73 100 72 196647 1 64 116 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1137path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 135 122 43 196617 p loader;
+#P hidden newex 472 229 48 196617 r 1137path;
+#P comment 45 102 26 196617 read;
+#P newex 52 184 45 196617 vasp.opt;
+#P message 120 252 27 196617 stop;
+#P message 52 252 65 196617 startwindow;
+#P newex 156 229 30 196617 line~;
+#P message 156 203 72 196617 0 \, 8000 8000;
+#P newex 156 276 29 196617 dac~;
+#P newex 156 252 75 196617 play~ bufssqr1;
+#P message 52 139 72 196617 vasp bufssqr1;
+#P newex 52 162 52 196617 vasp.ssqr;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 275 46 49 196617 p wfkeys;
+#P hidden message 275 93 65 196617 set bufssqr1;
+#P hidden newex 275 68 45 196617 loadbang;
+#P user waveform~ 275 119 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 52 206 61 196617 vasp.update;
+#P newex 472 252 112 196617 buffer~ bufssqr1 8000;
+#P comment 45 41 123 196622 listen to ssquare;
+#P connect 8 0 7 0;
+#P connect 7 0 15 0;
+#P connect 15 0 2 0;
+#P hidden connect 19 1 18 0;
+#P connect 11 0 12 0;
+#P connect 12 0 9 0;
+#P connect 9 0 10 0;
+#P fasten 14 0 10 0 125 271 161 271;
+#P fasten 13 0 10 0 57 271 161 271;
+#P connect 9 0 10 1;
+#P hidden fasten 1 1 5 0 579 260 601 260 601 88 280 88;
+#P hidden connect 4 0 5 0;
+#P hidden connect 6 0 3 0;
+#P hidden connect 5 0 3 0;
+#P connect 21 0 20 0;
+#P hidden connect 17 0 1 0;
+#P pop;
+#P newobj 41 338 95 196617 p listen_to_ssquare;
+#P newex 41 177 61 196617 vasp.update;
+#P comment 38 58 85 196617 signed sample^2;
+#P message 41 238 65 196617 vasp bufssqr;
+#P newex 41 266 52 196617 vasp.ssqr;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 268 53 49 196617 p wfkeys;
+#P hidden message 268 99 59 196617 set bufssqr;
+#P hidden newex 268 75 45 196617 loadbang;
+#P user waveform~ 268 125 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 41 287 61 196617 vasp.update;
+#P message 41 127 65 196617 vasp bufssqr;
+#P newex 475 338 105 196617 buffer~ bufssqr 2000;
+#P newex 41 156 80 196617 vasp.osc 44100;
+#P comment 38 34 89 196622 vasp.ssqr;
+#P comment 114 127 123 196617 generate a 1Hz sine wave;
+#P connect 4 0 2 0;
+#P connect 2 0 13 0;
+#P connect 11 0 10 0;
+#P connect 10 0 5 0;
+#P hidden connect 7 0 8 0;
+#P hidden connect 8 0 6 0;
+#P hidden connect 9 0 6 0;
+#P connect 16 0 15 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.ssqrt.help b/externals/grill/vasp/max-help/vasp.ssqrt.help
new file mode 100755
index 00000000..e2a84cab
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.ssqrt.help
@@ -0,0 +1,219 @@
+max v2;
+#N vpatcher 191 126 812 519;
+#P message 404 321 70 196617 vasp bufssqrt;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 404 340 73 196617 p clear_buffer;
+#N vpatcher 189 114 813 442;
+#P user umenu 74 100 72 196647 1 64 116 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1139path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 136 122 43 196617 p loader;
+#P message 392 233 75 196617 vasp bufssqrt1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 392 252 73 196617 p clear_buffer;
+#P hidden newex 472 232 48 196617 r 1139path;
+#P comment 46 102 26 196617 read;
+#P newex 52 184 45 196617 vasp.opt;
+#P message 120 252 27 196617 stop;
+#P message 52 252 65 196617 startwindow;
+#P newex 156 229 30 196617 line~;
+#P message 156 203 72 196617 0 \, 8000 8000;
+#P newex 156 276 29 196617 dac~;
+#P newex 156 252 80 196617 play~ bufssqrt1;
+#P message 52 139 75 196617 vasp bufssqrt1;
+#P newex 52 162 55 196617 vasp.ssqrt;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 275 46 49 196617 p wfkeys;
+#P hidden message 275 93 69 196617 set bufssqrt1;
+#P hidden newex 275 68 45 196617 loadbang;
+#P user waveform~ 275 119 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 52 206 61 196617 vasp.update;
+#P newex 472 252 115 196617 buffer~ bufssqrt1 8000;
+#P comment 45 41 161 196622 listen to ssquare root;
+#P connect 8 0 7 0;
+#P connect 7 0 15 0;
+#P connect 15 0 2 0;
+#P hidden connect 21 1 20 0;
+#P connect 11 0 12 0;
+#P connect 12 0 9 0;
+#P fasten 14 0 10 0 125 271 161 271;
+#P fasten 13 0 10 0 57 271 161 271;
+#P connect 9 0 10 0;
+#P connect 9 0 10 1;
+#P hidden connect 4 0 5 0;
+#P hidden fasten 1 1 5 0 582 273 601 273 601 88 280 88;
+#P hidden connect 6 0 3 0;
+#P hidden connect 5 0 3 0;
+#P connect 19 0 18 0;
+#P hidden connect 17 0 1 0;
+#P pop;
+#P newobj 52 340 122 196617 p listen_to_ssquare_root;
+#P newex 52 188 61 196617 vasp.update;
+#P comment 49 67 90 196617 signed square root;
+#P message 52 248 70 196617 vasp bufssqrt;
+#P newex 52 278 55 196617 vasp.ssqrt;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 279 63 49 196617 p wfkeys;
+#P hidden message 279 109 63 196617 set bufssqrt;
+#P hidden newex 279 85 45 196617 loadbang;
+#P user waveform~ 279 135 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 52 298 61 196617 vasp.update;
+#P message 52 137 70 196617 vasp bufssqrt;
+#P newex 480 340 110 196617 buffer~ bufssqrt 2000;
+#P newex 52 167 80 196617 vasp.osc 44100;
+#P comment 49 44 89 196622 vasp.ssqrt;
+#P comment 129 138 123 196617 generate a 1hz sine wave;
+#P connect 4 0 2 0;
+#P connect 2 0 13 0;
+#P connect 11 0 10 0;
+#P connect 10 0 5 0;
+#P hidden connect 7 0 8 0;
+#P hidden connect 8 0 6 0;
+#P hidden connect 9 0 6 0;
+#P connect 16 0 15 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.sub.help b/externals/grill/vasp/max-help/vasp.sub.help
new file mode 100755
index 00000000..fbf4b8ae
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.sub.help
@@ -0,0 +1,67 @@
+max v2;
+#N vpatcher 124 137 939 471;
+#P message 594 264 51 196617 vasp buf-;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 594 285 73 196617 p clear_buffer;
+#P comment 350 214 101 196617 shift all values - 0.5;
+#P comment 136 213 131 196617 shift all values + 0.5;
+#P comment 138 190 132 196617 half the amplitude;
+#P comment 285 84 205 196617 optional argument/right inlet: right operand;
+#P comment 285 67 195 196617 subtracts a value or a vasp from a vasp;
+#P comment 285 43 89 196622 vasp.-;
+#P message 288 134 51 196617 vasp buf-;
+#P newex 288 234 61 196617 vasp.update;
+#P newex 288 211 55 196617 vasp.- 0.5;
+#P newex 288 166 80 196617 vasp.osc 44100;
+#P newex 288 188 55 196617 vasp.* 0.5;
+#P message 54 134 51 196617 vasp buf-;
+#P newex 54 234 61 196617 vasp.update;
+#P newex 54 211 55 196617 vasp.+ 0.5;
+#P newex 54 166 80 196617 vasp.osc 44100;
+#P hidden message 450 134 44 196617 set buf-;
+#P hidden newex 450 113 45 196617 loadbang;
+#P user waveform~ 450 154 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 671 284 91 196617 buffer~ buf- 2000;
+#P newex 54 188 55 196617 vasp.* 0.5;
+#P comment 52 84 205 196617 optional argument/right inlet: right operand;
+#P comment 52 67 168 196617 adds a value or a vasp to a vasp;
+#P comment 52 43 89 196622 vasp.+;
+#P comment 139 169 132 196617 generate a 1Hz sine wave;
+#P connect 12 0 9 0;
+#P connect 9 0 4 0;
+#P connect 4 0 10 0;
+#P connect 10 0 11 0;
+#P connect 17 0 14 0;
+#P connect 14 0 13 0;
+#P connect 13 0 15 0;
+#P connect 15 0 16 0;
+#P hidden connect 7 0 8 0;
+#P hidden connect 8 0 6 0;
+#P connect 25 0 24 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.sync.help b/externals/grill/vasp/max-help/vasp.sync.help
new file mode 100755
index 00000000..8ae0c72a
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.sync.help
@@ -0,0 +1,164 @@
+max v2;
+#N vpatcher 185 136 861 638;
+#P origin 0 41;
+#P message 406 413 115 196617 vasp bufsync1 bufsync2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 406 433 78 196617 p clear_buffers;
+#P hidden newex 526 379 48 196617 r 1044path;
+#P user umenu 86 140 72 196647 1 64 156 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1044path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 148 162 43 196617 p loader;
+#P comment 60 142 26 196617 read;
+#P comment 60 82 188 196617 argument: number of vasps to be synced;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 327 78 49 196617 p wfkeys;
+#P newex 67 350 61 196617 vasp.update;
+#P message 67 186 115 196617 vasp bufsync1 bufsync2;
+#P newex 526 433 113 196617 buffer~ bufsync2 2000;
+#P hidden message 327 241 65 196617 set bufsync2;
+#P user waveform~ 327 259 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P hidden message 327 123 65 196617 set bufsync1;
+#P hidden newex 327 101 45 196617 loadbang;
+#P user waveform~ 327 140 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 526 412 113 196617 buffer~ bufsync1 2000;
+#P comment 60 44 89 196622 vasp.sync;
+#P newex 67 324 52 196617 vasp.c!fft;
+#P newex 67 299 62 196617 vasp.sync 2;
+#P newex 119 271 45 196617 vasp.= 0;
+#P newex 67 218 49 196617 vasp.cfft;
+#P newex 119 249 55 196617 vasp.upper;
+#P comment 60 67 124 196617 syncs two or more vasps;
+#P comment 135 301 167 196617 puts out vasp (from left inlet) after receiving a vasp into right inlet;
+#P newex 327 433 75 196617 play~ bufsync1;
+#P message 327 384 72 196617 0 \, 2000 2000;
+#P newex 327 408 30 196617 line~;
+#P newex 327 460 29 196617 dac~;
+#P message 218 434 65 196617 startwindow;
+#P message 286 434 27 196617 stop;
+#P connect 21 0 9 0;
+#P connect 9 0 11 0;
+#P connect 11 0 12 0;
+#P connect 12 0 22 0;
+#P fasten 9 0 8 0 72 242 124 242;
+#P connect 8 0 10 0;
+#P connect 10 0 11 1;
+#P hidden connect 27 1 26 0;
+#P hidden connect 16 0 17 0;
+#P hidden fasten 14 1 17 0 634 430 642 430 642 116 332 116;
+#P hidden connect 23 0 15 0;
+#P hidden connect 17 0 15 0;
+#P hidden connect 16 0 19 0;
+#P hidden connect 23 0 18 0;
+#P hidden connect 19 0 18 0;
+#P connect 4 0 3 0;
+#P connect 3 0 5 0;
+#P fasten 0 0 2 0 291 453 332 453;
+#P fasten 1 0 2 0 223 453 332 453;
+#P connect 5 0 2 0;
+#P connect 5 0 2 1;
+#P connect 30 0 29 0;
+#P hidden connect 28 0 14 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.tilt.help b/externals/grill/vasp/max-help/vasp.tilt.help
new file mode 100755
index 00000000..277dded2
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.tilt.help
@@ -0,0 +1,89 @@
+max v2;
+#N vpatcher 260 180 873 549;
+#P hidden newex 491 280 48 196617 r 1168path;
+#P message 415 282 60 196617 vasp buftilt;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 415 302 73 196617 p clear_buffer;
+#P user umenu 60 118 72 196647 1 64 134 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1168path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 122 140 43 196617 p loader;
+#P message 237 302 27 196617 stop;
+#P message 169 302 65 196617 startwindow;
+#P newex 278 329 29 196617 dac~;
+#P newex 278 277 30 196617 line~;
+#P message 278 254 72 196617 0 \, 4000 4000;
+#P newex 278 302 64 196617 play~ buftilt;
+#P newex 60 211 61 196617 vasp.update;
+#P message 60 158 60 196617 vasp buftilt;
+#P newex 60 189 64 196617 vasp.tilt 0.5;
+#P comment 55 70 138 196617 resamples the buffer content;
+#P comment 55 47 96 196622 vasp.tilt;
+#P hidden message 278 110 53 196617 set buftilt;
+#P hidden newex 278 85 45 196617 loadbang;
+#P user waveform~ 278 129 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 491 302 100 196617 buffer~ buftilt 4000;
+#P comment 55 85 194 196617 argument/right inlet: resampling factor;
+#P comment 127 191 100 196617 pitch down an octave;
+#P connect 9 0 8 0;
+#P connect 8 0 10 0;
+#P hidden connect 18 1 17 0;
+#P hidden fasten 2 1 5 0 586 323 594 323 594 102 283 102;
+#P hidden connect 4 0 5 0;
+#P hidden connect 5 0 3 0;
+#P connect 12 0 13 0;
+#P connect 13 0 11 0;
+#P connect 11 0 14 0;
+#P fasten 15 0 14 0 174 322 283 322;
+#P fasten 16 0 14 0 242 322 283 322;
+#P connect 11 0 14 1;
+#P connect 20 0 19 0;
+#P hidden connect 21 0 2 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.update.help b/externals/grill/vasp/max-help/vasp.update.help
new file mode 100755
index 00000000..481c7347
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.update.help
@@ -0,0 +1,41 @@
+max v2;
+#N vpatcher 209 155 868 527;
+#P message 62 292 55 196617 vasp bufup;
+#P newex 62 313 45 196617 vasp.= 0;
+#P comment 127 231 99 196617 update the graphics;
+#P newex 62 229 61 196617 vasp.update;
+#P comment 127 126 99 196617 generate a sine wave;
+#P message 62 125 55 196617 vasp bufup;
+#P newex 62 185 80 196617 vasp.osc 22050;
+#P comment 57 69 230 196617 updates the graphics of a patcher (e.g. waveform);
+#P comment 57 46 96 196622 vasp.update;
+#P hidden message 308 104 49 196617 set bufup;
+#P hidden newex 308 84 45 196617 loadbang;
+#P user waveform~ 308 123 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 525 323 95 196617 buffer~ bufup 2000;
+#P comment 125 293 271 196617 use vasp.update at the end of a chain of vasp operations \, although most vasp objects are updating automatically;
+#P connect 8 0 7 0;
+#P connect 7 0 10 0;
+#P connect 13 0 12 0;
+#P hidden connect 3 0 4 0;
+#P hidden connect 4 0 2 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.valleys.help b/externals/grill/vasp/max-help/vasp.valleys.help
new file mode 100755
index 00000000..9752bbc1
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.valleys.help
@@ -0,0 +1,174 @@
+max v2;
+#N vpatcher 219 119 883 614;
+#P message 435 404 95 196617 vasp bufval bufval1;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 435 425 78 196617 p clear_buffers;
+#P hidden newex 532 382 48 196617 r 1162path;
+#P user umenu 77 128 72 196647 1 64 144 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1162path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 139 150 43 196617 p loader;
+#P comment 51 93 160 196617 outlet: current density value 0-1;
+#P comment 181 294 115 196617 = number of valleys;
+#P number 143 292 35 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P flonum 143 240 71 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 143 264 51 196617 * 88200.;
+#P comment 215 242 100 196617 current density;
+#P comment 198 266 100 196617 * lenght of the vasp;
+#P newex 58 235 61 196617 vasp.update;
+#P comment 592 237 44 196617 valleys;
+#P comment 132 174 161 196617 copy to new buffer \, find valleys;
+#P message 53 345 65 196617 vasp bufval1;
+#P newex 53 373 45 196617 vasp.opt;
+#P hidden message 325 234 59 196617 set bufval1;
+#P user waveform~ 325 252 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 532 425 105 196617 buffer~ bufval1 2000;
+#P comment 51 79 188 196617 argument/right inlet: density value 0-1;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 2 0 6 0 275 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 5 0 6 0 52 243 134 243;
+#P connect 11 0 14 0;
+#P connect 14 0 8 0;
+#P connect 3 3 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 13 0 1 0;
+#P connect 9 0 1 0;
+#P connect 4 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 325 67 49 196617 p wfkeys;
+#P message 284 425 27 196617 stop;
+#P message 215 425 65 196617 startwindow;
+#P newex 325 451 29 196617 dac~;
+#P newex 325 404 30 196617 line~;
+#P message 325 381 72 196617 0 \, 2000 2000;
+#P newex 325 425 70 196617 play~ bufval1;
+#P hidden message 325 113 53 196617 set bufval;
+#P hidden newex 325 89 45 196617 loadbang;
+#P user waveform~ 325 133 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 58 214 95 196617 vasp.valleys 0.001;
+#P newex 53 394 61 196617 vasp.update;
+#P message 58 173 65 196617 vasp bufval1;
+#P newex 532 404 105 196617 buffer~ bufval 2000;
+#P newex 58 194 69 196617 vasp.= bufval;
+#P comment 51 64 215 196617 find the local minima of the buffer samples;
+#P comment 51 41 107 196622 vasp.valleys;
+#P comment 127 346 111 196617 optimize buffer content;
+#P comment 594 118 44 196617 source;
+#P comment 51 129 32 196617 read;
+#P connect 25 0 24 0;
+#P connect 24 0 8 0;
+#P connect 7 0 5 0;
+#P connect 5 0 9 0;
+#P connect 9 0 28 0;
+#P hidden connect 37 1 36 0;
+#P connect 9 1 32 0;
+#P connect 32 0 31 0;
+#P connect 31 0 33 0;
+#P hidden connect 11 0 12 0;
+#P hidden fasten 6 1 12 0 632 421 642 421 642 109 330 109;
+#P hidden connect 19 0 10 0;
+#P hidden connect 12 0 10 0;
+#P hidden connect 11 0 23 0;
+#P hidden connect 19 0 22 0;
+#P hidden connect 23 0 22 0;
+#P connect 14 0 15 0;
+#P connect 15 0 13 0;
+#P connect 13 0 16 0;
+#P fasten 17 0 16 0 220 444 330 444;
+#P fasten 18 0 16 0 289 444 330 444;
+#P connect 13 0 16 1;
+#P connect 40 0 39 0;
+#P hidden connect 38 0 6 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.vector.help b/externals/grill/vasp/max-help/vasp.vector.help
new file mode 100755
index 00000000..0af86d39
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.vector.help
@@ -0,0 +1,175 @@
+max v2;
+#N vpatcher 282 124 678 511;
+#P hidden message 324 118 22 196617 set;
+#P hidden newex 324 92 45 196617 loadbang;
+#N vpatcher 116 168 848 567;
+#P message 515 334 85 196617 vasp bufn1 bufn2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 515 355 73 196617 p clear_buffer;
+#P hidden newex 707 332 48 196617 r 1048path;
+#P user umenu 88 71 72 196647 1 64 87 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1048path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 150 93 43 196617 p loader;
+#P newex 58 158 61 196617 vasp.update;
+#P comment 155 190 157 196617 clear imaginary part of soundfile (vector with index 1);
+#P message 58 191 85 196617 vasp bufn1 bufn2;
+#P newex 58 238 45 196617 vasp.= 0;
+#P newex 58 213 45 196617 vasp.n 1;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 389 41 49 196617 p wfkeys;
+#P comment 574 212 127 196617 imaginary part of soundfile;
+#P message 58 115 85 196617 vasp bufn1 bufn2;
+#P hidden message 389 206 50 196617 set bufn2;
+#P user waveform~ 389 227 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 606 355 95 196617 buffer~ bufn2 2000;
+#P hidden message 390 82 50 196617 set bufn1;
+#P hidden newex 389 60 45 196617 loadbang;
+#P user waveform~ 389 100 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 58 285 61 196617 vasp.update;
+#P newex 606 334 95 196617 buffer~ bufn1 2000;
+#P newex 58 137 49 196617 vasp.cfft;
+#P comment 155 116 197 196617 transform into real and imaginary part;
+#P comment 581 84 119 196617 real part of the soundfile;
+#P comment 58 73 29 196617 read;
+#P connect 12 0 3 0;
+#P connect 3 0 19 0;
+#P connect 17 0 15 0;
+#P connect 15 0 16 0;
+#P connect 16 0 5 0;
+#P hidden connect 21 1 20 0;
+#P hidden connect 14 0 6 0;
+#P hidden connect 8 0 6 0;
+#P hidden fasten 7 0 11 0 394 70 394 70;
+#P hidden fasten 11 0 10 0 394 222 394 222;
+#P hidden connect 14 0 10 0;
+#P hidden fasten 4 1 8 0 696 352 707 352 707 71 395 71;
+#P hidden connect 7 0 8 0;
+#P connect 24 0 23 0;
+#P hidden connect 22 0 4 0;
+#P pop;
+#P newobj 57 325 85 196617 p more_examples;
+#P message 57 143 85 196617 vasp bufn1 bufn2;
+#P newex 57 219 45 196617 vasp.n 0;
+#P newex 220 219 45 196617 vasp.n 1;
+#P comment 269 220 53 196617 vector 1;
+#P message 220 271 130 196617;
+#P newex 220 241 60 196617 prepend set;
+#P comment 105 220 53 196617 vector 0;
+#P message 57 271 130 196617;
+#P newex 57 241 60 196617 prepend set;
+#P comment 52 70 168 196617 get one vector of a vasp;
+#P comment 52 48 89 196622 vasp.n;
+#P comment 52 88 183 196617 argument/right inlet: index of vector;
+#P connect 11 0 10 0;
+#P connect 10 0 3 0;
+#P hidden fasten 14 0 4 0 329 267 62 267;
+#P connect 3 0 4 0;
+#P fasten 11 0 9 0 62 187 225 187;
+#P connect 9 0 6 0;
+#P connect 6 0 7 0;
+#P hidden fasten 14 0 7 0 329 268 225 268;
+#P hidden connect 13 0 14 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.vectors.help b/externals/grill/vasp/max-help/vasp.vectors.help
new file mode 100755
index 00000000..9d8774b1
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.vectors.help
@@ -0,0 +1,12 @@
+max v2;
+#N vpatcher 257 69 578 345;
+#P number 57 218 35 9 0 0 160 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P message 57 112 63 196617 vasp bufn?1;
+#P message 127 112 131 196617 vasp bufn?1 bufn?2 bufn?3;
+#P newex 57 169 43 196617 vasp.n?;
+#P comment 52 66 168 196617 get the number of vectors of a vasp;
+#P comment 52 44 89 196622 vasp.n?;
+#P fasten 3 0 2 0 132 140 62 140;
+#P connect 4 0 2 0;
+#P connect 2 0 5 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.xmirr.help b/externals/grill/vasp/max-help/vasp.xmirr.help
new file mode 100755
index 00000000..34d30a42
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.xmirr.help
@@ -0,0 +1,169 @@
+max v2;
+#N vpatcher 157 154 838 677;
+#P message 395 430 129 196617 vasp bufxmirr1 bufxmirr2;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 395 450 78 196617 p clear_buffers;
+#P hidden newex 530 406 48 196617 r 1129path;
+#P user umenu 80 101 72 196647 1 64 117 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1129path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 5 0 2 0;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 142 123 43 196617 p loader;
+#P comment 54 103 26 196617 read;
+#N vpatcher 40 55 418 371;
+#P button 183 82 15 0;
+#P newex 129 145 60 196617 prepend set;
+#N comlet waveform~ mode messages;
+#P inlet 129 121 15 0;
+#P newex 259 64 27 196617 << 1;
+#P newex 206 121 40 196617 change;
+#P newex 206 145 107 196617 select 0 1 2;
+#P newex 206 98 27 196617 |;
+#P newex 47 121 40 196617 change;
+#P outlet 129 252 15 0;
+#P message 47 145 65 196617 constrain \$1;
+#P newex 129 195 45 196617 loadbang;
+#P newex 47 40 222 196617 pushkeys;
+#P message 270 169 58 196617 mode move;
+#P message 206 213 61 196617 mode select;
+#P message 238 191 52 196617 mode loop;
+#P connect 3 0 7 0;
+#P connect 7 0 5 0;
+#P connect 12 0 13 0;
+#P fasten 5 0 6 0 52 243 134 243;
+#P fasten 0 0 6 0 243 243 134 243;
+#P fasten 1 0 6 0 211 243 134 243;
+#P fasten 2 0 6 0 275 243 134 243;
+#P connect 11 0 14 0;
+#P connect 3 3 8 0;
+#P connect 14 0 8 0;
+#P connect 8 0 10 0;
+#P connect 10 0 9 0;
+#P connect 4 0 1 0;
+#P connect 9 0 1 0;
+#P connect 13 0 1 0;
+#P connect 11 0 8 1;
+#P connect 9 1 0 0;
+#P connect 3 4 11 0;
+#P connect 9 2 2 0;
+#P pop;
+#P hidden newobj 337 77 49 196617 p wfkeys;
+#P newex 59 443 61 196617 vasp.update;
+#P newex 59 364 61 196617 vasp.update;
+#P newex 58 286 61 196617 vasp.update;
+#P newex 57 183 61 196617 vasp.update;
+#P newex 58 264 45 196617 vasp.= 0;
+#P message 58 221 129 196617 vasp bufxmirr1 bufxmirr2;
+#P newex 58 241 55 196617 vasp.upper;
+#P message 276 451 27 196617 stop;
+#P message 208 451 65 196617 startwindow;
+#P newex 307 477 29 196617 dac~;
+#P newex 307 420 30 196617 line~;
+#P message 307 397 72 196617 0 \, 2000 2000;
+#P newex 307 450 83 196617 play~ bufxmirr1;
+#P message 59 399 129 196617 vasp bufxmirr1 bufxmirr2;
+#P newex 59 421 49 196617 vasp.cfft;
+#P message 59 320 129 196617 vasp bufxmirr1 bufxmirr2;
+#P newex 59 342 59 196617 vasp.xmirr;
+#P message 57 140 129 196617 vasp bufxmirr1 bufxmirr2;
+#P newex 57 162 49 196617 vasp.cfft;
+#P hidden message 337 243 72 196617 set bufxmirr2;
+#P user waveform~ 337 262 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P hidden message 337 121 72 196617 set bufxmirr1;
+#P hidden newex 337 97 45 196617 loadbang;
+#P user waveform~ 337 140 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 530 428 119 196617 buffer~ bufxmirr1 2000;
+#P comment 51 67 156 196617 mirrors a vasp symmetrically;
+#P comment 51 43 96 196622 vasp.xmirr;
+#P newex 530 450 119 196617 buffer~ bufxmirr2 2000;
+#P connect 10 0 9 0;
+#P connect 9 0 24 0;
+#P connect 22 0 21 0;
+#P connect 21 0 23 0;
+#P connect 23 0 25 0;
+#P connect 12 0 11 0;
+#P connect 11 0 26 0;
+#P connect 14 0 13 0;
+#P connect 13 0 27 0;
+#P hidden connect 31 1 30 0;
+#P connect 16 0 17 0;
+#P connect 17 0 15 0;
+#P fasten 19 0 18 0 213 470 312 470;
+#P fasten 20 0 18 0 281 470 312 470;
+#P connect 15 0 18 0;
+#P connect 15 0 18 1;
+#P hidden connect 5 0 6 0;
+#P hidden fasten 3 1 6 0 644 448 660 448 660 117 342 117;
+#P hidden connect 28 0 4 0;
+#P hidden connect 6 0 4 0;
+#P hidden connect 5 0 8 0;
+#P hidden connect 8 0 7 0;
+#P hidden connect 28 0 7 0;
+#P connect 34 0 33 0;
+#P hidden connect 32 0 3 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.xrot.help b/externals/grill/vasp/max-help/vasp.xrot.help
new file mode 100755
index 00000000..e3f887e9
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.xrot.help
@@ -0,0 +1,91 @@
+max v2;
+#N vpatcher 441 216 1022 579;
+#P message 367 275 65 196617 vasp bufxrot;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 367 295 73 196617 p clear_buffer;
+#P hidden newex 449 275 48 196617 r 1127path;
+#P user umenu 76 121 72 196647 1 64 137 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1127path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 138 143 43 196617 p loader;
+#P comment 51 82 187 196617 optional argument/right inlet: value;
+#P message 201 295 27 196617 stop;
+#P message 133 295 65 196617 startwindow;
+#P newex 242 321 29 196617 dac~;
+#P newex 242 275 30 196617 line~;
+#P message 242 246 72 196617 0 \, 2000 2000;
+#P newex 242 295 70 196617 play~ bufxrot;
+#P number 131 179 64 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 56 228 61 196617 vasp.update;
+#P message 56 150 65 196617 vasp bufxrot;
+#P newex 56 200 85 196617 vasp.xrot 10000;
+#P comment 51 67 179 196617 rotate buffer content symmetrically;
+#P comment 51 43 96 196622 vasp.xrot;
+#P hidden message 242 98 59 196617 set bufxrot;
+#P hidden newex 242 73 45 196617 loadbang;
+#P user waveform~ 242 117 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 449 295 105 196617 buffer~ bufxrot 2000;
+#P comment 51 122 29 196617 read;
+#P connect 8 0 7 0;
+#P connect 7 0 9 0;
+#P connect 10 0 7 1;
+#P hidden connect 19 1 18 0;
+#P hidden fasten 1 1 4 0 549 316 558 316 558 94 247 94;
+#P hidden connect 3 0 4 0;
+#P hidden connect 4 0 2 0;
+#P connect 12 0 13 0;
+#P connect 13 0 11 0;
+#P connect 11 0 14 0;
+#P fasten 15 0 14 0 138 314 247 314;
+#P fasten 16 0 14 0 206 314 247 314;
+#P connect 11 0 14 1;
+#P connect 22 0 21 0;
+#P hidden connect 20 0 1 0;
+#P pop;
diff --git a/externals/grill/vasp/max-help/vasp.xshift.help b/externals/grill/vasp/max-help/vasp.xshift.help
new file mode 100755
index 00000000..68cbfa5d
--- /dev/null
+++ b/externals/grill/vasp/max-help/vasp.xshift.help
@@ -0,0 +1,91 @@
+max v2;
+#N vpatcher 220 165 835 542;
+#P message 383 278 73 196617 vasp bufxshift;
+#N vpatcher 40 55 218 175;
+#P newex 45 79 61 196617 vasp.update;
+#P newex 45 56 45 196617 vasp.= 0;
+#N comlet vasp to clear in;
+#P inlet 45 26 15 0;
+#P connect 0 0 1 0;
+#P connect 1 0 2 0;
+#P pop;
+#P newobj 383 298 73 196617 p clear_buffer;
+#P hidden newex 463 269 48 196617 r 1125path;
+#P user umenu 89 116 72 196647 1 64 132 1;
+#X add bass.aif;
+#X add beat.aif;
+#X add fly.aif;
+#X add plastic.aif;
+#X add your_own...;
+#N vpatcher 93 462 631 722;
+#P message 59 102 28 196617 read;
+#P newex 59 69 89 196617 route your_own...;
+#N comlet popup comment in;
+#P inlet 59 26 15 0;
+#P newex 59 149 48 196617 s 1125path;
+#P newex 138 102 79 196617 sprintf read %s;
+#P user umenu 48 169 100 196647 1 64 185 1;
+#X add drums.aif;
+#X add voice.aif;
+#X add test.aif;
+#X add read a soundfile;
+#P connect 3 0 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 2 0;
+#P fasten 1 0 2 0 143 134 64 134;
+#P connect 4 1 1 0;
+#P pop;
+#P hidden newobj 151 138 43 196617 p loader;
+#P comment 63 118 26 196617 read;
+#P comment 61 86 187 196617 optional argument/right inlet: value;
+#P message 223 299 27 196617 stop;
+#P message 155 299 65 196617 startwindow;
+#P newex 264 325 29 196617 dac~;
+#P newex 264 273 30 196617 line~;
+#P message 264 250 72 196617 0 \, 2000 2000;
+#P newex 264 298 75 196617 play~ bufxshift;
+#P number 148 181 64 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
+#P newex 66 233 61 196617 vasp.update;
+#P message 66 155 73 196617 vasp bufxshift;
+#P newex 66 205 92 196617 vasp.xshift 11000;
+#P comment 61 48 96 196622 vasp.xshift;
+#P hidden message 264 102 65 196617 set bufxshift;
+#P hidden newex 264 77 45 196617 loadbang;
+#P user waveform~ 264 121 312 99 3 9;
+#W mode select;
+#W mouseoutput continuous;
+#W unit ms;
+#W grid 1000.;
+#W ticks 8.;
+#W labels 1;
+#W vlabels 1;
+#W vticks 1;
+#W vzoom 1.;
+#W voffset 0.;
+#W bpm 120. 4.;
+#W frgb 0 0 0;
+#W brgb 255 255 255;
+#W rgb2 132 132 132;
+#W rgb3 0 0 0;
+#W rgb4 0 0 0;
+#W rgb5 255 255 255;
+#W rgb6 100 100 100;
+#W rgb7 100 100 100;
+#P newex 463 298 113 196617 buffer~ bufxshift 2000;
+#P comment 61 71 187 196617 shifts buffer content symmetrically;
+#P connect 7 0 6 0;
+#P connect 6 0 8 0;
+#P connect 9 0 6 1;
+#P hidden connect 19 1 18 0;
+#P hidden fasten 1 1 4 0 571 319 580 319 580 98 269 98;
+#P hidden connect 3 0 4 0;
+#P hidden connect 4 0 2 0;
+#P connect 11 0 12 0;
+#P connect 12 0 10 0;
+#P connect 10 0 13 0;
+#P fasten 14 0 13 0 160 318 269 318;
+#P fasten 15 0 13 0 228 318 269 318;
+#P connect 10 0 13 1;
+#P connect 22 0 21 0;
+#P hidden connect 20 0 1 0;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.conv b/externals/grill/vasp/max/vasp.conv
new file mode 100755
index 00000000..0d101377
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.conv
@@ -0,0 +1,30 @@
+max v2;
+#N vpatcher 30 70 430 370;
+#P newex 53 224 52 196617 vasp.c!fft;
+#P newex 134 130 62 196617 vasp.sync 2;
+#P newex 150 103 45 196617 vasp.= 0;
+#P newex 151 79 43 196617 vasp.im;
+#P newex 133 157 49 196617 vasp.cfft;
+#P newex 54 198 44 196617 vasp.c*;
+#P newex 54 131 62 196617 vasp.sync 2;
+#P newex 70 104 45 196617 vasp.= 0;
+#P newex 71 80 43 196617 vasp.im;
+#P newex 53 158 49 196617 vasp.cfft;
+#P outlet 52 252 15 0;
+#P inlet 140 51 15 0;
+#P inlet 54 51 15 0;
+#P connect 12 0 2 0;
+#P connect 6 0 3 0;
+#P connect 7 0 12 0;
+#P connect 0 0 6 0;
+#P connect 3 0 7 0;
+#P connect 4 0 5 0;
+#P connect 0 0 4 0;
+#P connect 8 0 7 1;
+#P connect 5 0 6 1;
+#P connect 11 0 8 0;
+#P connect 1 0 11 0;
+#P connect 9 0 10 0;
+#P connect 1 0 9 0;
+#P connect 10 0 11 1;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.freeze b/externals/grill/vasp/max/vasp.freeze
new file mode 100755
index 00000000..3a5551fa
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.freeze
@@ -0,0 +1,24 @@
+max v2;
+#N vpatcher 40 55 317 473;
+#P outlet 37 328 15 0;
+#P newex 37 292 52 196617 vasp.c!fft;
+#P newex 37 269 51 196617 vasp.rect;
+#P newex 37 246 58 196617 vasp.join 2;
+#P newex 65 214 105 196617 vasp.* 3.141593;
+#P newex 65 190 55 196617 vasp.noise;
+#P newex 37 158 61 196617 vasp.split 2;
+#P newex 37 132 55 196617 vasp.polar;
+#P newex 37 103 49 196617 vasp.cfft;
+#P inlet 37 77 15 0;
+#P comment 35 39 156 196617 Spectral freeze needs real and imaginary vectors;
+#P connect 1 0 2 0;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 7 0;
+#P connect 7 0 8 0;
+#P connect 8 0 9 0;
+#P connect 9 0 10 0;
+#P connect 4 1 5 0;
+#P connect 5 0 6 0;
+#P connect 6 0 7 1;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.hilbert b/externals/grill/vasp/max/vasp.hilbert
new file mode 100755
index 00000000..3348d665
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.hilbert
@@ -0,0 +1,25 @@
+max v2;
+#N vpatcher 380 246 816 656;
+#P inlet 27 68 15 0;
+#P outlet 27 317 15 0;
+#P newex 27 288 52 196617 vasp.c!fft;
+#P newex 27 263 62 196617 vasp.sync 2;
+#P newex 48 235 45 196617 vasp.= 0;
+#P newex 27 182 49 196617 vasp.cfft;
+#P newex 48 213 55 196617 vasp.upper;
+#P newex 27 154 62 196617 vasp.sync 2;
+#P newex 50 123 45 196617 vasp.= 0;
+#P newex 50 101 43 196617 vasp.im;
+#P comment 17 32 150 196617 Hilbert transformation needs real and complex vectors;
+#P connect 10 0 3 0;
+#P connect 3 0 5 0;
+#P connect 5 0 7 0;
+#P connect 7 0 8 0;
+#P connect 8 0 9 0;
+#P connect 5 0 4 0;
+#P connect 4 0 6 0;
+#P connect 10 0 1 0;
+#P connect 1 0 2 0;
+#P connect 2 0 3 1;
+#P connect 6 0 7 1;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.im b/externals/grill/vasp/max/vasp.im
new file mode 100755
index 00000000..f7a271f5
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.im
@@ -0,0 +1,8 @@
+max v2;
+#N vpatcher 681 58 1081 358;
+#P outlet 33 86 15 0;
+#P newex 35 57 45 196617 vasp.n 1;
+#P inlet 36 33 15 0;
+#P connect 1 0 2 0;
+#P connect 0 0 1 0;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.lower b/externals/grill/vasp/max/vasp.lower
new file mode 100755
index 00000000..3cd170c5
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.lower
@@ -0,0 +1,18 @@
+max v2;
+#N vpatcher 40 55 215 336;
+#P newex 53 156 32 196617 + 0.9;
+#P newex 14 180 64 196617 vasp.frames;
+#P newex 53 135 27 196617 / 2;
+#P newex 53 110 70 196617 vasp.frames?;
+#P newex 14 79 64 196617 vasp.multi 2;
+#P outlet 14 208 15 0;
+#P inlet 15 54 15 0;
+#P comment 16 34 100 196617 lower half of a vasp;
+#P connect 1 0 3 0;
+#P connect 3 0 6 0;
+#P connect 6 0 2 0;
+#P connect 3 1 4 0;
+#P connect 4 0 5 0;
+#P connect 5 0 7 0;
+#P connect 7 0 6 1;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.opt b/externals/grill/vasp/max/vasp.opt
new file mode 100755
index 00000000..24b1bbdc
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.opt
@@ -0,0 +1,31 @@
+max v2;
+#N vpatcher 40 55 440 355;
+#P newex 14 62 44 196617 route to;
+#P outlet 228 266 15 0;
+#P newex 119 101 60 196617 prepend set;
+#P newex 159 226 38 196617 vasp./;
+#P newex 174 170 27 196617 t b f;
+#P newex 138 169 20 196617 t b;
+#P newex 138 140 50 196617 route 0 1;
+#P newex 119 226 32 196617 vasp;
+#P newex 48 101 62 196617 vasp.amax?;
+#P outlet 142 265 15 0;
+#P inlet 14 30 15 0;
+#P connect 0 0 10 0;
+#P connect 10 1 2 0;
+#P connect 10 1 8 0;
+#P fasten 8 0 3 0 124 172 124 172;
+#P fasten 10 0 3 0 19 218 124 218;
+#P connect 5 0 3 0;
+#P fasten 2 1 4 0 105 129 143 129;
+#P connect 4 0 5 0;
+#P connect 4 1 5 0;
+#P connect 7 0 1 0;
+#P connect 3 0 1 0;
+#P fasten 8 0 7 0 124 202 164 202;
+#P connect 6 0 7 0;
+#P fasten 10 0 7 0 19 218 164 218;
+#P connect 4 2 6 0;
+#P connect 6 1 7 1;
+#P fasten 2 1 9 0 105 129 233 129;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.pwrap b/externals/grill/vasp/max/vasp.pwrap
new file mode 100755
index 00000000..9e6e71fa
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.pwrap
@@ -0,0 +1,12 @@
+max v2;
+#N vpatcher 40 55 440 355;
+#P newex 50 149 85 196617 vasp.- 3.141593;
+#P newex 50 120 101 196617 vasp.% 6.283185;
+#P newex 50 88 134 196617 vasp.+ 3.141593;
+#P outlet 50 223 15 0;
+#P inlet 50 49 15 0;
+#P connect 0 0 2 0;
+#P connect 2 0 3 0;
+#P connect 3 0 4 0;
+#P connect 4 0 1 0;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.re b/externals/grill/vasp/max/vasp.re
new file mode 100755
index 00000000..4acdea90
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.re
@@ -0,0 +1,8 @@
+max v2;
+#N vpatcher 681 58 1081 358;
+#P outlet 33 86 15 0;
+#P newex 35 57 45 196617 vasp.n 0;
+#P inlet 36 33 15 0;
+#P connect 1 0 2 0;
+#P connect 0 0 1 0;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.ropt b/externals/grill/vasp/max/vasp.ropt
new file mode 100755
index 00000000..b3db78d4
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.ropt
@@ -0,0 +1,31 @@
+max v2;
+#N vpatcher 425 221 825 521;
+#P newex 23 59 44 196617 route to;
+#P outlet 248 255 15 0;
+#P newex 128 91 60 196617 prepend set;
+#P newex 169 216 43 196617 vasp.c/;
+#P newex 184 160 27 196617 t b f;
+#P newex 147 159 20 196617 t b;
+#P newex 147 130 50 196617 route 0 1;
+#P newex 128 216 32 196617 vasp;
+#P newex 57 91 62 196617 vasp.rmax?;
+#P outlet 151 255 15 0;
+#P inlet 21 29 15 0;
+#P connect 0 0 10 0;
+#P connect 10 1 2 0;
+#P connect 10 1 8 0;
+#P fasten 10 0 3 0 28 209 133 209;
+#P connect 5 0 3 0;
+#P fasten 8 0 3 0 133 162 133 162;
+#P fasten 2 1 4 0 114 119 152 119;
+#P connect 4 0 5 0;
+#P connect 4 1 5 0;
+#P connect 7 0 1 0;
+#P connect 3 0 1 0;
+#P connect 6 0 7 0;
+#P fasten 8 0 7 0 133 194 174 194;
+#P fasten 10 0 7 0 28 209 174 209;
+#P connect 4 2 6 0;
+#P connect 6 1 7 1;
+#P fasten 2 1 9 0 114 119 253 119;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.spin b/externals/grill/vasp/max/vasp.spin
new file mode 100755
index 00000000..ebc2a1ff
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.spin
@@ -0,0 +1,24 @@
+max v2;
+#N vpatcher 448 294 770 681;
+#P newex 50 145 60 196617 vasp.pwrap;
+#P outlet 24 268 15 0;
+#P inlet 25 56 15 0;
+#P newex 24 232 51 196617 vasp.rect;
+#P newex 25 210 58 196617 vasp.join 2;
+#P newex 49 187 44 196617 vasp.int;
+#P newex 50 167 55 196617 vasp.* $1;
+#P newex 50 123 44 196617 vasp.dif;
+#P newex 25 81 55 196617 vasp.polar;
+#P newex 25 101 61 196617 vasp.split 2;
+#P comment 26 31 203 196617 multiply phase velocity by argument factor;
+#P connect 6 0 7 0;
+#P connect 7 0 9 0;
+#P connect 8 0 2 0;
+#P connect 2 0 1 0;
+#P connect 1 0 6 0;
+#P connect 4 0 5 0;
+#P connect 1 1 3 0;
+#P connect 3 0 10 0;
+#P connect 10 0 4 0;
+#P connect 5 0 6 1;
+#P pop;
diff --git a/externals/grill/vasp/max/vasp.upper b/externals/grill/vasp/max/vasp.upper
new file mode 100755
index 00000000..1c24882b
--- /dev/null
+++ b/externals/grill/vasp/max/vasp.upper
@@ -0,0 +1,21 @@
+max v2;
+#N vpatcher 40 55 353 400;
+#P newex 37 212 64 196617 vasp.frames;
+#P newex 37 183 65 196617 vasp.offset+;
+#P newex 74 159 32 196617 + 0.9;
+#P newex 117 131 27 196617 / 2;
+#P newex 77 106 70 196617 vasp.frames?;
+#P newex 38 75 64 196617 vasp.multi 2;
+#P outlet 36 257 15 0;
+#P inlet 39 50 15 0;
+#P comment 74 42 100 196617 upper half of a vasp;
+#P connect 8 0 2 0;
+#P connect 3 0 7 0;
+#P connect 7 0 8 0;
+#P connect 1 0 3 0;
+#P connect 5 0 6 0;
+#P connect 3 1 4 0;
+#P connect 5 0 8 1;
+#P connect 6 0 7 1;
+#P connect 4 0 5 0;
+#P pop;
diff --git a/externals/grill/vasp/pd-ex/granular1.pd b/externals/grill/vasp/pd-ex/granular1.pd
new file mode 100755
index 00000000..c2ef29d4
--- /dev/null
+++ b/externals/grill/vasp/pd-ex/granular1.pd
@@ -0,0 +1,329 @@
+#N canvas 62 0 622 487 10;
+#N canvas 0 0 450 300 graph34 0;
+#X array insert 64 float 1;
+#A 0 1 0.55557 -0.382683 -0.980785 -0.707107 0.19509 0.92388 0.83147
+1.17033e-007 -0.83147 -0.92388 -0.19509 0.707107 0.980785 0.382684
+-0.55557 -1 -0.55557 0.382683 0.980785 0.707107 -0.19509 -0.923879
+-0.83147 -3.511e-007 0.831469 0.92388 0.195091 -0.707106 -0.980785
+-0.382684 0.55557 1 0.555571 -0.382683 -0.980785 -0.707107 0.19509
+0.923879 0.83147 5.85167e-007 -0.831469 -0.92388 -0.195091 0.707106
+0.980785 0.382684 -0.55557 -1 -0.555571 0.382683 0.980785 0.707107
+-0.19509 -0.923879 -0.83147 -8.19234e-007 0.831469 0.92388 0.195091
+-0.707106 -0.980785 -0.382684 0.555569;
+#X coords 0 1 63 -1 200 140 1;
+#X restore 78 68 graph;
+#N canvas 374 102 510 487 player 0;
+#X obj 112 139 tabplay~ schnipparray;
+#X obj 148 240 tabplay~ schnipparray;
+#X obj 204 337 tabplay~ schnipparray;
+#X obj 112 163 throw~ toex;
+#X obj 148 259 throw~ toex;
+#X obj 204 361 throw~ toex;
+#X msg 112 119 0 64;
+#X msg 148 220 64 64;
+#X msg 205 317 128 64;
+#X obj 86 64 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+;
+#X obj 86 91 spigot;
+#X obj 233 161 t b b;
+#X obj 427 276 s \$0-part;
+#X obj 269 262 t b b;
+#X obj 325 361 t b b;
+#X msg 258 182 3;
+#X msg 294 282 1;
+#X msg 350 388 2;
+#X obj 86 40 inlet;
+#X connect 0 0 3 0;
+#X connect 0 1 11 0;
+#X connect 1 0 4 0;
+#X connect 1 1 13 0;
+#X connect 2 0 5 0;
+#X connect 2 1 14 0;
+#X connect 6 0 0 0;
+#X connect 7 0 1 0;
+#X connect 8 0 2 0;
+#X connect 9 0 10 1;
+#X connect 9 0 10 0;
+#X connect 10 0 6 0;
+#X connect 11 0 7 0;
+#X connect 11 1 15 0;
+#X connect 13 0 8 0;
+#X connect 13 1 16 0;
+#X connect 14 0 10 0;
+#X connect 14 1 17 0;
+#X connect 15 0 12 0;
+#X connect 16 0 12 0;
+#X connect 17 0 12 0;
+#X connect 18 0 9 0;
+#X restore 204 294 pd player;
+#X obj 204 348 catch~ toex;
+#X obj 204 403 dac~;
+#X floatatom 76 311 0 0 0 0 - - -;
+#X obj 76 271 nbx 5 14 -1e+037 1e+037 0 1 empty empty empty 0 -6 0
+10 -24198 -1 -1 2 256;
+#X text 76 253 density;
+#X obj 76 333 s \$0-density;
+#X obj 204 275 tgl 15 0 empty empty start/stop 0 -6 0 8 -24198 -1 -1
+0 1;
+#X text 319 80 this array is insertet at triggering points;
+#X obj 76 290 * 0.001;
+#X floatatom 241 429 0 0 0 0 - - -;
+#X obj 241 407 env~ 32768;
+#N canvas 0 0 350 219 inside 0;
+#X obj 41 63 table positions;
+#X obj 40 37 table schnipparray 192;
+#N canvas 0 0 460 310 create_schippler 0;
+#X msg 155 114 vasp insert;
+#X obj 155 162 vasp.u;
+#X obj 155 138 vasp.osc 6.4;
+#X msg 66 114 vasp insert;
+#X obj 66 162 vasp.u;
+#X obj 66 138 vasp.osc 64;
+#X msg 251 115 vasp insert;
+#X obj 251 163 vasp.u;
+#X obj 251 139 vasp.osc 2;
+#X text 56 71 create various samples to insert;
+#X msg 63 216 vasp insert;
+#X obj 63 261 vasp.u;
+#X obj 63 239 vasp.window;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X connect 3 0 5 0;
+#X connect 5 0 4 0;
+#X connect 6 0 8 0;
+#X connect 8 0 7 0;
+#X connect 10 0 12 0;
+#X connect 12 0 11 0;
+#X restore 43 113 pd create_schippler;
+#N canvas 0 0 642 330 inserter 0;
+#X obj 48 84 sel 1 2 3;
+#N canvas 2 7 397 657 first_part 0;
+#X obj 48 483 tabread positions;
+#X obj 48 172 vasp.noise;
+#X obj 48 149 vasp.! 64;
+#X obj 48 238 vasp.??;
+#X obj 48 192 vasp.abs;
+#X obj 48 215 vasp.< 0.1;
+#X obj 48 262 route list;
+#X text 58 501 insert a soundfile at certain offset-position;
+#X msg 48 525 vasp 64 schnipparray \$1;
+#X text 111 552 fuer drei teilbereiche;
+#X obj 48 551 vasp.o+ 0;
+#X obj 48 586 vasp.+ vasp insert;
+#X obj 48 120 t b b;
+#X obj 126 146 vasp.= 0;
+#X obj 48 70 inlet;
+#X obj 103 192 r \$0-density;
+#X msg 162 326 \; positions resize \$1;
+#X obj 80 362 tabset positions;
+#X obj 48 387 0;
+#X obj 48 411 until;
+#X obj 90 436 + 1;
+#X obj 48 436 0;
+#X msg 72 386 0;
+#X obj 97 310 length;
+#X obj 48 460 t f f;
+#X obj 97 331 t f f;
+#X obj 48 288 t b b l l;
+#X msg 126 124 vasp 64 schnipparray;
+#X connect 0 0 8 0;
+#X connect 1 0 4 0;
+#X connect 2 0 1 0;
+#X connect 3 0 6 0;
+#X connect 4 0 5 0;
+#X connect 5 0 3 0;
+#X connect 6 0 26 0;
+#X connect 8 0 10 0;
+#X connect 10 0 11 0;
+#X connect 12 0 2 0;
+#X connect 12 1 27 0;
+#X connect 14 0 12 0;
+#X connect 15 0 5 1;
+#X connect 18 0 19 0;
+#X connect 19 0 21 0;
+#X connect 20 0 21 1;
+#X connect 21 0 24 0;
+#X connect 22 0 21 1;
+#X connect 23 0 25 0;
+#X connect 24 0 0 0;
+#X connect 24 1 20 0;
+#X connect 25 0 18 1;
+#X connect 25 1 16 0;
+#X connect 26 0 18 0;
+#X connect 26 1 22 0;
+#X connect 26 2 17 0;
+#X connect 26 3 23 0;
+#X connect 27 0 13 0;
+#X restore 48 183 pd first_part;
+#N canvas 162 22 375 655 second_part 0;
+#X obj 48 483 tabread positions;
+#X obj 48 172 vasp.noise;
+#X obj 48 149 vasp.! 64;
+#X obj 48 238 vasp.??;
+#X obj 48 192 vasp.abs;
+#X obj 48 215 vasp.< 0.1;
+#X obj 48 262 route list;
+#X text 58 501 insert a soundfile at certain offset-position;
+#X msg 48 525 vasp 64 schnipparray \$1;
+#X text 124 552 fuer drei teilbereiche;
+#X obj 48 586 vasp.+ vasp insert;
+#X obj 48 120 t b b;
+#X obj 126 146 vasp.= 0;
+#X obj 48 70 inlet;
+#X obj 48 551 vasp.o+ 64;
+#X obj 103 192 r \$0-density;
+#X msg 162 323 \; positions resize \$1;
+#X obj 80 359 tabset positions;
+#X obj 48 384 0;
+#X obj 48 408 until;
+#X obj 90 433 + 1;
+#X obj 48 433 0;
+#X msg 72 383 0;
+#X obj 97 307 length;
+#X obj 48 457 t f f;
+#X obj 97 328 t f f;
+#X obj 48 285 t b b l l;
+#X msg 126 124 vasp 64 schnipparray 64;
+#X connect 0 0 8 0;
+#X connect 1 0 4 0;
+#X connect 2 0 1 0;
+#X connect 3 0 6 0;
+#X connect 4 0 5 0;
+#X connect 5 0 3 0;
+#X connect 6 0 26 0;
+#X connect 8 0 14 0;
+#X connect 11 0 2 0;
+#X connect 11 1 27 0;
+#X connect 13 0 11 0;
+#X connect 14 0 10 0;
+#X connect 15 0 5 1;
+#X connect 18 0 19 0;
+#X connect 19 0 21 0;
+#X connect 20 0 21 1;
+#X connect 21 0 24 0;
+#X connect 22 0 21 1;
+#X connect 23 0 25 0;
+#X connect 24 0 0 0;
+#X connect 24 1 20 0;
+#X connect 25 0 18 1;
+#X connect 25 1 16 0;
+#X connect 26 0 18 0;
+#X connect 26 1 22 0;
+#X connect 26 2 17 0;
+#X connect 26 3 23 0;
+#X connect 27 0 12 0;
+#X restore 191 181 pd second_part;
+#N canvas 323 1 606 693 third_part 0;
+#X msg 155 289 \; positions resize \$1;
+#X obj 73 325 tabset positions;
+#X obj 41 350 0;
+#X obj 41 374 until;
+#X obj 83 399 + 1;
+#X obj 41 399 0;
+#X obj 41 445 tabread positions;
+#X msg 65 349 0;
+#X obj 41 134 vasp.noise;
+#X obj 41 111 vasp.! 64;
+#X obj 41 200 vasp.??;
+#X obj 41 154 vasp.abs;
+#X obj 41 177 vasp.< 0.1;
+#X obj 90 273 length;
+#X obj 41 423 t f f;
+#X obj 41 224 route list;
+#X obj 41 642 vasp.+ vasp insert;
+#X obj 41 82 t b b;
+#X obj 119 108 vasp.= 0;
+#X obj 41 52 inlet;
+#X obj 96 154 r \$0-density;
+#X text 177 107 (clears second part);
+#X text 101 502 sample-length;
+#X obj 72 526 - 0;
+#X text 103 526 minus offset;
+#X obj 41 584 vasp.f;
+#X text 91 586 that's the space you have;
+#X text 292 215 this part has to write "around the corner";
+#X msg 41 548 vasp 64 schnipparray \$1;
+#X obj 300 551 + 0;
+#X text 339 526 frames;
+#X text 339 550 plus offset;
+#X obj 300 597 - 192;
+#X text 344 594 minus sample-length;
+#X obj 300 643 vasp.+ vasp insert;
+#X msg 300 619 vasp \$1 schnipparray;
+#X text 177 642 insert at end;
+#X text 300 670 insert at beginning;
+#X obj 300 574 + 128;
+#X text 343 572 for third part;
+#X obj 300 528 64;
+#X obj 90 294 t f f;
+#X obj 41 251 t b b l l;
+#X obj 41 467 t f b f b f;
+#X obj 72 500 64;
+#X msg 119 86 vasp 64 schnipparray 128;
+#X connect 2 0 3 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 1;
+#X connect 5 0 14 0;
+#X connect 6 0 43 0;
+#X connect 7 0 5 1;
+#X connect 8 0 11 0;
+#X connect 9 0 8 0;
+#X connect 10 0 15 0;
+#X connect 11 0 12 0;
+#X connect 12 0 10 0;
+#X connect 13 0 41 0;
+#X connect 14 0 6 0;
+#X connect 14 1 4 0;
+#X connect 15 0 42 0;
+#X connect 17 0 9 0;
+#X connect 17 1 45 0;
+#X connect 19 0 17 0;
+#X connect 20 0 12 1;
+#X connect 23 0 25 1;
+#X connect 25 0 16 0;
+#X connect 28 0 25 0;
+#X connect 29 0 38 0;
+#X connect 32 0 35 0;
+#X connect 35 0 34 0;
+#X connect 38 0 32 0;
+#X connect 40 0 29 0;
+#X connect 41 0 2 1;
+#X connect 41 1 0 0;
+#X connect 42 0 2 0;
+#X connect 42 1 7 0;
+#X connect 42 2 1 0;
+#X connect 42 3 13 0;
+#X connect 43 0 28 0;
+#X connect 43 1 44 0;
+#X connect 43 2 23 1;
+#X connect 43 3 40 0;
+#X connect 43 4 29 1;
+#X connect 44 0 23 0;
+#X connect 45 0 18 0;
+#X restore 336 183 pd third_part;
+#X obj 48 55 r \$0-part;
+#X text 50 33 after a sample-part is played \, next step is calculated
+;
+#X text 296 84 1) generate noise \; 2) get triggering-values \; 3)
+...save in positions-array \; 4) read samplevalues of positions \;
+5) at every trigger insert the "insert"array;
+#X connect 0 0 1 0;
+#X connect 0 1 2 0;
+#X connect 0 2 3 0;
+#X connect 4 0 0 0;
+#X restore 42 88 pd inserter;
+#X restore 516 119 pd inside;
+#X obj 322 271 vsl 15 100 0 1 0 0 empty empty volume 0 -8 0 8 -24198
+-1 -1 0 1;
+#X obj 204 374 *~ 0.2;
+#X text 387 445 needs the zexy library and vasp;
+#X connect 2 0 15 0;
+#X connect 4 0 7 0;
+#X connect 5 0 10 0;
+#X connect 8 0 1 0;
+#X connect 10 0 4 0;
+#X connect 12 0 11 0;
+#X connect 14 0 15 1;
+#X connect 15 0 3 0;
+#X connect 15 0 3 1;
+#X connect 15 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_abs.pd b/externals/grill/vasp/pd-help/vasp_abs.pd
new file mode 100644
index 00000000..493bf9fd
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_abs.pd
@@ -0,0 +1,48 @@
+#N canvas 99 112 853 471 10;
+#X msg 521 263 vasp bufabs;
+#X text 71 63 get absolute values of a vasp;
+#X text 71 79 see also vasp.*.help for an example using vasp.abs to
+generate an envelope from a vasp;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.abs 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufabs 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 465 124 graph;
+#N canvas 0 0 394 270 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufabs;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 737 285 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 521 284 pd clear_buffer;
+#X text 189 209 get the absolute values;
+#X obj 77 209 prepend set;
+#X obj 77 285 vasp.update;
+#X text 178 134 generate a sinewave;
+#X msg 77 135 vasp bufabs;
+#X obj 77 154 vasp.osc 22050;
+#X obj 77 247 vasp.abs;
+#X obj 170 210 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 77 173 vasp.update;
+#X text 58 209 *;
+#X text 71 414 * prepend-object from iemlib2 (http://pd.iem.at/iemlib)
+;
+#X obj 77 383 VASP-HELP;
+#X connect 0 0 6 0;
+#X connect 8 0 13 0;
+#X connect 11 0 12 0;
+#X connect 12 0 15 0;
+#X connect 13 0 9 0;
+#X connect 14 0 13 0;
+#X connect 15 0 8 0;
diff --git a/externals/grill/vasp/pd-help/vasp_add.pd b/externals/grill/vasp/pd-help/vasp_add.pd
new file mode 100644
index 00000000..56781928
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_add.pd
@@ -0,0 +1,54 @@
+#N canvas 8 252 972 385 10;
+#N canvas 40 55 255 173 clear_buffer 0;
+#X obj 59 79 vasp.update;
+#X obj 59 56 vasp.= 0;
+#X obj 59 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 755 285 pd clear_buffer;
+#X text 452 193 shift all values - 0.5;
+#X text 372 63 optional argument/right inlet: right operand;
+#X text 372 46 subtracts a value or a vasp from a vasp;
+#X obj 376 213 vasp.update;
+#X obj 376 190 vasp.- 0.5;
+#X obj 376 145 vasp.osc 44100;
+#X obj 376 167 vasp.* 0.5;
+#X text 45 63 optional argument/right inlet: right operand;
+#X text 45 46 adds a value or a vasp to a vasp;
+#X obj 45 20 cnv 15 15 15 empty empty vasp.+ 0 10 1 14 -262144 -1 0
+;
+#X obj 374 18 cnv 15 15 15 empty empty vasp.- 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph167 0;
+#X array bufadd 88200 float 0;
+#X coords 0 1 88199 -1 300 120 1;
+#X restore 624 100 graph;
+#X text 124 192 shift all values + 0.5;
+#X text 127 169 half the amplitude;
+#X obj 49 213 vasp.update;
+#X obj 49 190 vasp.+ 0.5;
+#X obj 49 145 vasp.osc 44100;
+#X obj 49 167 vasp.* 0.5;
+#X text 157 147 generate a 1Hz sine wave;
+#X msg 49 113 vasp bufadd;
+#X msg 376 113 vasp bufadd;
+#X msg 755 264 vasp bufadd;
+#N canvas 0 0 396 272 init 0;
+#X obj 36 19 loadbang;
+#X msg 36 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 36 45 symbol bufadd;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 879 285 pd init;
+#X obj 49 345 VASP-HELP;
+#X connect 5 0 4 0;
+#X connect 6 0 7 0;
+#X connect 7 0 5 0;
+#X connect 16 0 15 0;
+#X connect 17 0 18 0;
+#X connect 18 0 16 0;
+#X connect 20 0 17 0;
+#X connect 21 0 6 0;
+#X connect 22 0 0 0;
diff --git a/externals/grill/vasp/pd-help/vasp_ageq.pd b/externals/grill/vasp/pd-help/vasp_ageq.pd
new file mode 100644
index 00000000..04df10f5
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_ageq.pd
@@ -0,0 +1,50 @@
+#N canvas 44 207 839 468 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.a>= 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufageq 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 408 84 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufageq \, symbol bufageq1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 662 388 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufageq1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 408 213 graph;
+#X text 60 94 argument/right inlet: value;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 460 390 pd clear_buffers;
+#X obj 57 418 VASP-HELP;
+#X obj 58 366 vasp.update;
+#X floatatom 125 308 5 0 0;
+#X text 164 236 copy to new buffer;
+#X text 60 80 abs(sample) >= abs(value);
+#X msg 61 150 vasp bufageq;
+#X msg 58 236 vasp bufageq1;
+#X obj 58 262 vasp.= bufageq;
+#X obj 58 335 vasp.>= -0.4;
+#X msg 460 364 vasp bufageq bufageq1;
+#X connect 5 0 6 0;
+#X connect 10 0 16 1;
+#X connect 13 0 5 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 0;
+#X connect 16 0 9 0;
+#X connect 17 0 7 0;
diff --git a/externals/grill/vasp/pd-help/vasp_agtr.pd b/externals/grill/vasp/pd-help/vasp_agtr.pd
new file mode 100644
index 00000000..c7ff71e6
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_agtr.pd
@@ -0,0 +1,52 @@
+#N canvas 44 207 841 470 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.a> 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufagtr 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 439 87 graph;
+#N canvas 0 0 398 274 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufagtr \, symbol bufagtr1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 693 391 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufagtr1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 439 216 graph;
+#X text 60 94 argument/right inlet: value;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 491 393 pd clear_buffers;
+#X text 338 218 1/true;
+#X text 337 258 0/false;
+#X obj 57 418 VASP-HELP;
+#X obj 58 366 vasp.update;
+#X floatatom 119 309 5 0 0;
+#X text 164 230 copy to new buffer;
+#X msg 491 367 vasp bufagtr bufagtr1;
+#X text 60 80 abs(sample) > abs(value);
+#X msg 61 150 vasp bufagtr;
+#X msg 58 236 vasp bufagtr1;
+#X obj 58 262 vasp.= bufagtr;
+#X obj 58 335 vasp.> -0.4;
+#X connect 5 0 6 0;
+#X connect 12 0 19 1;
+#X connect 14 0 7 0;
+#X connect 16 0 5 0;
+#X connect 17 0 18 0;
+#X connect 18 0 19 0;
+#X connect 19 0 11 0;
diff --git a/externals/grill/vasp/pd-help/vasp_aleq.pd b/externals/grill/vasp/pd-help/vasp_aleq.pd
new file mode 100644
index 00000000..30a88cf6
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_aleq.pd
@@ -0,0 +1,52 @@
+#N canvas 56 200 881 464 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.a<= 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufaleq 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 489 91 graph;
+#N canvas 0 0 402 278 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufaleq \, symbol bufaleq1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 743 395 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufaleq1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 489 220 graph;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 541 397 pd clear_buffers;
+#X text 389 220 1/true;
+#X text 388 260 0/false;
+#X text 60 94 argument/right inlet: value;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#X obj 58 366 vasp.update;
+#X floatatom 125 308 5 0 0;
+#X text 164 230 copy to new buffer;
+#X obj 57 418 VASP-HELP;
+#X msg 541 371 vasp bufaleq bufaleq1;
+#X msg 61 150 vasp bufaleq;
+#X msg 58 236 vasp bufaleq1;
+#X obj 58 262 vasp.= bufaleq;
+#X obj 58 335 vasp.<= -0.4;
+#X text 60 80 abs(sample) <= abs(value);
+#X connect 8 0 9 0;
+#X connect 11 0 18 1;
+#X connect 14 0 4 0;
+#X connect 15 0 8 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 18 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_alwr.pd b/externals/grill/vasp/pd-help/vasp_alwr.pd
new file mode 100644
index 00000000..2eca3860
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_alwr.pd
@@ -0,0 +1,52 @@
+#N canvas 44 207 843 472 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.a< 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufalwr 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 480 90 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufalwr \, symbol bufalwr1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 734 394 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufalwr1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 480 219 graph;
+#X text 60 94 argument/right inlet: value;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#X text 164 234 copy to new buffer;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 532 396 pd clear_buffers;
+#X text 378 219 1/true;
+#X text 377 259 0/false;
+#X obj 58 366 vasp.update;
+#X floatatom 125 313 5 0 0;
+#X obj 59 418 VASP-HELP;
+#X msg 532 370 vasp bufalwr bufalwr1;
+#X msg 58 236 vasp bufalwr1;
+#X msg 61 150 vasp bufalwr;
+#X obj 58 262 vasp.= bufalwr;
+#X obj 58 335 vasp.a< -0.4;
+#X text 61 80 abs(sample) < abs(value);
+#X connect 5 0 6 0;
+#X connect 12 0 18 1;
+#X connect 14 0 8 0;
+#X connect 15 0 17 0;
+#X connect 16 0 5 0;
+#X connect 17 0 18 0;
+#X connect 18 0 11 0;
diff --git a/externals/grill/vasp/pd-help/vasp_cadd.pd b/externals/grill/vasp/pd-help/vasp_cadd.pd
new file mode 100644
index 00000000..ec1492eb
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cadd.pd
@@ -0,0 +1,21 @@
+#N canvas 266 193 597 452 10;
+#X text 49 142 c \, d ... right operand;
+#X text 49 127 a \, b ... left operand;
+#X text 49 112 e \, f ... target buffers;
+#X text 49 202 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 49 80 e+if=(a+ib)+(c+id);
+#X text 49 174 vasp.c+ needs 2 vectors per operand which are treated
+as pairs;
+#X text 49 65 complex addition;
+#X obj 55 34 cnv 15 15 15 empty empty vasp.c+ 0 10 1 14 -262144 -1
+0;
+#X obj 263 107 vasp.c+;
+#X text 46 287 related objects:;
+#X obj 182 330 vasp.c!-;
+#X obj 265 330 vasp.c!/;
+#X obj 182 288 vasp.c=;
+#X obj 265 309 vasp.c/;
+#X obj 265 288 vasp.c*;
+#X obj 182 309 vasp.c-;
+#X obj 50 384 VASP-HELP;
diff --git a/externals/grill/vasp/pd-help/vasp_cconj.pd b/externals/grill/vasp/pd-help/vasp_cconj.pd
new file mode 100644
index 00000000..ba402500
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cconj.pd
@@ -0,0 +1,33 @@
+#N canvas 122 81 821 476 10;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.cconj 0 10 1 14 -262144
+-1 0;
+#X obj 51 208 vasp.update;
+#X obj 53 367 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufconre 21 float 1;
+#A 0 0.619999 0.639999 0.4 0.18 0.3 0.32 0.0599999 -0.28 -0.26 -0.14
+0.22 0.46 0.26 -0.24 -0.719999 -0.619999 -0.26 -0.02 -0.26 -0.48 -0.5
+;
+#X coords 0 1 20 -1 300 100 1;
+#X restore 410 100 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 45 symbol bufconre \, symbol bufconim;
+#X msg 33 73 \; \$1 xticks 0 1 5 \; \$1 xlabel 1.1 0 5 10 15 20 \;
+\$1 yticks 0 0.25 2 \; \$1 ylabel 21.3 -1 -0.5 0 0.5 1;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 670 381 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufconim 21 float 1;
+#A 0 0.900005 0.820005 0.720004 0.640004 0.580003 0.460003 0.360002
+0.240002 0.120001 0.0600005 -0.0600002 -0.180001 -0.300002 -0.300002
+-0.400002 -0.480003 -0.500003 -0.500003 -0.560003 -0.420002 -0.380002
+;
+#X coords 0 1 20 -1 300 100 1;
+#X restore 411 232 graph;
+#X text 44 59 conjugates the imaginary part of a complex vasp;
+#X obj 51 177 vasp.cconj;
+#X msg 51 142 vasp bufconre bufconim;
+#X connect 7 0 1 0;
+#X connect 8 0 7 0;
diff --git a/externals/grill/vasp/pd-help/vasp_ccopy.pd b/externals/grill/vasp/pd-help/vasp_ccopy.pd
new file mode 100644
index 00000000..5e2d51da
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_ccopy.pd
@@ -0,0 +1,83 @@
+#N canvas 21 60 973 580 10;
+#X obj 62 33 cnv 15 15 15 empty empty vasp.c-> 0 10 1 14 -262144 -1
+0;
+#X text 55 81 optional argument/right inlet: value/vasp;
+#N canvas 0 0 262 199 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X restore 308 479 pd clear_buffer;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcopy1 100 float 1;
+#A 0 0.143758 0.0686079 -0.38831 -0.0776481 0.294635 0.674558 0.607506
+-0.170675 -0.0864513 -0.41061 -0.195257 -0.0921464 -0.0565912 -0.0555828
+0.0530162 0.0249378 -0.0623897 -0.0156552 0.0755211 0.0167451 0.141562
+0.0405158 -0.023263 0.0180184 -0.0637342 -0.0822978 -0.00542918 -0.000371593
+0.0383471 0.0352856 0.00255783 -0.0732533 0.00192948 -0.00246741 -0.00759756
+0.038446 -0.030182 -0.0408431 -0.0153346 -0.0652415 -0.0363779 0.0186147
+0.0138818 0.0333752 0.0466349 0.0131742 -0.0321698 0.0154971 0.00843997
+0.0131756 0.0645522 0.00604813 -0.0115883 0.00454732 -0.0538017 -0.0109963
+0.0257179 0.0423155 0.0291044 0.0311714 -0.0175559 -0.0558005 0.0108977
+-0.0305093 -0.00780438 0.0367772 -0.0188594 -0.00453038 -0.0172815
+-0.0762415 -0.00338057 0.0343781 0.0289549 0.00518148 0.0427147 -0.0310832
+-0.0454392 0.0401651 -0.0132068 0.0646664 0.120187 -0.00961662 0.0462419
+-0.0174716 -0.0689202 -0.0208856 0.0423041 0.024882 0.00339087 -0.0797522
+-0.230074 -0.440424 -0.0808137 -0.16581 0.848087 -0.0205055 -0.296507
+0.0507298 0.357646 -0.480663;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 572 53 graph;
+#N canvas 0 0 394 270 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 87 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufcopy1 \, symbol bufcopy2 \, symbol bufcopy3
+\, symbol bufcopy4;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 308 518 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcopy2 100 float 1;
+#A 0 0.0280782 -0.0422518 0.554172 -0.1767 1 0.156081 -0.876136 -0.11387
+-0.208158 -0.115016 0.0598257 -0.00410798 -0.0287769 0.247451 -0.0203781
+-0.0739293 0.0539849 0.0833412 0.0777782 0.109606 0.0072245 -0.146124
+-0.0299617 -0.123235 -0.0657105 0.00113347 -0.00988766 -0.00689244
+0.0115624 -0.0669525 -0.0608685 -0.0229969 0.00134453 -0.0204591 0.0424171
+-0.0235819 -0.0606822 -0.0179317 -0.0448778 -0.00991407 0.042282 0.0112347
+0.00659574 -0.0135941 -0.0447328 -0.0525184 -0.00989902 0.00836445
+-0.00132186 0.0146546 -0.000898497 -0.0431941 -0.00978027 -0.0237825
+-0.0115866 0.0196117 0.0161645 0.000628861 -0.0328125 -0.0393695 -0.0745345
+-0.0206123 0.0146289 -0.0234719 0.0331914 -0.00930453 -0.0477893 0.0219494
+-0.0180073 0.0137906 0.0326551 0.0580143 -0.0392246 -0.0196385 -0.0287846
+-0.0691948 0.00847168 0.0580848 -0.00780806 0.111565 -0.0162468 -0.142128
+-0.0371815 -0.0349165 -0.0117682 -0.022951 -0.012041 -0.245803 -0.0872
+-0.246933 -0.3275 0.130284 0.138918 -0.150566 0.816856 0.0117589 0.391891
+0.00536379 0.00963765 0.49746;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 572 167 graph;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcopy3 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 573 319 graph;
+#X text 111 357 abbreviation;
+#X obj 211 251 vasp.update;
+#X text 53 224 original;
+#X text 55 99 left outlet: original \, right outlet copy;
+#X text 183 226 copy;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcopy4 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 573 435 graph;
+#X msg 54 169 vasp bufcopy1 bufcopy2;
+#X obj 54 204 vasp.copy bufcopy3 bufcopy4;
+#X msg 308 454 vasp bufcopy3 bufcopy4;
+#X obj 53 356 vasp.c->;
+#X text 55 62 copy a complex vasp to another;
+#X text 50 405 related object;
+#X obj 162 404 vasp.copy;
+#X obj 249 404 vasp.=;
+#X obj 50 500 VASP-HELP;
+#X connect 13 0 14 0;
+#X connect 14 1 8 0;
+#X connect 15 0 2 0;
diff --git a/externals/grill/vasp/pd-help/vasp_cdiv.pd b/externals/grill/vasp/pd-help/vasp_cdiv.pd
new file mode 100644
index 00000000..bb1a5073
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cdiv.pd
@@ -0,0 +1,16 @@
+#N canvas 235 228 623 356 10;
+#X text 52 141 c \, d ... right operand;
+#X text 52 126 a \, b ... left operand;
+#X text 52 111 e \, f ... target buffers;
+#X text 51 199 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 52 81 e+if=(a+ib)/(c+id);
+#X text 52 168 vasp.c/ needs 2 vectors per operand which are treated
+as pairs;
+#X text 52 65 complex division;
+#X obj 55 34 cnv 15 15 15 empty empty vasp.c/ 0 10 1 14 -262144 -1
+0;
+#X obj 277 86 vasp.c/;
+#X obj 173 280 vasp.c!/;
+#X obj 54 317 VASP-HELP;
+#X text 51 281 related object:;
diff --git a/externals/grill/vasp/pd-help/vasp_cdivr.pd b/externals/grill/vasp/pd-help/vasp_cdivr.pd
new file mode 100644
index 00000000..5aa1c1a2
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cdivr.pd
@@ -0,0 +1,18 @@
+#N canvas 231 208 570 384 10;
+#X text 52 141 c \, d ... right operand;
+#X text 52 126 a \, b ... left operand;
+#X text 52 111 e \, f ... target buffers;
+#X text 51 199 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 52 81 e+if=(a+ib)/(c+id);
+#X text 52 168 vasp.c/ needs 2 vectors per operand which are treated
+as pairs;
+#X obj 55 34 cnv 15 15 15 empty empty vasp.c!/ 0 10 1 14 -262144 -1
+0;
+#X text 52 65 reverse complex division;
+#X obj 283 79 vasp.c!/;
+#X obj 186 308 vasp.c/;
+#X obj 186 287 vasp.c*;
+#X obj 53 346 VASP-HELP;
+#X text 92 348 - vasp overview;
+#X text 51 285 related objects:;
diff --git a/externals/grill/vasp/pd-help/vasp_cfft.pd b/externals/grill/vasp/pd-help/vasp_cfft.pd
new file mode 100644
index 00000000..e6f46809
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cfft.pd
@@ -0,0 +1,98 @@
+#N canvas 48 55 915 635 10;
+#N canvas 92 108 405 306 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 203 210 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 259 135 resize \$1;
+#X obj 259 88 loadbang;
+#X obj 67 53 loadbang;
+#X msg 259 109 88200;
+#X obj 259 157 s bufre;
+#X obj 269 181 s bufim;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 4;
+#X obj 66 178 t b;
+#X msg 67 133 read \$1 bufre;
+#X connect 0 0 11 0;
+#X connect 3 0 7 0;
+#X connect 3 0 8 0;
+#X connect 4 0 6 0;
+#X connect 5 0 10 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 9 0 12 0;
+#X connect 10 0 9 0;
+#X connect 11 0 2 0;
+#X connect 12 0 0 0;
+#X restore 781 473 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.cfft 0 10 1 14 -262144 -1
+0;
+#X obj 326 113 filelist \$0;
+#X text 75 52 complex fourier transformation (giant);
+#X text 70 68 cfft needs two buffers;
+#X msg 67 113 vasp bufre;
+#X obj 67 136 vasp.noise;
+#X text 151 112 generate white noise or;
+#X obj 67 159 vasp.* 0.5;
+#X obj 67 182 vasp.update;
+#X obj 67 205 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 61 411 vasp.update;
+#X obj 61 434 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 61 388 vasp.c!fft;
+#X obj 61 276 vasp.cfft;
+#X msg 61 253 vasp bufre bufim;
+#X obj 61 299 vasp.update;
+#X obj 61 322 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 61 365 vasp bufre bufim;
+#X text 758 100 real;
+#X text 768 242 imaginary;
+#X text 524 387 0 Hz;
+#X text 660 387 sr/2;
+#X obj 558 117 wavedisplay-select bufre \$0;
+#X obj 559 266 wavedisplay-select bufim \$0;
+#X text 166 472 <-- click to open;
+#X text 789 387 44.1 kHz;
+#X text 145 274 convert a signal from the time domain into the frequency
+domain. each sample now represents a frequency (range from 0 to 44.1
+kHz).;
+#X obj 59 473 filter_example;
+#X obj 352 478 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 486 472 pd clear_buffers;
+#X obj 352 434 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 374 428 play;
+#X text 486 428 clear;
+#X obj 352 455 tabplay~ bufre;
+#X msg 486 449 vasp bufre bufim;
+#X text 67 556 related objects:;
+#X obj 68 596 VASP-HELP;
+#X text 110 595 - vasp overview;
+#X obj 379 557 vasp.r!fft;
+#X obj 296 557 vasp.rfft;
+#X obj 210 557 vasp.c!fft;
+#X connect 5 0 6 0;
+#X connect 6 0 8 0;
+#X connect 8 0 9 0;
+#X connect 9 0 10 0;
+#X connect 11 0 12 0;
+#X connect 13 0 11 0;
+#X connect 14 0 16 0;
+#X connect 15 0 14 0;
+#X connect 16 0 17 0;
+#X connect 18 0 13 0;
+#X connect 31 0 34 0;
+#X connect 34 0 29 0;
+#X connect 34 0 29 1;
+#X connect 35 0 30 0;
diff --git a/externals/grill/vasp/pd-help/vasp_channel.pd b/externals/grill/vasp/pd-help/vasp_channel.pd
new file mode 100644
index 00000000..2734b3f6
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_channel.pd
@@ -0,0 +1,10 @@
+#N canvas 87 123 442 407 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.channel 0 10 1 14 -262144
+-1 0;
+#X obj 59 163 vasp.channel;
+#X obj 161 209 vasp.channel?;
+#X text 57 69 set channel index of vectors in vasp;
+#X text 54 105 only used for interleaved stereo-files;
+#X text 57 210 related object;
+#X text 52 123 (MaxMSP version of vasp);
+#X obj 61 268 VASP-HELP;
diff --git a/externals/grill/vasp/pd-help/vasp_check.pd b/externals/grill/vasp/pd-help/vasp_check.pd
new file mode 100644
index 00000000..ef9311e4
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_check.pd
@@ -0,0 +1,26 @@
+#N canvas 219 135 653 496 10;
+#X text 250 113 buffer length = 88200 samples;
+#X text 67 72 checks the dimensions of a vasp and corrects them;
+#X obj 70 32 cnv 15 15 15 empty empty vasp.check 0 10 1 14 -262144
+-1 0;
+#X obj 69 114 table bufchk 88200;
+#X text 250 253 corrected vasp with maximum length at offset 44100
+;
+#X obj 69 227 prepend set;
+#X msg 69 159 vasp 88200 bufchk 44100 0;
+#X text 250 158 vasp with impossible dimensions;
+#X msg 69 254 vasp 44100 bufchk 44100 0;
+#X obj 69 186 vasp.check;
+#X obj 65 334 vasp.chk;
+#X text 139 333 abbreviation;
+#X text 64 363 related objects:;
+#X obj 67 393 VASP-HELP;
+#X text 52 226 *;
+#X text 62 432 * prepend-object from iemlib2 (http://pd.iem.at/iemlib)
+;
+#X obj 337 362 vasp.frames?;
+#X obj 187 362 vasp.n?;
+#X obj 245 362 vasp.offset?;
+#X connect 5 0 8 0;
+#X connect 6 0 9 0;
+#X connect 9 0 5 0;
diff --git a/externals/grill/vasp/pd-help/vasp_cifft.pd b/externals/grill/vasp/pd-help/vasp_cifft.pd
new file mode 100644
index 00000000..22f10920
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cifft.pd
@@ -0,0 +1,89 @@
+#N canvas 81 48 890 610 10;
+#N canvas 92 108 396 316 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 192 209 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 241 140 resize \$1;
+#X obj 241 93 loadbang;
+#X obj 67 53 loadbang;
+#X msg 241 114 88200;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 4;
+#X obj 241 162 s bufrei;
+#X obj 251 186 s bufimi;
+#X obj 66 178 t b;
+#X msg 67 133 read \$1 bufrei;
+#X connect 0 0 11 0;
+#X connect 3 0 9 0;
+#X connect 3 0 10 0;
+#X connect 4 0 6 0;
+#X connect 5 0 8 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 12 0;
+#X connect 8 0 7 0;
+#X connect 11 0 2 0;
+#X connect 12 0 0 0;
+#X restore 781 472 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.c!fft 0 10 1 14 -262144
+-1 0;
+#X obj 74 90 filelist \$0;
+#X obj 61 411 vasp.update;
+#X obj 61 434 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 61 388 vasp.c!fft;
+#X obj 61 233 vasp.cfft;
+#X obj 61 254 vasp.update;
+#X obj 61 275 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 801 97 real;
+#X text 768 242 imaginary;
+#X text 524 385 0 Hz;
+#X text 660 384 sr/2;
+#X text 171 473 <-- click to open;
+#X text 789 386 44.1 kHz;
+#X obj 352 474 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 486 474 pd clear_buffers;
+#X obj 352 431 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 374 428 play;
+#X text 486 429 clear;
+#X obj 59 473 filter_examplei;
+#X text 71 53 invers complex fourier transformation (giant);
+#X text 69 66 c!fft needs two buffers;
+#X msg 486 451 vasp bufrei bufimi;
+#X obj 352 451 tabplay~ bufrei;
+#X msg 61 212 vasp bufrei bufimi;
+#X text 189 211 transform to frequency domain;
+#X text 152 247 each sample of the buffer now represents a frequency
+(range from 0 to 44.1 kHz).;
+#X text 60 306 to get back to the sourcefile in time domain either
+use 3 more times vasp.cfft or just once vasp.c!fft;
+#X text 195 364 invers cfft to transform back to time domain;
+#X msg 61 365 vasp bufrei bufimi;
+#X obj 525 112 wavedisplay-simple bufrei \$0;
+#X obj 527 263 wavedisplay-simple bufimi \$0;
+#X text 59 538 related objects:;
+#X obj 59 574 VASP-HELP;
+#X obj 371 539 vasp.r!fft;
+#X obj 288 539 vasp.rfft;
+#X obj 202 539 vasp.cfft;
+#X connect 3 0 4 0;
+#X connect 5 0 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 17 0 24 0;
+#X connect 23 0 16 0;
+#X connect 24 0 15 0;
+#X connect 24 0 15 1;
+#X connect 25 0 6 0;
+#X connect 30 0 5 0;
diff --git a/externals/grill/vasp/pd-help/vasp_cmul.pd b/externals/grill/vasp/pd-help/vasp_cmul.pd
new file mode 100644
index 00000000..1847cf69
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cmul.pd
@@ -0,0 +1,21 @@
+#N canvas 262 173 610 420 10;
+#X text 54 148 c \, d ... right operand;
+#X text 54 130 a \, b ... left operand;
+#X text 54 112 e \, f ... target buffers;
+#X text 54 197 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 54 82 e+if=(a+ib)*(c+id);
+#X text 54 166 vasp.c* needs 2 vectors per operand which are treated
+as pairs;
+#X text 54 64 complex multiplication;
+#X obj 55 29 cnv 15 15 15 empty empty vasp.c* 0 10 1 14 -262144 -1
+0;
+#X obj 286 81 vasp.c*;
+#X text 46 271 related objects:;
+#X obj 182 314 vasp.c!-;
+#X obj 263 293 vasp.c!/;
+#X obj 263 272 vasp.c/;
+#X obj 182 293 vasp.c-;
+#X obj 50 347 VASP-HELP;
+#X obj 182 272 vasp.c+;
+#X obj 263 314 vasp.c=;
diff --git a/externals/grill/vasp/pd-help/vasp_cnoise.pd b/externals/grill/vasp/pd-help/vasp_cnoise.pd
new file mode 100644
index 00000000..7485db5b
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cnoise.pd
@@ -0,0 +1,53 @@
+#N canvas 47 54 881 559 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.cnoise 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcnoise1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 500 96 graph;
+#N canvas 0 0 402 278 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufcnoise1 \, symbol bufcnoise2;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 775 366 pd init;
+#X obj 65 217 vasp.update;
+#X obj 65 194 vasp.* 0.5;
+#N canvas 40 55 247 122 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 504 389 pd clear_buffers;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcnoise2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 501 228 graph;
+#X text 71 63 vasp complex noise generator;
+#X text 71 83 needs 2 buffers;
+#X msg 65 127 vasp bufcnoise1 bufcnoise2;
+#X text 267 140 into two buffers;
+#X obj 65 171 vasp.cnoise;
+#X obj 324 411 dac~;
+#X obj 324 345 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 346 344 play;
+#X msg 504 366 vasp bufcnoise1 bufcnoise2;
+#X obj 324 366 tabplay~ bufcnoise1;
+#X obj 343 388 tabplay~ bufcnoise2;
+#X obj 64 505 VASP-HELP;
+#X obj 189 472 vasp.noise;
+#X text 64 471 related object:;
+#X text 265 126 generate complex noise;
+#X connect 4 0 3 0;
+#X connect 9 0 11 0;
+#X connect 11 0 4 0;
+#X connect 13 0 16 0;
+#X connect 13 0 17 0;
+#X connect 15 0 5 0;
+#X connect 16 0 12 0;
+#X connect 17 0 12 1;
diff --git a/externals/grill/vasp/pd-help/vasp_cnorm.pd b/externals/grill/vasp/pd-help/vasp_cnorm.pd
new file mode 100644
index 00000000..403165dd
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cnorm.pd
@@ -0,0 +1,94 @@
+#N canvas 36 36 806 582 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.cnorm 0 10 1 14 -262144
+-1 0;
+#X obj 72 113 filelist \$0;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 479 494 pd clear_buffers;
+#X obj 59 247 vasp.update;
+#X obj 59 267 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 337 493 dac~;
+#X obj 337 455 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 358 454 play;
+#N canvas 92 108 432 397 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 202 278 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 240 212 resize \$1;
+#X obj 66 47 loadbang;
+#X obj 66 113 filelisthandler \$0;
+#X msg 66 91 4;
+#X obj 240 234 s bufcnorm1;
+#X obj 241 255 s bufcnorm2;
+#X msg 235 92 88200;
+#X obj 66 69 t b b;
+#X obj 66 193 t b;
+#X msg 66 145 read \$1 bufcnorm1;
+#X connect 0 0 11 0;
+#X connect 3 0 7 0;
+#X connect 3 0 8 0;
+#X connect 4 0 10 0;
+#X connect 5 0 12 0;
+#X connect 6 0 5 0;
+#X connect 9 0 3 0;
+#X connect 9 0 1 0;
+#X connect 10 0 6 0;
+#X connect 10 1 9 0;
+#X connect 11 0 2 0;
+#X connect 12 0 0 0;
+#X restore 668 494 pd inside;
+#X obj 397 118 wavedisplay-simple bufcnorm1 \$0;
+#X obj 398 275 wavedisplay-simple bufcnorm2 \$0;
+#X msg 59 207 vasp bufcnorm1 bufcnorm2;
+#X text 235 206 cfft;
+#X obj 59 227 vasp.cfft;
+#X obj 59 343 vasp.update;
+#X obj 59 363 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 303 vasp bufcnorm1 bufcnorm2;
+#X obj 59 323 vasp.cnorm;
+#X obj 59 434 vasp.update;
+#X obj 59 454 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 394 vasp bufcnorm1 bufcnorm2;
+#X text 235 393 inverse cfft;
+#X obj 59 414 vasp.c!fft;
+#X obj 337 473 tabplay~ bufcnorm2;
+#X obj 202 493 dac~;
+#X obj 202 455 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 223 454 play;
+#X obj 202 473 tabplay~ bufcnorm1;
+#X text 668 97 real;
+#X text 643 253 imaginary;
+#X msg 479 474 vasp bufcnorm1 bufcnorm2;
+#X text 71 66 needs two buffers (or multiple pairs);
+#X text 71 49 sets radius of all complex sample pairs to unity (1)
+;
+#X obj 58 549 VASP-HELP;
+#X text 100 548 - vasp overview;
+#X connect 3 0 4 0;
+#X connect 6 0 23 0;
+#X connect 11 0 13 0;
+#X connect 13 0 3 0;
+#X connect 14 0 15 0;
+#X connect 16 0 17 0;
+#X connect 17 0 14 0;
+#X connect 18 0 19 0;
+#X connect 20 0 22 0;
+#X connect 22 0 18 0;
+#X connect 23 0 5 0;
+#X connect 23 0 5 1;
+#X connect 25 0 27 0;
+#X connect 27 0 24 0;
+#X connect 27 0 24 1;
+#X connect 30 0 2 0;
diff --git a/externals/grill/vasp/pd-help/vasp_copy.pd b/externals/grill/vasp/pd-help/vasp_copy.pd
new file mode 100644
index 00000000..f75ecad3
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_copy.pd
@@ -0,0 +1,70 @@
+#N canvas 21 60 971 578 10;
+#X obj 62 33 cnv 15 15 15 empty empty vasp.-> 0 10 1 14 -262144 -1
+0;
+#X text 55 81 optional argument/right inlet: value/vasp;
+#X obj 235 402 vasp.update;
+#N canvas 0 0 262 199 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X restore 380 379 pd clear_buffer;
+#X obj 50 500 VASP-HELP;
+#X text 55 62 copy an array/buffer to a new one;
+#X obj 57 452 vasp.->;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcopy1 100 float 1;
+#A 0 0 0 0 0.0599997 0.0899995 0.119999 0.179999 0.239999 0.259999
+0.279999 0.299998 0.309998 0.319998 0.323998 0.327998 0.331998 0.335998
+0.339998 0.339998 0.339998 0.339998 0.339998 0.309998 0.279999 0.179999
+0.0799996 -0.0599997 -0.0999995 -0.109999 -0.119999 -0.109999 -0.0999995
+-0.0899995 -0.0799996 -0.0599997 -0.0399998 -0.0199999 2.30968e-008
+0.0199999 0.0799996 0.139999 0.259999 0.239999 0.119999 1.86265e-008
+-0.0299998 -0.0599997 -0.0899995 -0.119999 -0.123333 -0.126666 -0.129999
+-0.133333 -0.136666 -0.139999 -0.133333 -0.126666 -0.119999 -0.113333
+-0.106666 -0.0999995 -0.0533331 -0.00666663 0.0399998 0.0866662 0.133333
+0.179999 0.239999 0.299998 0.379998 0.279999 0.159999 0.189999 0.219999
+0.299998 0.379998 0.459998 0.539997 0.595997 0.651997 0.707996 0.763996
+0.819996 0.379998 0.239999 0.0999995 0.0949996 0.0899996 0.0849996
+0.0799997 0.139999 0.199999 0.0399999 0.0999995 0 0 0 0 0 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 621 72 graph;
+#N canvas 0 0 392 268 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufcopy1 \, symbol bufcopy2 \, symbol bufcopy3
+;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 711 457 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcopy2 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 621 186 graph;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcopy3 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 621 301 graph;
+#X text 111 453 abbreviation;
+#X msg 54 169 vasp bufcopy1;
+#X obj 157 281 vasp.update;
+#X msg 380 354 vasp bufcopy2 bufcopy3;
+#X text 53 254 original;
+#X obj 235 379 vasp.= bufcopy1;
+#X msg 235 354 vasp bufcopy2;
+#X obj 54 234 vasp.copy bufcopy2;
+#X msg 178 226 vasp bufcopy3;
+#X msg 178 203 vasp bufcopy2;
+#X text 66 351 or the other way round:;
+#X text 164 254 copy;
+#X text 55 99 left outlet: original \, right outlet: copy !!!;
+#X text 377 330 clear buffer 2 and 3;
+#X connect 12 0 18 0;
+#X connect 14 0 3 0;
+#X connect 16 0 2 0;
+#X connect 17 0 16 0;
+#X connect 18 1 13 0;
+#X connect 19 0 18 1;
+#X connect 20 0 18 1;
diff --git a/externals/grill/vasp/pd-help/vasp_cosc.pd b/externals/grill/vasp/pd-help/vasp_cosc.pd
new file mode 100644
index 00000000..bbc4941c
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cosc.pd
@@ -0,0 +1,63 @@
+#N canvas 47 54 885 488 10;
+#N canvas 0 0 452 302 Hz_to_period_length 0;
+#X floatatom 125 238 0 0 0;
+#X obj 125 142 t b f;
+#X text 164 238 period length in samples (float);
+#X floatatom 125 80 0 0 0;
+#X obj 125 206 / 1;
+#X text 170 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 125 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 78 302 pd Hz_to_period_length;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.cosc 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcosc1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 500 96 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufcosc1 \, symbol bufcosc2;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 781 387 pd init;
+#X text 71 83 optional argument/right inlet: frequency in period length
+in samples;
+#X obj 77 241 vasp.update;
+#X obj 77 218 vasp.* 0.5;
+#X msg 503 360 vasp bufcosc1 bufcosc2;
+#N canvas 40 55 247 122 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 503 383 pd clear_buffers;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufcosc2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 501 228 graph;
+#X text 71 63 vasp complex sine wave generator;
+#X text 241 123 generate a complex sinewave;
+#X text 241 135 at 1 Hz into two buffers;
+#X obj 77 194 vasp.cosc 44100;
+#X msg 77 127 vasp bufcosc1 bufcosc2;
+#X floatatom 162 168 7 0 0;
+#X text 239 168 set period length (samples);
+#X obj 79 424 VASP-HELP;
+#X connect 6 0 5 0;
+#X connect 7 0 8 0;
+#X connect 13 0 6 0;
+#X connect 14 0 13 0;
+#X connect 15 0 13 1;
diff --git a/externals/grill/vasp/pd-help/vasp_cpowi.pd b/externals/grill/vasp/pd-help/vasp_cpowi.pd
new file mode 100644
index 00000000..8d5d8047
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cpowi.pd
@@ -0,0 +1,84 @@
+#N canvas 28 51 892 605 10;
+#N canvas 92 108 411 413 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 67 53 loadbang;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 133 read -resize \$1 bufcpowi1;
+#X obj 214 228 s bufcpowi1;
+#X obj 224 252 s bufcpowi2;
+#X msg 67 79 1;
+#X connect 0 0 5 0;
+#X connect 3 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 10 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 0 0;
+#X connect 10 0 6 0;
+#X restore 693 501 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.cpowi 0 10 1 14 -262144
+-1 0;
+#X obj 77 139 filelist \$0;
+#X obj 59 482 vasp.update;
+#X obj 59 502 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 59 442 vasp.c!fft;
+#X obj 59 264 vasp.cfft;
+#X obj 59 284 vasp.update;
+#X obj 59 304 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 360 498 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 494 498 pd clear_buffers;
+#X obj 360 455 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 382 452 play;
+#X text 494 453 clear;
+#X text 74 61 complex integer power function;
+#X text 74 75 complex sample ^ n;
+#X text 74 101 argument: exponent;
+#X msg 59 244 vasp bufcpowi1 bufcpowi2;
+#X obj 470 111 wavedisplay-simple bufcpowi1 \$0;
+#X obj 471 254 wavedisplay-simple bufcpowi2 \$0;
+#X obj 360 475 tabplay~ bufcpowi1;
+#X msg 494 475 vasp bufcpowi1 bufcpowi2;
+#X obj 59 368 vasp.update;
+#X obj 59 388 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 328 vasp bufcpowi1 bufcpowi2;
+#X obj 59 348 vasp.cpowi 2;
+#X msg 59 422 vasp bufcpowi1 bufcpowi2;
+#X obj 59 462 vasp.opt;
+#X text 75 88 needs two vectors (or more complex pairs);
+#X obj 59 552 VASP-HELP;
+#X text 222 242 1 transform to frequency domain;
+#X text 219 310 2 complex int power function;
+#X text 217 404 3 transform back to time domain;
+#X connect 3 0 4 0;
+#X connect 5 0 27 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 11 0 20 0;
+#X connect 17 0 6 0;
+#X connect 20 0 9 0;
+#X connect 20 0 9 1;
+#X connect 21 0 10 0;
+#X connect 22 0 23 0;
+#X connect 24 0 25 0;
+#X connect 25 0 22 0;
+#X connect 26 0 5 0;
+#X connect 27 0 3 0;
diff --git a/externals/grill/vasp/pd-help/vasp_crsub.pd b/externals/grill/vasp/pd-help/vasp_crsub.pd
new file mode 100644
index 00000000..8a70d962
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_crsub.pd
@@ -0,0 +1,22 @@
+#N canvas 262 173 566 417 10;
+#X text 56 204 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 59 142 c \, d ... right operand;
+#X text 59 127 a \, b ... left operand;
+#X text 59 83 e+if=(c+id)-(a+ib);
+#X text 59 112 e \, f ... target buffers;
+#X text 59 170 vasp.c- needs 2 vectors per operand which are treated
+as pairs;
+#X text 59 67 complex inverse substraction;
+#X obj 55 34 cnv 15 15 15 empty empty vasp.c!- 0 10 1 14 -262144 -1
+0;
+#X obj 286 96 vasp.c!-;
+#X text 46 287 related objects:;
+#X obj 265 330 vasp.c!/;
+#X obj 182 288 vasp.c=;
+#X obj 265 309 vasp.c/;
+#X obj 265 288 vasp.c*;
+#X obj 52 377 VASP-HELP;
+#X text 94 377 - vasp overview;
+#X obj 182 309 vasp.c+;
+#X obj 182 330 vasp.c-;
diff --git a/externals/grill/vasp/pd-help/vasp_cset.pd b/externals/grill/vasp/pd-help/vasp_cset.pd
new file mode 100644
index 00000000..b317f1d2
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_cset.pd
@@ -0,0 +1,20 @@
+#N canvas 232 203 575 403 10;
+#X text 57 188 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 58 124 c \, d is the target;
+#X text 58 109 a \, b is the source;
+#X text 58 84 (a+ib)=(c+id);
+#X text 58 153 vasp.c= needs 2 vectors per operand which are treated
+as pairs;
+#X text 58 68 complex =;
+#X obj 55 34 cnv 15 15 15 empty empty vasp.c= 0 10 1 14 -262144 -1
+0;
+#X obj 291 90 vasp.c=;
+#X text 58 265 related objects:;
+#X obj 194 308 vasp.c!-;
+#X obj 277 308 vasp.c!/;
+#X obj 277 287 vasp.c/;
+#X obj 277 266 vasp.c*;
+#X obj 194 287 vasp.c-;
+#X obj 57 352 VASP-HELP;
+#X obj 194 266 vasp.c+;
diff --git a/externals/grill/vasp/pd-help/vasp_csqr.pd b/externals/grill/vasp/pd-help/vasp_csqr.pd
new file mode 100644
index 00000000..23554fe5
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_csqr.pd
@@ -0,0 +1,79 @@
+#N canvas 28 51 892 642 10;
+#N canvas 92 108 415 417 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 67 53 loadbang;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 3;
+#X obj 214 228 s bufcsqr1;
+#X obj 224 252 s bufcsqr2;
+#X msg 67 133 read -resize \$1 bufcsqr1;
+#X connect 0 0 5 0;
+#X connect 3 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 7 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 10 0;
+#X connect 7 0 6 0;
+#X connect 10 0 0 0;
+#X restore 685 477 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.csqr 0 10 1 14 -262144 -1
+0;
+#X obj 77 139 filelist \$0;
+#X obj 59 482 vasp.update;
+#X obj 59 502 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 59 442 vasp.c!fft;
+#X obj 59 264 vasp.cfft;
+#X obj 59 284 vasp.update;
+#X obj 59 304 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 352 474 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 486 474 pd clear_buffers;
+#X obj 352 431 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 374 428 play;
+#X text 486 429 clear;
+#X obj 59 368 vasp.update;
+#X obj 59 388 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 59 462 vasp.opt;
+#X text 74 75 complex sample ^ 2;
+#X msg 59 244 vasp bufcsqr1 bufcsqr2;
+#X msg 59 328 vasp bufcsqr1 bufcsqr2;
+#X obj 59 348 vasp.csqr;
+#X msg 59 422 vasp bufcsqr1 bufcsqr2;
+#X obj 352 451 tabplay~ bufcsqr1;
+#X msg 486 451 vasp bufcsqr1 bufcsqr2;
+#X obj 383 123 wavedisplay-simple bufcsqr1 \$0;
+#X obj 383 258 wavedisplay-simple bufcsqr2 \$0;
+#X text 75 88 needs two vectors (or multiple complex pairs);
+#X obj 57 580 VASP-HELP;
+#X connect 3 0 4 0;
+#X connect 5 0 16 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 11 0 22 0;
+#X connect 14 0 15 0;
+#X connect 16 0 3 0;
+#X connect 18 0 6 0;
+#X connect 19 0 20 0;
+#X connect 20 0 14 0;
+#X connect 21 0 5 0;
+#X connect 22 0 9 0;
+#X connect 22 0 9 1;
+#X connect 23 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_csub.pd b/externals/grill/vasp/pd-help/vasp_csub.pd
new file mode 100644
index 00000000..35cd2bd7
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_csub.pd
@@ -0,0 +1,21 @@
+#N canvas 262 173 610 462 10;
+#X text 62 147 c \, d ... right operand;
+#X text 62 132 a \, b ... left operand;
+#X text 62 117 e \, f ... target buffers;
+#X text 60 201 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 62 87 e+if=(a+ib)-(c+id);
+#X text 61 169 vasp.c- needs 2 vectors per operand which are treated
+as pairs;
+#X text 62 71 complex subtraction;
+#X obj 57 23 cnv 15 15 15 empty empty vasp.c- 0 10 1 14 -262144 -1
+0;
+#X obj 297 94 vasp.c-;
+#X text 46 287 related objects:;
+#X obj 182 330 vasp.c!-;
+#X obj 265 330 vasp.c!/;
+#X obj 182 288 vasp.c=;
+#X obj 265 309 vasp.c/;
+#X obj 265 288 vasp.c*;
+#X obj 52 377 VASP-HELP;
+#X obj 182 309 vasp.c+;
diff --git a/externals/grill/vasp/pd-help/vasp_csubr.pd b/externals/grill/vasp/pd-help/vasp_csubr.pd
new file mode 100644
index 00000000..ed2e3027
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_csubr.pd
@@ -0,0 +1,21 @@
+#N canvas 266 193 568 419 10;
+#X text 56 204 differences in lengths are adjusted to smaller vector
+of each pair;
+#X text 59 142 c \, d ... right operand;
+#X text 59 127 a \, b ... left operand;
+#X text 59 83 e+if=(c+id)-(a+ib);
+#X text 59 112 e \, f ... target buffers;
+#X text 59 170 vasp.c- needs 2 vectors per operand which are treated
+as pairs;
+#X text 59 67 complex inverse substraction;
+#X obj 55 34 cnv 15 15 15 empty empty vasp.c!- 0 10 1 14 -262144 -1
+0;
+#X obj 286 96 vasp.c!-;
+#X text 46 287 related objects:;
+#X obj 265 330 vasp.c!/;
+#X obj 182 288 vasp.c=;
+#X obj 265 309 vasp.c/;
+#X obj 265 288 vasp.c*;
+#X obj 52 377 VASP-HELP;
+#X obj 182 309 vasp.c+;
+#X obj 182 330 vasp.c-;
diff --git a/externals/grill/vasp/pd-help/vasp_dframes.pd b/externals/grill/vasp/pd-help/vasp_dframes.pd
new file mode 100644
index 00000000..327ff98e
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_dframes.pd
@@ -0,0 +1,65 @@
+#N canvas 97 138 905 512 10;
+#X obj 62 303 vasp.osc 22050;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.frames+ 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufdfram1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 149 graph;
+#N canvas 0 0 402 278 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufdfram1;
+#X msg 140 45 symbol bufdfram2;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 1 0;
+#X restore 714 408 pd init;
+#X obj 62 335 vasp.update;
+#X text 119 397 abbreviation;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufdfram2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 268 graph;
+#X text 56 98 !!!all vectors of a vasp have the same framesize/length!!!
+;
+#X obj 77 252 prepend set;
+#X obj 62 220 vasp.frames+ 30000;
+#X obj 63 396 vasp.f+;
+#X obj 63 452 VASP-HELP;
+#X text 57 69 adds a value to the frames of a vasp;
+#X text 58 83 argument/right inlet: value in frames;
+#X obj 278 432 vasp.osc 22050;
+#X obj 278 455 vasp.update;
+#X obj 278 258 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+10 -24198 -1 -1 -161 256;
+#X obj 278 277 * 100;
+#X floatatom 313 280 12 0 0;
+#X msg 62 192 vasp 0 bufdfram1;
+#X text 62 164 add 30000 frames to a buffer with length 0;
+#X obj 296 351 vasp.= 0;
+#X obj 278 306 t b b f;
+#X obj 278 408 vasp.frames+ 0;
+#X msg 278 380 vasp 30000 bufdfram2;
+#X msg 296 330 vasp bufdfram2;
+#X text 278 217 add an amount \, to subtract;
+#X text 278 231 try negative values;
+#X msg 77 274;
+#X connect 0 0 4 0;
+#X connect 8 0 28 0;
+#X connect 9 0 8 0;
+#X connect 9 0 0 0;
+#X connect 14 0 15 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 17 0 22 0;
+#X connect 19 0 9 0;
+#X connect 22 0 24 0;
+#X connect 22 1 25 0;
+#X connect 22 2 23 1;
+#X connect 23 0 14 0;
+#X connect 24 0 23 0;
+#X connect 25 0 21 0;
diff --git a/externals/grill/vasp/pd-help/vasp_dif.pd b/externals/grill/vasp/pd-help/vasp_dif.pd
new file mode 100644
index 00000000..039671ca
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_dif.pd
@@ -0,0 +1,49 @@
+#N canvas 96 158 863 464 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.dif 0 10 1 14 -262144 -1
+0;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 469 375 pd clear_buffer;
+#X obj 77 365 vasp.update;
+#X obj 77 243 vasp.update;
+#X obj 77 340 vasp.opt;
+#X obj 77 315 vasp.dif;
+#X text 70 61 vasp differential function;
+#X text 70 77 argument/right inlet: repetition count (default 1);
+#X obj 77 154 vasp.- 0.5;
+#X obj 77 177 vasp.abs;
+#X obj 77 199 vasp.- 0.25;
+#X obj 77 220 vasp.* 4;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufdif 20 float 0;
+#X coords 0 1 19 -1 300 100 1;
+#X restore 441 173 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 5 \; \$1 xlabel 1.1 0 5 10 15 \; \$1
+yticks 0 0.25 2 \; \$1 ylabel 20.5 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufdif;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 690 378 pd init;
+#X msg 469 354 vasp bufdif;
+#X obj 77 130 vasp.phasor 10;
+#X msg 77 103 vasp bufdif;
+#X msg 77 293 vasp bufdif;
+#X text 170 293 find the gradient of the curve;
+#X text 187 101 generate triangular wave;
+#X obj 79 422 VASP-HELP;
+#X connect 4 0 2 0;
+#X connect 5 0 4 0;
+#X connect 8 0 9 0;
+#X connect 9 0 10 0;
+#X connect 10 0 11 0;
+#X connect 11 0 3 0;
+#X connect 14 0 1 0;
+#X connect 15 0 8 0;
+#X connect 16 0 15 0;
+#X connect 17 0 5 0;
diff --git a/externals/grill/vasp/pd-help/vasp_div.pd b/externals/grill/vasp/pd-help/vasp_div.pd
new file mode 100644
index 00000000..2b2363e9
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_div.pd
@@ -0,0 +1,42 @@
+#N canvas 193 184 764 384 10;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 45 79 vasp.update;
+#X obj 45 56 vasp.= 0;
+#X obj 45 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 522 282 pd clear_buffer;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufdiv 88200 float 0;
+#X coords 0 1 88199 -1 300 120 1;
+#X restore 401 42 graph;
+#N canvas 0 0 398 274 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufdiv;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 655 282 pd init;
+#X obj 51 19 cnv 15 15 15 empty empty vasp./ 0 10 1 14 -262144 -1 0
+;
+#X text 127 122 generate a sine wave at 1Hz;
+#X text 44 82 optional argument/right inlet: divisor;
+#X text 44 67 vasp division;
+#X msg 522 262 vasp bufdiv;
+#X obj 51 271 vasp.update;
+#X obj 51 204 vasp.osc 44100;
+#X obj 51 231 vasp./ 2;
+#X msg 51 175 vasp bufdiv;
+#X obj 51 334 VASP-HELP;
+#X obj 51 144 t b f;
+#X obj 51 123 nbx 5 14 -1e+037 1e+037 0 1 empty empty empty 0 -6 0
+10 -24198 -1 -1 2 256;
+#X connect 7 0 0 0;
+#X connect 9 0 10 0;
+#X connect 10 0 8 0;
+#X connect 11 0 9 0;
+#X connect 13 0 11 0;
+#X connect 13 1 10 1;
+#X connect 14 0 13 0;
diff --git a/externals/grill/vasp/pd-help/vasp_divr.pd b/externals/grill/vasp/pd-help/vasp_divr.pd
new file mode 100644
index 00000000..ee67e6c4
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_divr.pd
@@ -0,0 +1,37 @@
+#N canvas 193 184 768 388 10;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 45 79 vasp.update;
+#X obj 45 56 vasp.= 0;
+#X obj 45 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 403 225 pd clear_buffer;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufrdiv 88200 float 0;
+#X coords 0 1 88199 -1 300 120 1;
+#X restore 401 42 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufrdiv;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 668 245 pd init;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.!/ 0 10 1 14 -262144 -1
+0;
+#X msg 403 205 vasp bufrdiv;
+#X text 44 67 vasp reverse division (value/sample);
+#X text 44 82 optional argument/right inlet: denominator;
+#X obj 49 219 vasp.update;
+#X msg 49 124 vasp bufrdiv;
+#X text 137 124 generate a ramp from 1 to 2;
+#X obj 49 186 vasp.!/ 1;
+#X text 136 185 1/x;
+#X obj 48 298 VASP-HELP;
+#X obj 49 151 vasp.= env 1 0 2 88200;
+#X connect 4 0 0 0;
+#X connect 8 0 13 0;
+#X connect 10 0 7 0;
+#X connect 13 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_doffset.pd b/externals/grill/vasp/pd-help/vasp_doffset.pd
new file mode 100644
index 00000000..c1f7b32c
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_doffset.pd
@@ -0,0 +1,28 @@
+#N canvas 199 140 620 413 10;
+#X text 55 80 argument/right inlet: value;
+#X obj 41 11 cnv 15 15 15 empty empty vasp.offset+ 0 10 1 14 -262144
+-1 0;
+#X text 57 323 abbreviation;
+#X floatatom 149 151 0 0 0;
+#X obj 58 201 prepend set;
+#X obj 58 172 vasp.offset+ 300;
+#X msg 58 128 vasp bufoffsd1;
+#X msg 58 234;
+#X floatatom 336 151 0 0 0;
+#X obj 245 201 prepend set;
+#X obj 245 172 vasp.offset+ 300;
+#X msg 245 128 vasp bufoffsd1 220 bufoffsd2 100;
+#X msg 245 234;
+#X obj 147 324 vasp.o+;
+#X text 55 63 change the offset of a vasp (relatively);
+#X obj 471 286 table bufoffsd1;
+#X obj 471 313 table bufoffsd2;
+#X obj 58 365 VASP-HELP;
+#X connect 3 0 5 1;
+#X connect 4 0 7 0;
+#X connect 5 0 4 0;
+#X connect 6 0 5 0;
+#X connect 8 0 10 1;
+#X connect 9 0 12 0;
+#X connect 10 0 9 0;
+#X connect 11 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_dsize.pd b/externals/grill/vasp/pd-help/vasp_dsize.pd
new file mode 100644
index 00000000..b8c47396
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_dsize.pd
@@ -0,0 +1,39 @@
+#N canvas 85 111 905 540 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.size+ 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 408 284 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 2 5 \; \$1 xlabel 1.1 0 10 20 30 40 50
+\; \$1 yticks 0 0.25 2;
+#X msg 33 45 symbol bufdsize;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 714 408 pd init;
+#X text 119 392 abbreviation;
+#X text 58 83 argument/right inlet: value in samples;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufdsize 176 float 0;
+#X coords 0 1 175 -1 300 100 1;
+#X restore 453 153 graph;
+#X text 62 433 related objects:;
+#X obj 343 460 vasp.frames;
+#X obj 183 460 vasp.size?;
+#X obj 259 460 vasp.size*;
+#X obj 259 437 vasp.size/;
+#X msg 62 152 vasp bufdsize;
+#X text 56 67 add an amount to the size of a buffer/array;
+#X obj 62 225 vasp.size+ 10;
+#X obj 62 271 vasp.size?;
+#X floatatom 62 304 5 0 0;
+#X obj 63 392 vasp.s+;
+#X obj 183 436 vasp.size;
+#X obj 62 504 VASP-HELP;
+#X obj 135 199 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+10 -24198 -1 -1 0 256;
+#X obj 62 129 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X connect 10 0 12 0;
+#X connect 12 0 13 0;
+#X connect 13 0 14 0;
+#X connect 18 0 12 1;
+#X connect 19 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_equ.pd b/externals/grill/vasp/pd-help/vasp_equ.pd
new file mode 100644
index 00000000..36c5ce74
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_equ.pd
@@ -0,0 +1,53 @@
+#N canvas 28 91 940 545 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.== 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufequ 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 402 278 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufequ \, symbol bufequ1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 766 421 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufequ1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 248 graph;
+#X text 60 104 argument/right inlet: value;
+#X text 166 293 copy to new buffer;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 564 426 pd clear_buffers;
+#X text 60 80 equal;
+#X msg 564 399 vasp bufequ bufequ1;
+#X text 173 149 generate a function;
+#X msg 61 150 vasp bufequ;
+#X text 406 248 1/true;
+#X text 405 288 0/false;
+#X text 164 359 test if a part of the function is equal to -1;
+#X obj 58 431 VASP-HELP;
+#X obj 60 384 vasp.update;
+#X msg 60 294 vasp bufequ1;
+#X obj 60 326 vasp.= bufequ;
+#X obj 60 357 vasp.== -1;
+#X obj 61 218 vasp.update;
+#X obj 61 178 vasp.= env 0 0 1 22049 0.3 22050 0.3 44099 -1 44100 -1
+66149 1 66150 0 88200;
+#X connect 8 0 6 0;
+#X connect 10 0 20 0;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 18 0 15 0;
+#X connect 20 0 19 0;
diff --git a/externals/grill/vasp/pd-help/vasp_exp.pd b/externals/grill/vasp/pd-help/vasp_exp.pd
new file mode 100644
index 00000000..902ebc33
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_exp.pd
@@ -0,0 +1,42 @@
+#N canvas 51 74 827 464 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.exp 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 408 284 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufexp;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 608 330 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 463 330 pd clear_buffer;
+#X obj 77 197 vasp.update;
+#X text 71 63 e ^ sample;
+#X text 72 81 exponential function;
+#X obj 77 150 vasp.osc 22050;
+#X obj 77 172 vasp.* 0.5;
+#X msg 77 127 vasp bufexp;
+#X msg 463 307 vasp bufexp;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufexp 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 341 144 graph;
+#X obj 78 372 VASP-HELP;
+#X obj 77 316 vasp.update;
+#X msg 77 246 vasp bufexp;
+#X obj 77 291 vasp.opt;
+#X obj 77 269 vasp.exp;
+#X connect 6 0 7 0;
+#X connect 7 0 3 0;
+#X connect 8 0 6 0;
+#X connect 9 0 2 0;
+#X connect 13 0 15 0;
+#X connect 14 0 12 0;
+#X connect 15 0 14 0;
diff --git a/externals/grill/vasp/pd-help/vasp_fhp.pd b/externals/grill/vasp/pd-help/vasp_fhp.pd
new file mode 100644
index 00000000..9b5eff80
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_fhp.pd
@@ -0,0 +1,89 @@
+#N canvas 47 54 891 554 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.fhp 0 10 1 14 -262144 -1
+0;
+#X obj 76 247 vasp.update;
+#X obj 76 224 vasp.* 0.5;
+#X obj 401 449 dac~;
+#X obj 401 405 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 423 404 play;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 533 449 pd clear_buffer;
+#X text 180 178 generate white noise;
+#X obj 76 201 vasp.noise;
+#X obj 76 270 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 77 391 vasp.update;
+#X obj 77 414 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#N canvas 92 108 341 266 init 0;
+#X obj 110 180 s \$0-sample-length;
+#X msg 177 126 resize \$1;
+#X obj 177 79 loadbang;
+#X msg 177 100 88200;
+#X obj 177 148 s buffhp;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 3 0 0 0;
+#X restore 672 447 pd init;
+#N canvas 0 0 458 308 Hz_to_period_length 0;
+#X floatatom 125 242 0 0 0;
+#X obj 125 142 t b f;
+#X text 158 223 period length in samples (float);
+#X floatatom 125 80 0 0 0;
+#X obj 125 206 / 1;
+#X text 170 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 125 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 78 457 pd Hz_to_period_length;
+#X text 71 63 vasp high pass filter (FIR);
+#X text 70 78 first argument: cutoff frequency in period length;
+#X text 70 92 second argument: q-factor from 1 to infinite (integer)
+default 1;
+#X text 70 119 right inlet: cutoff and q-factor (list);
+#X obj 421 188 wavedisplay-simple buffhp \$0;
+#X msg 76 179 vasp buffhp;
+#X msg 77 330 vasp buffhp;
+#X floatatom 201 298 5 0 0;
+#X floatatom 260 298 5 0 0;
+#X text 195 278 cutoff;
+#X text 261 277 q-factor;
+#X obj 201 345 pack;
+#X obj 401 426 tabplay~ buffhp;
+#X msg 533 426 vasp buffhp;
+#X obj 260 319 t b f;
+#X obj 77 366 vasp.fhp 220;
+#X obj 78 503 VASP-HELP;
+#X connect 1 0 9 0;
+#X connect 2 0 1 0;
+#X connect 4 0 26 0;
+#X connect 8 0 2 0;
+#X connect 10 0 11 0;
+#X connect 19 0 8 0;
+#X connect 20 0 29 0;
+#X connect 21 0 25 0;
+#X connect 22 0 28 0;
+#X connect 25 0 29 1;
+#X connect 26 0 3 0;
+#X connect 26 0 3 1;
+#X connect 27 0 6 0;
+#X connect 28 0 25 0;
+#X connect 28 1 25 1;
+#X connect 29 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_fix.pd b/externals/grill/vasp/pd-help/vasp_fix.pd
new file mode 100644
index 00000000..871a1d33
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_fix.pd
@@ -0,0 +1,64 @@
+#N canvas 40 76 961 604 10;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 45 79 vasp.update;
+#X obj 45 56 vasp.= 0;
+#X obj 45 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 567 519 pd clear_buffer;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.fix 0 10 1 14 -262144 -1
+0;
+#X obj 52 493 VASP-HELP;
+#X text 43 57 NAN (not a number) - values become 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array buffix1 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 539 58 graph;
+#N canvas 0 0 390 266 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol buffix1 \, symbol buffix2 \, symbol buffix3;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 799 523 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array buffix2 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 539 207 graph;
+#N canvas 0 0 450 300 graph1 0;
+#X array buffix3 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 539 353 graph;
+#X msg 567 490 vasp buffix1 buffix2 buffix3;
+#X obj 142 254 vasp.log;
+#X obj 246 392 vasp.u;
+#X obj 246 365 vasp.fix;
+#X obj 142 393 vasp.u;
+#X obj 142 332 vasp.exp;
+#X text 152 362 no fix;
+#X obj 57 179 vasp.u;
+#X text 212 253 values < 0 become NANs;
+#X text 803 324 fixed;
+#X text 802 18 source;
+#X text 814 179 NANs;
+#X msg 57 121 vasp buffix1;
+#X obj 57 202 vasp.-> buffix2;
+#X obj 142 292 vasp.-> buffix3;
+#X obj 246 334 vasp.exp;
+#X text 142 421 NANs;
+#X text 246 420 fixed;
+#X text 157 121 generate sine wave;
+#X obj 57 157 vasp.osc 21;
+#X text 316 365 NANs become 0;
+#X connect 8 0 0 0;
+#X connect 9 0 22 0;
+#X connect 11 0 10 0;
+#X connect 13 0 12 0;
+#X connect 15 0 21 0;
+#X connect 20 0 27 0;
+#X connect 21 1 9 0;
+#X connect 22 0 13 0;
+#X connect 22 1 23 0;
+#X connect 23 0 11 0;
+#X connect 27 0 15 0;
diff --git a/externals/grill/vasp/pd-help/vasp_flp.pd b/externals/grill/vasp/pd-help/vasp_flp.pd
new file mode 100644
index 00000000..ab720f99
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_flp.pd
@@ -0,0 +1,86 @@
+#N canvas 47 54 883 546 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.flp 0 10 1 14 -262144 -1
+0;
+#X obj 76 247 vasp.update;
+#X obj 76 224 vasp.* 0.5;
+#X obj 401 449 dac~;
+#X obj 401 405 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 423 404 play;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 533 449 pd clear_buffer;
+#X text 180 178 generate white noise;
+#X obj 76 201 vasp.noise;
+#X obj 76 270 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#N canvas 92 108 343 268 init 0;
+#X obj 110 180 s \$0-sample-length;
+#X msg 177 126 resize \$1;
+#X obj 177 79 loadbang;
+#X msg 177 100 88200;
+#X obj 177 148 s bufflp;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 3 0 0 0;
+#X restore 672 447 pd init;
+#N canvas 0 0 456 306 Hz_to_period_length 0;
+#X floatatom 125 242 0 0 0;
+#X obj 125 142 t b f;
+#X text 158 223 period length in samples (float);
+#X floatatom 125 80 0 0 0;
+#X obj 125 206 / 1;
+#X text 170 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 125 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 78 457 pd Hz_to_period_length;
+#X text 70 78 first argument: cutoff frequency in period length;
+#X text 70 92 second argument: q-factor from 1 to infinite (integer)
+default 1;
+#X text 70 119 right inlet: cutoff and q-factor (list);
+#X text 71 63 vasp low pass filter (FIR);
+#X msg 76 179 vasp bufflp;
+#X obj 428 165 wavedisplay-simple bufflp \$0;
+#X msg 533 426 vasp bufflp;
+#X obj 401 426 tabplay~ bufflp;
+#X obj 78 496 VASP-HELP;
+#X obj 77 371 vasp.update;
+#X obj 77 394 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X floatatom 201 298 5 0 0;
+#X floatatom 260 298 5 0 0;
+#X text 195 278 cutoff;
+#X text 261 277 q-factor;
+#X obj 201 318 pack;
+#X msg 77 297 vasp bufflp;
+#X obj 77 347 vasp.flp 220;
+#X connect 1 0 9 0;
+#X connect 2 0 1 0;
+#X connect 4 0 19 0;
+#X connect 8 0 2 0;
+#X connect 16 0 8 0;
+#X connect 18 0 6 0;
+#X connect 19 0 3 0;
+#X connect 19 0 3 1;
+#X connect 21 0 22 0;
+#X connect 23 0 27 0;
+#X connect 24 0 27 1;
+#X connect 27 0 29 1;
+#X connect 28 0 29 0;
+#X connect 29 0 21 0;
diff --git a/externals/grill/vasp/pd-help/vasp_frames.pd b/externals/grill/vasp/pd-help/vasp_frames.pd
new file mode 100644
index 00000000..6ee8ce96
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_frames.pd
@@ -0,0 +1,60 @@
+#N canvas 79 77 899 565 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.frames 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array buffram1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 149 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol buffram1;
+#X msg 140 45 symbol buffram2;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 1 0;
+#X restore 714 408 pd init;
+#X text 119 397 abbreviation;
+#N canvas 0 0 450 300 graph1 0;
+#X array buffram2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 268 graph;
+#X obj 62 303 vasp.osc 22050;
+#X obj 62 335 vasp.update;
+#X msg 62 165 vasp buffram1;
+#X obj 62 225 vasp.frames 30000;
+#X obj 90 258 prepend set;
+#X msg 90 280;
+#X obj 233 226 vasp.frames 22050;
+#X obj 233 335 vasp.update;
+#X obj 261 258 prepend set;
+#X msg 233 164 vasp buffram1 buffram2 11050;
+#X floatatom 330 197 5 0 0 0 - - -;
+#X obj 233 303 vasp.osc 11025;
+#X msg 261 280;
+#X obj 62 397 vasp.f;
+#X obj 61 498 VASP-HELP;
+#X text 57 69 set the number of frames of a vasp;
+#X text 58 83 argument/right inlet: value in frames;
+#X text 60 429 related objects:;
+#X obj 61 451 vasp.size;
+#X obj 150 451 vasp.f?;
+#X obj 223 451 vasp.f=;
+#X text 57 100 the number of frames is limited by the size of a buffer/array!
+;
+#X text 57 129 all vectors of a vasp have the same frame count/length!
+;
+#X connect 5 0 6 0;
+#X connect 7 0 8 0;
+#X connect 8 0 9 0;
+#X connect 8 0 5 0;
+#X connect 9 0 10 0;
+#X connect 11 0 13 0;
+#X connect 11 0 16 0;
+#X connect 13 0 17 0;
+#X connect 14 0 11 0;
+#X connect 15 0 11 1;
+#X connect 16 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_gate.pd b/externals/grill/vasp/pd-help/vasp_gate.pd
new file mode 100644
index 00000000..7dfcda6e
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_gate.pd
@@ -0,0 +1,74 @@
+#N canvas 36 36 808 584 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.gate 0 10 1 14 -262144 -1
+0;
+#X obj 71 131 filelist \$0;
+#N canvas 92 108 418 383 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 84 253 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 214 221 resize \$1;
+#X obj 66 60 loadbang;
+#X obj 66 193 t b f f;
+#X obj 66 113 filelisthandler \$0;
+#X msg 66 91 1;
+#X obj 214 243 s bufgate1;
+#X obj 225 264 s bufgate2;
+#X msg 66 145 read -resize \$1 bufgate1;
+#X connect 0 0 5 0;
+#X connect 3 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 7 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 10 0;
+#X connect 7 0 6 0;
+#X connect 10 0 0 0;
+#X restore 668 495 pd inside;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 479 495 pd clear_buffers;
+#X obj 60 272 vasp.update;
+#X obj 60 292 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 69 52 gate buffer content with a value;
+#X obj 419 261 wavedisplay-simple bufgate2 \$0;
+#X obj 419 112 wavedisplay-simple bufgate1 \$0;
+#X msg 60 232 vasp bufgate2;
+#X obj 60 252 vasp.= bufgate1;
+#X msg 479 475 vasp bufgate1 bufgate2;
+#X text 161 229 copy from bufgate1 to bufgate2;
+#X obj 337 495 dac~;
+#X obj 337 457 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 358 455 play;
+#X obj 337 475 tabplay~ bufgate2;
+#X text 71 66 optional argument/right inlet: value (usually from 0-1
+to gate the soundfile sample for sample (not like a compressor!);
+#X obj 58 497 VASP-HELP;
+#X obj 60 391 vasp.update;
+#X floatatom 133 349 5 0 0;
+#X obj 60 411 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 60 324 vasp bufgate2;
+#X obj 60 371 vasp.gate 0.2;
+#X text 177 348 value;
+#X text 159 321 gate the buffer content;
+#X connect 4 0 5 0;
+#X connect 9 0 10 0;
+#X connect 10 0 4 0;
+#X connect 11 0 3 0;
+#X connect 14 0 16 0;
+#X connect 16 0 13 0;
+#X connect 16 0 13 1;
+#X connect 19 0 21 0;
+#X connect 20 0 23 1;
+#X connect 22 0 23 0;
+#X connect 23 0 19 0;
diff --git a/externals/grill/vasp/pd-help/vasp_gather.pd b/externals/grill/vasp/pd-help/vasp_gather.pd
new file mode 100644
index 00000000..8f5e2969
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_gather.pd
@@ -0,0 +1,64 @@
+#N canvas 112 58 831 625 10;
+#X text 403 160 gather as many vasps as you want and put them out (bang)
+;
+#X text 71 74 gather several vasps into one;
+#X text 70 90 argument: vasps to gather before output;
+#X text 71 143 right inlet: stores the different vasps;
+#X text 70 110 left inlet: outputs a vasp immediately \, causes output
+of vasps gathered in right inlet (bang);
+#X text 72 163 use vasp.gather like the int/float object;
+#X text 398 444 !vasps can have more vectors \, but just one length!
+;
+#X text 398 464 gather will always take the length from the shortest
+of all gathered vasps for the new one!;
+#X obj 71 37 cnv 15 15 15 empty empty vasp.gather 0 10 1 14 -262144
+-1 0;
+#X msg 486 242 vasp bufgather4;
+#X msg 471 221 vasp bufgather3;
+#X msg 410 178 bang;
+#X msg 456 201 vasp bufgather2;
+#X msg 410 314;
+#X obj 410 291 prepend set;
+#X obj 410 268 vasp.gather;
+#X msg 447 178 vasp bufgather1;
+#X msg 167 450 vasp bufgather4;
+#X msg 233 200 vasp bufgather2;
+#X msg 78 200 bang;
+#X obj 78 291 prepend set;
+#X msg 117 200 vasp bufgather1;
+#X msg 151 429 vasp bufgather3;
+#X msg 78 386 bang;
+#X msg 137 409 vasp bufgather2;
+#X msg 78 520;
+#X obj 78 497 prepend set;
+#X obj 78 474 vasp.gather 2;
+#X msg 125 386 vasp bufgather1;
+#X text 71 366 gather two vasps (opt. argument) an put them out;
+#X obj 77 561 VASP-HELP;
+#N canvas 274 433 336 148 tables 0;
+#X obj 105 39 table bufgather1;
+#X obj 105 61 table bufgather2;
+#X obj 105 84 table bufgather3;
+#X obj 105 106 table bufgather4;
+#X restore 422 552 pd tables;
+#X obj 78 268 vasp.gather;
+#X msg 78 314;
+#X connect 9 0 15 1;
+#X connect 10 0 15 1;
+#X connect 11 0 15 0;
+#X connect 12 0 15 1;
+#X connect 14 0 13 0;
+#X connect 15 0 14 0;
+#X connect 16 0 15 1;
+#X connect 17 0 27 1;
+#X connect 18 0 32 1;
+#X connect 19 0 32 0;
+#X connect 20 0 33 0;
+#X connect 21 0 32 0;
+#X connect 22 0 27 1;
+#X connect 23 0 27 0;
+#X connect 24 0 27 1;
+#X connect 26 0 25 0;
+#X connect 27 0 26 0;
+#X connect 28 0 27 1;
+#X connect 32 0 20 0;
diff --git a/externals/grill/vasp/pd-help/vasp_geq.pd b/externals/grill/vasp/pd-help/vasp_geq.pd
new file mode 100644
index 00000000..c0339b41
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_geq.pd
@@ -0,0 +1,50 @@
+#N canvas 44 207 837 466 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.>= 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufgeq 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 408 84 graph;
+#N canvas 0 0 398 274 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufgeq \, symbol bufgeq1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 662 388 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufgeq1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 408 213 graph;
+#X text 60 94 argument/right inlet: value;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 460 390 pd clear_buffers;
+#X msg 460 364 vasp bufgeq bufgeq1;
+#X text 60 80 sample >= value;
+#X msg 61 150 vasp bufgeq;
+#X obj 57 418 VASP-HELP;
+#X obj 58 366 vasp.update;
+#X floatatom 119 308 5 0 0;
+#X text 164 236 copy to new buffer;
+#X msg 58 236 vasp bufgeq1;
+#X obj 58 262 vasp.= bufgeq;
+#X obj 58 335 vasp.>= 0.4;
+#X connect 5 0 6 0;
+#X connect 8 0 7 0;
+#X connect 10 0 5 0;
+#X connect 13 0 17 1;
+#X connect 15 0 16 0;
+#X connect 16 0 17 0;
+#X connect 17 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_gtr.pd b/externals/grill/vasp/pd-help/vasp_gtr.pd
new file mode 100644
index 00000000..41b2bf9c
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_gtr.pd
@@ -0,0 +1,52 @@
+#N canvas 44 207 839 468 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.> 0 10 1 14 -262144 -1 0
+;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufgtr 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 439 87 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufgtr \, symbol bufgtr1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 693 391 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufgtr1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 439 216 graph;
+#X text 60 94 argument/right inlet: value;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 491 393 pd clear_buffers;
+#X text 60 80 sample > value;
+#X msg 61 150 vasp bufgtr;
+#X msg 491 367 vasp bufgtr bufgtr1;
+#X text 338 218 1/true;
+#X text 337 258 0/false;
+#X obj 57 418 VASP-HELP;
+#X obj 58 366 vasp.update;
+#X floatatom 113 308 5 0 0;
+#X text 164 230 copy to new buffer;
+#X obj 58 335 vasp.> 0.4;
+#X msg 58 236 vasp bufgtr1;
+#X obj 58 262 vasp.= bufgtr;
+#X connect 5 0 6 0;
+#X connect 9 0 5 0;
+#X connect 10 0 7 0;
+#X connect 15 0 17 1;
+#X connect 17 0 14 0;
+#X connect 18 0 19 0;
+#X connect 19 0 17 0;
diff --git a/externals/grill/vasp/pd-help/vasp_imm.pd b/externals/grill/vasp/pd-help/vasp_imm.pd
new file mode 100644
index 00000000..b44e4fda
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_imm.pd
@@ -0,0 +1,77 @@
+#N canvas 51 36 891 586 10;
+#X obj 61 33 cnv 15 15 15 empty empty vasp.imm 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 261 214 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 656 460 pd clear_buffer;
+#X obj 51 533 VASP-HELP;
+#X obj 159 477 vasp.!;
+#X text 58 476 abbreviation:;
+#X obj 57 216 vasp.imm 88200;
+#X obj 154 218 vasp.imm 88200;
+#X obj 254 218 vasp.imm 88200;
+#X obj 57 241 vasp.noise;
+#X obj 154 268 vasp.max;
+#X obj 57 316 vasp.-> bufnotimm;
+#X obj 154 369 vasp.update;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufnotimm 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 511 69 graph;
+#N canvas 0 0 394 270 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufnotimm;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 760 461 pd init;
+#X obj 57 191 t b b b;
+#X obj 355 447 dac~;
+#X obj 355 399 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X text 377 398 play;
+#X obj 355 422 tabplay~ bufnotimm;
+#X msg 656 435 vasp bufnotimm;
+#X obj 57 290 vasp.min;
+#X obj 154 243 vasp.osc 882;
+#X obj 57 266 vasp.* 0.1;
+#X obj 254 268 vasp.* 0.2;
+#X obj 254 243 vasp.osc 3.4;
+#X text 61 55 create an immediate vasp;
+#X text 360 217 create three immediate vasps;
+#X text 111 164 <-- click me;
+#X text 55 124 argument/right inlet: length in samples;
+#X text 55 86 immediate vasps are temporary buffers that are created
+on demand and deleted after usage in a command chain.;
+#X obj 57 165 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X text 361 239 and compose them;
+#X text 363 318 copy the result to an existing buffer/array;
+#X connect 5 0 8 0;
+#X connect 6 0 21 0;
+#X connect 7 0 24 0;
+#X connect 8 0 22 0;
+#X connect 9 0 20 1;
+#X connect 10 1 11 0;
+#X connect 14 0 5 0;
+#X connect 14 1 6 0;
+#X connect 14 2 7 0;
+#X connect 16 0 18 0;
+#X connect 18 0 15 0;
+#X connect 18 0 15 1;
+#X connect 19 0 1 0;
+#X connect 20 0 10 0;
+#X connect 21 0 9 0;
+#X connect 22 0 20 0;
+#X connect 23 0 9 1;
+#X connect 24 0 23 0;
+#X connect 30 0 14 0;
diff --git a/externals/grill/vasp/pd-help/vasp_int.pd b/externals/grill/vasp/pd-help/vasp_int.pd
new file mode 100644
index 00000000..e53ec66a
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_int.pd
@@ -0,0 +1,40 @@
+#N canvas 95 158 862 404 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.int 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufint 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 465 124 graph;
+#N canvas 0 0 398 274 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufint;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 737 285 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 521 284 pd clear_buffer;
+#X text 70 61 vasp integral function;
+#X msg 521 263 vasp bufint;
+#X msg 77 131 vasp bufint;
+#X obj 77 178 vasp.update;
+#X text 70 77 argument: repetition count;
+#X obj 76 336 VASP-HELP;
+#X obj 77 289 vasp.update;
+#X msg 77 211 vasp bufint;
+#X obj 77 242 vasp.int;
+#X obj 77 266 vasp.opt;
+#X obj 77 153 vasp.window lin;
+#X connect 5 0 3 0;
+#X connect 6 0 14 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 13 0 10 0;
+#X connect 14 0 7 0;
diff --git a/externals/grill/vasp/pd-help/vasp_iwindow.pd b/externals/grill/vasp/pd-help/vasp_iwindow.pd
new file mode 100644
index 00000000..10db2b49
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_iwindow.pd
@@ -0,0 +1,61 @@
+#N canvas 58 39 870 560 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.!window 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufiwindow 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 408 284 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufiwindow;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 771 320 pd init;
+#N canvas 0 0 194 221 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 569 326 pd clear_buffers;
+#X text 173 148 generate a function;
+#X obj 61 278 vasp.u;
+#X floatatom 194 186 5 0 0;
+#X text 259 185 0..4;
+#X msg 231 215 lin;
+#X msg 231 240 sin;
+#X msg 231 265 hanning;
+#X msg 231 290 hamming;
+#X msg 231 315 blackman;
+#X text 275 214 0;
+#X text 275 236 1;
+#X text 295 260 2;
+#X text 300 289 3;
+#X text 300 316 4;
+#X obj 132 401 vasp.window;
+#X obj 132 426 vasp.*window;
+#X text 60 396 see also:;
+#X obj 322 426 vasp.*xwindow;
+#X obj 225 426 vasp.*!window;
+#X text 60 104 argument/right inlet: name or number of name;
+#X text 60 80 generate window functions;
+#X msg 569 301 vasp bufiwindow;
+#X obj 322 401 vasp.xwindow;
+#X msg 61 149 vasp bufiwindow;
+#X obj 61 226 vasp.!window lin;
+#X obj 60 503 VASP-HELP;
+#X connect 6 0 28 1;
+#X connect 8 0 28 1;
+#X connect 9 0 28 1;
+#X connect 10 0 28 1;
+#X connect 11 0 28 1;
+#X connect 12 0 28 1;
+#X connect 25 0 3 0;
+#X connect 27 0 28 0;
+#X connect 28 0 5 0;
diff --git a/externals/grill/vasp/pd-help/vasp_join.pd b/externals/grill/vasp/pd-help/vasp_join.pd
new file mode 100644
index 00000000..3d48406b
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_join.pd
@@ -0,0 +1,26 @@
+#N canvas 239 111 493 440 10;
+#X text 51 62 join several vasps into one;
+#X text 51 78 argument: number of vasps to join;
+#X text 51 95 left inlet triggers the output;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.join 0 10 1 14 -262144 -1
+0;
+#X obj 62 382 VASP-HELP;
+#X msg 230 159 vasp bufjoin1 bufjoin2 bufjoin3;
+#X obj 128 214 prepend set;
+#X obj 61 305 prepend set;
+#X obj 61 191 vasp.split 2;
+#X obj 61 282 vasp.join 2;
+#X msg 61 159 vasp bufjoin1 bufjoin2;
+#X obj 310 337 table bufjoin1;
+#X obj 310 360 table bufjoin2;
+#X obj 310 384 table bufjoin3;
+#X msg 128 238;
+#X msg 61 329;
+#X connect 5 0 8 0;
+#X connect 6 0 14 0;
+#X connect 7 0 15 0;
+#X connect 8 0 9 0;
+#X connect 8 1 9 1;
+#X connect 8 2 6 0;
+#X connect 9 0 7 0;
+#X connect 10 0 8 0;
diff --git a/externals/grill/vasp/pd-help/vasp_leq.pd b/externals/grill/vasp/pd-help/vasp_leq.pd
new file mode 100644
index 00000000..85b55609
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_leq.pd
@@ -0,0 +1,52 @@
+#N canvas 56 200 877 460 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.<= 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufleq 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 489 91 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufleq \, symbol bufleq1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 743 395 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufleq1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 489 220 graph;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 541 397 pd clear_buffers;
+#X msg 541 371 vasp bufleq bufleq1;
+#X text 389 220 1/true;
+#X text 388 260 0/false;
+#X text 60 94 argument/right inlet: value;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#X obj 58 366 vasp.update;
+#X floatatom 119 308 5 0 0;
+#X text 164 230 copy to new buffer;
+#X obj 58 335 vasp.<= 0.4;
+#X text 60 80 sample <= value;
+#X msg 61 150 vasp bufleq;
+#X msg 58 236 vasp bufleq1;
+#X obj 58 262 vasp.= bufleq;
+#X obj 57 418 VASP-HELP;
+#X connect 5 0 4 0;
+#X connect 9 0 10 0;
+#X connect 12 0 14 1;
+#X connect 14 0 11 0;
+#X connect 16 0 9 0;
+#X connect 17 0 18 0;
+#X connect 18 0 14 0;
diff --git a/externals/grill/vasp/pd-help/vasp_list.pd b/externals/grill/vasp/pd-help/vasp_list.pd
new file mode 100644
index 00000000..6764e257
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_list.pd
@@ -0,0 +1,28 @@
+#N canvas 93 206 852 414 10;
+#X text 60 80 outputs the values of all samples of a vasp as list;
+#X obj 74 32 cnv 15 15 15 empty empty vasp.? 0 10 1 14 -262144 -1 0
+;
+#N canvas 0 0 450 300 graph1 0;
+#X array buflist 20 float 0;
+#X coords 0 1 19 -1 300 100 1;
+#X restore 389 143 graph;
+#N canvas 0 0 392 268 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 45 symbol buflist;
+#X msg 33 73 \; \$1 xticks 0 1 5 \; \$1 xlabel 1.1 0 5 10 15 \; \$1
+yticks 0 0.25 2 \; \$1 ylabel 20.5 -1 -0.5 0 0.5 1;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 677 302 pd init;
+#X obj 99 205 vasp.?;
+#X msg 99 130 vasp buflist;
+#X obj 99 173 vasp.update;
+#X obj 99 237 prepend set;
+#X obj 95 373 VASP-HELP;
+#X obj 99 151 vasp.window lin;
+#X msg 99 284;
+#X connect 4 0 7 0;
+#X connect 5 0 9 0;
+#X connect 6 0 4 0;
+#X connect 7 0 10 0;
+#X connect 9 0 6 0;
diff --git a/externals/grill/vasp/pd-help/vasp_log.pd b/externals/grill/vasp/pd-help/vasp_log.pd
new file mode 100644
index 00000000..4e8c839f
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_log.pd
@@ -0,0 +1,50 @@
+#N canvas 47 54 892 462 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.log 0 10 1 14 -262144 -1
+0;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 494 337 pd clear_buffer;
+#X text 71 63 ln (sample);
+#X text 72 81 natural logarithm;
+#X text 170 281 calculate the natural logarithm;
+#X msg 494 314 vasp buflog;
+#X text 167 184 draw a line from 1 to a value (def 1001);
+#X text 193 127 value;
+#N canvas 0 0 450 300 graph1 0;
+#X array buflog 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 493 168 graph;
+#N canvas 0 0 390 266 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol buflog;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 756 336 pd init;
+#X text 170 303 and optimize to values between (-1) and 1;
+#X obj 69 329 vasp.update;
+#X obj 69 305 vasp.opt;
+#X obj 69 282 vasp.log;
+#X msg 69 185 vasp buflog;
+#X obj 69 232 vasp.* 1000;
+#X obj 69 258 vasp.+ 1;
+#X obj 133 147 t b f;
+#X obj 70 405 VASP-HELP;
+#X obj 69 207 vasp.window lin;
+#X obj 133 129 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+10 -24198 -1 -1 1 256;
+#X connect 5 0 1 0;
+#X connect 12 0 11 0;
+#X connect 13 0 12 0;
+#X connect 14 0 19 0;
+#X connect 15 0 16 0;
+#X connect 16 0 13 0;
+#X connect 17 0 14 0;
+#X connect 17 1 15 1;
+#X connect 19 0 15 0;
+#X connect 20 0 17 0;
diff --git a/externals/grill/vasp/pd-help/vasp_lwr.pd b/externals/grill/vasp/pd-help/vasp_lwr.pd
new file mode 100644
index 00000000..f2f5f021
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_lwr.pd
@@ -0,0 +1,52 @@
+#N canvas 44 207 839 468 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.< 0 10 1 14 -262144 -1 0
+;
+#N canvas 0 0 450 300 graph1 0;
+#X array buflwr 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 480 90 graph;
+#N canvas 0 0 394 270 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol buflwr \, symbol buflwr1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 734 394 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array buflwr1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 480 219 graph;
+#X text 60 80 sample < value;
+#X text 60 94 argument/right inlet: value;
+#X msg 61 150 vasp buflwr;
+#X obj 61 172 vasp.osc 44100;
+#X obj 61 194 vasp.update;
+#X text 164 234 copy to new buffer;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 532 396 pd clear_buffers;
+#X msg 532 370 vasp buflwr buflwr1;
+#X text 378 219 1/true;
+#X text 377 259 0/false;
+#X obj 58 366 vasp.update;
+#X obj 58 262 vasp.= buflwr;
+#X msg 58 236 vasp buflwr1;
+#X floatatom 113 308 5 0 0;
+#X obj 58 335 vasp.< 0.4;
+#X obj 59 418 VASP-HELP;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 11 0 10 0;
+#X connect 15 0 18 0;
+#X connect 16 0 15 0;
+#X connect 17 0 18 1;
+#X connect 18 0 14 0;
diff --git a/externals/grill/vasp/pd-help/vasp_max.pd b/externals/grill/vasp/pd-help/vasp_max.pd
new file mode 100644
index 00000000..92e25c7e
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_max.pd
@@ -0,0 +1,51 @@
+#N canvas 53 20 825 522 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.max 0 10 1 14 -262144 -1
+0;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 400 405 pd clear_buffer;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmax 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 400 114 graph;
+#N canvas 0 0 398 274 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 43 symbol bufmax \, symbol bufmax1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 675 411 pd init;
+#X obj 73 144 vasp.osc 44100;
+#X obj 73 167 vasp.update;
+#X text 68 58 take maximum of vasp and argument;
+#X text 70 75 argument/right inlet: value;
+#X msg 73 123 vasp bufmax;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmax1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 400 251 graph;
+#X text 625 70 source;
+#X obj 72 281 vasp.= bufmax;
+#X msg 72 255 vasp bufmax1;
+#X obj 72 334 vasp.update;
+#X msg 400 382 vasp bufmax bufmax1;
+#X text 162 121 generate a sine wave at 1 Hz;
+#X text 178 251 copy to new buffer;
+#X obj 72 309 vasp.max -0.4;
+#X obj 65 435 VASP-HELP;
+#X text 177 327 set all values < -0.4 to -0.4;
+#X connect 4 0 5 0;
+#X connect 8 0 4 0;
+#X connect 11 0 17 0;
+#X connect 12 0 11 0;
+#X connect 14 0 1 0;
+#X connect 17 0 13 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mcosc.pd b/externals/grill/vasp/pd-help/vasp_mcosc.pd
new file mode 100644
index 00000000..46d729f5
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mcosc.pd
@@ -0,0 +1,68 @@
+#N canvas 14 55 990 494 10;
+#N canvas 4 20 456 306 Hz_to_period_length 0;
+#X floatatom 135 238 0 0 0;
+#X obj 135 142 t b f;
+#X text 136 260 period length in samples (float);
+#X floatatom 135 80 0 0 0;
+#X obj 135 206 / 1;
+#X text 180 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 135 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 65 415 pd Hz_to_period_length;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.*cosc 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmcosc1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 563 101 graph;
+#N canvas 0 0 402 278 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufmcosc1 \, symbol bufmcosc2;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 846 418 pd init;
+#N canvas 40 55 247 122 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 568 414 pd clear_buffers;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmcosc2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 566 259 graph;
+#X text 71 63 multiplies a complex buffer with a complex sine wave
+;
+#X text 71 83 argument/right inlet: frequency in period length in samples
+;
+#X msg 568 391 vasp bufmcosc1 bufmcosc2;
+#X obj 65 179 vasp.update;
+#X msg 65 127 vasp bufmcosc1 bufmcosc2;
+#X text 246 127 generate a ramp from 0 to 1;
+#X text 742 70 *real part of the cosc;
+#X text 713 227 *imaginary part of the cosc;
+#X obj 65 357 vasp.update;
+#X obj 65 334 vasp.* 0.5;
+#X msg 65 267 vasp bufmcosc1 bufmcosc2;
+#X obj 65 311 vasp.*cosc 44100;
+#X obj 64 448 VASP-HELP;
+#X obj 65 154 vasp.window lin;
+#X text 245 265 multiply the ramp with a complex sine wave;
+#X connect 8 0 4 0;
+#X connect 10 0 19 0;
+#X connect 15 0 14 0;
+#X connect 16 0 17 0;
+#X connect 17 0 15 0;
+#X connect 19 0 9 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mframes.pd b/externals/grill/vasp/pd-help/vasp_mframes.pd
new file mode 100644
index 00000000..ead17da8
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mframes.pd
@@ -0,0 +1,63 @@
+#N canvas 80 119 908 535 10;
+#X obj 62 323 vasp.osc 22050;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.frames* 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmfram1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 149 graph;
+#N canvas 0 0 404 280 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufmfram1;
+#X msg 140 45 symbol bufmfram2;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 1 0;
+#X restore 813 459 pd init;
+#X obj 62 355 vasp.update;
+#X text 117 412 abbreviation;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmfram2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 268 graph;
+#X text 54 103 !!!all vectors of a vasp have the same framesize/length!!!
+;
+#X obj 77 274 prepend set;
+#X obj 233 323 vasp.osc 22050;
+#X obj 233 355 vasp.update;
+#X text 58 83 argument/right inlet: value;
+#X obj 233 239 vasp.frames* 2;
+#X obj 62 187 vasp.-> bufmfram2;
+#X obj 255 271 prepend set;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 528 439 pd clear_buffer;
+#X msg 528 418 vasp bufmfram1 bufmfram2;
+#X msg 62 153 vasp 30000 bufmfram1;
+#X obj 61 411 vasp.f*;
+#X obj 161 453 vasp.frames;
+#X text 53 454 related objects:;
+#X obj 243 453 vasp.frames+;
+#X text 59 66 multiply the number of frames of a vasp by a value;
+#X obj 59 495 VASP-HELP;
+#X msg 77 297;
+#X msg 255 294;
+#X connect 0 0 4 0;
+#X connect 8 0 24 0;
+#X connect 9 0 10 0;
+#X connect 12 0 14 0;
+#X connect 12 0 9 0;
+#X connect 13 0 8 0;
+#X connect 13 0 0 0;
+#X connect 13 1 12 0;
+#X connect 14 0 25 0;
+#X connect 16 0 15 0;
+#X connect 17 0 13 0;
diff --git a/externals/grill/vasp/pd-help/vasp_min.pd b/externals/grill/vasp/pd-help/vasp_min.pd
new file mode 100644
index 00000000..f2448cbe
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_min.pd
@@ -0,0 +1,51 @@
+#N canvas 57 40 836 521 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.min 0 10 1 14 -262144 -1
+0;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 412 403 pd clear_buffer;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmin 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 412 112 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 43 symbol bufmin \, symbol bufmin1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 687 409 pd init;
+#X obj 73 144 vasp.osc 44100;
+#X obj 73 167 vasp.update;
+#X text 70 75 argument/right inlet: value;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmin1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 412 249 graph;
+#X text 666 74 source;
+#X text 68 58 take minimum of vasp and argument;
+#X msg 73 123 vasp bufmin;
+#X msg 412 380 vasp bufmin bufmin1;
+#X text 162 121 generate a sine wave at 1 Hz;
+#X text 178 251 copy to new buffer;
+#X obj 72 354 vasp.update;
+#X msg 72 255 vasp bufmin1;
+#X obj 72 281 vasp.= bufmin;
+#X obj 72 328 vasp.min 0.4;
+#X obj 66 460 VASP-HELP;
+#X text 177 327 set all values > 0.4 to 0.4;
+#X connect 4 0 5 0;
+#X connect 10 0 4 0;
+#X connect 11 0 1 0;
+#X connect 15 0 16 0;
+#X connect 16 0 17 0;
+#X connect 17 0 14 0;
diff --git a/externals/grill/vasp/pd-help/vasp_minmax.pd b/externals/grill/vasp/pd-help/vasp_minmax.pd
new file mode 100644
index 00000000..5e0f8397
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_minmax.pd
@@ -0,0 +1,59 @@
+#N canvas 58 24 940 639 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.minmax 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmm1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 546 71 graph;
+#N canvas 0 0 408 284 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 yticks 0 0.25 2 \; \$1
+ylabel 94000 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufmm1 \, symbol bufmm2 \, symbol bufmm3 \, symbol
+bufmm4;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 875 594 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 65 491 pd clear_buffer;
+#X obj 77 178 vasp.update;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmm2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 546 212 graph;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmm3 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 547 356 graph;
+#X text 780 334 min values;
+#X text 786 480 max values;
+#X obj 76 315 vasp.update;
+#X obj 76 294 vasp.minmax;
+#X obj 65 534 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmm4 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 548 499 graph;
+#X text 788 45 source1;
+#X text 797 191 source2;
+#X obj 77 152 vasp.cosc 44100;
+#X msg 77 127 vasp bufmm1 bufmm2;
+#X obj 76 266 vasp.c-> bufmm3 bufmm4;
+#X msg 76 242 vasp bufmm1 bufmm2;
+#X text 228 295 compare the two buffers;
+#X text 227 264 copy and;
+#X msg 65 468 vasp bufmm1 bufmm2 bufmm3 bufmm4;
+#X text 71 63 compare two vasps and assign lower values to the first
+and higher values to the second buffer;
+#X text 210 125 generate a complex sine wave at 1 Hz;
+#X connect 10 0 9 0;
+#X connect 15 0 4 0;
+#X connect 16 0 15 0;
+#X connect 17 1 10 0;
+#X connect 18 0 17 0;
+#X connect 21 0 3 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mirr.pd b/externals/grill/vasp/pd-help/vasp_mirr.pd
new file mode 100644
index 00000000..9096f0b8
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mirr.pd
@@ -0,0 +1,45 @@
+#N canvas 24 75 805 395 10;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.mirr 0 10 1 14 -262144 -1
+0;
+#X text 453 269 clear;
+#N canvas 0 0 413 295 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 453 313 pd clear_buffer;
+#X msg 453 290 vasp bufmirr;
+#X text 75 52 mirrors a vasp (reverse);
+#X obj 69 204 vasp.update;
+#X msg 69 156 vasp bufmirr;
+#X obj 69 181 vasp.mirr;
+#X obj 68 312 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmirr 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 342 75 graph;
+#N canvas 0 0 390 266 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 45 symbol buflist;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X obj 32 227 vasp.u;
+#X msg 32 182 vasp bufmirr;
+#X obj 32 205 vasp.= env 0 0 1 20 -1 100;
+#X obj 32 160 loadbang;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 4 0 5 0;
+#X connect 5 0 3 0;
+#X connect 6 0 4 0;
+#X restore 578 313 pd init;
+#X obj 69 135 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X connect 3 0 2 0;
+#X connect 6 0 7 0;
+#X connect 7 0 5 0;
+#X connect 11 0 6 0;
diff --git a/externals/grill/vasp/pd-help/vasp_miwindow.pd b/externals/grill/vasp/pd-help/vasp_miwindow.pd
new file mode 100644
index 00000000..3719874c
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_miwindow.pd
@@ -0,0 +1,64 @@
+#N canvas 44 117 889 563 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.*!window 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmiwindow 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 408 284 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufmiwindow;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 771 320 pd init;
+#N canvas 0 0 194 221 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 569 327 pd clear_buffers;
+#X obj 63 495 VASP-HELP;
+#X obj 61 302 vasp.u;
+#X floatatom 194 210 5 0 0;
+#X text 259 209 0..4;
+#X msg 231 239 lin;
+#X msg 231 264 sin;
+#X msg 231 289 hanning;
+#X msg 231 314 hamming;
+#X msg 231 339 blackman;
+#X text 275 238 0;
+#X text 275 260 1;
+#X text 295 284 2;
+#X text 300 313 3;
+#X text 300 335 4;
+#X obj 225 401 vasp.!window;
+#X text 60 396 see also:;
+#X obj 322 426 vasp.*xwindow;
+#X text 60 102 argument/right inlet: name or number of name;
+#X text 60 80 generate window functions;
+#X obj 322 401 vasp.xwindow;
+#X obj 134 401 vasp.window;
+#X obj 61 174 vasp.osc 3000;
+#X text 182 156 generate a sine wave;
+#X text 182 178 and multiply it with a window function;
+#X msg 569 302 vasp bufmiwindow;
+#X msg 61 149 vasp bufmiwindow;
+#X obj 61 250 vasp.*!window lin;
+#X obj 134 426 vasp.*window;
+#X connect 6 0 30 1;
+#X connect 8 0 30 1;
+#X connect 9 0 30 1;
+#X connect 10 0 30 1;
+#X connect 11 0 30 1;
+#X connect 12 0 30 1;
+#X connect 25 0 30 0;
+#X connect 28 0 3 0;
+#X connect 29 0 25 0;
+#X connect 30 0 5 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mod.pd b/externals/grill/vasp/pd-help/vasp_mod.pd
new file mode 100644
index 00000000..f5551c88
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mod.pd
@@ -0,0 +1,48 @@
+#N canvas 35 127 922 431 10;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 613 298 pd clear_buffer;
+#X text 366 125 ramp from 0-1;
+#X obj 286 174 vasp.update;
+#X obj 51 173 vasp.update;
+#X text 132 126 a sine wave at 1Hz or;
+#X obj 51 149 vasp.osc 44100;
+#X text 54 77 optional argument/right inlet: divisor;
+#X text 54 60 modulo function / remainder of a division;
+#X obj 62 31 cnv 15 15 15 empty empty vasp.% 0 10 1 14 -262144 -1 0
+;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmod 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 485 110 graph;
+#N canvas 0 0 394 270 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufmod;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 760 300 pd init;
+#X msg 51 126 vasp bufmod;
+#X msg 613 273 vasp bufmod;
+#X msg 286 127 vasp bufmod;
+#X obj 100 292 vasp.update;
+#X floatatom 161 245 0 0 0;
+#X obj 100 268 vasp.% 0.25;
+#X text 187 260 modulo;
+#X msg 100 219 vasp bufmod;
+#X obj 53 388 VASP-HELP;
+#X obj 286 148 vasp.window lin;
+#X connect 5 0 3 0;
+#X connect 11 0 5 0;
+#X connect 12 0 0 0;
+#X connect 13 0 20 0;
+#X connect 15 0 16 1;
+#X connect 16 0 14 0;
+#X connect 18 0 16 0;
+#X connect 20 0 2 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mosc.pd b/externals/grill/vasp/pd-help/vasp_mosc.pd
new file mode 100644
index 00000000..416d86dd
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mosc.pd
@@ -0,0 +1,80 @@
+#N canvas 47 54 883 486 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.*osc 0 10 1 14 -262144 -1
+0;
+#X obj 77 195 vasp.update;
+#X obj 77 172 vasp.* 0.5;
+#X obj 402 397 dac~;
+#X obj 402 353 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 424 352 play;
+#X text 71 63 multiplies a sine wave with a buffer content;
+#X text 70 78 argument/right inlet: frequency in period length in samples
+;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 534 397 pd clear_buffer;
+#X msg 534 374 vasp bufmosc;
+#X msg 77 127 vasp bufmosc;
+#X text 181 126 generate white noise;
+#X obj 77 149 vasp.noise;
+#X obj 77 218 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 427 174 wavedisplay-simple bufmosc \$0;
+#X obj 402 374 tabplay~ bufmosc;
+#N canvas 92 108 339 264 init 0;
+#X obj 110 180 s \$0-sample-length;
+#X msg 177 126 resize \$1;
+#X obj 177 79 loadbang;
+#X msg 177 100 88200;
+#X obj 177 148 s bufmosc;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 3 0 0 0;
+#X restore 673 395 pd init;
+#N canvas 4 20 454 304 Hz_to_period_length 0;
+#X floatatom 136 242 0 0 0;
+#X obj 136 142 t b f;
+#X text 169 223 period length in samples (float);
+#X floatatom 136 80 0 0 0;
+#X obj 136 206 / 1;
+#X text 181 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 136 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 79 405 pd Hz_to_period_length;
+#X text 188 379 ringmod-example;
+#X obj 79 380 ringmod_example;
+#X text 188 263 with 2Hz;
+#X text 186 245 generate an amplitude modulation;
+#X msg 78 245 vasp bufmosc;
+#X obj 78 268 vasp.*osc 22050;
+#X obj 78 292 vasp.update;
+#X obj 78 315 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 60 460 VASP-HELP;
+#X connect 1 0 13 0;
+#X connect 2 0 1 0;
+#X connect 4 0 15 0;
+#X connect 9 0 8 0;
+#X connect 10 0 12 0;
+#X connect 12 0 2 0;
+#X connect 15 0 3 0;
+#X connect 15 0 3 1;
+#X connect 22 0 23 0;
+#X connect 23 0 24 0;
+#X connect 24 0 25 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mphasor.pd b/externals/grill/vasp/pd-help/vasp_mphasor.pd
new file mode 100644
index 00000000..5ad39ce7
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mphasor.pd
@@ -0,0 +1,78 @@
+#N canvas 47 54 883 486 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.*phasor 0 10 1 14 -262144
+-1 0;
+#X obj 77 195 vasp.update;
+#X obj 77 172 vasp.* 0.5;
+#X obj 394 397 dac~;
+#X obj 394 353 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 416 352 play;
+#X text 70 78 argument/right inlet: frequency in period length in samples
+;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 534 397 pd clear_buffer;
+#X text 188 126 generate white noise;
+#X obj 77 149 vasp.noise;
+#X obj 77 218 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#N canvas 92 108 341 266 init 0;
+#X obj 110 180 s \$0-sample-length;
+#X msg 177 126 resize \$1;
+#X obj 177 79 loadbang;
+#X msg 177 100 88200;
+#X obj 177 148 s bufmphasor;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 3 0 0 0;
+#X restore 673 395 pd init;
+#N canvas 4 20 454 304 Hz_to_period_length 0;
+#X floatatom 135 242 0 0 0;
+#X obj 135 142 t b f;
+#X text 168 223 period length in samples (float);
+#X floatatom 135 80 0 0 0;
+#X obj 135 206 / 1;
+#X text 180 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 135 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 80 396 pd Hz_to_period_length;
+#X text 72 63 multiplies a saw tooth ramp with a buffer content;
+#X msg 77 127 vasp bufmphasor;
+#X obj 464 158 wavedisplay-simple bufmphasor \$0;
+#X msg 534 374 vasp bufmphasor;
+#X obj 394 374 tabplay~ bufmphasor;
+#X text 207 243 generate an amplitude modulation;
+#X text 208 258 with 2Hz;
+#X obj 78 292 vasp.update;
+#X obj 78 315 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 78 268 vasp.*phasor 22050;
+#X msg 78 245 vasp bufmphasor;
+#X obj 79 449 VASP-HELP;
+#X connect 1 0 10 0;
+#X connect 2 0 1 0;
+#X connect 4 0 17 0;
+#X connect 9 0 2 0;
+#X connect 14 0 9 0;
+#X connect 16 0 7 0;
+#X connect 17 0 3 0;
+#X connect 17 0 3 1;
+#X connect 20 0 21 0;
+#X connect 22 0 20 0;
+#X connect 23 0 22 0;
diff --git a/externals/grill/vasp/pd-help/vasp_msize.pd b/externals/grill/vasp/pd-help/vasp_msize.pd
new file mode 100644
index 00000000..6053bf6f
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_msize.pd
@@ -0,0 +1,38 @@
+#N canvas 85 111 836 513 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.size/ 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmsize 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 453 152 graph;
+#X obj 252 439 vasp.frames;
+#X text 62 415 related objects:;
+#X floatatom 120 319 5 0 0;
+#X obj 252 417 vasp.size;
+#X obj 253 373 vasp.s/;
+#X obj 62 217 vasp.size* 2;
+#X obj 177 217 vasp.size/ 2;
+#X obj 193 31 cnv 15 15 15 empty empty vasp.size* 0 10 1 14 -262144
+-1 0;
+#X text 57 69 divide and multiplicate the size of a buffer/array;
+#X text 59 371 abbreviations:;
+#X obj 175 372 vasp.s*;
+#X obj 120 289 vasp.size?;
+#X obj 176 439 vasp.size?;
+#N canvas 0 0 412 288 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 2 5 \; \$1 xlabel 1.1 0 10 20 30 40 50
+\; \$1 yticks 0 0.25 2;
+#X msg 33 45 symbol bufmsize;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 714 408 pd init;
+#X obj 176 416 vasp.s+;
+#X msg 62 152 vasp bufmsize;
+#X msg 177 152 vasp bufmsize;
+#X obj 58 481 VASP-HELP;
+#X connect 7 0 13 0;
+#X connect 8 0 13 0;
+#X connect 13 0 4 0;
+#X connect 17 0 7 0;
+#X connect 18 0 8 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mul.pd b/externals/grill/vasp/pd-help/vasp_mul.pd
new file mode 100644
index 00000000..de6420b4
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mul.pd
@@ -0,0 +1,135 @@
+#N canvas 162 101 824 443 10;
+#N canvas 40 55 247 122 clear_buffers 0;
+#X obj 45 79 vasp.update;
+#X obj 45 56 vasp.= 0;
+#X obj 45 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 362 340 pd clear_buffers;
+#X text 60 57 optional argument/right inlet: multiplier;
+#X text 62 41 multiplies a vasp;
+#X obj 62 19 cnv 15 15 15 empty empty vasp.* 0 10 1 14 -262144 -1 0
+;
+#N canvas 0 0 450 300 graph168 0;
+#X array bufmul 88200 float 0;
+#X coords 0 1 88199 -1 300 120 1;
+#X restore 390 67 graph;
+#N canvas 0 0 394 270 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufmul;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 662 331 pd init;
+#X msg 362 319 vasp bufmul;
+#X text 182 315 <- click to open;
+#N canvas 32 40 910 552 envelope_example 0;
+#X text 167 179 generate noise;
+#X text 148 346 normalize the vasp;
+#X obj 59 344 vasp.opt;
+#X obj 59 321 vasp.flp 2205;
+#X obj 59 297 vasp.abs;
+#X obj 60 204 vasp.noise;
+#X text 74 32 use vasp.* to multiply an envelope to noise;
+#X msg 60 183 vasp bufmul1;
+#X text 796 105 bufmul1;
+#X obj 438 485 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 662 492 pd clear_buffers;
+#X obj 438 435 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 463 431 play;
+#X obj 536 122 wavedisplay-simple bufmul1 \$0;
+#X obj 536 274 wavedisplay-simple bufmul2 \$0;
+#X text 797 256 bufmul2;
+#X obj 80 79 filelist \$0;
+#N canvas 92 108 393 368 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 214 159 loadbang;
+#X obj 67 53 loadbang;
+#X msg 214 180 88200;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X obj 224 252 s bufmul2;
+#X obj 214 228 s bufmul1;
+#X msg 67 133 read -resize \$1 bufmul2;
+#X msg 67 79 2;
+#X connect 0 0 7 0;
+#X connect 3 0 9 0;
+#X connect 3 0 10 0;
+#X connect 4 0 6 0;
+#X connect 5 0 12 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 2 0;
+#X connect 7 1 1 0;
+#X connect 7 2 3 0;
+#X connect 8 0 11 0;
+#X connect 11 0 0 0;
+#X connect 12 0 8 0;
+#X restore 780 493 pd inside;
+#X obj 438 458 tabplay~ bufmul1;
+#X msg 662 466 vasp bufmul1 bufmul2;
+#X text 221 79 into buffer bufmul2;
+#X obj 60 225 vasp.update;
+#X obj 60 247 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 275 vasp bufmul2;
+#X obj 59 367 vasp.update;
+#X obj 59 389 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 147 296 get absolute values;
+#X text 153 422 multiply noise with the envelope;
+#X obj 60 470 vasp.update;
+#X obj 60 492 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 60 422 vasp bufmul1;
+#X obj 60 444 vasp.* bufmul2;
+#X text 157 329 get the envelope (2Hz);
+#X text 156 316 filter the values with a lowpass to;
+#X connect 2 0 24 0;
+#X connect 3 0 2 0;
+#X connect 4 0 3 0;
+#X connect 5 0 21 0;
+#X connect 7 0 5 0;
+#X connect 11 0 18 0;
+#X connect 18 0 9 0;
+#X connect 18 0 9 1;
+#X connect 19 0 10 0;
+#X connect 21 0 22 0;
+#X connect 23 0 4 0;
+#X connect 24 0 25 0;
+#X connect 28 0 29 0;
+#X connect 30 0 31 0;
+#X connect 31 0 28 0;
+#X restore 45 315 pd envelope_example;
+#X obj 45 255 vasp.update;
+#X msg 45 173 vasp bufmul;
+#X obj 45 375 VASP-HELP;
+#X obj 45 119 nbx 5 14 -1 1 0 1 empty empty empty 0 -6 0 10 -24198
+-1 -1 0.5 256;
+#X obj 45 140 t b f;
+#X obj 45 200 vasp.osc 4410;
+#X text 138 132 and change gain;
+#X text 136 118 generate sine wave;
+#X obj 45 229 vasp.* 0.5;
+#X connect 6 0 0 0;
+#X connect 10 0 14 0;
+#X connect 12 0 13 0;
+#X connect 13 0 10 0;
+#X connect 13 1 17 1;
+#X connect 14 0 17 0;
+#X connect 17 0 9 0;
diff --git a/externals/grill/vasp/pd-help/vasp_multi.pd b/externals/grill/vasp/pd-help/vasp_multi.pd
new file mode 100644
index 00000000..337d562b
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_multi.pd
@@ -0,0 +1,20 @@
+#N canvas 266 151 546 412 10;
+#X text 51 63 outputs a vasp multiple times;
+#X obj 43 28 cnv 15 15 15 empty empty vasp.multi 0 10 1 14 -262144
+-1 0;
+#X obj 56 111 table bufm 88200;
+#X obj 223 232 prepend set;
+#X text 51 80 argument: number of outlets (default 2);
+#X text 109 312 abbreviation;
+#X obj 56 232 prepend set;
+#X msg 56 156 vasp 22050 bufm 44100 0;
+#X obj 56 190 vasp.multi 2;
+#X obj 58 311 vasp.m;
+#X obj 58 366 VASP-HELP;
+#X msg 56 257;
+#X msg 223 257;
+#X connect 3 0 12 0;
+#X connect 6 0 11 0;
+#X connect 7 0 8 0;
+#X connect 8 0 6 0;
+#X connect 8 1 3 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mwindow.pd b/externals/grill/vasp/pd-help/vasp_mwindow.pd
new file mode 100644
index 00000000..e14dbb28
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mwindow.pd
@@ -0,0 +1,64 @@
+#N canvas 44 117 889 563 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.*window 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmwindow 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 406 282 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufmwindow;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 771 320 pd init;
+#N canvas 0 0 194 221 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 569 325 pd clear_buffers;
+#X obj 63 495 VASP-HELP;
+#X obj 61 302 vasp.u;
+#X floatatom 194 210 5 0 0;
+#X text 259 209 0..4;
+#X msg 231 239 lin;
+#X msg 231 264 sin;
+#X msg 231 289 hanning;
+#X msg 231 314 hamming;
+#X msg 231 339 blackman;
+#X text 275 238 0;
+#X text 275 260 1;
+#X text 295 284 2;
+#X text 300 313 3;
+#X text 300 340 4;
+#X obj 225 401 vasp.!window;
+#X text 60 396 see also:;
+#X obj 322 426 vasp.*xwindow;
+#X obj 225 426 vasp.*!window;
+#X text 60 104 argument/right inlet: name or number of name;
+#X text 60 80 generate window functions;
+#X obj 322 401 vasp.xwindow;
+#X msg 61 149 vasp bufmwindow;
+#X obj 61 250 vasp.*window lin;
+#X obj 134 401 vasp.window;
+#X msg 569 301 vasp bufmwindow;
+#X obj 61 178 vasp.osc 3000;
+#X text 182 156 generate a sine wave;
+#X text 183 173 and multiply it with a window function;
+#X connect 6 0 26 1;
+#X connect 8 0 26 1;
+#X connect 9 0 26 1;
+#X connect 10 0 26 1;
+#X connect 11 0 26 1;
+#X connect 12 0 26 1;
+#X connect 25 0 29 0;
+#X connect 26 0 5 0;
+#X connect 28 0 3 0;
+#X connect 29 0 26 0;
diff --git a/externals/grill/vasp/pd-help/vasp_mxwindow.pd b/externals/grill/vasp/pd-help/vasp_mxwindow.pd
new file mode 100644
index 00000000..615af950
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_mxwindow.pd
@@ -0,0 +1,64 @@
+#N canvas 68 99 889 563 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.*xwindow 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufmxwindow 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 410 286 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufmxwindow;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 771 320 pd init;
+#N canvas 0 0 194 221 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 569 327 pd clear_buffers;
+#X obj 63 495 VASP-HELP;
+#X obj 61 302 vasp.u;
+#X floatatom 194 210 5 0 0;
+#X text 259 209 0..4;
+#X msg 231 239 lin;
+#X msg 231 264 sin;
+#X msg 231 289 hanning;
+#X msg 231 314 hamming;
+#X msg 231 339 blackman;
+#X text 275 238 0;
+#X text 275 260 1;
+#X text 295 284 2;
+#X text 300 313 3;
+#X text 300 335 4;
+#X obj 225 401 vasp.!window;
+#X text 60 396 see also:;
+#X text 60 102 argument/right inlet: name or number of name;
+#X text 60 80 generate window functions;
+#X obj 322 401 vasp.xwindow;
+#X obj 134 401 vasp.window;
+#X obj 61 174 vasp.osc 3000;
+#X text 182 156 generate a sine wave;
+#X text 182 178 and multiply it with a window function;
+#X obj 134 426 vasp.*window;
+#X msg 569 302 vasp bufmxwindow;
+#X obj 225 426 vasp.*!window;
+#X msg 61 149 vasp bufmxwindow;
+#X obj 61 250 vasp.*xwindow lin;
+#X connect 6 0 31 1;
+#X connect 8 0 31 1;
+#X connect 9 0 31 1;
+#X connect 10 0 31 1;
+#X connect 11 0 31 1;
+#X connect 12 0 31 1;
+#X connect 24 0 31 0;
+#X connect 28 0 3 0;
+#X connect 30 0 24 0;
+#X connect 31 0 5 0;
diff --git a/externals/grill/vasp/pd-help/vasp_neq.pd b/externals/grill/vasp/pd-help/vasp_neq.pd
new file mode 100644
index 00000000..15f3c905
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_neq.pd
@@ -0,0 +1,52 @@
+#N canvas 28 91 938 543 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.!= 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufneq1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 404 280 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufneq1 \, symbol bufneq2;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 766 421 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufneq2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 248 graph;
+#X text 59 98 argument/right inlet: value;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 564 426 pd clear_buffers;
+#X text 417 248 1/true;
+#X text 416 288 0/false;
+#X text 60 80 not equal;
+#X msg 564 399 vasp bufneq1 bufneq2;
+#X text 166 358 test if a part of the function is not equal to -1;
+#X obj 62 383 vasp.update;
+#X obj 62 356 vasp.!= -1;
+#X obj 62 325 vasp.= bufneq1;
+#X msg 62 298 vasp bufneq2;
+#X obj 53 444 VASP-HELP;
+#X text 173 149 generate a function;
+#X msg 61 150 vasp bufequ;
+#X obj 61 218 vasp.update;
+#X obj 61 178 vasp.= env 0 0 1 22049 0.3 22050 0.3 44099 -1 44100 -1
+66149 1 66150 0 88200;
+#X connect 9 0 5 0;
+#X connect 12 0 11 0;
+#X connect 13 0 12 0;
+#X connect 14 0 13 0;
+#X connect 17 0 19 0;
+#X connect 19 0 18 0;
diff --git a/externals/grill/vasp/pd-help/vasp_noise.pd b/externals/grill/vasp/pd-help/vasp_noise.pd
new file mode 100644
index 00000000..59e2e38b
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_noise.pd
@@ -0,0 +1,43 @@
+#N canvas 56 83 867 431 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.noise 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufnoise 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 412 131 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufnoise;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 692 310 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 547 310 pd clear_buffer;
+#X obj 415 311 dac~;
+#X obj 415 267 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 437 266 play;
+#X text 71 63 vasp noise generator;
+#X obj 415 288 tabplay~ bufnoise;
+#X msg 547 287 vasp bufnoise;
+#X obj 77 217 vasp.update;
+#X obj 77 194 vasp.* 0.5;
+#X msg 77 126 vasp bufnoise;
+#X text 175 125 generate white noise;
+#X obj 77 171 vasp.noise;
+#X obj 65 369 VASP-HELP;
+#X connect 5 0 8 0;
+#X connect 8 0 4 0;
+#X connect 8 0 4 1;
+#X connect 9 0 3 0;
+#X connect 11 0 10 0;
+#X connect 12 0 14 0;
+#X connect 14 0 11 0;
diff --git a/externals/grill/vasp/pd-help/vasp_nonzero.pd b/externals/grill/vasp/pd-help/vasp_nonzero.pd
new file mode 100644
index 00000000..137f7abd
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_nonzero.pd
@@ -0,0 +1,160 @@
+#N canvas 96 126 848 577 10;
+#X obj 62 32 cnv 15 15 15 empty empty vasp.?? 0 10 1 14 -262144 -1
+0;
+#X text 64 66 outputs all samples of a vasp that are unequal zero;
+#X text 64 95 right outlet: sample value;
+#X text 65 83 left outlet: sample index;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 512 453 pd clear_buffers;
+#X msg 512 427 vasp bufnonzero bufnonzero1;
+#N canvas 92 108 504 435 inside 0;
+#X obj 87 206 soundfiler;
+#X obj 305 257 s \$0-sample-length;
+#X obj 87 260 s \$0-draw_display;
+#X msg 235 258 resize \$1;
+#X obj 235 280 s bufnonzero1;
+#X obj 245 304 s bufnonzero;
+#X msg 235 232 44100;
+#N canvas 0 0 691 318 menuhandler 0;
+#X obj 69 270 outlet;
+#X msg 111 216 color \$1 \$2;
+#X obj 183 270 outlet;
+#X msg 225 216 color \$1 \$2;
+#X obj 297 270 outlet;
+#X msg 339 216 color \$1 \$2;
+#X obj 411 79 r \$0-plastic;
+#X obj 411 270 outlet;
+#X obj 453 241 s \$0-plastic-color;
+#X msg 453 216 color \$1 \$2;
+#X obj 69 79 r \$0-bass;
+#X obj 183 79 r \$0-beat;
+#X obj 297 79 r \$0-fly;
+#X obj 111 241 s \$0-bass-color;
+#X obj 225 241 s \$0-beat-color;
+#X obj 339 241 s \$0-fly-color;
+#X obj 69 108 t b b b;
+#X obj 183 108 t b b b;
+#X obj 297 108 t b b b;
+#X obj 411 108 t b b b;
+#X msg 111 133 6 12;
+#X msg 79 133 1 10;
+#X msg 191 133 1 10;
+#X msg 225 133 6 12;
+#X msg 306 133 1 10;
+#X msg 339 133 6 12;
+#X msg 419 132 1 10;
+#X msg 453 133 6 12;
+#X connect 1 0 13 0;
+#X connect 3 0 14 0;
+#X connect 5 0 15 0;
+#X connect 6 0 19 0;
+#X connect 9 0 8 0;
+#X connect 10 0 16 0;
+#X connect 11 0 17 0;
+#X connect 12 0 18 0;
+#X connect 16 0 0 0;
+#X connect 16 1 21 0;
+#X connect 16 2 20 0;
+#X connect 17 0 2 0;
+#X connect 17 1 22 0;
+#X connect 17 2 23 0;
+#X connect 18 0 4 0;
+#X connect 18 1 24 0;
+#X connect 18 2 25 0;
+#X connect 19 0 7 0;
+#X connect 19 1 26 0;
+#X connect 19 2 27 0;
+#X connect 20 0 1 0;
+#X connect 21 0 3 0;
+#X connect 21 0 5 0;
+#X connect 21 0 9 0;
+#X connect 22 0 1 0;
+#X connect 22 0 5 0;
+#X connect 22 0 9 0;
+#X connect 23 0 3 0;
+#X connect 24 0 1 0;
+#X connect 24 0 3 0;
+#X connect 24 0 9 0;
+#X connect 25 0 5 0;
+#X connect 26 0 5 0;
+#X connect 26 0 3 0;
+#X connect 26 0 1 0;
+#X connect 27 0 9 0;
+#X restore 77 43 pd menuhandler;
+#X obj 235 211 loadbang;
+#X obj 41 107 loadbang;
+#X msg 87 230 bang;
+#X msg 77 79 read bass.aif bufnonzero;
+#X msg 103 107 read beat.aif bufnonzero;
+#X msg 129 133 read fly.aif bufnonzero;
+#X msg 156 160 read plastic.aif bufnonzero;
+#X connect 0 0 10 0;
+#X connect 3 0 4 0;
+#X connect 3 0 5 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 11 0;
+#X connect 7 1 12 0;
+#X connect 7 2 13 0;
+#X connect 7 3 14 0;
+#X connect 8 0 6 0;
+#X connect 9 0 12 0;
+#X connect 10 0 2 0;
+#X connect 11 0 0 0;
+#X connect 12 0 0 0;
+#X connect 13 0 0 0;
+#X connect 14 0 0 0;
+#X restore 708 457 pd inside;
+#X obj 462 101 wavedisplay-simple bufnonzero \$0;
+#X obj 463 243 wavedisplay-simple bufnonzero1 \$0;
+#X obj 81 151 hdl 15 1 0 6 \$0-beat empty empty 0 -6 1152 8 -262144
+-1 -1 0;
+#X obj 81 151 cnv 15 90 15 empty \$0-beat-color beat.aif 5 8 576 8
+-225271 -33289 0;
+#X obj 81 169 hdl 15 1 0 6 \$0-fly empty empty 0 -6 1152 8 -262144
+-1 -1 0;
+#X obj 81 169 cnv 15 90 15 empty \$0-fly-color fly.aif 5 8 576 8 -166441
+-233017 0;
+#X obj 81 133 hdl 15 1 0 6 \$0-bass empty empty 0 -6 1152 8 -262144
+-1 -1 0;
+#X obj 81 133 cnv 15 90 15 empty \$0-bass-color bass.aif 5 8 576 8
+-166441 -233017 0;
+#X obj 81 187 hdl 15 1 0 6 \$0-plastic empty empty 0 -6 1152 8 -262144
+-1 -1 0;
+#X obj 81 187 cnv 15 90 15 empty \$0-plastic-color plastic.aif 5 8
+576 8 -166441 -233017 0;
+#X text 723 83 source;
+#X text 728 224 peaks;
+#X obj 62 258 vasp.= bufnonzero;
+#X msg 62 229 vasp bufnonzero1;
+#X obj 62 309 vasp.update;
+#X obj 115 330 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 62 285 vasp.peaks 0.0004;
+#X text 140 388 sample index;
+#X text 177 455 sample values;
+#X obj 62 346 vasp.??;
+#X text 183 228 copy to new buffer \, find peaks;
+#X obj 62 389 prepend set;
+#X obj 99 455 prepend set;
+#X msg 62 415;
+#X msg 99 481;
+#X obj 34 521 VASP-HELP;
+#X connect 5 0 4 0;
+#X connect 19 0 23 0;
+#X connect 20 0 19 0;
+#X connect 21 0 22 0;
+#X connect 21 0 26 0;
+#X connect 23 0 21 0;
+#X connect 26 0 28 0;
+#X connect 26 1 29 0;
+#X connect 28 0 30 0;
+#X connect 29 0 31 0;
diff --git a/externals/grill/vasp/pd-help/vasp_offset.pd b/externals/grill/vasp/pd-help/vasp_offset.pd
new file mode 100644
index 00000000..214d0284
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_offset.pd
@@ -0,0 +1,30 @@
+#N canvas 192 165 707 400 10;
+#X text 55 83 argument/right inlet: value;
+#X text 55 69 set the offset of a vasp (into a buffer);
+#X text 55 98 ---! vasp.offs sets all vectors to the same offset !---
+;
+#X obj 41 11 cnv 15 15 15 empty empty vasp.offset 0 10 1 14 -262144
+-1 0;
+#X text 57 323 abbreviation;
+#X floatatom 143 175 0 0 0;
+#X obj 58 221 prepend set;
+#X msg 58 148 vasp bufoffs1;
+#X obj 58 196 vasp.offset 300;
+#X floatatom 330 175 0 0 0;
+#X obj 245 221 prepend set;
+#X msg 245 148 vasp bufoffs1 220 bufoffs2 100;
+#X obj 245 196 vasp.offset 300;
+#X obj 157 322 vasp.o;
+#X obj 55 370 VASP-HELP;
+#X obj 521 273 table bufoffs1;
+#X obj 522 300 table bufoffs2;
+#X msg 58 254;
+#X msg 245 254;
+#X connect 5 0 8 1;
+#X connect 6 0 17 0;
+#X connect 7 0 8 0;
+#X connect 8 0 6 0;
+#X connect 9 0 12 1;
+#X connect 10 0 18 0;
+#X connect 11 0 12 0;
+#X connect 12 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_offsetd.pd b/externals/grill/vasp/pd-help/vasp_offsetd.pd
new file mode 100644
index 00000000..037a01b6
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_offsetd.pd
@@ -0,0 +1,28 @@
+#N canvas 191 100 545 439 10;
+#X text 55 80 argument/right inlet: value;
+#X text 55 63 change the offset to a vasp (relatively);
+#X obj 41 11 cnv 15 15 15 empty empty vasp.offset+ 0 10 1 14 -262144
+-1 0;
+#X text 57 323 abbreviation;
+#X floatatom 149 151 0 0 0;
+#X msg 58 234 vasp -1 bufoffsd1 300 0;
+#X obj 58 201 prepend set;
+#X obj 58 177 vasp.offset+ 300;
+#X msg 58 128 vasp bufoffsd1;
+#X floatatom 336 151 0 0 0;
+#X msg 245 234 vasp -1 bufoffs+1 520 0 bufoffsd2 400 0;
+#X obj 245 201 prepend set;
+#X obj 245 174 vasp.offset+ 300;
+#X obj 138 324 vasp.o+;
+#X msg 245 128 vasp bufoffsd1 220 bufoffsd2 100;
+#X obj 359 284 table bufoffsd1 88200;
+#X obj 359 305 table bufoffsd2 88200;
+#X obj 57 386 VASP-HELP;
+#X connect 4 0 7 1;
+#X connect 6 0 5 0;
+#X connect 7 0 6 0;
+#X connect 8 0 7 0;
+#X connect 9 0 12 1;
+#X connect 11 0 10 0;
+#X connect 12 0 11 0;
+#X connect 14 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_offsetq.pd b/externals/grill/vasp/pd-help/vasp_offsetq.pd
new file mode 100644
index 00000000..e2a35dde
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_offsetq.pd
@@ -0,0 +1,25 @@
+#N canvas 243 134 633 339 10;
+#X obj 56 30 cnv 15 15 15 empty empty vasp.offset? 0 10 1 14 -262144
+-1 0;
+#X text 42 59 get a single vectored vasp's offset;
+#X obj 45 131 cnv 15 74 17 empty empty empty 20 12 0 14 -258699 -66577
+0;
+#X obj 226 132 cnv 15 74 17 empty empty empty 20 12 0 14 -258699 -66577
+0;
+#X floatatom 226 163 0 0 0;
+#X floatatom 45 162 0 0 0;
+#X obj 226 132 vasp.offset?;
+#X obj 45 131 vasp.offset?;
+#X msg 226 107 vasp buffoffsetq 220 buffoffsetq 300;
+#X msg 45 106 vasp 200 buffoffsetq 300;
+#X text 228 89 more than 1 vector. watch pd window!;
+#X text 52 278 abbreviation;
+#X obj 148 275 vasp.o;
+#X obj 148 275 cnv 15 44 17 empty empty empty 20 12 0 14 -258699 -66577
+0;
+#X obj 148 275 vasp.o?;
+#X obj 278 221 table buffoffsetq 88200;
+#X connect 6 0 4 0;
+#X connect 7 0 5 0;
+#X connect 8 0 6 0;
+#X connect 9 0 7 0;
diff --git a/externals/grill/vasp/pd-help/vasp_opt.pd b/externals/grill/vasp/pd-help/vasp_opt.pd
new file mode 100644
index 00000000..97fd05b7
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_opt.pd
@@ -0,0 +1,71 @@
+#N canvas 36 36 786 555 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.opt 0 10 1 14 -262144 -1
+0;
+#X obj 72 113 filelist \$0;
+#X obj 340 453 dac~;
+#X obj 340 415 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 361 413 play;
+#N canvas 92 108 338 379 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 91 253 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X obj 66 47 loadbang;
+#X obj 66 113 filelisthandler \$0;
+#X msg 66 145 read -resize \$1 bufopt;
+#X msg 66 91 3;
+#X obj 66 193 t b f;
+#X connect 0 0 7 0;
+#X connect 3 0 6 0;
+#X connect 4 0 5 0;
+#X connect 5 0 0 0;
+#X connect 6 0 4 0;
+#X connect 7 0 2 0;
+#X connect 7 1 1 0;
+#X restore 607 456 pd inside;
+#X obj 59 440 vasp.update;
+#X obj 59 460 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 69 59 optimise a vasp (normalize);
+#X text 70 73 right outlet: the previous maximum set to 1;
+#X obj 342 136 wavedisplay-simple bufopt \$0;
+#X obj 340 433 tabplay~ bufopt;
+#X msg 482 433 vasp bufopt;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 482 453 pd clear_buffer;
+#X msg 59 338 vasp bufopt;
+#X obj 59 361 vasp.amax?;
+#X text 58 317 or use vasp.amax? to optimise buffer content;
+#X floatatom 114 399 12 0 0;
+#X obj 59 419 vasp./;
+#X text 123 381 current absolute maximum;
+#X obj 59 269 vasp.update;
+#X obj 59 289 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 204 vasp bufopt;
+#X obj 59 227 vasp.opt;
+#X floatatom 102 250 8 0 0;
+#X obj 60 514 VASP-HELP;
+#X text 102 514 - vasp overview;
+#X connect 3 0 11 0;
+#X connect 6 0 7 0;
+#X connect 11 0 2 0;
+#X connect 11 0 2 1;
+#X connect 12 0 13 0;
+#X connect 14 0 15 0;
+#X connect 15 0 18 0;
+#X connect 15 1 17 0;
+#X connect 17 0 18 1;
+#X connect 18 0 6 0;
+#X connect 20 0 21 0;
+#X connect 22 0 23 0;
+#X connect 23 0 20 0;
+#X connect 23 1 24 0;
diff --git a/externals/grill/vasp/pd-help/vasp_osc.pd b/externals/grill/vasp/pd-help/vasp_osc.pd
new file mode 100644
index 00000000..0c34f5ae
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_osc.pd
@@ -0,0 +1,63 @@
+#N canvas 47 54 873 437 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.osc 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufosc 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 412 131 graph;
+#N canvas 0 0 400 276 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufosc;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 692 310 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 547 310 pd clear_buffer;
+#X text 71 83 optional argument/right inlet: frequency in period length
+in samples;
+#X obj 415 311 dac~;
+#X obj 415 267 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 437 266 play;
+#X text 71 63 vasp sine wave generator;
+#X text 175 125 generate a sine wave at 1 kHz;
+#X obj 415 288 tabplay~ bufosc;
+#X msg 547 287 vasp bufosc;
+#N canvas 4 20 454 304 Hz_to_period_length 0;
+#X floatatom 139 242 0 0 0;
+#X obj 139 142 t b f;
+#X text 172 223 period length in samples (float);
+#X floatatom 139 80 0 0 0;
+#X obj 139 206 / 1;
+#X text 184 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 139 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 81 311 pd Hz_to_period_length;
+#X obj 77 217 vasp.update;
+#X obj 77 194 vasp.* 0.5;
+#X msg 77 127 vasp bufosc;
+#X obj 77 171 vasp.osc 44.1;
+#X obj 66 380 VASP-HELP;
+#X connect 6 0 10 0;
+#X connect 10 0 5 0;
+#X connect 10 0 5 1;
+#X connect 11 0 3 0;
+#X connect 14 0 13 0;
+#X connect 15 0 16 0;
+#X connect 16 0 14 0;
diff --git a/externals/grill/vasp/pd-help/vasp_part.pd b/externals/grill/vasp/pd-help/vasp_part.pd
new file mode 100644
index 00000000..45a49b5e
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_part.pd
@@ -0,0 +1,34 @@
+#N canvas 218 99 717 545 10;
+#X text 69 160 right outlet: a vasp with remaining length (if there
+is one) of the input vasp;
+#X text 69 144 left outlet: the new vasps one after the other;
+#X obj 71 47 cnv 15 15 15 empty empty vasp.part 0 10 1 14 -262144 -1
+0;
+#X obj 199 275 print rest;
+#X obj 78 274 print;
+#X obj 78 242 vasp.part 100 100 100;
+#X text 189 206 vasp.part generates 3 new vasps and a rest vasp;
+#X msg 78 207 vasp bufpart1;
+#X obj 125 430 print rest;
+#X obj 76 430 print;
+#X msg 284 360 100 200 300 500 100 200;
+#X obj 76 392 vasp.part;
+#X text 272 323 the input vasp defines the maximum lengths of the vasps
+at the output;
+#X msg 76 328 vasp 1100 bufpart1 bufpart2;
+#X text 202 430 so there are just 4 vasps and no rest.... watch pd
+window;
+#X obj 66 498 VASP-HELP;
+#X text 67 101 left inlet: a vasp to define the buffername and the
+maximum length;
+#X obj 441 477 table bufpart1 2000;
+#X obj 441 499 table bufpart2 2000;
+#X text 67 84 generates vasps with certain lengths;
+#X text 67 131 argument/ right inlet: vasps lengths (list);
+#X connect 5 0 4 0;
+#X connect 5 1 3 0;
+#X connect 7 0 5 0;
+#X connect 10 0 11 1;
+#X connect 11 0 9 0;
+#X connect 11 1 8 0;
+#X connect 13 0 11 0;
diff --git a/externals/grill/vasp/pd-help/vasp_peaks.pd b/externals/grill/vasp/pd-help/vasp_peaks.pd
new file mode 100644
index 00000000..7cfc0fd0
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_peaks.pd
@@ -0,0 +1,89 @@
+#N canvas 152 40 822 598 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.peaks 0 10 1 14 -262144
+-1 0;
+#X obj 71 131 filelist \$0;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 479 495 pd clear_buffers;
+#X obj 60 292 vasp.update;
+#X obj 58 433 vasp.update;
+#X obj 58 453 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 60 312 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 337 495 dac~;
+#X obj 337 457 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 358 455 play;
+#X text 70 66 argument/right inlet: density value 0-1;
+#X text 172 231 copy to new buffer \, find valleys;
+#X floatatom 151 307 12 0 0;
+#X obj 151 328 * 88200;
+#X floatatom 151 350 5 0 0;
+#X obj 58 412 vasp.opt;
+#X text 679 99 source;
+#X text 69 52 find the local maxima of a buffer content;
+#X text 69 81 outlet: current density value;
+#X msg 60 227 vasp bufpeaks2;
+#X obj 337 475 tabplay~ bufpeaks1;
+#X msg 479 475 vasp bufpeaks1 bufpeaks2;
+#X obj 399 117 wavedisplay-simple bufpeaks1 \$0;
+#X obj 399 271 wavedisplay-simple bufpeaks2 \$0;
+#N canvas 92 108 428 393 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 84 253 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 214 221 resize \$1;
+#X obj 66 47 loadbang;
+#X obj 66 193 t b f f;
+#X obj 66 113 filelisthandler \$0;
+#X msg 66 91 2;
+#X obj 66 69 t b b;
+#X msg 99 91 88200;
+#X obj 214 243 s bufpeaks1;
+#X obj 225 264 s bufpeaks2;
+#X msg 66 145 read \$1 bufpeaks1;
+#X connect 0 0 5 0;
+#X connect 3 0 10 0;
+#X connect 3 0 11 0;
+#X connect 4 0 8 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 12 0;
+#X connect 7 0 6 0;
+#X connect 8 0 7 0;
+#X connect 8 1 9 0;
+#X connect 9 0 5 0;
+#X connect 12 0 0 0;
+#X restore 668 495 pd inside;
+#X msg 58 389 vasp bufpeaks2;
+#X text 673 252 peaks;
+#X text 191 348 peak count;
+#X text 230 306 actual peak density;
+#X text 166 273 target peak density as argument;
+#X text 171 390 optimize the buffer content;
+#X obj 60 251 vasp.= bufpeaks1;
+#X obj 60 272 vasp.peaks 0.001;
+#X obj 49 531 VASP-HELP;
+#X connect 3 0 6 0;
+#X connect 4 0 5 0;
+#X connect 8 0 20 0;
+#X connect 12 0 13 0;
+#X connect 13 0 14 0;
+#X connect 15 0 4 0;
+#X connect 19 0 31 0;
+#X connect 20 0 7 0;
+#X connect 20 0 7 1;
+#X connect 21 0 2 0;
+#X connect 25 0 15 0;
+#X connect 31 0 32 0;
+#X connect 32 0 3 0;
+#X connect 32 1 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_phasor.pd b/externals/grill/vasp/pd-help/vasp_phasor.pd
new file mode 100644
index 00000000..38695a08
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_phasor.pd
@@ -0,0 +1,67 @@
+#N canvas 47 54 871 435 10;
+#N canvas 4 20 454 304 Hz_to_period_length 1;
+#X floatatom 138 238 0 0 0;
+#X obj 138 142 t b f;
+#X text 138 259 period length in samples (float);
+#X floatatom 138 80 0 0 0;
+#X obj 138 206 / 1;
+#X text 183 79 frequency in Hz;
+#X obj 53 142 samplerate~;
+#X obj 53 119 loadbang;
+#X floatatom 138 175 5 0 0;
+#X connect 1 0 8 0;
+#X connect 1 1 4 1;
+#X connect 3 0 1 0;
+#X connect 4 0 0 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 4 0;
+#X restore 78 302 pd Hz_to_period_length;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.phasor 0 10 1 14 -262144
+-1 0;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 547 310 pd clear_buffer;
+#X text 71 83 optional argument/right inlet: frequency in period length
+in samples;
+#X obj 415 311 dac~;
+#X obj 415 267 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 437 266 play;
+#X text 71 63 vasp saw tooth ramp generator;
+#X obj 415 288 tabplay~ bufphasor;
+#X msg 547 287 vasp bufphasor;
+#X obj 414 124 wavedisplay-simple bufphasor \$0;
+#N canvas 92 108 276 288 inside 0;
+#X obj 63 149 s \$0-sample-length;
+#X msg 103 103 resize \$1;
+#X obj 103 56 loadbang;
+#X msg 103 77 88200;
+#X obj 103 124 s bufphasor;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 3 0 0 0;
+#X restore 680 311 pd inside;
+#X obj 77 217 vasp.update;
+#X obj 77 194 vasp.* 0.5;
+#X msg 77 127 vasp bufphasor;
+#X text 188 124 generate saw tooth at 20 Hz;
+#X floatatom 168 151 5 0 0;
+#X obj 77 239 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 77 171 vasp.phasor 2205;
+#X obj 77 371 VASP-HELP;
+#X connect 5 0 8 0;
+#X connect 8 0 4 0;
+#X connect 8 0 4 1;
+#X connect 9 0 2 0;
+#X connect 12 0 17 0;
+#X connect 13 0 12 0;
+#X connect 14 0 18 0;
+#X connect 16 0 18 1;
+#X connect 18 0 13 0;
diff --git a/externals/grill/vasp/pd-help/vasp_polar.pd b/externals/grill/vasp/pd-help/vasp_polar.pd
new file mode 100644
index 00000000..e5314f9f
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_polar.pd
@@ -0,0 +1,90 @@
+#N canvas 28 7 948 670 10;
+#N canvas 92 108 559 430 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 214 159 loadbang;
+#X obj 67 53 loadbang;
+#X msg 214 180 88200;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 4;
+#X obj 214 228 s bufpol1;
+#X obj 224 252 s bufpol2;
+#X msg 67 133 read \$1 bufpol1;
+#X obj 236 278 s bufpola;
+#X obj 246 302 s bufpolp;
+#X obj 226 123 s \$0-bounds;
+#X msg 226 101 ylabel 315 -3.14 0 3.14 \, bounds 0 3.5 300 -3.5;
+#X connect 0 0 7 0;
+#X connect 3 0 10 0;
+#X connect 3 0 11 0;
+#X connect 3 0 13 0;
+#X connect 3 0 14 0;
+#X connect 4 0 6 0;
+#X connect 5 0 9 0;
+#X connect 5 0 16 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 2 0;
+#X connect 7 1 1 0;
+#X connect 7 2 3 0;
+#X connect 8 0 12 0;
+#X connect 9 0 8 0;
+#X connect 12 0 0 0;
+#X connect 16 0 15 0;
+#X restore 360 610 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.polar 0 10 1 14 -262144
+-1 0;
+#X obj 72 91 filelist \$0;
+#X obj 59 223 vasp.cfft;
+#X obj 59 244 vasp.update;
+#X obj 59 267 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 551 318 0 Hz;
+#X text 687 317 sr/2;
+#X text 206 474 <-- click to open;
+#X text 816 319 44.1 kHz;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 254 610 pd clear_buffers;
+#X text 254 565 clear;
+#X msg 59 200 vasp bufpol1 bufpol2;
+#X obj 546 51 wavedisplay-simple bufpol1 \$0;
+#X obj 546 194 wavedisplay-simple bufpol2 \$0;
+#X text 71 53 cartesian to polar coordinate conversion;
+#X text 202 201 transform into real and imaginary part;
+#X text 229 313 real/imaginary -> amplitude/phase;
+#X obj 59 473 phase-random_example;
+#X obj 59 380 vasp.update;
+#X obj 59 403 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 314 vasp bufpol1 bufpol2;
+#X obj 59 357 vasp.polar;
+#X obj 56 622 VASP-HELP;
+#X obj 546 365 wavedisplay-simple bufpola \$0;
+#X obj 546 518 wavedisplay-simple bufpolp \$0;
+#X obj 59 335 vasp.c-> bufpola bufpolp;
+#X msg 254 587 vasp bufpol1 bufpol2 bufpola bufpolp;
+#X obj 546 497 r \$0-bounds;
+#X text 788 31 real part;
+#X text 759 173 imaginary part;
+#X text 791 345 amplitude;
+#X text 812 497 phase;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X connect 12 0 3 0;
+#X connect 19 0 20 0;
+#X connect 21 0 26 0;
+#X connect 22 0 19 0;
+#X connect 26 1 22 0;
+#X connect 27 0 10 0;
+#X connect 28 0 25 0;
diff --git a/externals/grill/vasp/pd-help/vasp_pow.pd b/externals/grill/vasp/pd-help/vasp_pow.pd
new file mode 100644
index 00000000..1ee54241
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_pow.pd
@@ -0,0 +1,44 @@
+#N canvas 47 54 867 462 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.pow 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 410 286 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufpow;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 608 330 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 463 330 pd clear_buffer;
+#X obj 77 197 vasp.update;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufpow 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 341 144 graph;
+#X text 72 81 vasp power function;
+#X text 71 93 argument/right inlet: exponent;
+#X msg 77 127 vasp bufpow;
+#X msg 463 308 vasp bufpow;
+#X obj 77 150 vasp.osc 44100;
+#X obj 77 172 vasp.* 0.2;
+#X text 71 63 sample ^ x;
+#X obj 77 329 vasp.update;
+#X msg 77 246 vasp bufpow;
+#X obj 77 303 vasp.pow 0.1;
+#X floatatom 144 279 5 0 0;
+#X text 202 278 exponent;
+#X obj 79 397 VASP-HELP;
+#X connect 7 0 9 0;
+#X connect 8 0 2 0;
+#X connect 9 0 10 0;
+#X connect 10 0 3 0;
+#X connect 13 0 14 0;
+#X connect 14 0 12 0;
+#X connect 15 0 14 1;
diff --git a/externals/grill/vasp/pd-help/vasp_qamax.pd b/externals/grill/vasp/pd-help/vasp_qamax.pd
new file mode 100644
index 00000000..00c47f4b
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qamax.pd
@@ -0,0 +1,75 @@
+#N canvas 57 40 901 555 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.amax? 0 10 1 14 -262144
+-1 0;
+#X obj 492 462 dac~;
+#X obj 492 418 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 514 417 play;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 624 462 pd clear_buffer;
+#X obj 74 116 filelist \$0;
+#N canvas 92 108 400 365 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 66 50 loadbang;
+#X obj 66 178 t b f f;
+#X obj 66 98 filelisthandler \$0;
+#X msg 66 76 3;
+#X msg 66 130 read -resize \$1 bufamax;
+#X obj 214 228 s bufamax;
+#X connect 0 0 5 0;
+#X connect 3 0 9 0;
+#X connect 4 0 7 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 0 0;
+#X restore 755 462 pd inside;
+#X text 70 75 right outlet: calculated value;
+#X text 72 58 max-value of the absolute values of a vasp;
+#X obj 492 439 tabplay~ bufamax;
+#X msg 624 439 vasp bufamax;
+#X obj 484 219 wavedisplay-simple bufamax \$0;
+#X msg 72 405 vasp bufamax;
+#X obj 72 451 vasp.update;
+#X obj 72 476 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 72 428 vasp.opt;
+#X text 173 402 or use vasp.opt which does the same;
+#X floatatom 128 272 5 0 0;
+#X msg 73 215 vasp bufamax;
+#X obj 73 238 vasp.amax?;
+#X text 166 216 find the absolute maximum of this soundfile;
+#X msg 73 305 vasp bufamax;
+#X obj 73 328 vasp./;
+#X obj 73 351 vasp.update;
+#X obj 73 376 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 171 271 -> current absolute maximum;
+#X obj 63 520 VASP-HELP;
+#X text 169 327 use it to optimize buffer content;
+#X connect 2 0 9 0;
+#X connect 9 0 1 0;
+#X connect 9 0 1 1;
+#X connect 10 0 4 0;
+#X connect 12 0 15 0;
+#X connect 13 0 14 0;
+#X connect 15 0 13 0;
+#X connect 17 0 22 1;
+#X connect 18 0 19 0;
+#X connect 19 1 17 0;
+#X connect 21 0 22 0;
+#X connect 22 0 23 0;
+#X connect 23 0 24 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qamin.pd b/externals/grill/vasp/pd-help/vasp_qamin.pd
new file mode 100644
index 00000000..6635dd85
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qamin.pd
@@ -0,0 +1,53 @@
+#N canvas 57 40 879 499 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.amin? 0 10 1 14 -262144
+-1 0;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 616 427 pd clear_buffer;
+#X text 72 58 min-value of the absolute values of a vasp;
+#X text 70 75 right outlet: calculated value;
+#X msg 616 404 vasp bufamin;
+#X msg 50 192 vasp bufamin;
+#X obj 50 215 vasp.amin?;
+#X floatatom 105 249 5 0 0;
+#X text 148 248 -> current absolute minimum;
+#X obj 48 429 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufamin 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 535 123 graph;
+#N canvas 0 0 398 274 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufamin;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 772 429 pd init;
+#X obj 48 311 vasp.abs;
+#X msg 48 290 vasp bufamin;
+#X obj 48 332 vasp.u;
+#X obj 51 128 vasp.noise;
+#X msg 51 106 vasp bufamin;
+#X text 148 106 1 create random values;
+#X obj 51 149 vasp.u;
+#X text 150 193 2 find the absolute minimum of this soundfile;
+#X text 139 291 3 to control the result display the absolute values
+;
+#X text 55 387 related objects;
+#X obj 172 386 vasp.min;
+#X obj 246 386 vasp.min?;
+#X connect 4 0 1 0;
+#X connect 5 0 6 0;
+#X connect 6 1 7 0;
+#X connect 12 0 14 0;
+#X connect 13 0 12 0;
+#X connect 15 0 18 0;
+#X connect 16 0 15 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qchannel.pd b/externals/grill/vasp/pd-help/vasp_qchannel.pd
new file mode 100644
index 00000000..8bb34876
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qchannel.pd
@@ -0,0 +1,10 @@
+#N canvas 35 145 460 376 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.channel? 0 10 1 14 -262144
+-1 0;
+#X text 58 212 related object;
+#X text 53 125 (MaxMSP version of vasp);
+#X obj 60 165 vasp.channel?;
+#X text 58 71 get channel index of 0th vector in vasp;
+#X text 55 107 only useful for interleaved stereo-files;
+#X obj 162 211 vasp.channel;
+#X obj 61 280 VASP-HELP;
diff --git a/externals/grill/vasp/pd-help/vasp_qframes.pd b/externals/grill/vasp/pd-help/vasp_qframes.pd
new file mode 100644
index 00000000..bfc0535c
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qframes.pd
@@ -0,0 +1,27 @@
+#N canvas 207 210 709 402 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.frames? 0 10 1 14 -262144
+-1 0;
+#X text 372 130 get the maximum vasp length of both buffers;
+#X floatatom 372 211 0 0 0;
+#X obj 372 181 vasp.frames?;
+#X floatatom 212 211 0 0 0;
+#X obj 212 181 vasp.frames?;
+#X text 212 130 get the buffer length;
+#X msg 372 155 vasp bufframq bufframq1;
+#X msg 212 155 vasp bufframq;
+#X obj 418 273 table bufframq 88200;
+#X obj 418 296 table bufframq1 44100;
+#X floatatom 45 210 0 0 0;
+#X obj 45 180 vasp.frames?;
+#X msg 45 154 vasp 400 bufframq 300;
+#X text 106 312 abbreviation;
+#X obj 49 312 vasp.f?;
+#X obj 41 357 VASP-HELP;
+#X text 44 64 get a vasp's frame count (length) in frames;
+#X text 45 129 get the vasp's length;
+#X connect 3 0 2 0;
+#X connect 5 0 4 0;
+#X connect 7 0 3 0;
+#X connect 8 0 5 0;
+#X connect 12 0 11 0;
+#X connect 13 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qmax.pd b/externals/grill/vasp/pd-help/vasp_qmax.pd
new file mode 100644
index 00000000..43226edc
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qmax.pd
@@ -0,0 +1,44 @@
+#N canvas 57 40 757 367 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.max? 0 10 1 14 -262144 -1
+0;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 468 280 pd clear_buffer;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufqmax 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 339 115 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 43 symbol bufqmax;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 615 284 pd init;
+#X text 70 75 right outlet: max value;
+#X obj 73 144 vasp.osc 44100;
+#X obj 73 165 vasp.* 0.5;
+#X obj 73 186 vasp.update;
+#X msg 73 123 vasp bufqmax;
+#X text 68 58 get maximum sample value of a vasp;
+#X msg 468 257 vasp bufqmax;
+#X floatatom 124 285 5 0 0;
+#X msg 75 230 vasp bufqmax;
+#X obj 75 251 vasp.max?;
+#X text 167 282 >>>> maximum value;
+#X obj 64 339 VASP-HELP;
+#X connect 5 0 6 0;
+#X connect 6 0 7 0;
+#X connect 8 0 5 0;
+#X connect 10 0 1 0;
+#X connect 12 0 13 0;
+#X connect 13 1 11 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qmin.pd b/externals/grill/vasp/pd-help/vasp_qmin.pd
new file mode 100644
index 00000000..f205f105
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qmin.pd
@@ -0,0 +1,44 @@
+#N canvas 57 40 817 436 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.min? 0 10 1 14 -262144 -1
+0;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 468 280 pd clear_buffer;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufqmin 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 339 115 graph;
+#N canvas 0 0 394 270 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufqmin;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 615 284 pd init;
+#X text 68 58 get minimum sample value of a vasp;
+#X text 70 75 right outlet: max value;
+#X msg 468 257 vasp bufqmin;
+#X msg 73 123 vasp bufqmin;
+#X obj 73 144 vasp.osc 44100;
+#X obj 73 165 vasp.* 0.5;
+#X obj 73 186 vasp.update;
+#X floatatom 124 285 5 0 0;
+#X obj 75 251 vasp.min?;
+#X msg 75 230 vasp bufqmin;
+#X text 167 282 >>>> minimum value;
+#X obj 56 344 VASP-HELP;
+#X connect 6 0 1 0;
+#X connect 7 0 8 0;
+#X connect 8 0 9 0;
+#X connect 9 0 10 0;
+#X connect 12 1 11 0;
+#X connect 13 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qoffset.pd b/externals/grill/vasp/pd-help/vasp_qoffset.pd
new file mode 100644
index 00000000..22c6575c
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qoffset.pd
@@ -0,0 +1,19 @@
+#N canvas 307 266 648 378 10;
+#X obj 44 28 cnv 15 15 15 empty empty vasp.offset? 0 10 1 14 -262144
+-1 0;
+#X text 42 59 get a single vectored vasp's offset;
+#X text 52 278 abbreviation;
+#X obj 150 278 vasp.o?;
+#X obj 411 295 table buffoffsetq 88200;
+#X floatatom 45 162 0 0 0;
+#X obj 45 131 vasp.offset?;
+#X msg 45 106 vasp 200 buffoffsetq 300;
+#X floatatom 226 163 0 0 0;
+#X obj 226 132 vasp.offset?;
+#X msg 226 107 vasp buffoffsetq 220 buffoffsetq 300;
+#X text 228 88 more than 1 vector. watch pd window!;
+#X obj 45 325 VASP-HELP;
+#X connect 6 0 5 0;
+#X connect 7 0 6 0;
+#X connect 9 0 8 0;
+#X connect 10 0 9 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qrmax.pd b/externals/grill/vasp/pd-help/vasp_qrmax.pd
new file mode 100644
index 00000000..3018e79b
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qrmax.pd
@@ -0,0 +1,99 @@
+#N canvas 36 36 881 653 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.rmax? 0 10 1 14 -262144
+-1 0;
+#X obj 289 135 filelist \$0;
+#N canvas 92 108 410 375 inside 0;
+#X obj 63 217 soundfiler;
+#X obj 184 273 s \$0-sample-length;
+#X obj 63 271 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 63 49 loadbang;
+#X obj 63 161 filelisthandler \$0;
+#X msg 63 139 2;
+#X obj 214 228 s bufqrmax1;
+#X obj 225 250 s bufqrmax2;
+#X msg 63 193 read \$1 bufqrmax1;
+#X obj 63 76 t b b;
+#X msg 214 134 88200;
+#X obj 63 241 t b;
+#X connect 0 0 12 0;
+#X connect 3 0 7 0;
+#X connect 3 0 8 0;
+#X connect 4 0 10 0;
+#X connect 5 0 9 0;
+#X connect 6 0 5 0;
+#X connect 9 0 0 0;
+#X connect 10 0 6 0;
+#X connect 10 1 11 0;
+#X connect 11 0 3 0;
+#X connect 11 0 1 0;
+#X connect 12 0 2 0;
+#X restore 719 546 pd inside;
+#X text 70 75 right outlet: calculated value;
+#X text 70 92 needs two vectors;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 520 545 pd clear_buffers;
+#X obj 373 544 dac~;
+#X obj 373 501 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 395 498 play;
+#X text 72 58 maximum value of the radius values of a complex vasp
+;
+#X obj 465 130 wavedisplay-simple bufqrmax1 \$0;
+#X obj 465 267 wavedisplay-simple bufqrmax2 \$0;
+#X msg 520 522 vasp bufqrmax1 bufqrmax2;
+#X obj 51 538 vasp.update;
+#X obj 51 558 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 53 162 vasp.cfft;
+#X obj 53 182 vasp.update;
+#X obj 53 202 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 53 142 vasp bufqrmax1 bufqrmax2;
+#X obj 53 432 vasp.update;
+#X obj 53 452 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 53 392 vasp bufqrmax1 bufqrmax2;
+#X obj 53 412 vasp.c!fft;
+#X text 49 482 or use vasp.ropt which does the same;
+#X msg 51 498 vasp bufqrmax1 bufqrmax2;
+#X obj 51 518 vasp.ropt;
+#X obj 373 521 tabplay~ bufqrmax1;
+#X floatatom 108 309 5 0 0;
+#X obj 53 327 vasp./;
+#X obj 53 347 vasp.update;
+#X obj 53 367 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 53 254 vasp.rmax?;
+#X text 150 308 -> current maximum;
+#X text 136 346 use it to optimise radius;
+#X msg 53 234 vasp bufqrmax1 bufqrmax2;
+#X msg 53 282 vasp bufqrmax1 bufqrmax2;
+#X obj 50 618 VASP-HELP;
+#X connect 7 0 26 0;
+#X connect 12 0 5 0;
+#X connect 13 0 14 0;
+#X connect 15 0 16 0;
+#X connect 16 0 17 0;
+#X connect 18 0 15 0;
+#X connect 19 0 20 0;
+#X connect 21 0 22 0;
+#X connect 22 0 19 0;
+#X connect 24 0 25 0;
+#X connect 25 0 13 0;
+#X connect 26 0 6 0;
+#X connect 26 0 6 1;
+#X connect 27 0 28 1;
+#X connect 28 0 29 0;
+#X connect 29 0 30 0;
+#X connect 31 1 27 0;
+#X connect 34 0 31 0;
+#X connect 35 0 28 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qrmin.pd b/externals/grill/vasp/pd-help/vasp_qrmin.pd
new file mode 100644
index 00000000..6b3a6b96
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qrmin.pd
@@ -0,0 +1,59 @@
+#N canvas 57 40 879 562 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.rmin? 0 10 1 14 -262144
+-1 0;
+#X obj 70 140 filelist \$0;
+#N canvas 92 108 402 367 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 66 50 loadbang;
+#X obj 66 178 t b f f;
+#X obj 66 98 filelisthandler \$0;
+#X msg 66 130 read -resize \$1 bufqrmin1;
+#X obj 214 228 s bufqrmin1;
+#X obj 225 250 s bufqrmin2;
+#X msg 66 76 4;
+#X connect 0 0 5 0;
+#X connect 3 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 10 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 0 0;
+#X connect 10 0 6 0;
+#X restore 678 426 pd inside;
+#X text 70 75 right outlet: calculated value;
+#X text 72 58 min-value of the radius values of a complex vasp;
+#X text 70 95 needs two vectors;
+#X obj 434 93 wavedisplay-simple bufqrmin1 \$0;
+#X obj 434 238 wavedisplay-simple bufqrmin2 \$0;
+#X obj 60 280 vasp.cfft;
+#X obj 60 302 vasp.update;
+#X obj 60 325 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 60 258 vasp bufqrmin1 bufqrmin2;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 436 422 pd clear_buffers;
+#X msg 436 399 vasp bufqrmin1 bufqrmin2;
+#X floatatom 110 417 12 0 0;
+#X text 112 435 -> current absolute minimum;
+#X obj 55 383 vasp.rmin?;
+#X msg 55 360 vasp bufqrmin1 bufqrmin2;
+#X obj 41 508 VASP-HELP;
+#X connect 8 0 9 0;
+#X connect 9 0 10 0;
+#X connect 11 0 8 0;
+#X connect 13 0 12 0;
+#X connect 16 1 14 0;
+#X connect 17 0 16 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qsize.pd b/externals/grill/vasp/pd-help/vasp_qsize.pd
new file mode 100644
index 00000000..2ea1b884
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qsize.pd
@@ -0,0 +1,31 @@
+#N canvas 85 111 907 542 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.size? 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 408 284 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 2 5 \; \$1 xlabel 1.1 0 10 20 30 40 50
+\; \$1 yticks 0 0.25 2;
+#X msg 33 45 symbol bufqsize;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 714 408 pd init;
+#X text 119 374 abbreviation;
+#X obj 62 225 vasp.size 100;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufqsize 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 453 153 graph;
+#X floatatom 135 200 5 0 0;
+#X obj 175 417 vasp.frames;
+#X text 62 415 related objects:;
+#X msg 62 152 vasp bufqsize;
+#X obj 62 266 vasp.size?;
+#X floatatom 62 302 5 0 0;
+#X obj 63 374 vasp.s?;
+#X obj 256 417 vasp.size;
+#X obj 62 463 VASP-HELP;
+#X text 57 69 get the size of a referenced buffer/array;
+#X connect 3 0 9 0;
+#X connect 5 0 3 1;
+#X connect 8 0 3 0;
+#X connect 9 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qvector.pd b/externals/grill/vasp/pd-help/vasp_qvector.pd
new file mode 100644
index 00000000..67c681da
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qvector.pd
@@ -0,0 +1,13 @@
+#N canvas 257 69 511 284 10;
+#X text 52 66 get the number of vectors of a vasp;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.n? 0 10 1 14 -262144 -1
+0;
+#X obj 57 169 cnv 15 44 17 empty empty empty 20 12 0 14 -258699 -66577
+0;
+#X floatatom 57 218 0 0 0;
+#X obj 57 169 vasp.n?;
+#X msg 57 112 vasp bufqn1;
+#X msg 137 112 vasp bufqn1 bufqn2 bufqn3;
+#X connect 4 0 3 0;
+#X connect 5 0 4 0;
+#X connect 6 0 4 0;
diff --git a/externals/grill/vasp/pd-help/vasp_qvectors.pd b/externals/grill/vasp/pd-help/vasp_qvectors.pd
new file mode 100644
index 00000000..d4725441
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_qvectors.pd
@@ -0,0 +1,17 @@
+#N canvas 261 89 556 365 10;
+#X text 52 66 get the number of vectors of a vasp;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.n? 0 10 1 14 -262144 -1
+0;
+#X floatatom 57 218 0 0 0;
+#X obj 57 169 vasp.n?;
+#X msg 57 112 vasp bufqn1;
+#X msg 147 113 vasp bufqn1 bufqn2 bufqn3;
+#X obj 54 318 VASP-HELP;
+#X obj 438 86 table bufqn1;
+#X obj 438 107 table bufqn2;
+#X obj 438 128 table bufqn3;
+#X obj 151 277 vasp.n?;
+#X text 53 279 abbreviation:;
+#X connect 3 0 2 0;
+#X connect 4 0 3 0;
+#X connect 5 0 3 0;
diff --git a/externals/grill/vasp/pd-help/vasp_radd.pd b/externals/grill/vasp/pd-help/vasp_radd.pd
new file mode 100644
index 00000000..f28aebc8
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_radd.pd
@@ -0,0 +1,84 @@
+#N canvas 63 27 894 612 10;
+#N canvas 415 205 410 337 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 222 207 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 259 138 resize \$1;
+#X obj 259 91 loadbang;
+#X obj 67 53 loadbang;
+#X msg 259 112 88200;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 4;
+#X msg 67 133 read -resize \$1 bufradd1;
+#X obj 259 160 s bufradd1;
+#X obj 269 183 s bufradd2;
+#X obj 66 178 t b;
+#X connect 0 0 12 0;
+#X connect 3 0 10 0;
+#X connect 3 0 11 0;
+#X connect 4 0 6 0;
+#X connect 5 0 8 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 9 0;
+#X connect 8 0 7 0;
+#X connect 9 0 0 0;
+#X connect 12 0 2 0;
+#X restore 772 512 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.r+ 0 10 1 14 -262144 -1
+0;
+#X obj 73 134 filelist \$0;
+#X obj 65 512 vasp.update;
+#X obj 65 535 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 65 489 vasp.c!fft;
+#X obj 65 260 vasp.cfft;
+#X obj 65 281 vasp.update;
+#X obj 65 302 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 343 514 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 477 514 pd clear_buffers;
+#X obj 343 471 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 365 468 play;
+#X text 477 469 clear;
+#X text 71 53 add avalue to a radius;
+#X text 71 65 argument/right inlet: value (offset);
+#X text 72 82 needs two vectors;
+#X obj 522 272 wavedisplay-simple bufradd2 \$0;
+#X obj 521 116 wavedisplay-simple bufradd1 \$0;
+#X msg 65 239 vasp bufradd1 bufradd2;
+#X msg 65 465 vasp bufradd1 bufradd2;
+#X obj 343 491 tabplay~ bufradd1;
+#X msg 477 491 vasp bufradd1 bufradd2;
+#X obj 65 405 vasp.update;
+#X obj 65 426 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 65 325 vasp bufradd1 bufradd2;
+#X obj 65 379 vasp.r+ 0.05;
+#X floatatom 132 352 5 0 0;
+#X text 183 350 value;
+#X obj 59 579 VASP-HELP;
+#X connect 3 0 4 0;
+#X connect 5 0 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 11 0 21 0;
+#X connect 19 0 6 0;
+#X connect 20 0 5 0;
+#X connect 21 0 9 0;
+#X connect 21 0 9 1;
+#X connect 22 0 10 0;
+#X connect 23 0 24 0;
+#X connect 25 0 26 0;
+#X connect 26 0 23 0;
+#X connect 27 0 26 1;
diff --git a/externals/grill/vasp/pd-help/vasp_radio.pd b/externals/grill/vasp/pd-help/vasp_radio.pd
new file mode 100644
index 00000000..0f26c220
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_radio.pd
@@ -0,0 +1,28 @@
+#N canvas 128 36 361 454 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.radio 0 10 1 14 -262144
+-1 0;
+#X obj 66 406 VASP-HELP;
+#X text 71 63 filters radio messages;
+#X floatatom 208 126 5 0 0;
+#X msg 208 146 vasp buf;
+#X msg 51 126 radio prior 1;
+#X msg 208 172 env 0 1 2;
+#X msg 208 195 5 5;
+#X obj 74 267 vasp.radio;
+#X msg 51 150 radio loglvl 3;
+#X obj 74 298 prepend set;
+#X obj 177 300 prepend set;
+#X text 73 350 radio;
+#X text 177 351 other;
+#X msg 74 323;
+#X msg 177 327;
+#X connect 3 0 8 0;
+#X connect 4 0 8 0;
+#X connect 5 0 8 0;
+#X connect 6 0 8 0;
+#X connect 7 0 8 0;
+#X connect 8 0 10 0;
+#X connect 8 1 11 0;
+#X connect 9 0 8 0;
+#X connect 10 0 14 0;
+#X connect 11 0 15 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rect.pd b/externals/grill/vasp/pd-help/vasp_rect.pd
new file mode 100644
index 00000000..77f74d9f
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rect.pd
@@ -0,0 +1,87 @@
+#N canvas 15 40 916 673 10;
+#N canvas 92 108 375 293 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 184 208 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 221 138 resize \$1;
+#X obj 221 91 loadbang;
+#X obj 67 53 loadbang;
+#X msg 221 112 88200;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 4;
+#X obj 221 160 s bufrect1;
+#X obj 231 184 s bufrect2;
+#X msg 67 133 read \$1 bufrect1;
+#X obj 66 178 t b;
+#X connect 0 0 12 0;
+#X connect 3 0 9 0;
+#X connect 3 0 10 0;
+#X connect 4 0 6 0;
+#X connect 5 0 8 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 11 0;
+#X connect 8 0 7 0;
+#X connect 11 0 0 0;
+#X connect 12 0 2 0;
+#X restore 777 531 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.rect 0 10 1 14 -262144 -1
+0;
+#X obj 72 91 filelist \$0;
+#X obj 59 327 vasp.update;
+#X obj 59 347 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 59 220 vasp.cfft;
+#X obj 59 240 vasp.update;
+#X obj 59 260 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 205 573 <-- click to open;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 567 527 pd clear_buffers;
+#X text 567 482 clear;
+#X obj 59 306 vasp.polar;
+#X text 229 283 real/imaginary -> amplitude/phase;
+#X obj 59 573 phase-random_example;
+#X text 71 53 polar to cartesian coordinate conversion;
+#X obj 512 116 wavedisplay-simple bufrect1 \$0;
+#X obj 514 261 wavedisplay-simple bufrect2 \$0;
+#X text 738 94 real/amplitude;
+#X text 729 240 imaginary/phase;
+#X msg 59 200 vasp bufrect1 bufrect2;
+#X text 230 201 transform with cfft to real/imaginary;
+#X obj 59 418 vasp.update;
+#X obj 59 438 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 59 496 vasp.cfft;
+#X obj 59 516 vasp.update;
+#X obj 59 536 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 476 vasp bufrect1 bufrect2;
+#X obj 59 397 vasp.rect;
+#X text 223 374 amplitude/phase -> real/imaginary;
+#X text 231 477 transform with inverse cfft to time domain;
+#X msg 567 504 vasp bufrect1 bufrect2;
+#X msg 59 285 vasp bufrect1 bufrect2;
+#X msg 59 376 vasp bufrect1 bufrect2;
+#X obj 58 622 VASP-HELP;
+#X connect 3 0 4 0;
+#X connect 5 0 6 0;
+#X connect 6 0 7 0;
+#X connect 11 0 3 0;
+#X connect 19 0 5 0;
+#X connect 21 0 22 0;
+#X connect 23 0 24 0;
+#X connect 24 0 25 0;
+#X connect 26 0 23 0;
+#X connect 27 0 21 0;
+#X connect 30 0 9 0;
+#X connect 31 0 11 0;
+#X connect 32 0 27 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rfft.pd b/externals/grill/vasp/pd-help/vasp_rfft.pd
new file mode 100644
index 00000000..d7bbb31f
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rfft.pd
@@ -0,0 +1,74 @@
+#N canvas 24 75 893 495 10;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.rfft 0 10 1 14 -262144 -1
+0;
+#N canvas 92 108 371 312 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 180 207 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 234 164 resize \$1;
+#X obj 234 117 loadbang;
+#X obj 67 53 loadbang;
+#X msg 234 138 88200;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 3;
+#X obj 234 186 s bufrfft;
+#X msg 67 133 read \$1 bufrfft;
+#X obj 66 178 t b;
+#X connect 0 0 11 0;
+#X connect 3 0 9 0;
+#X connect 4 0 6 0;
+#X connect 5 0 8 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 10 0;
+#X connect 8 0 7 0;
+#X connect 10 0 0 0;
+#X connect 11 0 2 0;
+#X restore 761 385 pd inside;
+#X obj 329 388 dac~;
+#X obj 329 345 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 351 342 play;
+#X text 463 343 clear;
+#X obj 69 121 filelist \$0;
+#X msg 463 365 vasp bufrfft;
+#N canvas 0 0 413 295 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 463 388 pd clear_buffer;
+#X obj 329 365 tabplay~ bufrfft;
+#X obj 519 137 wavedisplay-simple bufrfft \$0;
+#X text 157 345 inverse real fft;
+#X obj 68 371 vasp.update;
+#X obj 68 394 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 68 320 vasp bufrfft;
+#X obj 68 345 vasp.r!fft;
+#X text 71 60 real fft;
+#X text 72 73 in opposite to cfft there is only one real input buffer
+;
+#X text 73 86 imaginary part of the fft is assumed to be zero;
+#X text 157 239 real fft;
+#X obj 68 265 vasp.update;
+#X obj 68 288 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 68 214 vasp bufrfft;
+#X obj 68 239 vasp.rfft;
+#X obj 61 456 VASP-HELP;
+#X text 103 456 - vasp overview;
+#X connect 3 0 9 0;
+#X connect 7 0 8 0;
+#X connect 9 0 2 0;
+#X connect 9 0 2 1;
+#X connect 12 0 13 0;
+#X connect 14 0 15 0;
+#X connect 15 0 12 0;
+#X connect 20 0 21 0;
+#X connect 22 0 23 0;
+#X connect 23 0 20 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rframes.pd b/externals/grill/vasp/pd-help/vasp_rframes.pd
new file mode 100644
index 00000000..f20ada29
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rframes.pd
@@ -0,0 +1,63 @@
+#N canvas 80 119 908 535 10;
+#X obj 62 323 vasp.osc 22050;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.frames/ 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufrfram1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 149 graph;
+#N canvas 0 0 404 280 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufrfram1;
+#X msg 140 45 symbol bufrfram2;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 1 0;
+#X restore 813 459 pd init;
+#X obj 62 355 vasp.update;
+#X text 117 412 abbreviation;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufrfram2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 530 268 graph;
+#X text 54 103 !!!all vectors of a vasp have the same framesize/length!!!
+;
+#X obj 77 274 prepend set;
+#X obj 233 323 vasp.osc 22050;
+#X obj 233 355 vasp.update;
+#X text 58 83 argument/right inlet: value;
+#X obj 62 187 vasp.-> bufrfram2;
+#X msg 77 297 vasp 66150 bufrfram1 0 0;
+#X obj 255 271 prepend set;
+#X msg 255 294 vasp 33075 bufrfram2 0 0;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 528 439 pd clear_buffer;
+#X msg 528 418 vasp bufrfram1 bufrfram2;
+#X obj 161 453 vasp.frames;
+#X text 53 454 related objects:;
+#X obj 243 453 vasp.frames+;
+#X text 59 66 divide the number of frames of a vasp by a value;
+#X msg 62 153 vasp 66150 bufrfram1;
+#X obj 233 239 vasp.frames/ 2;
+#X obj 61 411 vasp.f/;
+#X obj 59 495 VASP-HELP;
+#X connect 0 0 4 0;
+#X connect 8 0 13 0;
+#X connect 9 0 10 0;
+#X connect 12 0 8 0;
+#X connect 12 0 0 0;
+#X connect 12 1 23 0;
+#X connect 14 0 15 0;
+#X connect 17 0 16 0;
+#X connect 22 0 12 0;
+#X connect 23 0 14 0;
+#X connect 23 0 9 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rgate.pd b/externals/grill/vasp/pd-help/vasp_rgate.pd
new file mode 100644
index 00000000..cee131b5
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rgate.pd
@@ -0,0 +1,86 @@
+#N canvas 36 36 808 624 10;
+#X obj 72 26 cnv 15 15 15 empty empty vasp.rgate 0 10 1 14 -262144
+-1 0;
+#X obj 76 157 filelist \$0;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 481 518 pd clear_buffers;
+#X obj 63 291 vasp.update;
+#X obj 63 311 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 401 162 wavedisplay-simple bufrgate1 \$0;
+#X obj 402 319 wavedisplay-simple bufrgate2 \$0;
+#X msg 63 251 vasp bufrgate1 bufrgate2;
+#X obj 63 271 vasp.cfft;
+#X obj 63 504 vasp.update;
+#X obj 63 524 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 63 464 vasp bufrgate1 bufrgate2;
+#X obj 63 484 vasp.c!fft;
+#X obj 296 518 dac~;
+#X obj 296 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 317 483 play;
+#X obj 296 498 tabplay~ bufrgate1;
+#X msg 481 498 vasp bufrgate1 bufrgate2;
+#X text 71 49 gate the radius of a complex buffer content with a value
+;
+#X text 72 96 needs two buffers (real/imaginary);
+#X text 71 66 argument/right inlet: value (usually from 0-1) to gate
+the radius;
+#N canvas 384 183 438 403 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 184 290 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 214 221 resize \$1;
+#X obj 66 47 loadbang;
+#X obj 66 113 filelisthandler \$0;
+#X obj 214 243 s bufrgate1;
+#X obj 225 264 s bufrgate2;
+#X msg 66 91 2;
+#X msg 95 91 88200;
+#X obj 66 68 t b b;
+#X msg 66 145 read \$1 bufrgate1;
+#X obj 66 193 t b;
+#X connect 0 0 12 0;
+#X connect 3 0 6 0;
+#X connect 3 0 7 0;
+#X connect 3 0 1 0;
+#X connect 4 0 10 0;
+#X connect 5 0 11 0;
+#X connect 8 0 5 0;
+#X connect 9 0 3 0;
+#X connect 10 0 8 0;
+#X connect 10 1 9 0;
+#X connect 11 0 0 0;
+#X connect 12 0 2 0;
+#X restore 670 518 pd inside;
+#X obj 63 413 vasp.update;
+#X obj 63 433 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 63 329 vasp bufrgate1 bufrgate2;
+#X obj 63 393 vasp.rgate 0.2;
+#X floatatom 142 367 5 0 0;
+#X text 192 366 value;
+#X obj 56 582 VASP-HELP;
+#X connect 3 0 4 0;
+#X connect 7 0 8 0;
+#X connect 8 0 3 0;
+#X connect 9 0 10 0;
+#X connect 11 0 12 0;
+#X connect 12 0 9 0;
+#X connect 14 0 16 0;
+#X connect 16 0 13 0;
+#X connect 16 0 13 1;
+#X connect 17 0 2 0;
+#X connect 22 0 23 0;
+#X connect 24 0 25 0;
+#X connect 25 0 22 0;
+#X connect 26 0 25 1;
diff --git a/externals/grill/vasp/pd-help/vasp_rifft.pd b/externals/grill/vasp/pd-help/vasp_rifft.pd
new file mode 100644
index 00000000..037981a2
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rifft.pd
@@ -0,0 +1,75 @@
+#N canvas 24 75 823 495 10;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.r!fft 0 10 1 14 -262144
+-1 0;
+#N canvas 92 108 373 314 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 187 209 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 235 166 resize \$1;
+#X obj 235 119 loadbang;
+#X obj 67 53 loadbang;
+#X msg 235 140 88200;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 4;
+#X msg 67 133 read \$1 bufrifft;
+#X obj 235 188 s bufrifft;
+#X obj 66 178 t b;
+#X connect 0 0 11 0;
+#X connect 3 0 10 0;
+#X connect 4 0 6 0;
+#X connect 5 0 8 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 9 0;
+#X connect 8 0 7 0;
+#X connect 9 0 0 0;
+#X connect 11 0 2 0;
+#X restore 627 390 pd inside;
+#X obj 329 388 dac~;
+#X obj 329 345 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 351 342 play;
+#X text 463 343 clear;
+#X obj 69 121 filelist \$0;
+#N canvas 0 0 413 295 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 463 388 pd clear_buffer;
+#X text 157 239 real fft;
+#X obj 68 265 vasp.update;
+#X obj 68 288 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 68 238 vasp.rfft;
+#X text 72 73 in opposite to cfft there is only one real input buffer
+;
+#X text 73 86 imaginary part of the fft is assumed to be zero;
+#X text 71 60 inverse real fft;
+#X msg 463 365 vasp bufrifft;
+#X obj 329 365 tabplay~ bufrifft;
+#X msg 68 214 vasp bufrifft;
+#X obj 372 144 wavedisplay-simple bufrifft \$0;
+#X text 645 127 source;
+#X text 157 345 inverse real fft;
+#X obj 68 371 vasp.update;
+#X obj 68 394 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 68 345 vasp.r!fft;
+#X msg 68 320 vasp bufrifft;
+#X obj 61 461 VASP-HELP;
+#X text 103 461 - vasp overview;
+#X connect 3 0 16 0;
+#X connect 9 0 10 0;
+#X connect 11 0 9 0;
+#X connect 15 0 7 0;
+#X connect 16 0 2 0;
+#X connect 16 0 2 1;
+#X connect 17 0 11 0;
+#X connect 21 0 22 0;
+#X connect 23 0 21 0;
+#X connect 24 0 23 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rmax.pd b/externals/grill/vasp/pd-help/vasp_rmax.pd
new file mode 100644
index 00000000..6a05cd58
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rmax.pd
@@ -0,0 +1,81 @@
+#N canvas 36 36 881 625 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.rmax 0 10 1 14 -262144 -1
+0;
+#X obj 71 131 filelist \$0;
+#N canvas 92 108 410 375 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 177 275 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 66 50 loadbang;
+#X obj 66 98 filelisthandler \$0;
+#X msg 66 76 2;
+#X msg 214 146 88200;
+#X msg 66 130 read \$1 bufrmax1;
+#X obj 214 228 s bufrmax1;
+#X obj 225 250 s bufrmax2;
+#X obj 66 178 t b;
+#X connect 0 0 11 0;
+#X connect 3 0 9 0;
+#X connect 3 0 10 0;
+#X connect 4 0 7 0;
+#X connect 4 0 6 0;
+#X connect 5 0 8 0;
+#X connect 6 0 5 0;
+#X connect 7 0 3 0;
+#X connect 7 0 1 0;
+#X connect 8 0 0 0;
+#X connect 11 0 2 0;
+#X restore 700 501 pd inside;
+#X text 70 92 needs two vectors;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 501 500 pd clear_buffers;
+#X obj 354 499 dac~;
+#X obj 354 456 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 376 453 play;
+#X obj 60 252 vasp.cfft;
+#X obj 60 272 vasp.update;
+#X obj 60 484 vasp.update;
+#X obj 60 504 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 60 464 vasp.c!fft;
+#X text 72 58 set radius to a maximum value;
+#X text 70 75 argument/right inlet: value;
+#X msg 60 232 vasp bufrmax1 bufrmax2;
+#X obj 448 136 wavedisplay-simple bufrmax1 \$0;
+#X obj 449 281 wavedisplay-simple bufrmax2 \$0;
+#X msg 60 444 vasp bufrmax1 bufrmax2;
+#X obj 354 476 tabplay~ bufrmax1;
+#X msg 501 477 vasp bufrmax1 bufrmax2;
+#X obj 60 292 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 60 324 vasp bufrmax1 bufrmax2;
+#X obj 60 391 vasp.update;
+#X obj 60 371 vasp.rmax 0.2;
+#X floatatom 133 348 5 0 0;
+#X obj 60 411 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 50 564 VASP-HELP;
+#X connect 6 0 19 0;
+#X connect 8 0 9 0;
+#X connect 9 0 21 0;
+#X connect 10 0 11 0;
+#X connect 12 0 10 0;
+#X connect 15 0 8 0;
+#X connect 18 0 12 0;
+#X connect 19 0 5 0;
+#X connect 19 0 5 1;
+#X connect 20 0 4 0;
+#X connect 22 0 24 0;
+#X connect 23 0 26 0;
+#X connect 24 0 23 0;
+#X connect 25 0 24 1;
diff --git a/externals/grill/vasp/pd-help/vasp_rmin.pd b/externals/grill/vasp/pd-help/vasp_rmin.pd
new file mode 100644
index 00000000..6eb7fc75
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rmin.pd
@@ -0,0 +1,84 @@
+#N canvas 36 36 802 593 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.rmin 0 10 1 14 -262144 -1
+0;
+#X obj 71 131 filelist \$0;
+#N canvas 92 108 416 329 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 179 223 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 214 153 resize \$1;
+#X obj 66 38 loadbang;
+#X obj 66 113 filelisthandler \$0;
+#X msg 66 91 2;
+#X msg 214 95 88200;
+#X obj 214 175 s bufrmin1;
+#X obj 225 196 s bufrmin2;
+#X msg 66 145 read \$1 bufrmin1;
+#X obj 66 63 t b b;
+#X obj 66 193 t b;
+#X connect 0 0 12 0;
+#X connect 3 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 11 0;
+#X connect 5 0 10 0;
+#X connect 6 0 5 0;
+#X connect 7 0 3 0;
+#X connect 7 0 1 0;
+#X connect 10 0 0 0;
+#X connect 11 0 6 0;
+#X connect 11 1 7 0;
+#X connect 12 0 2 0;
+#X restore 640 502 pd inside;
+#X text 71 83 needs two vectors;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 480 500 pd clear_buffers;
+#X obj 334 499 dac~;
+#X obj 334 461 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 355 459 play;
+#X obj 60 252 vasp.cfft;
+#X obj 60 272 vasp.update;
+#X obj 60 484 vasp.update;
+#X obj 60 504 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 60 464 vasp.c!fft;
+#X text 71 66 argument/right inlet: value;
+#X obj 60 292 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 71 49 set radius to a minimum value;
+#X msg 60 232 vasp bufrmin1 bufrmin2;
+#X msg 60 444 vasp bufrmin1 bufrmin2;
+#X obj 374 257 wavedisplay-simple bufrmin2 \$0;
+#X obj 334 479 tabplay~ bufrmin1;
+#X msg 480 480 vasp bufrmin1 bufrmin2;
+#X obj 374 119 wavedisplay-simple bufrmin1 \$0;
+#X obj 60 391 vasp.update;
+#X floatatom 139 352 5 0 0;
+#X obj 60 411 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 60 324 vasp bufrmin1 bufrmin2;
+#X obj 60 371 vasp.rmin 0.05;
+#X obj 55 559 VASP-HELP;
+#X text 97 559 - vasp overview;
+#X connect 6 0 19 0;
+#X connect 8 0 9 0;
+#X connect 9 0 14 0;
+#X connect 10 0 11 0;
+#X connect 12 0 10 0;
+#X connect 16 0 8 0;
+#X connect 17 0 12 0;
+#X connect 19 0 5 0;
+#X connect 19 0 5 1;
+#X connect 20 0 4 0;
+#X connect 22 0 24 0;
+#X connect 23 0 26 1;
+#X connect 25 0 26 0;
+#X connect 26 0 22 0;
diff --git a/externals/grill/vasp/pd-help/vasp_ropt.pd b/externals/grill/vasp/pd-help/vasp_ropt.pd
new file mode 100644
index 00000000..c1975b8e
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_ropt.pd
@@ -0,0 +1,86 @@
+#N canvas 36 36 806 598 10;
+#X obj 72 26 cnv 15 15 15 empty empty vasp.ropt 0 10 1 14 -262144 -1
+0;
+#X obj 76 131 filelist \$0;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 507 536 pd clear_buffers;
+#X obj 63 291 vasp.update;
+#X obj 63 311 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 442 164 wavedisplay-simple bufropt1 \$0;
+#X obj 443 321 wavedisplay-simple bufropt2 \$0;
+#X msg 63 251 vasp bufropt1 bufropt2;
+#X obj 63 271 vasp.cfft;
+#X obj 63 504 vasp.update;
+#X obj 63 524 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 63 464 vasp bufropt1 bufropt2;
+#X obj 63 484 vasp.c!fft;
+#X obj 344 538 dac~;
+#X obj 344 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 365 503 play;
+#X obj 344 518 tabplay~ bufropt1;
+#X msg 507 516 vasp bufropt1 bufropt2;
+#N canvas 92 108 436 386 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 84 253 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 214 221 resize \$1;
+#X obj 66 47 loadbang;
+#X obj 66 193 t b f f;
+#X obj 66 113 filelisthandler \$0;
+#X obj 214 243 s bufropt1;
+#X obj 225 264 s bufropt2;
+#X msg 95 91 88200;
+#X obj 66 68 t b b;
+#X msg 66 145 read \$1 bufropt1;
+#X msg 66 91 3;
+#X connect 0 0 5 0;
+#X connect 3 0 7 0;
+#X connect 3 0 8 0;
+#X connect 4 0 10 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 11 0;
+#X connect 9 0 5 0;
+#X connect 10 0 12 0;
+#X connect 10 1 9 0;
+#X connect 11 0 0 0;
+#X connect 12 0 6 0;
+#X restore 696 536 pd inside;
+#X text 71 49 optimise the radius of a complex buffer content;
+#X text 71 66 right outlet: the previous maximum;
+#X text 72 84 needs two vectors;
+#X text 227 345 optimise;
+#X text 224 251 transform to frequency domain;
+#X text 224 462 transform to time domain;
+#X obj 63 393 vasp.update;
+#X obj 63 413 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 63 346 vasp bufropt1 bufropt2;
+#X obj 63 373 vasp.ropt 0.2;
+#X obj 51 569 VASP-HELP;
+#X text 93 569 - vasp overview;
+#X connect 3 0 4 0;
+#X connect 7 0 8 0;
+#X connect 8 0 3 0;
+#X connect 9 0 10 0;
+#X connect 11 0 12 0;
+#X connect 12 0 9 0;
+#X connect 14 0 16 0;
+#X connect 16 0 13 0;
+#X connect 16 0 13 1;
+#X connect 17 0 2 0;
+#X connect 25 0 26 0;
+#X connect 27 0 28 0;
+#X connect 28 0 25 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rot.pd b/externals/grill/vasp/pd-help/vasp_rot.pd
new file mode 100644
index 00000000..b7aaec0f
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rot.pd
@@ -0,0 +1,48 @@
+#N canvas 24 75 850 525 10;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.rot 0 10 1 14 -262144 -1
+0;
+#X text 463 343 clear;
+#N canvas 0 0 413 295 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 463 388 pd clear_buffer;
+#X text 72 73 optional argument/right inlet: value;
+#X text 71 60 rotate buffer content;
+#X msg 463 365 vasp bufrot;
+#X obj 68 333 vasp.update;
+#X floatatom 123 280 0 0 0;
+#X msg 68 246 vasp bufrot;
+#X obj 59 467 VASP-HELP;
+#X obj 72 192 vasp.u;
+#X obj 72 170 vasp.= env 0 0 1 20 -1 100;
+#X obj 180 427 vasp.shift;
+#X obj 260 427 vasp.xrot;
+#X text 55 426 related objects:;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufrot 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 443 130 graph;
+#N canvas 0 0 398 274 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufrot;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 698 395 pd init;
+#X msg 72 145 vasp bufrot;
+#X obj 68 305 vasp.rot 7;
+#X text 193 139 1 create envelope;
+#X text 193 245 2 rotate buffer content;
+#X connect 5 0 2 0;
+#X connect 7 0 18 1;
+#X connect 8 0 18 0;
+#X connect 11 0 10 0;
+#X connect 17 0 11 0;
+#X connect 18 0 6 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rpeaks.pd b/externals/grill/vasp/pd-help/vasp_rpeaks.pd
new file mode 100644
index 00000000..5891e6d1
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rpeaks.pd
@@ -0,0 +1,94 @@
+#N canvas 36 36 814 590 10;
+#X obj 72 26 cnv 15 15 15 empty empty vasp.rpeaks 0 10 1 14 -262144
+-1 0;
+#X obj 76 131 filelist \$0;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 500 505 pd clear_buffers;
+#X obj 65 264 vasp.update;
+#X obj 65 284 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 411 132 wavedisplay-simple bufrpeaks1 \$0;
+#X obj 412 289 wavedisplay-simple bufrpeaks2 \$0;
+#X msg 65 224 vasp bufrpeaks1 bufrpeaks2;
+#X obj 65 244 vasp.cfft;
+#X obj 65 510 vasp.update;
+#X obj 65 530 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 65 426 vasp bufrpeaks1 bufrpeaks2;
+#X obj 65 446 vasp.c!fft;
+#X obj 337 507 dac~;
+#X obj 337 469 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 358 472 play;
+#X obj 337 487 tabplay~ bufrpeaks1;
+#X msg 500 485 vasp bufrpeaks1 bufrpeaks2;
+#N canvas 92 108 442 392 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 135 260 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 247 217 resize \$1;
+#X obj 66 47 loadbang;
+#X obj 66 113 filelisthandler \$0;
+#X obj 247 239 s bufrpeaks1;
+#X obj 258 260 s bufrpeaks2;
+#X msg 247 183 88200;
+#X obj 66 68 t b b;
+#X msg 66 145 read \$1 bufrpeaks1;
+#X obj 66 193 t b;
+#X msg 66 91 2;
+#X connect 0 0 11 0;
+#X connect 3 0 6 0;
+#X connect 3 0 7 0;
+#X connect 4 0 9 0;
+#X connect 5 0 10 0;
+#X connect 8 0 1 0;
+#X connect 8 0 3 0;
+#X connect 9 0 12 0;
+#X connect 9 1 8 0;
+#X connect 10 0 0 0;
+#X connect 11 0 2 0;
+#X connect 12 0 5 0;
+#X restore 689 505 pd inside;
+#X text 71 65 argument/right inlet: density (0-1);
+#X text 72 97 needs two vectors (real and imaginary);
+#X obj 65 467 vasp.opt;
+#X obj 65 489 vasp.* 0.5;
+#X text 71 49 find radius peaks of a complex vasp;
+#X text 71 81 right outlet: current peaks density;
+#X obj 65 374 vasp.update;
+#X obj 65 394 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 65 308 vasp bufrpeaks1 bufrpeaks2;
+#X floatatom 156 331 5 0 0;
+#X floatatom 156 398 12 0 0;
+#X obj 65 354 vasp.rpeaks 0.05;
+#X text 206 329 density;
+#X obj 156 376 * 88200;
+#X text 242 396 current peaks;
+#X obj 46 559 VASP-HELP;
+#X connect 3 0 4 0;
+#X connect 7 0 8 0;
+#X connect 8 0 3 0;
+#X connect 9 0 10 0;
+#X connect 11 0 12 0;
+#X connect 12 0 21 0;
+#X connect 14 0 16 0;
+#X connect 16 0 13 0;
+#X connect 16 0 13 1;
+#X connect 17 0 2 0;
+#X connect 21 0 22 0;
+#X connect 22 0 9 0;
+#X connect 25 0 26 0;
+#X connect 27 0 30 0;
+#X connect 28 0 30 1;
+#X connect 30 0 25 0;
+#X connect 30 1 32 0;
+#X connect 32 0 29 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rpow.pd b/externals/grill/vasp/pd-help/vasp_rpow.pd
new file mode 100644
index 00000000..cbfb4bc6
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rpow.pd
@@ -0,0 +1,83 @@
+#N canvas 28 51 932 647 10;
+#N canvas 92 108 417 419 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 67 53 loadbang;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 1;
+#X msg 67 133 read -resize \$1 bufrpow1;
+#X obj 214 228 s bufrpow1;
+#X obj 224 252 s bufrpow2;
+#X connect 0 0 5 0;
+#X connect 3 0 9 0;
+#X connect 3 0 10 0;
+#X connect 4 0 7 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 0 0;
+#X restore 685 477 pd inside;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.rpow 0 10 1 14 -262144 -1
+0;
+#X obj 77 139 filelist \$0;
+#X obj 59 508 vasp.update;
+#X obj 59 528 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 59 487 vasp.c!fft;
+#X obj 59 264 vasp.cfft;
+#X obj 59 284 vasp.update;
+#X obj 59 304 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 352 474 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 486 474 pd clear_buffers;
+#X obj 352 431 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 374 428 play;
+#X text 486 429 clear;
+#X text 73 60 radius ^ x;
+#X text 73 75 power function for the radius values of a complex vasp
+;
+#X text 73 92 argument/right inlet: exponent;
+#X text 73 107 needs two vectors;
+#X msg 59 244 vasp bufrpow1 bufrpow2;
+#X msg 59 467 vasp bufrpow1 bufrpow2;
+#X obj 364 130 wavedisplay-simple bufrpow1 \$0;
+#X obj 365 276 wavedisplay-simple bufrpow2 \$0;
+#X obj 352 451 tabplay~ bufrpow1;
+#X msg 486 451 vasp bufrpow1 bufrpow2;
+#X obj 59 413 vasp.update;
+#X obj 59 433 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 59 339 vasp bufrpow1 bufrpow2;
+#X obj 59 393 vasp.rpow 2;
+#X floatatom 120 366 5 0 0 0 - - -;
+#X text 170 363 exponent;
+#X obj 51 591 VASP-HELP;
+#X connect 3 0 4 0;
+#X connect 5 0 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 11 0 22 0;
+#X connect 18 0 6 0;
+#X connect 19 0 5 0;
+#X connect 22 0 9 0;
+#X connect 22 0 9 1;
+#X connect 23 0 10 0;
+#X connect 24 0 25 0;
+#X connect 26 0 27 0;
+#X connect 27 0 24 0;
+#X connect 28 0 27 1;
diff --git a/externals/grill/vasp/pd-help/vasp_rsize.pd b/externals/grill/vasp/pd-help/vasp_rsize.pd
new file mode 100644
index 00000000..ad7d8da3
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rsize.pd
@@ -0,0 +1,37 @@
+#N canvas 85 111 909 544 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.size/ 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 410 286 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 2 5 \; \$1 xlabel 1.1 0 10 20 30 40 50
+\; \$1 yticks 0 0.25 2;
+#X msg 33 45 symbol bufrsize;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 714 408 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufrsize 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 453 152 graph;
+#X obj 175 416 vasp.frames;
+#X text 62 415 related objects:;
+#X floatatom 120 319 5 0 0;
+#X obj 256 416 vasp.size;
+#X obj 256 374 vasp.s/;
+#X msg 62 152 vasp bufrsize;
+#X msg 177 152 vasp bufrsize;
+#X obj 62 217 vasp.size* 2;
+#X obj 177 217 vasp.size/ 2;
+#X obj 193 31 cnv 15 15 15 empty empty vasp.size* 0 10 1 14 -262144
+-1 0;
+#X text 57 69 divide and multiplicate the size of a buffer/array;
+#X text 59 371 abbreviations:;
+#X obj 175 375 vasp.s*;
+#X obj 120 289 vasp.size?;
+#X obj 331 416 vasp.size?;
+#X obj 62 463 VASP-HELP;
+#X connect 8 0 10 0;
+#X connect 9 0 11 0;
+#X connect 10 0 16 0;
+#X connect 11 0 16 0;
+#X connect 16 0 5 0;
diff --git a/externals/grill/vasp/pd-help/vasp_rvalleys.pd b/externals/grill/vasp/pd-help/vasp_rvalleys.pd
new file mode 100644
index 00000000..20170c20
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_rvalleys.pd
@@ -0,0 +1,91 @@
+#N canvas 36 36 837 642 10;
+#X obj 72 26 cnv 15 15 15 empty empty vasp.rval 0 10 1 14 -262144 -1
+0;
+#X obj 76 131 filelist \$0;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 500 505 pd clear_buffers;
+#X obj 65 263 vasp.update;
+#X obj 65 283 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 411 132 wavedisplay-simple bufrval1 \$0;
+#X obj 412 289 wavedisplay-simple bufrval2 \$0;
+#X msg 65 223 vasp bufrval1 bufrval2;
+#X obj 65 243 vasp.cfft;
+#X obj 65 510 vasp.update;
+#X obj 65 530 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 65 426 vasp bufrval1 bufrval2;
+#X obj 65 446 vasp.c!fft;
+#X obj 337 507 dac~;
+#X obj 337 469 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 358 472 play;
+#X obj 337 487 tabplay~ bufrval1;
+#X msg 500 485 vasp bufrval1 bufrval2;
+#N canvas 92 108 440 390 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 135 260 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 247 217 resize \$1;
+#X obj 66 47 loadbang;
+#X obj 66 113 filelisthandler \$0;
+#X obj 247 239 s bufrval1;
+#X obj 258 260 s bufrval2;
+#X msg 247 183 88200;
+#X obj 66 68 t b b;
+#X msg 66 145 read \$1 bufrval1;
+#X msg 66 91 3;
+#X obj 66 193 t b;
+#X connect 0 0 12 0;
+#X connect 3 0 6 0;
+#X connect 3 0 7 0;
+#X connect 4 0 9 0;
+#X connect 5 0 10 0;
+#X connect 8 0 1 0;
+#X connect 8 0 3 0;
+#X connect 9 0 11 0;
+#X connect 9 1 8 0;
+#X connect 10 0 0 0;
+#X connect 11 0 5 0;
+#X connect 12 0 2 0;
+#X restore 689 505 pd inside;
+#X text 71 49 find radius valleys of a complex vasp;
+#X text 71 65 argument/right inlet: density (0-1);
+#X text 72 97 needs two vectors (real and imaginary);
+#X obj 65 467 vasp.opt;
+#X obj 65 489 vasp.* 0.5;
+#X text 71 81 right outlet: the current density;
+#X obj 65 382 vasp.update;
+#X obj 65 402 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 65 308 vasp bufrval1 bufrval2;
+#X floatatom 168 342 5 0 0;
+#X floatatom 168 383 12 0 0;
+#X text 257 382 current density;
+#X obj 65 362 vasp.rvalleys 0.05;
+#X obj 54 595 VASP-HELP;
+#X connect 3 0 4 0;
+#X connect 7 0 8 0;
+#X connect 8 0 3 0;
+#X connect 9 0 10 0;
+#X connect 11 0 12 0;
+#X connect 12 0 22 0;
+#X connect 14 0 16 0;
+#X connect 16 0 13 0;
+#X connect 16 0 13 1;
+#X connect 17 0 2 0;
+#X connect 22 0 23 0;
+#X connect 23 0 9 0;
+#X connect 25 0 26 0;
+#X connect 27 0 31 0;
+#X connect 28 0 31 1;
+#X connect 31 0 25 0;
+#X connect 31 1 29 0;
diff --git a/externals/grill/vasp/pd-help/vasp_set.pd b/externals/grill/vasp/pd-help/vasp_set.pd
new file mode 100644
index 00000000..161b4774
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_set.pd
@@ -0,0 +1,90 @@
+#N canvas 21 60 881 576 10;
+#X obj 61 33 cnv 15 15 15 empty empty vasp.= 0 10 1 14 -262144 -1 0
+;
+#X text 56 66 set a vasp to a value;
+#X text 55 81 optional argument/right inlet: value/vasp;
+#X msg 56 166 vasp bufset;
+#X obj 56 188 vasp.noise;
+#X obj 56 211 vasp.* 0.5;
+#X text 142 164 generate noise;
+#X obj 56 232 vasp.update;
+#X obj 56 254 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 56 385 vasp.= 0;
+#X obj 112 342 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 56 406 vasp.update;
+#X obj 56 426 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X text 446 103 select a region by drawing inside the wavedisplay:
+mouse+spacebar (select) or mouse+"s" (shift).;
+#N canvas 109 162 310 376 tovaspdata 0;
+#X obj 107 305 outlet;
+#X obj 107 92 unpack;
+#X obj 107 232 runden;
+#X obj 107 210 - 0;
+#X text 191 251 offset;
+#X obj 107 156 t b f;
+#X obj 107 185 0;
+#X text 111 250 length;
+#X obj 188 233 runden;
+#X obj 107 274 pack;
+#X obj 107 72 change2;
+#X obj 107 115 t f f;
+#X obj 107 47 inlet;
+#X connect 1 0 11 0;
+#X connect 1 1 6 1;
+#X connect 2 0 9 0;
+#X connect 3 0 2 0;
+#X connect 5 0 6 0;
+#X connect 5 1 3 1;
+#X connect 6 0 3 0;
+#X connect 8 0 9 1;
+#X connect 9 0 0 0;
+#X connect 10 0 1 0;
+#X connect 11 0 5 0;
+#X connect 11 1 8 0;
+#X connect 12 0 10 0;
+#X restore 447 302 pd tovaspdata;
+#X msg 447 330 set vasp \$1 bufset \$2;
+#X obj 447 145 wavedisplay-select bufset \$0;
+#X msg 56 315 vasp bufset;
+#X text 134 314 set all samples to zero;
+#X text 136 339 set selected samples to zero;
+#N canvas 0 0 261 214 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 559 465 pd clear_buffer;
+#X msg 559 439 vasp bufset;
+#X text 177 472 <-- click to open more examples;
+#X text 57 138 use vasp.= to clear a buffer;
+#X obj 53 473 vaspset_examples;
+#X obj 51 533 VASP-HELP;
+#N canvas 280 291 407 308 inside 0;
+#X obj 82 165 s \$0-sample-length;
+#X msg 138 90 resize \$1;
+#X obj 138 43 loadbang;
+#X msg 138 64 88200;
+#X obj 138 112 s bufset;
+#X connect 1 0 4 0;
+#X connect 2 0 3 0;
+#X connect 3 0 1 0;
+#X connect 3 0 0 0;
+#X restore 709 420 pd inside;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X connect 5 0 7 0;
+#X connect 7 0 8 0;
+#X connect 9 0 11 0;
+#X connect 10 0 9 0;
+#X connect 11 0 12 0;
+#X connect 14 0 15 0;
+#X connect 15 0 9 0;
+#X connect 17 0 9 0;
+#X connect 21 0 20 0;
diff --git a/externals/grill/vasp/pd-help/vasp_sframes.pd b/externals/grill/vasp/pd-help/vasp_sframes.pd
new file mode 100644
index 00000000..510f50b4
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_sframes.pd
@@ -0,0 +1,136 @@
+#N canvas 39 37 929 624 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.frames= 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsfram1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 544 107 graph;
+#N canvas 0 0 392 216 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufsfram1;
+#X msg 140 45 symbol bufsfram2;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 1 0;
+#X restore 798 498 pd init;
+#X obj 57 402 vasp.update;
+#X text 113 443 abbreviation;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsfram2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 545 227 graph;
+#X text 56 87 argument/right inlet: value in samples;
+#X obj 57 442 vasp.f+;
+#X obj 55 559 VASP-HELP;
+#X obj 57 378 vasp.noise;
+#X obj 58 200 vasp.update;
+#X msg 58 153 vasp bufsfram1;
+#X msg 57 261 vasp bufsfram1;
+#X obj 57 284 vasp.frames= 0.7;
+#X obj 58 176 vasp.= env -1 0 1 44100 -1 88200;
+#X floatatom 148 305 12 0 0 0 - - -;
+#X text 57 104 right outlet: frames relatively to the starting point
+of the search;
+#X text 147 319 since the search runs from the end to the left \, this
+value is negative;
+#X obj 57 356 vasp.-> bufsfram2;
+#X obj 57 502 vasp.o=;
+#X obj 190 148 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X text 222 148 1 generate a ramp;
+#X obj 190 260 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X text 218 274 the value 0.7 appears in the ramp;
+#X text 218 259 2 generate noise until the position \, where;
+#N canvas 77 60 429 598 dir_and_target 0;
+#X text 46 56 forward;
+#X text 48 154 backward;
+#X text 31 22 search direction;
+#X text 58 369 both;
+#X text 28 401 negative;
+#X text 58 337 positive;
+#X text 28 314 target slope;
+#X text 46 99 both (nearest);
+#X obj 185 228 vasp.noise;
+#X obj 185 249 vasp.u;
+#X msg 110 156 dir -1;
+#X msg 111 121 dir 0;
+#X msg 110 59 dir 1;
+#X obj 185 90 t a b;
+#X obj 210 111 bng 15 250 50 0 \$0-clear empty empty 0 -6 1152 8 -262144
+-1 -1;
+#X text 228 111 (clear);
+#X floatatom 234 175 12 0 0 0 - - -;
+#X msg 126 336 slope 1;
+#X msg 110 367 slope 0;
+#X msg 97 399 slope -1;
+#X obj 239 355 t a b;
+#X obj 264 376 bng 15 250 50 0 \$0-clear empty empty 0 -6 1152 8 -262144
+-1 -1;
+#X text 282 376 (clear);
+#X floatatom 300 423 12 0 0 0 - - -;
+#X text 29 290 find values with positive and/or negative slope;
+#X obj 185 197 vasp.-> bufsfram2;
+#X obj 239 481 vasp.noise;
+#X obj 239 502 vasp.u;
+#X obj 239 450 vasp.-> bufsfram2;
+#X obj 239 400 vasp.f= 0.2;
+#X obj 185 153 vasp.f= 0;
+#X msg 185 71 vasp 44101 bufsfram1;
+#X msg 239 336 vasp 0 bufsfram1;
+#X connect 8 0 9 0;
+#X connect 10 0 30 0;
+#X connect 11 0 30 0;
+#X connect 12 0 30 0;
+#X connect 13 0 30 0;
+#X connect 13 1 14 0;
+#X connect 17 0 29 0;
+#X connect 18 0 29 0;
+#X connect 19 0 29 0;
+#X connect 20 0 29 0;
+#X connect 20 1 21 0;
+#X connect 25 1 8 0;
+#X connect 26 0 27 0;
+#X connect 28 1 26 0;
+#X connect 29 0 28 0;
+#X connect 29 1 23 0;
+#X connect 30 0 25 0;
+#X connect 30 1 16 0;
+#X connect 31 0 13 0;
+#X connect 32 0 20 0;
+#X restore 586 418 pd dir_and_target;
+#X obj 538 415 cnv 15 15 15 empty empty --> 0 10 0 14 -262144 -24198
+0;
+#X msg 562 464 vasp bufsfram2;
+#N canvas 249 259 328 183 clear 0;
+#X obj 74 54 inlet;
+#X obj 74 77 vasp.= 0;
+#X obj 74 100 vasp.u;
+#X obj 168 53 r \$0-clear;
+#X msg 168 76 vasp bufsfram2;
+#X obj 168 99 vasp.= 0;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X restore 562 490 pd clear;
+#X text 537 398 3 more features!;
+#X text 56 56 search for a value (starting at the end) and set the
+length of the vasp according to it;
+#X text 55 482 related objects:;
+#X obj 139 502 vasp.f;
+#X obj 204 502 vasp.s;
+#X connect 9 0 3 0;
+#X connect 11 0 14 0;
+#X connect 12 0 13 0;
+#X connect 13 0 18 0;
+#X connect 13 1 15 0;
+#X connect 14 0 10 0;
+#X connect 18 1 9 0;
+#X connect 20 0 11 0;
+#X connect 22 0 12 0;
+#X connect 27 0 28 0;
diff --git a/externals/grill/vasp/pd-help/vasp_shift.pd b/externals/grill/vasp/pd-help/vasp_shift.pd
new file mode 100644
index 00000000..46b2e408
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_shift.pd
@@ -0,0 +1,57 @@
+#N canvas 24 75 875 494 10;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.shift 0 10 1 14 -262144
+-1 0;
+#X text 520 322 clear;
+#N canvas 0 0 413 295 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 520 367 pd clear_buffer;
+#X text 71 60 shifts buffer content to a sample index;
+#X text 72 73 optional argument/right inlet: value;
+#X msg 520 344 vasp bufshift;
+#X obj 70 354 vasp.update;
+#X msg 70 228 vasp bufshift;
+#X floatatom 143 259 0 0 0 0 - - -;
+#X obj 59 430 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufshift 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 436 125 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufshift;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 673 368 pd init;
+#X obj 70 327 vasp.shift 10;
+#X obj 70 178 vasp.u;
+#X msg 70 133 vasp bufshift;
+#X text 187 132 1 draw envelope;
+#X text 184 230 2 shift content;
+#X obj 262 397 vasp.xrot;
+#X text 57 396 related objects:;
+#X obj 182 397 vasp.xshift;
+#X msg 199 260 fill 0;
+#X msg 199 280 fill 1;
+#X msg 199 300 fill 2;
+#X text 245 260 no filling;
+#X text 244 300 fill with edge-value;
+#X text 245 280 zero filling (default);
+#X obj 70 156 vasp.= env 0.5 0 1 20 -1 100;
+#X connect 5 0 2 0;
+#X connect 7 0 12 0;
+#X connect 8 0 12 1;
+#X connect 12 0 6 0;
+#X connect 14 0 26 0;
+#X connect 20 0 12 0;
+#X connect 21 0 12 0;
+#X connect 22 0 12 0;
+#X connect 26 0 13 0;
diff --git a/externals/grill/vasp/pd-help/vasp_sign.pd b/externals/grill/vasp/pd-help/vasp_sign.pd
new file mode 100644
index 00000000..83062d7e
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_sign.pd
@@ -0,0 +1,42 @@
+#N canvas 95 158 858 400 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.sign 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsign 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 465 124 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufsign;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 737 285 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 521 284 pd clear_buffer;
+#X text 178 134 generate a sinewave;
+#X obj 77 178 vasp.u;
+#X text 70 77 samples == 0 stay 0;
+#X text 70 95 samples < 0 become -1;
+#X text 70 61 samples > 0 become 1;
+#X msg 77 135 vasp bufsign;
+#X obj 77 156 vasp.osc 44100;
+#X msg 521 263 vasp bufsign;
+#X obj 77 322 vasp.update;
+#X obj 77 291 vasp.sign;
+#X msg 77 260 vasp bufsign;
+#X text 79 237 use sign to generate a square wave out of a sine wave
+;
+#X obj 46 370 VASP-HELP;
+#X connect 9 0 10 0;
+#X connect 10 0 5 0;
+#X connect 11 0 3 0;
+#X connect 13 0 12 0;
+#X connect 14 0 13 0;
diff --git a/externals/grill/vasp/pd-help/vasp_size.pd b/externals/grill/vasp/pd-help/vasp_size.pd
new file mode 100644
index 00000000..11fbf1c8
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_size.pd
@@ -0,0 +1,43 @@
+#N canvas 85 111 842 540 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp.size 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 406 282 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 45 symbol bufsize;
+#X msg 33 73 \; \$1 xticks 0 2 5 \; \$1 xlabel 1.1 0 10 20 30 40 50
+\; \$1 yticks 0 0.25 2;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X restore 714 408 pd init;
+#X text 119 392 abbreviation;
+#X obj 62 335 vasp.update;
+#X obj 90 258 prepend set;
+#X msg 62 196 vasp bufsize;
+#X obj 62 225 vasp.size 100;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsize 133 float 0;
+#X coords 0 1 132 -1 300 100 1;
+#X restore 453 153 graph;
+#X text 57 69 change the size of a buffer/array;
+#X obj 62 303 vasp.osc 16;
+#X obj 63 392 vasp.s;
+#X text 62 433 related objects:;
+#X obj 343 460 vasp.frames;
+#X obj 183 460 vasp.size?;
+#X obj 183 436 vasp.s+;
+#X obj 259 460 vasp.size*;
+#X obj 259 437 vasp.size/;
+#X obj 62 504 VASP-HELP;
+#X obj 62 157 nbx 5 14 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
+10 -24198 -1 -1 133 256;
+#X obj 62 175 t b f;
+#X msg 90 280;
+#X text 58 83 argument/right inlet: value in frames;
+#X connect 4 0 20 0;
+#X connect 5 0 6 0;
+#X connect 6 0 4 0;
+#X connect 6 0 9 0;
+#X connect 9 0 3 0;
+#X connect 18 0 19 0;
+#X connect 19 0 5 0;
+#X connect 19 1 6 1;
diff --git a/externals/grill/vasp/pd-help/vasp_soffset.pd b/externals/grill/vasp/pd-help/vasp_soffset.pd
new file mode 100644
index 00000000..8a515a2a
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_soffset.pd
@@ -0,0 +1,153 @@
+#N canvas 31 15 964 662 10;
+#X text 54 77 argument/right inlet: value;
+#X obj 58 27 cnv 15 15 15 empty empty vasp.offset= 0 10 1 14 -262144
+-1 0;
+#X text 68 587 abbreviation;
+#X obj 75 272 prepend set;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsoffs1 1000 float 0;
+#X coords 0 1 999 -1 300 100 1;
+#X restore 551 88 graph;
+#N canvas 466 356 387 251 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 45 symbol bufsoffs1;
+#X msg 151 45 symbol bufsoffs2;
+#X msg 33 71 \; \$1 xticks 0 100 10 \; \$1 xlabel 1.1 0 200 300 500
+700 800 1000 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 1100 -1 -0.5 0 0.5
+1;
+#X connect 0 0 1 0;
+#X connect 0 0 2 0;
+#X connect 1 0 3 0;
+#X connect 2 0 3 0;
+#X restore 802 556 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsoffs2 1000 float 0;
+#X coords 0 1 999 -1 300 100 1;
+#X restore 551 207 graph;
+#X obj 64 177 vasp.u;
+#X msg 63 130 vasp bufsoffs1;
+#X msg 64 221 vasp bufsoffs1;
+#X msg 75 293 vasp 701 bufsoffs1 299 0;
+#X obj 64 367 vasp.noise;
+#X obj 64 388 vasp.u;
+#X obj 159 591 vasp.o=;
+#X obj 259 592 VASP-HELP;
+#X text 54 95 right outlet: relative offset position in frames;
+#X text 201 128 1 generate a ramp;
+#X text 199 220 2 generate noise \, and start at the point \,;
+#X obj 64 325 vasp.o?;
+#X msg 64 346 vasp bufsoffs2 \$1;
+#X text 54 59 search for a value set it as offset;
+#X floatatom 161 271 5 0 0;
+#X obj 170 130 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X obj 170 221 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#N canvas 0 0 261 214 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 683 549 pd clear_buffer;
+#X msg 683 528 vasp bufsoffs2;
+#X text 703 508 clear second buffer;
+#X obj 683 509 bng 15 250 50 0 empty \$0-clear empty 0 -6 576 8 -262144
+-1 -1;
+#X obj 162 445 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#N canvas 77 60 409 578 dir_and_target 0;
+#X text 46 56 forward;
+#X text 48 154 backward;
+#X text 31 22 search direction;
+#X text 58 369 both;
+#X text 28 401 negative;
+#X text 58 337 positive;
+#X text 28 314 target slope;
+#X text 46 99 both (nearest);
+#X obj 183 210 vasp.noise;
+#X obj 183 231 vasp.u;
+#X msg 183 189 vasp bufsoffs2 \$1;
+#X msg 110 156 dir -1;
+#X msg 111 121 dir 0;
+#X msg 110 59 dir 1;
+#X obj 183 164 vasp.o?;
+#X obj 185 90 t a b;
+#X obj 210 111 bng 15 250 50 0 \$0-clear empty empty 0 -6 1152 8 -262144
+-1 -1;
+#X text 228 111 (clear);
+#X obj 185 135 vasp.offset= 0.1;
+#X msg 185 71 vasp bufsoffs1 500;
+#X floatatom 276 161 5 0 0;
+#X msg 126 336 slope 1;
+#X msg 110 367 slope 0;
+#X msg 97 399 slope -1;
+#X obj 239 484 vasp.noise;
+#X obj 239 505 vasp.u;
+#X msg 239 463 vasp bufsoffs2 \$1;
+#X obj 239 438 vasp.o?;
+#X obj 239 355 t a b;
+#X obj 264 376 bng 15 250 50 0 \$0-clear empty empty 0 -6 1152 8 -262144
+-1 -1;
+#X text 282 376 (clear);
+#X obj 239 400 vasp.offset= 0.1;
+#X floatatom 330 426 5 0 0;
+#X text 29 290 find values with positive and/or negative slope;
+#X msg 239 336 vasp bufsoffs1;
+#X connect 8 0 9 0;
+#X connect 10 0 8 0;
+#X connect 11 0 18 0;
+#X connect 12 0 18 0;
+#X connect 13 0 18 0;
+#X connect 14 0 10 0;
+#X connect 15 0 18 0;
+#X connect 15 1 16 0;
+#X connect 18 0 14 0;
+#X connect 18 1 20 0;
+#X connect 19 0 15 0;
+#X connect 21 0 31 0;
+#X connect 22 0 31 0;
+#X connect 23 0 31 0;
+#X connect 24 0 25 0;
+#X connect 26 0 24 0;
+#X connect 27 0 26 0;
+#X connect 28 0 31 0;
+#X connect 28 1 29 0;
+#X connect 31 0 27 0;
+#X connect 31 1 32 0;
+#X connect 34 0 28 0;
+#X restore 612 422 pd dir_and_target;
+#X obj 64 151 vasp.= env -1 0 1 500 -1 1000;
+#X obj 102 496 t a b;
+#X obj 127 517 bng 15 250 50 0 \$0-clear empty empty 0 -6 1152 8 -262144
+-1 -1;
+#X text 145 517 (clear);
+#X text 148 418 the search always starts at the offsetpoint;
+#X text 566 403 more features!;
+#X obj 564 419 cnv 15 15 15 empty empty --> 0 10 0 14 -262144 -24198
+0;
+#X text 214 232 where the ramp is at 0.2;
+#X obj 64 242 vasp.offset= 0.2;
+#X text 189 443 3 start searching at frame 501;
+#X msg 102 475 vasp bufsoffs1 501;
+#X connect 3 0 10 0;
+#X connect 8 0 30 0;
+#X connect 9 0 38 0;
+#X connect 11 0 12 0;
+#X connect 18 0 19 0;
+#X connect 19 0 11 0;
+#X connect 22 0 8 0;
+#X connect 23 0 9 0;
+#X connect 25 0 24 0;
+#X connect 27 0 25 0;
+#X connect 28 0 40 0;
+#X connect 30 0 7 0;
+#X connect 31 0 38 0;
+#X connect 31 1 32 0;
+#X connect 38 0 18 0;
+#X connect 38 0 3 0;
+#X connect 38 1 21 0;
+#X connect 40 0 31 0;
diff --git a/externals/grill/vasp/pd-help/vasp_spit.pd b/externals/grill/vasp/pd-help/vasp_spit.pd
new file mode 100644
index 00000000..be3d60a1
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_spit.pd
@@ -0,0 +1,46 @@
+#N canvas 190 73 663 567 10;
+#X text 62 76 spit out vectors of a vasp (one vector after the other)
+;
+#X text 62 92 argument: number of outlets (if more than 1 \, outputs
+from right to left);
+#X obj 57 19 cnv 15 15 15 empty empty vasp.spit 0 10 1 14 -262144 -1
+0;
+#X text 211 304 spits out one vector after the other from right to
+left;
+#X obj 119 335 print b;
+#X obj 63 335 print a;
+#X obj 63 305 vasp.spit 3;
+#X msg 63 271 vasp bufspit1 bufspit2;
+#X obj 178 335 print c;
+#X obj 234 335 print ready;
+#X obj 118 220 print b;
+#X obj 63 220 print a;
+#X text 63 118 most right outlet: bang when ready;
+#X msg 63 160 vasp bufspit1 bufspit2 bufspit3;
+#X obj 63 188 vasp.spit;
+#X text 144 189 spits out one vector after the other out of 1 outlet
+;
+#X msg 237 271 vasp bufspit1 bufspit2 bufspit3;
+#X text 171 428 if more vectors than outlets \, see what it does!;
+#X obj 118 459 print b;
+#X obj 63 459 print a;
+#X msg 63 399 vasp bufspit1 bufspit2 bufspit3;
+#X obj 63 429 vasp.spit 2;
+#X obj 174 459 print ready;
+#X obj 50 519 VASP-HELP;
+#X obj 487 483 table bufspit1;
+#X obj 487 504 table bufspit2;
+#X obj 487 525 table bufspit3;
+#X connect 6 0 5 0;
+#X connect 6 1 4 0;
+#X connect 6 2 8 0;
+#X connect 6 3 9 0;
+#X connect 7 0 6 0;
+#X connect 13 0 14 0;
+#X connect 14 0 11 0;
+#X connect 14 1 10 0;
+#X connect 16 0 6 0;
+#X connect 20 0 21 0;
+#X connect 21 0 19 0;
+#X connect 21 1 18 0;
+#X connect 21 2 22 0;
diff --git a/externals/grill/vasp/pd-help/vasp_split.pd b/externals/grill/vasp/pd-help/vasp_split.pd
new file mode 100644
index 00000000..44f3f70b
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_split.pd
@@ -0,0 +1,27 @@
+#N canvas 221 195 631 478 10;
+#X text 56 100 most right outlet: rest (if there is one) of vectors
+in a new vasp \, otherwise: bang;
+#X text 56 70 split a vasp into its vectors;
+#X text 56 85 argument: number of vectors to split;
+#X obj 57 38 cnv 15 15 15 empty empty vasp.split 0 10 1 14 -262144
+-1 0;
+#X obj 130 215 prepend set;
+#X obj 63 310 prepend set;
+#X obj 63 278 vasp.join 2;
+#X msg 241 153 vasp bufsplit1 bufsplit2 bufsplit3;
+#X obj 63 187 vasp.split 2;
+#X msg 63 153 vasp bufsplit1 bufsplit2;
+#X obj 53 410 VASP-HELP;
+#X obj 340 367 table bufsplit1;
+#X obj 340 391 table bufsplit2;
+#X obj 340 413 table bufsplit3;
+#X msg 63 339;
+#X msg 130 239;
+#X connect 4 0 15 0;
+#X connect 5 0 14 0;
+#X connect 6 0 5 0;
+#X connect 7 0 8 0;
+#X connect 8 0 6 0;
+#X connect 8 1 6 1;
+#X connect 8 2 4 0;
+#X connect 9 0 8 0;
diff --git a/externals/grill/vasp/pd-help/vasp_sqr.pd b/externals/grill/vasp/pd-help/vasp_sqr.pd
new file mode 100644
index 00000000..74f84aed
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_sqr.pd
@@ -0,0 +1,38 @@
+#N canvas 47 54 800 409 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.sqr 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 412 288 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufsqr;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 622 327 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 362 325 pd clear_buffer;
+#X obj 77 173 vasp.update;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsqr 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 363 170 graph;
+#X obj 77 150 vasp.osc 44100;
+#X text 71 63 sample ^ 2;
+#X msg 77 127 vasp bufsqr;
+#X text 184 124 generate a 1 Hz sinewave;
+#X msg 362 303 vasp bufsqr;
+#X obj 77 297 vasp.update;
+#X obj 77 271 vasp.sqr;
+#X msg 77 246 vasp bufsqr;
+#X obj 45 375 VASP-HELP;
+#X connect 5 0 3 0;
+#X connect 7 0 5 0;
+#X connect 9 0 2 0;
+#X connect 11 0 10 0;
+#X connect 12 0 11 0;
diff --git a/externals/grill/vasp/pd-help/vasp_sqrt.pd b/externals/grill/vasp/pd-help/vasp_sqrt.pd
new file mode 100644
index 00000000..3f940f25
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_sqrt.pd
@@ -0,0 +1,38 @@
+#N canvas 47 54 800 409 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.sqrt 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 414 290 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufsqrt;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 622 327 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 362 325 pd clear_buffer;
+#X obj 77 173 vasp.update;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsqrt 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 363 170 graph;
+#X obj 77 150 vasp.osc 44100;
+#X text 184 124 generate a 1 Hz sinewave;
+#X text 71 63 vasp square root;
+#X msg 77 127 vasp bufsqrt;
+#X msg 362 303 vasp bufsqrt;
+#X obj 77 297 vasp.update;
+#X msg 77 246 vasp bufsqrt;
+#X obj 77 271 vasp.sqrt;
+#X obj 65 354 VASP-HELP;
+#X connect 5 0 3 0;
+#X connect 8 0 5 0;
+#X connect 9 0 2 0;
+#X connect 11 0 12 0;
+#X connect 12 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_ssqr.pd b/externals/grill/vasp/pd-help/vasp_ssqr.pd
new file mode 100644
index 00000000..71630451
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_ssqr.pd
@@ -0,0 +1,96 @@
+#N canvas 47 54 816 469 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.ssqr 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 416 292 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufssqr;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 622 327 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 362 325 pd clear_buffer;
+#X obj 77 173 vasp.update;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufssqr 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 363 170 graph;
+#X obj 77 150 vasp.osc 44100;
+#X text 184 124 generate a 1 Hz sinewave;
+#X msg 77 127 vasp bufssqr;
+#X msg 362 303 vasp bufssqr;
+#X text 71 63 signed sample ^ 2;
+#N canvas 4 20 834 463 listen_to_ssqr 0;
+#X obj 71 32 cnv 15 15 15 empty empty listen_to_ssqr 0 10 1 14 -262144
+-1 0;
+#X obj 391 309 dac~;
+#X obj 391 265 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 413 264 play;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 523 309 pd clear_buffer;
+#X obj 79 99 filelist \$0;
+#N canvas 92 108 394 359 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 66 50 loadbang;
+#X obj 66 178 t b f f;
+#X obj 66 98 filelisthandler \$0;
+#X msg 66 76 4;
+#X msg 66 130 read -resize \$1 bufssqr1;
+#X obj 214 228 s bufssqr1;
+#X connect 0 0 5 0;
+#X connect 3 0 9 0;
+#X connect 4 0 7 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 0 0;
+#X restore 682 310 pd inside;
+#X obj 373 112 wavedisplay-simple bufssqr1 \$0;
+#X obj 391 286 tabplay~ bufssqr1;
+#X msg 523 286 vasp bufssqr1;
+#X obj 73 283 vasp.update;
+#X obj 73 306 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 73 238 vasp.ssqr;
+#X obj 73 259 vasp.opt;
+#X msg 73 215 vasp bufssqr1;
+#X connect 2 0 8 0;
+#X connect 8 0 1 0;
+#X connect 8 0 1 1;
+#X connect 9 0 4 0;
+#X connect 10 0 11 0;
+#X connect 12 0 13 0;
+#X connect 13 0 10 0;
+#X connect 14 0 12 0;
+#X restore 75 352 pd listen_to_ssqr;
+#X text 199 352 <-- click to open;
+#X obj 77 297 vasp.update;
+#X msg 77 247 vasp bufssqr;
+#X obj 77 271 vasp.ssqr;
+#X obj 66 422 VASP-HELP;
+#X connect 5 0 3 0;
+#X connect 7 0 5 0;
+#X connect 8 0 2 0;
+#X connect 13 0 14 0;
+#X connect 14 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_ssqrt.pd b/externals/grill/vasp/pd-help/vasp_ssqrt.pd
new file mode 100644
index 00000000..c94cfd12
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_ssqrt.pd
@@ -0,0 +1,96 @@
+#N canvas 47 54 818 471 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.ssqrt 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 418 294 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufssqrt;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 622 327 pd init;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 362 325 pd clear_buffer;
+#X obj 77 173 vasp.update;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufssqrt 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 363 170 graph;
+#X obj 77 150 vasp.osc 44100;
+#X text 184 124 generate a 1 Hz sinewave;
+#X text 208 352 <-- click to open;
+#X text 71 63 signed square root;
+#X msg 77 127 vasp bufssqrt;
+#N canvas 4 20 840 469 listen_to_ssqrt 0;
+#X obj 71 32 cnv 15 15 15 empty empty listen_to_ssqrt 0 10 1 14 -262144
+-1 0;
+#X obj 391 309 dac~;
+#X obj 391 265 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 413 264 play;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 523 309 pd clear_buffer;
+#X obj 79 99 filelist \$0;
+#N canvas 96 128 398 363 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 66 50 loadbang;
+#X obj 66 178 t b f f;
+#X obj 66 98 filelisthandler \$0;
+#X msg 66 76 4;
+#X msg 66 130 read -resize \$1 bufssqrt1;
+#X obj 214 228 s bufssqrt1;
+#X connect 0 0 5 0;
+#X connect 3 0 9 0;
+#X connect 4 0 7 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 0 0;
+#X restore 682 310 pd inside;
+#X obj 391 286 tabplay~ bufssqrt1;
+#X msg 523 286 vasp bufssqrt1;
+#X obj 361 111 wavedisplay-simple bufssqrt1 \$0;
+#X obj 73 283 vasp.update;
+#X obj 73 306 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 73 259 vasp.opt;
+#X msg 73 215 vasp bufssqrt1;
+#X obj 73 238 vasp.ssqrt;
+#X connect 2 0 7 0;
+#X connect 7 0 1 0;
+#X connect 7 0 1 1;
+#X connect 8 0 4 0;
+#X connect 10 0 11 0;
+#X connect 12 0 10 0;
+#X connect 13 0 14 0;
+#X connect 14 0 12 0;
+#X restore 75 352 pd listen_to_ssqrt;
+#X msg 362 303 vasp bufssqrt;
+#X obj 77 297 vasp.update;
+#X msg 77 246 vasp bufssqrt;
+#X obj 77 271 vasp.ssqrt;
+#X obj 73 413 VASP-HELP;
+#X connect 5 0 3 0;
+#X connect 9 0 5 0;
+#X connect 11 0 2 0;
+#X connect 13 0 14 0;
+#X connect 14 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_sub.pd b/externals/grill/vasp/pd-help/vasp_sub.pd
new file mode 100644
index 00000000..2d074d31
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_sub.pd
@@ -0,0 +1,54 @@
+#N canvas 28 239 963 381 10;
+#N canvas 44 75 276 122 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 738 292 pd clear_buffer;
+#X text 376 62 optional argument/right inlet: right operand;
+#X text 376 45 subtracts a value or a vasp from a vasp;
+#X text 62 62 optional argument/right inlet: right operand;
+#X text 62 45 adds a value or a vasp to a vasp;
+#X obj 62 19 cnv 15 15 15 empty empty vasp.+ 0 10 1 14 -262144 -1 0
+;
+#X obj 378 20 cnv 15 15 15 empty empty vasp.- 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 450 300 graph167 0;
+#X array bufsub 88200 float 0;
+#X coords 0 1 88199 -1 300 120 1;
+#X restore 629 93 graph;
+#X text 139 190 shift all values + 0.5;
+#X text 141 167 half the amplitude;
+#X obj 65 212 vasp.update;
+#X obj 65 189 vasp.+ 0.5;
+#X obj 65 144 vasp.osc 44100;
+#X obj 65 166 vasp.* 0.5;
+#X text 169 145 generate a 1Hz sine wave;
+#X msg 65 112 vasp bufsub;
+#X msg 738 271 vasp bufsub;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufsub;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 881 291 pd init;
+#X text 455 189 shift all values - 0.5;
+#X obj 380 212 vasp.update;
+#X obj 380 189 vasp.- 0.5;
+#X obj 380 144 vasp.osc 44100;
+#X obj 380 166 vasp.* 0.5;
+#X msg 380 112 vasp bufsub;
+#X obj 61 313 VASP-HELP;
+#X connect 11 0 10 0;
+#X connect 12 0 13 0;
+#X connect 13 0 11 0;
+#X connect 15 0 12 0;
+#X connect 16 0 0 0;
+#X connect 20 0 19 0;
+#X connect 21 0 22 0;
+#X connect 22 0 20 0;
+#X connect 23 0 21 0;
diff --git a/externals/grill/vasp/pd-help/vasp_subr.pd b/externals/grill/vasp/pd-help/vasp_subr.pd
new file mode 100644
index 00000000..42a6c5c1
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_subr.pd
@@ -0,0 +1,48 @@
+#N canvas 193 184 770 390 10;
+#N canvas 40 55 247 122 clear_buffer 0;
+#X obj 45 79 vasp.update;
+#X obj 45 56 vasp.= 0;
+#X obj 45 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 514 282 pd clear_buffer;
+#X text 49 91 optional argument/right inlet: right operand;
+#X text 49 76 subtracts a value or a vasp from a vasp;
+#X text 49 60 reverse subtraction;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufsubr 88200 float 0;
+#X coords 0 1 88199 -1 300 120 1;
+#X restore 370 102 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufsubr;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 647 283 pd init;
+#X msg 514 262 vasp bufsubr;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.!- 0 10 1 14 -262144 -1
+0;
+#X obj 52 236 vasp.update;
+#X msg 52 136 vasp bufsubr;
+#X obj 50 321 VASP-HELP;
+#X obj 52 168 vasp.osc 4410;
+#X obj 182 135 nbx 5 14 -50 50 0 1 empty empty empty 0 -6 0 10 -24198
+-1 -1 0 256;
+#X obj 182 154 * 0.01;
+#X obj 182 193 t b f;
+#X obj 52 213 vasp.!-;
+#X floatatom 182 175 5 0 0;
+#X obj 52 191 vasp.* 0.5;
+#X connect 6 0 0 0;
+#X connect 9 0 11 0;
+#X connect 11 0 17 0;
+#X connect 12 0 13 0;
+#X connect 13 0 16 0;
+#X connect 14 0 9 0;
+#X connect 14 1 15 1;
+#X connect 15 0 8 0;
+#X connect 16 0 14 0;
+#X connect 17 0 15 0;
diff --git a/externals/grill/vasp/pd-help/vasp_sync.pd b/externals/grill/vasp/pd-help/vasp_sync.pd
new file mode 100644
index 00000000..1da5d849
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_sync.pd
@@ -0,0 +1,81 @@
+#N canvas 95 103 854 570 10;
+#N canvas 92 108 403 405 inside 0;
+#X obj 87 206 soundfiler;
+#X obj 105 290 s \$0-sample-length;
+#X obj 87 260 s \$0-draw_display;
+#X msg 235 258 resize \$1;
+#X obj 235 211 loadbang;
+#X obj 235 280 s bufsync1;
+#X obj 245 304 s bufsync2;
+#X msg 235 232 88200;
+#X msg 87 184 read -resize \$1 bufsync1;
+#X obj 87 230 t b f f;
+#X obj 87 112 loadbang;
+#X obj 87 160 filelisthandler \$0;
+#X msg 87 138 3;
+#X connect 0 0 9 0;
+#X connect 3 0 5 0;
+#X connect 3 0 6 0;
+#X connect 4 0 7 0;
+#X connect 7 0 3 0;
+#X connect 7 0 1 0;
+#X connect 8 0 0 0;
+#X connect 9 0 2 0;
+#X connect 9 1 1 0;
+#X connect 9 2 3 0;
+#X connect 10 0 12 0;
+#X connect 11 0 8 0;
+#X connect 12 0 11 0;
+#X restore 711 485 pd inside;
+#X obj 463 297 wavedisplay-simple bufsync2 \$0;
+#X obj 463 155 wavedisplay-simple bufsync1 \$0;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.sync 0 10 1 14 -262144 -1
+0;
+#X text 53 64 syncs two or more vasps;
+#X msg 61 253 vasp bufsync1 bufsync2;
+#X obj 61 284 vasp.cfft;
+#X obj 122 335 vasp.= 0;
+#X obj 334 440 tabplay~ bufsync1;
+#X obj 353 460 tabplay~ bufsync2;
+#X obj 334 484 dac~;
+#X obj 61 409 vasp.update;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 149 483 pd clear_buffers;
+#X obj 61 431 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 122 313 vasp.upper;
+#X obj 61 388 vasp.c!fft;
+#X msg 149 457 vasp bufsync1 bufsync2;
+#X text 709 137 bufsync1;
+#X text 713 281 bufsync2;
+#X obj 61 366 vasp.sync 2;
+#X text 54 79 vasp.sync waits until all inlets have received a vasp
+and then outputs them and resets its status;
+#X text 143 365 outputs vasps after every inlet received one;
+#X obj 60 156 filelist \$0;
+#X obj 334 416 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 356 413 play;
+#X text 55 111 argument: number of vasps to be synced (default 2);
+#X obj 48 525 VASP-HELP;
+#X connect 5 0 6 0;
+#X connect 6 0 14 0;
+#X connect 6 0 19 0;
+#X connect 7 0 19 1;
+#X connect 8 0 10 0;
+#X connect 9 0 10 1;
+#X connect 11 0 13 0;
+#X connect 14 0 7 0;
+#X connect 15 0 11 0;
+#X connect 16 0 12 0;
+#X connect 19 0 15 0;
+#X connect 23 0 9 0;
+#X connect 23 0 8 0;
diff --git a/externals/grill/vasp/pd-help/vasp_tilt.pd b/externals/grill/vasp/pd-help/vasp_tilt.pd
new file mode 100644
index 00000000..eb80e3b3
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_tilt.pd
@@ -0,0 +1,100 @@
+#N canvas 21 60 945 604 10;
+#X obj 55 36 cnv 15 15 15 empty empty vasp.tilt 0 10 1 14 -262144 -1
+0;
+#N canvas 0 0 261 214 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 672 527 pd clear_buffer;
+#X obj 51 533 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array buftilt1 100 float 1;
+#A 0 0.32 0.32 0.74 0.2 -0.0400002 -0.24 -0.48 -0.0400002 0.2 0.36
+0.0199998 -0.1 -0.18 -0.24 -0.2 -0.0800002 -0.0600002 0.14 -0.0400002
+-0.2 0.0399998 0.0399998 0.0399998 0.0599998 0.0799999 0.0899999 0.0999999
+0.14 0.18 0.24 0.28 0.32 0.38 0.42 0.48 0.5 0.5 0.44 0.36 0.2 0.0599998
+-0.0600002 -0.2 -0.34 -0.44 -0.44 -0.46 -0.4 -0.34 -0.24 -0.12 -0.1
+-0.2 -0.28 -0.36 -0.44 -0.48 -0.48 -0.48 -0.48 -0.46 -0.44 -0.52 -0.52
+-0.48 -0.4 0.46 0.46 0.46 0.46 0.46 0.44 0.34 0.2 0.0999999 -1.3411e-007
+-0.0800002 -0.12 -0.13 -0.14 -0.16 -0.14 -0.0600002 0.56 0.58 0.6 0.6
+0.52 0.44 0.36 0.26 -0.72 0.22 0.68 0.74 0.76 0.66 0.66 0.76 0.82;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 561 61 graph;
+#N canvas 0 0 433 215 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol buftilt1 \, symbol buftilt2;
+#X obj 295 27 loadbang;
+#X obj 295 71 s \$0-ratio;
+#X msg 295 49 1.5;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X connect 3 0 5 0;
+#X connect 5 0 4 0;
+#X restore 811 524 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array buftilt2 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 564 202 graph;
+#X text 501 55 SOURCE;
+#X obj 394 358 pack;
+#X obj 394 332 t b f;
+#X text 331 285 ratio;
+#X text 197 422 needs one or two args;
+#X text 198 439 ratio \, center;
+#X text 231 284 edge;
+#X text 243 168 none;
+#X text 244 195 linear;
+#X text 231 261 zero (default);
+#X text 243 220 4 point (default);
+#X text 243 141 in place (dirty);
+#X obj 127 447 vasp.u;
+#X obj 127 421 vasp.tilt;
+#X obj 394 309 nbx 5 14 -1000 1000 0 1 empty empty empty 0 -6 0 10
+-24198 -1 -1 54 256;
+#X obj 331 309 nbx 5 14 -3 3 0 0 empty \$0-ratio empty 0 -6 576 10
+-24198 -1 -1 1.5 256;
+#X text 394 285 center sample;
+#X msg 181 262 fill 0;
+#X msg 181 288 fill 1;
+#X msg 183 142 inter 0;
+#X msg 183 168 inter 1;
+#X msg 183 194 inter 2;
+#X msg 183 220 inter 3;
+#X obj 36 160 bng 15 250 50 0 empty \$0-trigger empty 0 -6 576 8 -262144
+-1 -1;
+#X obj 394 399 bng 15 250 50 0 \$0-trigger empty empty 0 -6 1152 8
+-262144 -1 -1;
+#X msg 36 179 vasp buftilt1;
+#X obj 36 205 vasp.-> buftilt2;
+#X msg 672 501 vasp buftilt2;
+#X text 55 86 optional argument/right inlet: list of ratio and center
+sample;
+#X obj 160 493 vasp.xtilt;
+#X text 56 492 related object:;
+#X text 55 63 resample buffer data around a center sample;
+#X obj 394 379 t b l;
+#X connect 7 0 38 0;
+#X connect 8 0 7 0;
+#X connect 8 1 7 1;
+#X connect 19 0 18 0;
+#X connect 20 0 8 0;
+#X connect 21 0 7 0;
+#X connect 23 0 19 0;
+#X connect 24 0 19 0;
+#X connect 25 0 19 0;
+#X connect 26 0 19 0;
+#X connect 27 0 19 0;
+#X connect 28 0 19 0;
+#X connect 29 0 31 0;
+#X connect 31 0 32 0;
+#X connect 32 1 19 0;
+#X connect 33 0 1 0;
+#X connect 38 0 30 0;
+#X connect 38 1 19 1;
diff --git a/externals/grill/vasp/pd-help/vasp_update.pd b/externals/grill/vasp/pd-help/vasp_update.pd
new file mode 100644
index 00000000..ce47a313
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_update.pd
@@ -0,0 +1,36 @@
+#N canvas 213 175 703 499 10;
+#X msg 62 292 vasp bufup;
+#X obj 62 313 vasp.= 0;
+#X text 145 226 update the graphics;
+#X text 136 125 generate a sine wave;
+#X obj 62 185 vasp.osc 22050;
+#X obj 58 41 cnv 15 15 15 empty empty vasp.update 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufup 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 347 141 graph;
+#N canvas 0 0 396 272 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufup;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 607 383 pd init;
+#X obj 62 227 vasp.update;
+#X msg 62 125 vasp bufup;
+#X obj 62 374 vasp.u;
+#X msg 62 351 vasp bufup;
+#X obj 57 424 VASP-HELP;
+#X text 58 92 use vasp.update at the end of a chain of vasp operations
+;
+#X text 57 69 updates the graphic display of the array;
+#X text 145 291 set the buffer to zero;
+#X text 147 345 and display the changes;
+#X text 114 374 (abbreviation);
+#X connect 0 0 1 0;
+#X connect 4 0 8 0;
+#X connect 9 0 4 0;
+#X connect 11 0 10 0;
diff --git a/externals/grill/vasp/pd-help/vasp_v.pd b/externals/grill/vasp/pd-help/vasp_v.pd
new file mode 100644
index 00000000..6f5e1452
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_v.pd
@@ -0,0 +1,50 @@
+#N canvas 44 85 957 492 10;
+#X obj 58 31 cnv 15 15 15 empty empty vasp 0 10 1 14 -262144 -1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufvasp1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 594 161 graph;
+#N canvas 0 0 396 220 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufvasp1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 818 420 pd init;
+#X obj 57 375 vasp.update;
+#X obj 57 354 vasp.noise;
+#X text 57 66 stores and outputs a vasp;
+#X obj 58 231 vasp.update;
+#X obj 58 205 vasp.= 0.35;
+#X obj 58 174 vasp 50000 bufvasp1 10000;
+#X obj 57 332 vasp;
+#X msg 101 287 set vasp 2000 bufvasp1 66666;
+#X msg 125 310 vasp 2000 bufvasp1 11111;
+#X text 58 83 syntax: vasp [length] [name] [offset] [channel] \, etc.
+;
+#X obj 58 146 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X obj 57 286 bng 15 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
+-1;
+#X text 231 169 output vasp referencing a buffer region;
+#X text 231 183 with length of 50000 and starting at frame 10000;
+#X text 231 208 set region to value 0.35;
+#X text 230 232 update graphics;
+#X text 231 149 <-- click to start command chain;
+#X text 292 287 1 use "set" to define region non triggering \, then
+bang;
+#X text 291 307 2 right inlet: alternatively to set message;
+#X text 230 362 bang triggers output of predefined vasp;
+#X text 56 101 (see syntax description of vasp message in VASP-HELP)
+;
+#X obj 59 429 VASP-HELP;
+#X connect 4 0 3 0;
+#X connect 7 0 6 0;
+#X connect 8 0 7 0;
+#X connect 9 0 4 0;
+#X connect 10 0 9 0;
+#X connect 11 0 9 1;
+#X connect 13 0 8 0;
+#X connect 14 0 9 0;
diff --git a/externals/grill/vasp/pd-help/vasp_valleys.pd b/externals/grill/vasp/pd-help/vasp_valleys.pd
new file mode 100644
index 00000000..f2a11fab
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_valleys.pd
@@ -0,0 +1,86 @@
+#N canvas 36 36 847 582 10;
+#X obj 71 32 cnv 15 15 15 empty empty vasp.valleys 0 10 1 14 -262144
+-1 0;
+#X obj 71 131 filelist \$0;
+#N canvas 92 108 424 389 inside 0;
+#X obj 66 169 soundfiler;
+#X obj 84 253 s \$0-sample-length;
+#X obj 66 223 s \$0-draw_display;
+#X msg 214 221 resize \$1;
+#X obj 66 47 loadbang;
+#X obj 66 193 t b f f;
+#X obj 66 113 filelisthandler \$0;
+#X msg 66 91 2;
+#X obj 66 69 t b b;
+#X msg 99 91 88200;
+#X msg 66 145 read \$1 bufvalleys1;
+#X obj 214 243 s bufvalleys1;
+#X obj 225 264 s bufvalleys2;
+#X connect 0 0 5 0;
+#X connect 3 0 11 0;
+#X connect 3 0 12 0;
+#X connect 4 0 8 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 10 0;
+#X connect 7 0 6 0;
+#X connect 8 0 7 0;
+#X connect 8 1 9 0;
+#X connect 9 0 5 0;
+#X connect 10 0 0 0;
+#X restore 668 495 pd inside;
+#N canvas 40 55 281 170 clear_buffers 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 485 495 pd clear_buffers;
+#X obj 60 292 vasp.update;
+#X obj 58 433 vasp.update;
+#X obj 58 453 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 60 312 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 337 495 dac~;
+#X obj 337 457 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 358 455 play;
+#X text 69 52 find the local minima of a buffer content;
+#X text 70 66 argument/right inlet: density value 0-1;
+#X obj 446 118 wavedisplay-simple bufvalleys1 \$0;
+#X obj 60 252 vasp.= bufvalleys1;
+#X text 183 231 copy to new buffer \, find valleys;
+#X msg 60 232 vasp bufvalleys2;
+#X floatatom 163 312 12 0 0;
+#X obj 60 272 vasp.valleys 0.001;
+#X obj 163 333 * 88200;
+#X obj 337 475 tabplay~ bufvalleys1;
+#X floatatom 163 355 5 0 0;
+#X obj 447 272 wavedisplay-simple bufvalleys2 \$0;
+#X obj 58 412 vasp.opt;
+#X msg 58 391 vasp bufvalleys2;
+#X msg 485 475 vasp bufvalleys1 bufvalleys2;
+#X text 718 100 source;
+#X text 712 253 valleys;
+#X text 69 81 outlet: current density value;
+#X text 185 389 optimize the buffer content;
+#X obj 44 530 VASP-HELP;
+#X connect 4 0 7 0;
+#X connect 5 0 6 0;
+#X connect 9 0 20 0;
+#X connect 14 0 18 0;
+#X connect 16 0 14 0;
+#X connect 17 0 19 0;
+#X connect 18 0 4 0;
+#X connect 18 1 17 0;
+#X connect 19 0 21 0;
+#X connect 20 0 8 0;
+#X connect 20 0 8 1;
+#X connect 23 0 5 0;
+#X connect 24 0 23 0;
+#X connect 25 0 3 0;
diff --git a/externals/grill/vasp/pd-help/vasp_vector.pd b/externals/grill/vasp/pd-help/vasp_vector.pd
new file mode 100644
index 00000000..9a669067
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_vector.pd
@@ -0,0 +1,31 @@
+#N canvas 300 150 599 451 10;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.n 0 10 1 14 -262144 -1 0
+;
+#X text 53 55 get a vector of a vasp;
+#X text 53 79 argument/right inlet: index of vector;
+#X obj 58 193 prepend set;
+#X obj 175 166 vasp.n 1;
+#X obj 175 193 prepend set;
+#X obj 54 356 VASP-HELP;
+#X text 445 161 index starts at 0;
+#X obj 315 313 table bufn1;
+#X obj 315 335 table bufn2;
+#X obj 315 357 table bufn3;
+#X msg 58 121 vasp bufn1 bufn2 bufn3;
+#X obj 58 166 vasp.n 0;
+#X obj 300 193 prepend set;
+#X msg 300 219;
+#X msg 175 219;
+#X msg 58 220;
+#X obj 300 166 vasp.n 2;
+#X obj 154 308 vasp.n;
+#X text 58 310 abbreviation:;
+#X connect 3 0 16 0;
+#X connect 4 0 5 0;
+#X connect 5 0 15 0;
+#X connect 11 0 4 0;
+#X connect 11 0 12 0;
+#X connect 11 0 17 0;
+#X connect 12 0 3 0;
+#X connect 13 0 14 0;
+#X connect 17 0 13 0;
diff --git a/externals/grill/vasp/pd-help/vasp_vectors.pd b/externals/grill/vasp/pd-help/vasp_vectors.pd
new file mode 100644
index 00000000..e93cbbb0
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_vectors.pd
@@ -0,0 +1,13 @@
+#N canvas 257 69 509 282 10;
+#X text 52 66 get the number of vectors of a vasp;
+#X obj 51 19 cnv 15 15 15 empty empty vasp.n? 0 10 1 14 -262144 -1
+0;
+#X obj 57 169 cnv 15 44 17 empty empty empty 20 12 0 14 -258699 -66577
+0;
+#X floatatom 57 218 0 0 0;
+#X msg 57 112 vasp bufn?1;
+#X msg 137 112 vasp bufn?1 bufn?2 bufn?3;
+#X obj 57 169 vasp.n?;
+#X connect 4 0 6 0;
+#X connect 5 0 6 0;
+#X connect 6 0 3 0;
diff --git a/externals/grill/vasp/pd-help/vasp_window.pd b/externals/grill/vasp/pd-help/vasp_window.pd
new file mode 100644
index 00000000..eefd92cf
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_window.pd
@@ -0,0 +1,62 @@
+#N canvas 44 117 891 565 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.window 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufwindow 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 404 280 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufwindow;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 771 320 pd init;
+#N canvas 0 0 194 221 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 569 325 pd clear_buffers;
+#X text 173 149 generate a function;
+#X obj 63 495 VASP-HELP;
+#X msg 569 301 vasp bufwindow;
+#X msg 61 149 vasp bufwindow;
+#X obj 61 278 vasp.u;
+#X floatatom 194 186 5 0 0;
+#X text 259 185 0..4;
+#X msg 231 215 lin;
+#X msg 231 240 sin;
+#X msg 231 265 hanning;
+#X msg 231 290 hamming;
+#X msg 231 315 blackman;
+#X text 275 214 0;
+#X text 275 236 1;
+#X text 295 260 2;
+#X text 300 289 3;
+#X text 300 316 4;
+#X obj 132 426 vasp.*window;
+#X obj 225 401 vasp.!window;
+#X text 60 396 see also:;
+#X obj 322 426 vasp.*xwindow;
+#X obj 225 426 vasp.*!window;
+#X obj 61 226 vasp.window lin;
+#X text 60 80 generate window functions;
+#X obj 322 401 vasp.xwindow;
+#X text 60 104 argument/right inlet: name or number of name (def linear)
+;
+#X connect 6 0 3 0;
+#X connect 7 0 26 0;
+#X connect 9 0 26 1;
+#X connect 11 0 26 1;
+#X connect 12 0 26 1;
+#X connect 13 0 26 1;
+#X connect 14 0 26 1;
+#X connect 15 0 26 1;
+#X connect 26 0 8 0;
diff --git a/externals/grill/vasp/pd-help/vasp_xmirr.pd b/externals/grill/vasp/pd-help/vasp_xmirr.pd
new file mode 100644
index 00000000..863ecfaa
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_xmirr.pd
@@ -0,0 +1,86 @@
+#N canvas 48 7 827 616 10;
+#N canvas 92 108 411 413 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 67 53 loadbang;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 133 read -resize \$1 bufxmirr1;
+#X obj 214 228 s bufxmirr1;
+#X obj 224 252 s bufxmirr2;
+#X msg 67 79 4;
+#X connect 0 0 5 0;
+#X connect 3 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 10 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 0 0;
+#X connect 10 0 6 0;
+#X restore 643 547 pd inside;
+#X obj 79 100 filelist \$0;
+#X obj 69 234 vasp.cfft;
+#X obj 327 546 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 461 546 pd clear_buffers;
+#X obj 327 503 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 349 500 play;
+#X text 461 501 clear;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.xmirr 0 10 1 14 -262144
+-1 0;
+#X text 75 52 mirrors a vasp symmetrical;
+#X obj 472 303 wavedisplay-simple bufxmirr2 \$0;
+#X obj 472 150 wavedisplay-simple bufxmirr1 \$0;
+#X msg 69 213 vasp bufxmirr1 bufxmirr2;
+#X obj 69 298 vasp.update;
+#X obj 69 319 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 69 277 vasp.= 0;
+#X obj 69 256 vasp.upper;
+#X msg 461 523 vasp bufxmirr1 bufxmirr2;
+#X obj 69 484 vasp.update;
+#X obj 69 507 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 69 440 vasp bufxmirr1 bufxmirr2;
+#X obj 69 461 vasp.cfft;
+#X obj 327 523 tabplay~ bufxmirr1;
+#X obj 69 393 vasp.update;
+#X obj 69 414 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 69 351 vasp bufxmirr1 bufxmirr2;
+#X obj 69 372 vasp.xmirr;
+#X obj 57 574 VASP-HELP;
+#X text 332 88 revert the frequency spectrum;
+#X text 332 103 of the example sound;
+#X text 249 226 and clear upper part;
+#X text 247 351 2 revert spectrum;
+#X text 245 440 3 inverse fourier transform;
+#X text 248 209 1 fourier transform;
+#X connect 2 0 16 0;
+#X connect 5 0 22 0;
+#X connect 12 0 2 0;
+#X connect 13 0 14 0;
+#X connect 15 0 13 0;
+#X connect 16 0 15 0;
+#X connect 17 0 4 0;
+#X connect 18 0 19 0;
+#X connect 20 0 21 0;
+#X connect 21 0 18 0;
+#X connect 22 0 3 0;
+#X connect 22 0 3 1;
+#X connect 23 0 24 0;
+#X connect 25 0 26 0;
+#X connect 26 0 23 0;
diff --git a/externals/grill/vasp/pd-help/vasp_xrot.pd b/externals/grill/vasp/pd-help/vasp_xrot.pd
new file mode 100644
index 00000000..95b0ed02
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_xrot.pd
@@ -0,0 +1,48 @@
+#N canvas 24 75 779 480 10;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.xrot 0 10 1 14 -262144 -1
+0;
+#X text 445 307 clear;
+#N canvas 0 0 413 295 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 445 352 pd clear_buffer;
+#X text 72 73 optional argument/right inlet: value;
+#X text 71 60 rotate buffer content;
+#X msg 445 329 vasp bufxrot;
+#X obj 68 333 vasp.update;
+#X floatatom 129 281 0 0 0;
+#X msg 68 257 vasp bufxrot;
+#X obj 56 436 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufxrot 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 436 125 graph;
+#N canvas 488 326 314 207 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufxrot;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 683 355 pd init;
+#X obj 69 195 vasp.u;
+#X obj 69 172 vasp.= env 1 0 -1 10 0 50 -1 90 1 99;
+#X msg 69 150 vasp bufxrot;
+#X text 197 148 1 create envelope;
+#X obj 68 305 vasp.xrot 6;
+#X text 197 251 2 rotate symmetrically;
+#X text 54 387 related objects:;
+#X obj 179 388 vasp.xshift;
+#X obj 259 388 vasp.rot;
+#X connect 5 0 2 0;
+#X connect 7 0 16 1;
+#X connect 8 0 16 0;
+#X connect 13 0 12 0;
+#X connect 14 0 13 0;
+#X connect 16 0 6 0;
diff --git a/externals/grill/vasp/pd-help/vasp_xshift.pd b/externals/grill/vasp/pd-help/vasp_xshift.pd
new file mode 100644
index 00000000..121e43d2
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_xshift.pd
@@ -0,0 +1,57 @@
+#N canvas 24 75 858 509 10;
+#X obj 75 32 cnv 15 15 15 empty empty vasp.xshift 0 10 1 14 -262144
+-1 0;
+#X text 463 343 clear;
+#N canvas 0 0 413 295 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 463 388 pd clear_buffer;
+#X text 72 73 optional argument/right inlet: value;
+#X msg 463 365 vasp bufxshift;
+#X text 71 60 shifts buffer content symmetrically;
+#X obj 68 333 vasp.update;
+#X floatatom 141 279 0 0 0;
+#X msg 68 236 vasp bufxshift;
+#X obj 59 429 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufxshift 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 436 125 graph;
+#N canvas 488 326 312 205 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X msg 33 45 symbol bufxshift;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 683 355 pd init;
+#X obj 68 305 vasp.xshift 9;
+#X obj 69 195 vasp.u;
+#X msg 69 150 vasp bufxshift;
+#X obj 69 172 vasp.= env 1 0 -1 10 0 50 -1 90 1 99;
+#X text 197 148 1 create envelope;
+#X text 196 230 2 shift symmetrically;
+#X obj 262 403 vasp.xrot;
+#X text 57 402 related objects:;
+#X obj 182 403 vasp.xshift;
+#X msg 225 278 fill 0;
+#X msg 225 298 fill 1;
+#X msg 225 318 fill 2;
+#X text 271 278 no filling;
+#X text 270 318 fill with edge-value;
+#X text 271 298 zero filling (default);
+#X connect 4 0 2 0;
+#X connect 7 0 12 1;
+#X connect 8 0 12 0;
+#X connect 12 0 6 0;
+#X connect 14 0 15 0;
+#X connect 15 0 13 0;
+#X connect 21 0 12 0;
+#X connect 22 0 12 0;
+#X connect 23 0 12 0;
diff --git a/externals/grill/vasp/pd-help/vasp_xtilt.pd b/externals/grill/vasp/pd-help/vasp_xtilt.pd
new file mode 100644
index 00000000..c42c69e1
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_xtilt.pd
@@ -0,0 +1,107 @@
+#N canvas 21 60 881 576 10;
+#X obj 55 36 cnv 15 15 15 empty empty vasp.xtilt 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 261 214 clear_buffer 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 575 494 pd clear_buffer;
+#X text 177 472 <-- click to open more examples;
+#X obj 51 533 VASP-HELP;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufxtilt1 100 float 1;
+#A 0 1 -0.113512 0.171341 0.733251 -0.444804 0.13461 0.0181519 0.0751111
+-0.291489 -0.0661841 0.0808672 0.10525 -0.0372648 0.00712331 0.0321534
+0.00104712 -0.0797996 -0.0100332 0.038871 -0.00962814 -0.00245443 -0.0208043
+0.0418052 -0.0442626 -0.010092 -0.000713352 0.0310329 -0.0158379 -0.0325648
+0.0180381 -0.0174225 -0.0255639 -0.0137052 0.0219752 -0.00454053 -0.0387019
+-0.00129492 -0.00332361 -6.52102e-005 -0.0333087 0.00495665 0.00179575
+-0.0311061 -0.0221767 -0.00117427 0.000104884 -0.033587 -0.00918416
+0.00931789 -0.0172503 -0.0146257 0.0200174 0.00741167 -9.19656e-005
+-0.0248526 0.0180017 0.0184785 -0.000738001 0.00187258 0.0148586 0.0289194
+-0.0124819 0.000630443 0.0266685 0.0156491 0.0058523 0.0141721 0.0336186
+-0.00179237 -0.00582341 0.0232202 0.0428296 0.0249123 -0.00400539 0.0269429
+0.0367591 0.000278026 0.0241991 0.039058 0.0259654 -0.015077 0.0321762
+0.0799587 -0.035893 0.038519 0.024746 0.189796 -0.054207 -0.0128485
+-0.0301806 0.0762237 0.106943 0.0307454 0.226911 -0.221356 0.172835
+0.0519878 0.4068 -0.293863 -0.035514;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 481 75 graph;
+#N canvas 0 0 435 217 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 1 10 \; \$1 xlabel 1.1 0 20 40 60 80 100
+\; \$1 yticks 0 0.25 2 \; \$1 ylabel 105 -1 -0.5 0 0.5 1;
+#X obj 295 27 loadbang;
+#X obj 295 71 s \$0-ratio;
+#X msg 33 45 symbol bufxtilt1 \, symbol bufxtilt2;
+#X msg 295 49 1.5;
+#X connect 0 0 4 0;
+#X connect 2 0 5 0;
+#X connect 4 0 1 0;
+#X connect 5 0 3 0;
+#X restore 712 492 pd init;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufxtilt2 100 float 0;
+#X coords 0 1 99 -1 300 100 1;
+#X restore 483 205 graph;
+#X text 420 58 SOURCE;
+#X obj 344 357 pack;
+#X obj 344 331 t b f;
+#X text 281 284 ratio;
+#X text 201 404 needs one or two args;
+#X text 201 427 ratio \, center;
+#X text 236 264 edge;
+#X text 243 144 none;
+#X text 243 173 linear;
+#X text 236 241 zero (default);
+#X text 242 199 4 point (default);
+#X text 243 121 in place (dirty);
+#X obj 128 435 vasp.u;
+#X obj 344 308 nbx 5 14 -1000 1000 0 0 empty empty empty 0 -6 0 10
+-24198 -1 -1 0 256;
+#X obj 281 308 nbx 5 14 -3 3 0 0 empty \$0-ratio empty 0 -6 576 10
+-24198 -1 -1 1.5 256;
+#X text 344 284 center sample;
+#X msg 181 242 fill 0;
+#X msg 181 268 fill 1;
+#X msg 183 122 inter 0;
+#X msg 183 148 inter 1;
+#X msg 183 174 inter 2;
+#X msg 183 200 inter 3;
+#X obj 36 135 bng 15 250 50 0 empty \$0-trigger empty 0 -6 576 8 -262144
+-1 -1;
+#X obj 344 401 bng 15 250 50 0 \$0-trigger empty empty 0 -6 1152 8
+-262144 -1 -1;
+#X text 55 82 optional argument/right inlet: list of ratio and center
+sample;
+#X obj 53 473 xtilt_example;
+#X text 575 444 clear;
+#X msg 575 468 vasp bufxtilt2;
+#X text 55 59 resample buffer data symmetrically;
+#X msg 36 159 vasp bufxtilt1;
+#X obj 36 185 vasp.-> bufxtilt2;
+#X obj 128 409 vasp.xtilt;
+#X obj 344 379 t b l;
+#X connect 8 0 39 0;
+#X connect 9 0 8 0;
+#X connect 9 1 8 1;
+#X connect 20 0 9 0;
+#X connect 21 0 8 0;
+#X connect 23 0 38 0;
+#X connect 24 0 38 0;
+#X connect 25 0 38 0;
+#X connect 26 0 38 0;
+#X connect 27 0 38 0;
+#X connect 28 0 38 0;
+#X connect 29 0 36 0;
+#X connect 34 0 1 0;
+#X connect 36 0 37 0;
+#X connect 37 1 38 0;
+#X connect 38 0 19 0;
+#X connect 39 0 30 0;
+#X connect 39 1 38 1;
diff --git a/externals/grill/vasp/pd-help/vasp_xwindow.pd b/externals/grill/vasp/pd-help/vasp_xwindow.pd
new file mode 100644
index 00000000..7d6e4179
--- /dev/null
+++ b/externals/grill/vasp/pd-help/vasp_xwindow.pd
@@ -0,0 +1,61 @@
+#N canvas 58 39 897 607 10;
+#X obj 62 41 cnv 15 15 15 empty empty vasp.xwindow 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array bufxwindow 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 512 119 graph;
+#N canvas 0 0 406 282 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol bufxwindow;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 771 320 pd init;
+#N canvas 0 0 194 221 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 569 326 pd clear_buffers;
+#X text 173 148 generate a function;
+#X obj 60 503 VASP-HELP;
+#X msg 61 149 vasp bufxwindow;
+#X msg 569 301 vasp bufxwindow;
+#X obj 61 278 vasp.u;
+#X floatatom 194 186 5 0 0;
+#X text 259 185 0..4;
+#X msg 231 215 lin;
+#X msg 231 240 sin;
+#X msg 231 265 hanning;
+#X msg 231 290 hamming;
+#X msg 231 315 blackman;
+#X text 275 214 0;
+#X text 275 236 1;
+#X text 295 260 2;
+#X text 300 289 3;
+#X text 300 316 4;
+#X obj 61 226 vasp.xwindow lin;
+#X obj 132 401 vasp.window;
+#X obj 132 426 vasp.*window;
+#X obj 225 401 vasp.!window;
+#X text 60 396 see also:;
+#X obj 322 426 vasp.*xwindow;
+#X obj 225 426 vasp.*!window;
+#X text 60 104 argument/right inlet: name or number of name;
+#X text 60 80 generate window functions;
+#X connect 6 0 21 0;
+#X connect 7 0 3 0;
+#X connect 9 0 21 1;
+#X connect 11 0 21 1;
+#X connect 12 0 21 1;
+#X connect 13 0 21 1;
+#X connect 14 0 21 1;
+#X connect 15 0 21 1;
+#X connect 21 0 8 0;
diff --git a/externals/grill/vasp/pd/VASP-HELP.pd b/externals/grill/vasp/pd/VASP-HELP.pd
new file mode 100644
index 00000000..f60f4199
--- /dev/null
+++ b/externals/grill/vasp/pd/VASP-HELP.pd
@@ -0,0 +1,1155 @@
+#N canvas 193 23 624 685 10;
+#X obj 104 47 cnv 15 15 15 empty empty vasp_modular 0 10 1 14 -262144
+-1 0;
+#X obj 61 37 cnv 2 2 2 empty 2-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 37 cnv 2 2 2 empty 2-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 37 cnv 2 2 2 empty 2-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 37 cnv 2 2 2 empty 2-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 37 cnv 2 2 2 empty 2-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 37 cnv 2 2 2 empty 2-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 37 cnv 2 2 2 empty 2-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 37 cnv 2 2 2 empty 2-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 37 cnv 2 2 2 empty 2-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 37 cnv 2 2 2 empty 2-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 37 cnv 2 2 2 empty 2-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 37 cnv 2 2 2 empty 2-12-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 85 37 cnv 2 2 2 empty 2-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 37 cnv 2 2 2 empty 2-14-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 89 37 cnv 2 2 2 empty 2-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 39 cnv 2 2 2 empty 3-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 39 cnv 2 2 2 empty 3-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 39 cnv 2 2 2 empty 3-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 39 cnv 2 2 2 empty 3-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 39 cnv 2 2 2 empty 3-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 39 cnv 2 2 2 empty 3-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 39 cnv 2 2 2 empty 3-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 39 cnv 2 2 2 empty 3-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 39 cnv 2 2 2 empty 3-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 39 cnv 2 2 2 empty 3-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 39 cnv 2 2 2 empty 3-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 39 cnv 2 2 2 empty 3-12-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 85 39 cnv 2 2 2 empty 3-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 39 cnv 2 2 2 empty 3-14-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 89 39 cnv 2 2 2 empty 3-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 41 cnv 2 2 2 empty 4-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 41 cnv 2 2 2 empty 4-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 41 cnv 2 2 2 empty 4-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 41 cnv 2 2 2 empty 4-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 41 cnv 2 2 2 empty 4-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 41 cnv 2 2 2 empty 4-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 41 cnv 2 2 2 empty 4-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 41 cnv 2 2 2 empty 4-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 41 cnv 2 2 2 empty 4-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 41 cnv 2 2 2 empty 4-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 41 cnv 2 2 2 empty 4-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 41 cnv 2 2 2 empty 4-12-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 85 41 cnv 2 2 2 empty 4-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 41 cnv 2 2 2 empty 4-14-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 89 41 cnv 2 2 2 empty 4-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 43 cnv 2 2 2 empty 5-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 43 cnv 2 2 2 empty 5-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 43 cnv 2 2 2 empty 5-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 43 cnv 2 2 2 empty 5-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 43 cnv 2 2 2 empty 5-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 43 cnv 2 2 2 empty 5-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 43 cnv 2 2 2 empty 5-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 43 cnv 2 2 2 empty 5-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 43 cnv 2 2 2 empty 5-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 43 cnv 2 2 2 empty 5-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 43 cnv 2 2 2 empty 5-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 43 cnv 2 2 2 empty 5-12-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 85 43 cnv 2 2 2 empty 5-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 43 cnv 2 2 2 empty 5-14-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 89 43 cnv 2 2 2 empty 5-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 45 cnv 2 2 2 empty 6-1-r empty 20 12 64 14 -1 -262144 0;
+#X obj 63 45 cnv 2 2 2 empty 6-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 45 cnv 2 2 2 empty 6-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 45 cnv 2 2 2 empty 6-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 45 cnv 2 2 2 empty 6-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 45 cnv 2 2 2 empty 6-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 45 cnv 2 2 2 empty 6-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 45 cnv 2 2 2 empty 6-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 45 cnv 2 2 2 empty 6-9-r empty 20 12 64 14 -1 -262144 0;
+#X obj 79 45 cnv 2 2 2 empty 6-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 45 cnv 2 2 2 empty 6-11-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 83 45 cnv 2 2 2 empty 6-12-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 85 45 cnv 2 2 2 empty 6-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 45 cnv 2 2 2 empty 6-14-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 89 45 cnv 2 2 2 empty 6-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 47 cnv 2 2 2 empty 7-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 47 cnv 2 2 2 empty 7-2-r empty 20 12 64 14 -1 -262144 0;
+#X obj 65 47 cnv 2 2 2 empty 7-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 47 cnv 2 2 2 empty 7-4-r empty 20 12 64 14 -1 -262144 0;
+#X obj 69 47 cnv 2 2 2 empty 7-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 47 cnv 2 2 2 empty 7-6-r empty 20 12 64 14 -1 -262144 0;
+#X obj 73 47 cnv 2 2 2 empty 7-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 47 cnv 2 2 2 empty 7-8-r empty 20 12 64 14 -1 -262144 0;
+#X obj 77 47 cnv 2 2 2 empty 7-9-r empty 20 12 64 14 -1 -262144 0;
+#X obj 79 47 cnv 2 2 2 empty 7-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 47 cnv 2 2 2 empty 7-11-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 83 47 cnv 2 2 2 empty 7-12-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 85 47 cnv 2 2 2 empty 7-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 47 cnv 2 2 2 empty 7-14-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 89 47 cnv 2 2 2 empty 7-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 49 cnv 2 2 2 empty 8-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 49 cnv 2 2 2 empty 8-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 49 cnv 2 2 2 empty 8-3-r empty 20 12 64 14 -1 -262144 0;
+#X obj 67 49 cnv 2 2 2 empty 8-4-r empty 20 12 64 14 -1 -262144 0;
+#X obj 69 49 cnv 2 2 2 empty 8-5-r empty 20 12 64 14 -1 -262144 0;
+#X obj 71 49 cnv 2 2 2 empty 8-6-r empty 20 12 64 14 -1 -262144 0;
+#X obj 73 49 cnv 2 2 2 empty 8-7-r empty 20 12 64 14 -1 -262144 0;
+#X obj 75 49 cnv 2 2 2 empty 8-8-r empty 20 12 64 14 -1 -262144 0;
+#X obj 77 49 cnv 2 2 2 empty 8-9-r empty 20 12 64 14 -1 -262144 0;
+#X obj 79 49 cnv 2 2 2 empty 8-10-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 81 49 cnv 2 2 2 empty 8-11-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 83 49 cnv 2 2 2 empty 8-12-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 85 49 cnv 2 2 2 empty 8-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 49 cnv 2 2 2 empty 8-14-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 89 49 cnv 2 2 2 empty 8-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 51 cnv 2 2 2 empty 9-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 51 cnv 2 2 2 empty 9-2-r empty 20 12 64 14 -1 -262144 0;
+#X obj 65 51 cnv 2 2 2 empty 9-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 51 cnv 2 2 2 empty 9-4-r empty 20 12 64 14 -1 -262144 0;
+#X obj 69 51 cnv 2 2 2 empty 9-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 51 cnv 2 2 2 empty 9-6-r empty 20 12 64 14 -1 -262144 0;
+#X obj 73 51 cnv 2 2 2 empty 9-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 51 cnv 2 2 2 empty 9-8-r empty 20 12 64 14 -1 -262144 0;
+#X obj 77 51 cnv 2 2 2 empty 9-9-r empty 20 12 64 14 -1 -262144 0;
+#X obj 79 51 cnv 2 2 2 empty 9-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 51 cnv 2 2 2 empty 9-11-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 83 51 cnv 2 2 2 empty 9-12-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 85 51 cnv 2 2 2 empty 9-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 51 cnv 2 2 2 empty 9-14-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 89 51 cnv 2 2 2 empty 9-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 53 cnv 2 2 2 empty 10-1-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 63 53 cnv 2 2 2 empty 10-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 53 cnv 2 2 2 empty 10-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 53 cnv 2 2 2 empty 10-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 53 cnv 2 2 2 empty 10-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 53 cnv 2 2 2 empty 10-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 53 cnv 2 2 2 empty 10-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 53 cnv 2 2 2 empty 10-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 53 cnv 2 2 2 empty 10-9-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 79 53 cnv 2 2 2 empty 10-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 53 cnv 2 2 2 empty 10-11-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 83 53 cnv 2 2 2 empty 10-12-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 85 53 cnv 2 2 2 empty 10-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 53 cnv 2 2 2 empty 10-14-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 89 53 cnv 2 2 2 empty 10-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 55 cnv 2 2 2 empty 11-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 55 cnv 2 2 2 empty 11-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 55 cnv 2 2 2 empty 11-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 55 cnv 2 2 2 empty 11-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 55 cnv 2 2 2 empty 11-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 55 cnv 2 2 2 empty 11-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 55 cnv 2 2 2 empty 11-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 55 cnv 2 2 2 empty 11-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 55 cnv 2 2 2 empty 11-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 55 cnv 2 2 2 empty 11-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 55 cnv 2 2 2 empty 11-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 55 cnv 2 2 2 empty 11-12-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 85 55 cnv 2 2 2 empty 11-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 55 cnv 2 2 2 empty 11-14-r empty 20 12 64 14 -1 -262144 0
+;
+#X obj 89 55 cnv 2 2 2 empty 11-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 57 cnv 2 2 2 empty 12-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 57 cnv 2 2 2 empty 12-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 57 cnv 2 2 2 empty 12-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 57 cnv 2 2 2 empty 12-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 57 cnv 2 2 2 empty 12-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 57 cnv 2 2 2 empty 12-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 57 cnv 2 2 2 empty 12-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 57 cnv 2 2 2 empty 12-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 57 cnv 2 2 2 empty 12-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 57 cnv 2 2 2 empty 12-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 57 cnv 2 2 2 empty 12-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 57 cnv 2 2 2 empty 12-12-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 85 57 cnv 2 2 2 empty 12-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 57 cnv 2 2 2 empty 12-14-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 89 57 cnv 2 2 2 empty 12-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 59 cnv 2 2 2 empty 13-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 59 cnv 2 2 2 empty 13-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 59 cnv 2 2 2 empty 13-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 59 cnv 2 2 2 empty 13-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 59 cnv 2 2 2 empty 13-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 59 cnv 2 2 2 empty 13-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 59 cnv 2 2 2 empty 13-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 59 cnv 2 2 2 empty 13-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 59 cnv 2 2 2 empty 13-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 59 cnv 2 2 2 empty 13-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 59 cnv 2 2 2 empty 13-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 59 cnv 2 2 2 empty 13-12-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 85 59 cnv 2 2 2 empty 13-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 59 cnv 2 2 2 empty 13-14-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 89 59 cnv 2 2 2 empty 13-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 61 61 cnv 2 2 2 empty 14-1-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 63 61 cnv 2 2 2 empty 14-2-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 65 61 cnv 2 2 2 empty 14-3-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 67 61 cnv 2 2 2 empty 14-4-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 69 61 cnv 2 2 2 empty 14-5-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 71 61 cnv 2 2 2 empty 14-6-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 73 61 cnv 2 2 2 empty 14-7-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 75 61 cnv 2 2 2 empty 14-8-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 77 61 cnv 2 2 2 empty 14-9-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 79 61 cnv 2 2 2 empty 14-10-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 81 61 cnv 2 2 2 empty 14-11-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 83 61 cnv 2 2 2 empty 14-12-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 85 61 cnv 2 2 2 empty 14-13-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 87 61 cnv 2 2 2 empty 14-14-r empty 20 12 64 14 -225271 -262144
+0;
+#X obj 89 61 cnv 2 2 2 empty 14-15-r empty 20 12 64 14 -225271 -262144
+0;
+#X text 54 90 vasp modular - vector assembling signal processor ©2002
+thomas grill;
+#X text 54 123 vasp is a library of objects for max/msp and pd \, containing
+functions to generate and modify vectors as well as buffer content
+in a non-realtime context.;
+#X text 54 169 vasp objects are using a specialized message syntax
+for all objects to refer to a buffer or a part of it.;
+#X text 55 248 some reference patches need the prepend object of the
+IEMlib;
+#X text 55 565 inspired by guenther rabl's fftbox and NMS4. find guenther
+rabl at www.canto-crudo.com;
+#X text 54 602 vasp help patches for MaxMSP by florian bogner and oliver
+grimm - ©2002 patcherboys;
+#X text 55 639 revised & extended version for PD by marius schebella
+- www.parasitaere-kapazitaeten.net/vasp;
+#X text 54 202 the help patches should give you an idea of what is
+possible. feel free to combine different patches to more complex ones.
+;
+#X text 76 291 (very) quick overview;
+#N canvas 131 125 831 564 quickstart 0;
+#X text 86 223 How to use:;
+#X obj 292 270 bng 15 250 50 0 1displays 1displayr empty 0 -6 192 8
+-24198 -1 -1;
+#X text 320 269 1) Have a messagebox with the name of the array.;
+#X obj 292 317 bng 15 250 50 0 2displays 2displayr empty 0 -6 192 8
+-24198 -1 -1;
+#X obj 292 400 bng 15 250 50 0 3displays 3displayr empty 0 -6 192 8
+-24198 -1 -1;
+#N canvas 323 136 534 533 inside 0;
+#X obj 144 38 r 1displays;
+#X obj 176 281 delay 500;
+#X obj 144 156 r 2displays;
+#X obj 144 80 change;
+#X msg 144 59 1;
+#X obj 144 198 change;
+#X msg 144 177 1;
+#X msg 144 101 bang;
+#X msg 144 221 bang;
+#X obj 64 327 change;
+#X msg 64 306 1;
+#X obj 64 284 r 3displays;
+#X obj 64 349 t b b b;
+#X obj 315 37 table buffer1;
+#X text 314 55 (dummy-table);
+#X msg 144 122 \; pd-quickstart msg 130 270 vasp buffer1;
+#X msg 144 244 \; pd-quickstart obj 130 320 vasp.shift 100;
+#X msg 108 374 \; pd-quickstart msg 130 370 vasp buffer1;
+#X msg 82 411 \; pd-quickstart obj 130 400 vasp.update;
+#X msg 176 302 \; pd-quickstart connect 13 0 14 0;
+#X msg 64 452 \; pd-quickstart connect 15 0 16 0;
+#X connect 0 0 4 0;
+#X connect 1 0 19 0;
+#X connect 2 0 6 0;
+#X connect 3 0 7 0;
+#X connect 4 0 3 0;
+#X connect 5 0 8 0;
+#X connect 6 0 5 0;
+#X connect 7 0 15 0;
+#X connect 8 0 16 0;
+#X connect 8 0 1 0;
+#X connect 9 0 12 0;
+#X connect 10 0 9 0;
+#X connect 11 0 10 0;
+#X connect 12 0 20 0;
+#X connect 12 1 18 0;
+#X connect 12 2 17 0;
+#X restore 716 65 pd inside;
+#X text 87 54 The vasp modular system does calculation on buffers.
+;
+#X text 322 316 2) Connect it to a vasp-object-box that determines
+the processing algorithm.;
+#X text 323 374 3) At that point \, after clicking the message-box
+\, data processing is executed. To display the new vasp in the graph
+you may want to update the graphic display.;
+#X text 86 89 Vasp works "out of time" \, it does not relay on the
+usual blocksizes of Pd. A vasp algorithm can be assigned to any buffer
+size according to your own definition \, for example the whole sound-data
+of an array.;
+#X text 86 156 There is a general help-patch called "VASP-HELP" \,
+and there is a reference-patch for every vasp object.;
+#X text 233 241 (CLICK GREEN BUTTONS);
+#X text 85 481 Have a look at this help for detailed information about
+the syntax and the available objects and features.;
+#X restore 232 292 pd quickstart;
+#X text 108 324 the vasp message;
+#N canvas 10 33 986 670 syntax 0;
+#X text 76 52 the vasp message:;
+#X obj 75 20 cnv 15 15 15 empty empty vasp_syntax 0 10 1 14 -262144
+-1 0;
+#N canvas 0 0 405 218 init 0;
+#X obj 33 19 loadbang;
+#X msg 33 99 \; \$1 xticks 0 4410 5 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 33 45 symbol buf1 \, symbol buf2 \, sysymbol buf1 \, symbol
+buf2 \, symbol buf3 \, symbol buf4 \, symbol buf5 \, symbol buf6 \,
+symbol buf7 \, symbol buf8 \, symbol buf9;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 827 44 pd init;
+#X obj 73 92 cnv 15 800 450 empty empty empty 20 12 0 14 -241339 -66577
+0;
+#X text 469 241 (default 0);
+#X text 515 185 which does the same.;
+#X msg 462 184 vasp -1;
+#X msg 222 270 vasp 44100 buf1 22050 0;
+#X text 110 271 and the channel;
+#X msg 317 241 vasp 44100 buf1 22050;
+#X text 110 243 an optional offset in samples;
+#X msg 365 214 vasp 44100 buf1;
+#X text 110 216 the name of the buffer it refers to;
+#X msg 347 158 vasp 44100;
+#X text 110 161 followed by the length in samples;
+#X msg 266 132 vasp;
+#X text 89 102 - a vasp message is structured by the following parts:
+;
+#X text 110 135 it always starts with;
+#X text 110 450 set all samples of buf1 to 0;
+#X text 110 384 generate a sine wave at 2Hz;
+#X msg 311 451 vasp buf1;
+#X obj 311 497 vasp.update;
+#X obj 311 473 vasp.= 0;
+#X obj 310 412 vasp.update;
+#X obj 310 383 vasp.osc 22050;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf1 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 498 403 graph;
+#X msg 310 323 vasp 44100 buf1 22050 0;
+#X text 110 325 one vectored vasp message:;
+#X obj 73 582 cnv 15 800 480 empty empty empty 20 12 0 14 -241339 -66577
+0;
+#X text 138 890 set all samples of buf1 and buf2 to 0;
+#X msg 275 910 vasp buf2 buf3;
+#X obj 275 956 vasp.update;
+#X obj 275 932 vasp.= 0;
+#X obj 274 846 vasp.update;
+#X obj 274 816 vasp.osc 22050;
+#X text 139 993 a vasp message can contain as many vectors as you like
+\, but all vectors have the same length;
+#X msg 274 714 vasp 44100 buf2 0 0 buf3 22050;
+#X text 110 689 two vectored vasp message:;
+#X text 110 633 all vectors have the same length \, but the vectors
+can differ in the buffers and offsets;
+#X text 89 597 - if a vasp message contains more than one vector:;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf2 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 477 754 graph;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf3 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 478 878 graph;
+#X text 110 184 if missing \, it refers to the whole buffer \, or type
+;
+#X text 139 1028 different vectors of a vasp are processed in parallel
+or as pairs for complex operations respectively.;
+#X obj 860 1077 cnv 15 15 15 empty empty empty 20 12 0 14 -262144 -66577
+0;
+#X text 336 339 (CLICK HERE);
+#X text 377 451 (CLICK HERE);
+#X text 326 736 (CLICK HERE);
+#X text 470 683 referring to buffer buf1 from 0 sec to 1 sec on channel
+0 and buffer buf2 from 0.5 sec to 1.5 sec on channel 0;
+#X text 354 934 (CLICK HERE);
+#X text 393 271 (default 0 \, it is only used in Max/MSP);
+#X text 453 342 referring to buffer buf1 from 0.5sec to 1.5sec on channel
+0;
+#X connect 20 0 22 0;
+#X connect 22 0 21 0;
+#X connect 24 0 23 0;
+#X connect 26 0 24 0;
+#X connect 30 0 32 0;
+#X connect 32 0 31 0;
+#X connect 34 0 33 0;
+#X connect 36 0 34 0;
+#X restore 232 325 pd syntax;
+#X text 88 357 additional messages;
+#N canvas 30 20 964 685 moremessages 0;
+#X obj 59 74 cnv 15 800 330 empty empty empty 20 12 0 14 -241339 -66577
+0;
+#X obj 330 342 vasp.* 0.5;
+#X text 128 192 set all samples of buf1 to 0;
+#X obj 330 374 vasp.update;
+#X obj 330 316 vasp.noise;
+#X msg 330 191 vasp buf4;
+#X obj 330 243 vasp.update;
+#X obj 330 217 vasp.= 0;
+#X obj 330 159 vasp.update;
+#X obj 330 133 vasp.osc 22050;
+#X msg 330 290 vasp buf5;
+#X text 470 92 sets the message \, bang triggers the operation;
+#X text 68 29 additional vasp messages:;
+#X msg 330 92 set vasp 44100 buf4;
+#X text 107 92 - set:;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf4 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 503 145 graph;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf5 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 504 269 graph;
+#X obj 286 108 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 107 115 - bang:;
+#X obj 60 662 cnv 15 800 290 empty empty empty 20 12 0 14 -241339 -66577
+0;
+#X text 108 688 - update:;
+#X msg 233 726 update 1;
+#X msg 297 726 update 0;
+#X msg 361 690 vasp buf7;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf7 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 521 699 graph;
+#X obj 651 903 vasp.update;
+#X obj 392 752 random 10;
+#X obj 392 778 * 0.1;
+#X msg 651 877 vasp buf7;
+#X obj 361 716 t a b;
+#X obj 60 975 cnv 15 800 290 empty empty empty 20 12 0 14 -241339 -66577
+0;
+#X text 134 998 - detach:;
+#X text 233 839 with argument 1 or 0 you can turn automatic display-update
+on or off (default is off).;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf8 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 525 1088 graph;
+#X obj 297 1231 vasp.u;
+#X obj 297 1205 vasp.opt;
+#X obj 297 1178 vasp.rfft;
+#X msg 297 1074 vasp buf8;
+#X msg 225 1095 detach 1;
+#X text 238 998 use multithreading;
+#X msg 162 1095 detach 0;
+#X obj 59 1290 cnv 15 800 300 empty empty empty 20 12 0 14 -241339
+-66577 0;
+#X text 127 1321 - radio:;
+#X obj 845 1762 cnv 15 15 15 empty empty empty 20 12 0 14 -262144 -66577
+0;
+#X obj 59 430 cnv 15 800 210 empty empty empty 20 12 0 14 -241339 -66577
+0;
+#X text 129 556 set all samples of buf5/6 to 0;
+#X msg 351 559 vasp buf5 buf6;
+#X obj 351 611 vasp.update;
+#X obj 351 585 vasp.= 0;
+#X msg 351 470 to vasp buf6 \, vasp buf5;
+#X obj 351 522 vasp.update;
+#X text 143 474 sets the target buffer buf6;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf6 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 515 515 graph;
+#X text 113 448 - to:;
+#X msg 192 1537 radio update 1;
+#X msg 187 1386 radio detach 1;
+#X text 149 1536 also:;
+#X obj 297 1497 vasp.u;
+#N canvas 0 0 450 300 graph1 0;
+#X array buf9 88200 float 0;
+#X coords 0 1 88199 -1 300 100 1;
+#X restore 526 1398 graph;
+#X msg 297 1367 vasp buf9;
+#X obj 351 496 vasp.*osc 22100;
+#X text 45 497 and modulate the noise with a 2Hz sine wave;
+#X text 233 875 if automatic update is turned off \, you explicitely
+have to update the display with the object vasp.update;
+#X obj 361 806 vasp.=;
+#X text 237 1019 this very useful switch can put the vasp-calculation
+into the background and (try to) avoid dropouts in the Pd-DSP-processing.
+1 = on \, 0 = off.;
+#X obj 297 1125 vasp.noise;
+#X obj 297 1149 vasp.flp 100;
+#X text 392 1147 low pass filter;
+#X text 383 1125 generate noise;
+#X text 235 1321 radio messages are passed to/through all vasp objects
+of an object chain;
+#X obj 297 1422 vasp.xwindow lin;
+#X obj 297 1466 vasp.sqr;
+#X text 354 1465 square it;
+#X text 355 1439 make linear window;
+#X text 69 45 set \, bang \, to \, update \, detach \, help;
+#X obj 61 1624 cnv 15 800 130 empty empty empty 20 12 0 14 -241339
+-66577 0;
+#X text 127 1636 - help:;
+#X msg 240 1676 help;
+#X obj 240 1709 vasp.??;
+#X msg 323 1676 help;
+#X obj 323 1709 vasp.s/;
+#X text 236 1637 print out a short description of the object;
+#X text 376 1177 real fft;
+#X connect 1 0 3 0;
+#X connect 4 0 1 0;
+#X connect 5 0 7 0;
+#X connect 7 0 6 0;
+#X connect 9 0 8 0;
+#X connect 10 0 4 0;
+#X connect 13 0 9 0;
+#X connect 17 0 9 0;
+#X connect 21 0 63 0;
+#X connect 22 0 63 0;
+#X connect 23 0 29 0;
+#X connect 26 0 27 0;
+#X connect 27 0 63 1;
+#X connect 28 0 25 0;
+#X connect 29 0 63 0;
+#X connect 29 1 26 0;
+#X connect 35 0 34 0;
+#X connect 36 0 35 0;
+#X connect 37 0 65 0;
+#X connect 38 0 36 0;
+#X connect 38 0 66 0;
+#X connect 38 0 65 0;
+#X connect 40 0 36 0;
+#X connect 40 0 66 0;
+#X connect 40 0 65 0;
+#X connect 46 0 48 0;
+#X connect 48 0 47 0;
+#X connect 49 0 60 0;
+#X connect 55 0 70 0;
+#X connect 59 0 70 0;
+#X connect 60 0 50 0;
+#X connect 65 0 66 0;
+#X connect 66 0 36 0;
+#X connect 70 0 71 0;
+#X connect 71 0 57 0;
+#X connect 77 0 78 0;
+#X connect 79 0 80 0;
+#X restore 232 356 pd moremessages;
+#X text 107 389 the vasp objects;
+#N canvas 57 40 410 445 objects 0;
+#X obj 59 28 cnv 15 15 15 empty empty vasp_objects 0 10 1 14 -262144
+-1 0;
+#N canvas 343 209 509 292 fftobjects 0;
+#X obj 281 103 vasp.r!fft;
+#X obj 281 71 vasp.rfft;
+#X obj 72 160 vasp.polar;
+#X obj 72 103 vasp.c!fft;
+#X obj 72 71 vasp.cfft;
+#X text 145 160 changes between cartesian and polar representation
+;
+#X text 358 103 inverse real fft;
+#X text 145 71 complex fft;
+#X text 145 103 inverse complex fft;
+#X text 358 71 real fft;
+#X text 145 213 changes between polar and cartesian representation
+;
+#X obj 72 212 vasp.rect;
+#X obj 35 22 cnv 15 15 15 empty empty fftobjects 0 10 1 14 -262144
+-1 0;
+#X restore 71 206 pd fftobjects;
+#N canvas 386 9 605 635 arithmetic 0;
+#X obj 354 138 vasp.c!-;
+#X text 149 135 reverse subtraction;
+#X obj 76 136 vasp.!-;
+#X text 437 421 integral function;
+#X text 437 444 differential function;
+#X obj 362 448 vasp.dif;
+#X obj 362 422 vasp.int;
+#X obj 361 346 vasp.r+;
+#X text 414 350 radius offset;
+#X obj 354 216 vasp.c!/;
+#X text 150 213 reverse division;
+#X obj 76 214 vasp.!/;
+#X obj 355 250 vasp.c=;
+#X obj 354 190 vasp.c/;
+#X obj 354 164 vasp.c*;
+#X obj 354 112 vasp.c-;
+#X obj 354 86 vasp.c+;
+#X obj 76 578 vasp.sign;
+#X obj 76 552 vasp.%;
+#X obj 76 526 vasp.abs;
+#X obj 76 500 vasp.!=;
+#X obj 76 474 vasp.==;
+#X obj 76 344 vasp.>=;
+#X obj 76 318 vasp.<=;
+#X obj 76 292 vasp.>;
+#X obj 76 266 vasp.<;
+#X obj 76 240 vasp.=;
+#X obj 76 188 vasp./;
+#X obj 76 162 vasp.*;
+#X obj 76 110 vasp.-;
+#X obj 76 84 vasp.+;
+#X text 150 338 vasp >= x;
+#X text 150 315 vasp >= x;
+#X text 150 292 vasp > x;
+#X text 150 269 vasp < x;
+#X text 151 473 equal to;
+#X text 152 161 multiplication;
+#X text 149 187 division;
+#X text 150 106 subtraction;
+#X text 153 499 not equal to;
+#X text 153 551 modulo (remainder of a division);
+#X text 151 525 absolute value of a vasp;
+#X text 150 83 addition;
+#X text 354 62 complex ....;
+#X text 150 239 vasp = x;
+#X text 152 577 values < 0 become -1 | values > 0 become 1;
+#X text 361 322 radius ....;
+#X obj 35 22 cnv 15 15 15 empty empty arithmetic 0 10 1 14 -262144
+-1 0;
+#X obj 355 276 vasp.cconj;
+#X obj 76 370 vasp.a<;
+#X obj 76 396 vasp.a>;
+#X obj 76 422 vasp.a<=;
+#X obj 76 448 vasp.a>=;
+#X text 149 369 abs(vasp) < abs(x);
+#X text 149 392 abs(vasp) > abs(x);
+#X text 149 444 abs(vasp) >= abs(x);
+#X text 149 421 abs(vasp) <= abs(x);
+#X restore 72 128 pd arithmetic;
+#N canvas 197 195 744 308 generators 0;
+#X obj 389 194 vasp.*cosc;
+#X obj 389 138 vasp.*phasor;
+#X obj 389 110 vasp.*osc;
+#X obj 72 222 vasp.cnoise;
+#X obj 72 194 vasp.cosc;
+#X obj 72 166 vasp.noise;
+#X obj 72 138 vasp.phasor;
+#X obj 72 110 vasp.osc;
+#X text 72 67 generate .....;
+#X text 166 165 vasp noise generator;
+#X text 166 134 vasp saw tooth generator;
+#X text 166 109 vasp sine wave generator;
+#X text 166 226 complex noise;
+#X text 166 190 complex sine wave;
+#X obj 35 22 cnv 15 15 15 empty empty generators 0 10 1 14 -262144
+-1 0;
+#X text 366 67 multiply a buffer content with the oscillator functions
+...;
+#X restore 72 179 pd generators;
+#N canvas 510 190 355 349 filters 0;
+#X obj 53 107 vasp.flp;
+#X obj 53 77 vasp.fhp;
+#X text 157 111 low pass;
+#X text 157 80 high pass;
+#X obj 35 22 cnv 15 15 15 empty empty filters 0 10 1 14 -262144 -1
+0;
+#X obj 52 205 vasp.rvalleys;
+#X obj 52 238 vasp.rpeaks;
+#X text 156 205 radius valleys;
+#X text 156 238 radius peaks;
+#X obj 52 173 vasp.peaks;
+#X obj 52 140 vasp.valleys;
+#X text 156 175 local peaks of a vasp;
+#X text 156 142 local minima of a vasp;
+#X restore 71 255 pd filters;
+#N canvas 306 143 560 383 displace 0;
+#X text 158 163 rotate buffer content symmetrically;
+#X obj 80 164 vasp.xrot;
+#X obj 80 232 vasp.xmirr;
+#X obj 80 197 vasp.mirr;
+#X obj 80 132 vasp.rot;
+#X obj 80 97 vasp.xshift;
+#X obj 80 62 vasp.shift;
+#X text 158 231 mirrors a vasp symmetrically;
+#X text 158 196 mirrors a vasp;
+#X text 158 61 shifts the buffer content;
+#X text 158 131 rotate buffer content;
+#X obj 35 22 cnv 15 15 15 empty empty displace 0 10 1 14 -262144 -1
+0;
+#X text 157 96 shifts the buffer content symmetrically;
+#X obj 80 275 vasp.tilt;
+#X obj 80 316 vasp.xtilt;
+#X text 160 274 resamples around a center position;
+#X text 160 310 buffer is divided in two symmetrical halves and each
+one is resampled around a center position;
+#X restore 71 230 pd displace;
+#N canvas 206 180 677 313 transcendent 0;
+#X text 403 97 complex sample^2;
+#X text 403 67 complex integer power function;
+#X text 145 195 square root;
+#X text 145 226 signed sample^2;
+#X obj 329 66 vasp.cpowi;
+#X obj 329 96 vasp.csqr;
+#X obj 73 257 vasp.ssqrt;
+#X obj 73 226 vasp.ssqr;
+#X obj 73 194 vasp.sqrt;
+#X obj 73 164 vasp.sqr;
+#X obj 73 134 vasp.pow;
+#X text 145 257 signed square root;
+#X text 145 135 samps^x;
+#X text 145 165 sample^2;
+#X obj 329 142 vasp.rpow;
+#X text 396 143 radius power function;
+#X obj 73 102 vasp.log;
+#X obj 73 66 vasp.exp;
+#X text 145 102 logarithm;
+#X text 145 66 exponential;
+#X obj 35 22 cnv 15 15 15 empty empty transcendent 0 10 1 14 -262144
+-1 0;
+#X restore 72 153 pd transcendent;
+#N canvas 236 197 680 327 minmax_etc. 0;
+#X obj 422 250 vasp.rmin;
+#X obj 422 218 vasp.rmax;
+#X text 511 250 radius minimum;
+#X text 511 219 radius maximum;
+#X obj 76 250 vasp.min;
+#X obj 76 218 vasp.max;
+#X obj 76 187 vasp.max?;
+#X obj 76 156 vasp.min?;
+#X obj 76 125 vasp.amax?;
+#X obj 76 94 vasp.amin?;
+#X obj 422 187 vasp.rmax?;
+#X obj 422 156 vasp.rmin?;
+#X obj 76 62 vasp.minmax;
+#X text 167 250 minimum of vasp and argument;
+#X text 167 219 maximum of vasp and argument;
+#X text 167 156 output min. value of a vasp;
+#X text 167 187 output max. value of a vasp;
+#X text 167 125 output max. absolute value of a vasp;
+#X text 167 94 output min. absolute value of a vasp;
+#X text 511 187 radius max. value;
+#X text 511 156 radius min. value;
+#X text 167 65 splits a vasp into minimum and maximum values;
+#X obj 35 22 cnv 15 15 15 empty empty minmax 0 10 1 14 -262144 -1 0
+;
+#X restore 71 279 pd minmax_etc.;
+#N canvas 229 139 538 399 window-functions 0;
+#X obj 59 28 cnv 15 15 15 empty empty window-functions 0 10 1 14 -262144
+-1 0;
+#X obj 77 92 vasp.window;
+#X obj 77 125 vasp.xwindow;
+#X obj 77 159 vasp.!window;
+#X obj 116 255 vasp.*window;
+#X obj 116 289 vasp.*xwindow;
+#X obj 116 318 vasp.*!window;
+#X text 188 122 symmetrical window;
+#X text 188 90 left part of symmetrical window;
+#X text 190 160 right part of symmetrical window;
+#X text 77 212 multiply...;
+#X restore 71 303 pd window-functions;
+#N canvas 188 241 510 401 utilities 0;
+#X obj 77 143 vasp.cnorm;
+#X obj 80 321 vasp.pwrap;
+#X obj 80 265 vasp.opt;
+#X obj 77 64 vasp.gate;
+#X text 158 265 optimize buffer content;
+#X text 157 64 gates vasp under a value (amplitude);
+#X text 158 143 sets complex radius of all samples to unity;
+#X obj 80 292 vasp.ropt;
+#X text 157 294 radius optimize;
+#X obj 77 90 vasp.rgate;
+#X text 158 90 radius gate;
+#X text 158 321 wraps value from 0-2 to -1 to 1;
+#X obj 59 28 cnv 15 15 15 empty empty utilities 0 10 1 14 -262144 -1
+0;
+#X obj 77 115 vasp.fix;
+#X obj 76 173 vasp.radio;
+#X text 73 226 abstractions:;
+#X text 158 115 fix NAN (not a number) values;
+#X text 157 172 filter radio messages;
+#X restore 71 326 pd utilities;
+#N canvas 173 -1 652 692 declaration 0;
+#X obj 68 42 cnv 15 15 15 empty empty declaration 0 10 1 14 -262144
+-1 0;
+#X text 184 148 get a vector of a vasp;
+#X obj 84 152 vasp.vector;
+#X text 184 179 get the number of vectors of a vasp;
+#X obj 84 180 vasp.vectors?;
+#X text 184 207 set a vasp's offset(s) into the vector buffers;
+#X obj 84 208 vasp.offset;
+#X text 184 235 shift a vasp's offset(s) into the vector buffers;
+#X obj 84 236 vasp.offset+;
+#X text 184 263 get a single vectored vasp's offset(s) into the buffer
+;
+#X obj 84 264 vasp.offset?;
+#X obj 84 292 vasp.offset=;
+#X text 184 319 set a vasps frame count;
+#X obj 84 320 vasp.frames;
+#X text 184 349 raise/lower a vasps frame count;
+#X obj 84 348 vasp.frames+;
+#X text 184 374 get a vasps frame count;
+#X obj 84 376 vasp.frames?;
+#X obj 84 404 vasp.frames*;
+#X obj 84 432 vasp.frames/;
+#X obj 84 460 vasp.frames=;
+#X obj 84 488 vasp.size;
+#X obj 84 516 vasp.size+;
+#X obj 84 544 vasp.size*;
+#X obj 84 600 vasp.size?;
+#X obj 84 572 vasp.size/;
+#X obj 84 628 vasp.channel;
+#X obj 84 656 vasp.channel?;
+#X obj 84 124 vasp;
+#X text 184 123 store and output a vasp;
+#X text 184 405 change a vasps frame count by multiplication;
+#X text 184 430 change a vasps frame count by division;
+#X text 184 486 set the size of an array/buffer;
+#X text 186 517 raise the size of an array/buffer;
+#X text 186 542 change the size of an array/buffer by multiplication
+;
+#X text 185 603 get the size of a vasp;
+#X text 185 578 change the size of an array/buffer by division;
+#X text 186 658 get the channel of a multichannel vasp (MaxMSP only)
+;
+#X text 186 633 define the channel of a multichannel vasp (MAXMSP only)
+;
+#X text 55 84 (get help on right click/help just as usual);
+#X text 184 291 set a vasp's offset by searching for a value;
+#X text 184 461 change a vasp's frame count by searching for a value
+;
+#X restore 72 78 pd declaration;
+#N canvas 238 51 544 560 basics 0;
+#X text 173 122 check vasp dimensions;
+#X obj 73 122 vasp.check;
+#X text 173 162 sync 2 or more vasps;
+#X obj 73 162 vasp.sync;
+#X text 173 142 update the graphics of a patcher (e.g. waveform);
+#X obj 73 142 vasp.update;
+#X text 173 182 output a vasp multiply;
+#X obj 73 182 vasp.multi;
+#X text 173 228 split a vasp into its vectors;
+#X obj 73 228 vasp.split 2;
+#X text 173 248 join several vasps into one;
+#X obj 73 248 vasp.join 2;
+#X text 173 268 spit out vectors of a vasp (one vector after the other)
+;
+#X obj 73 268 vasp.spit;
+#X text 173 288 gather several vasps into one;
+#X obj 73 288 vasp.gather;
+#X text 173 308 output vasps with different lengths and offsets;
+#X obj 73 308 vasp.part;
+#X text 174 412 output the samples of a vasp as list;
+#X obj 74 412 vasp.?;
+#X text 174 431 output all non zero samples of a vasp as list;
+#X obj 74 432 vasp.??;
+#X obj 71 64 cnv 15 15 15 empty empty basics 0 10 1 14 -262144 -1 0
+;
+#X obj 73 328 vasp.->;
+#X text 173 328 copy a vasp into another one;
+#X text 173 348 copy a complex vasp;
+#X obj 73 348 vasp.c->;
+#X obj 75 469 vasp.!;
+#X text 175 469 create a temporary vasp (immediate);
+#X restore 72 103 pd basics;
+#X restore 232 387 pd objects;
+#X text 149 418 envelopes;
+#N canvas 39 33 908 540 envelopes 0;
+#N canvas 40 55 255 173 clear_buffer 0;
+#X obj 59 79 vasp.update;
+#X obj 59 56 vasp.= 0;
+#X obj 59 26 inlet;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 497 300 pd clear_buffer;
+#N canvas 0 0 450 300 graph167 0;
+#X array bufenv1 88200 float 0;
+#X coords 0 1 88199 -1 300 120 1;
+#X restore 513 99 graph;
+#N canvas 431 348 401 213 init 0;
+#X obj 36 19 loadbang;
+#X msg 36 73 \; \$1 xticks 0 4410 10 \; \$1 xlabel 1.1 0 22050 44100
+66150 88200 \; \$1 yticks 0 0.25 2 \; \$1 ylabel 94000 -1 -0.5 0 0.5
+1;
+#X msg 36 45 symbol bufenv1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 621 293 pd init;
+#X obj 48 469 vasp.u;
+#X text 43 17 create envelopes from data-pairs;
+#X msg 497 272 vasp bufenv1;
+#X msg 46 103 vasp bufenv1;
+#X obj 46 159 vasp.u;
+#X obj 46 319 vasp.=;
+#X obj 46 263 t b a;
+#X msg 46 291 vasp bufenv1;
+#X obj 46 347 vasp.u;
+#X msg 46 222 env 0 0 0.8 1500 1 4000 0.95 10000 0.5 20000 0.15 55000
+0 88200;
+#X msg 48 397 vasp bufenv1;
+#X obj 48 421 vasp.!window lin;
+#X obj 48 447 vasp.* env 0 0 1 22050;
+#X obj 46 131 vasp.= env 1 0 -0.6 70000;
+#X text 231 129 an envelope as a creation argument;
+#X text 45 199 or sent as message;
+#X text 159 394 used as an argument alternatively to a value or vasp
+;
+#X text 46 85 CLICK HERE!;
+#X text 43 36 value - position in samples \, value2 - position2 \,
+...;
+#X connect 5 0 0 0;
+#X connect 6 0 16 0;
+#X connect 8 0 11 0;
+#X connect 9 0 10 0;
+#X connect 9 1 8 1;
+#X connect 10 0 8 0;
+#X connect 12 0 9 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 3 0;
+#X connect 16 0 7 0;
+#X restore 232 419 pd envelopes;
+#X text 137 450 vasps units;
+#N canvas 49 240 511 378 units 0;
+#N canvas 442 226 404 340 Hz_to_period_length 0;
+#X text 17 201 current sampling rate;
+#X floatatom 157 241 0 0 0;
+#X obj 157 143 t b f;
+#X text 215 242 period length;
+#X floatatom 157 115 0 0 0;
+#X obj 157 210 / 1;
+#X floatatom 30 180 0 0 0;
+#X text 202 112 frequency in Hz;
+#X obj 30 138 samplerate~;
+#X obj 30 115 loadbang;
+#X obj 39 44 cnv 15 15 15 empty empty Hz_to_period_length 0 10 1 14
+-262144 -1 0;
+#X connect 2 0 5 0;
+#X connect 2 1 5 1;
+#X connect 4 0 2 0;
+#X connect 5 0 1 0;
+#X connect 8 0 6 0;
+#X connect 8 0 5 0;
+#X connect 9 0 8 0;
+#X restore 150 310 pd Hz_to_period_length;
+#X text 103 281 sample rate/frequency in Hz = frequency in period length
+(float);
+#X text 60 264 - frequencies are always defined in period lengths;
+#X msg 149 227 vasp 44100 buf1 22050 0;
+#X text 103 187 e.g: vasp message with an offset of 0.5 sec. and a
+length of 1 sec. (sr 44100);
+#X text 60 155 - lengths and offsets are always defined in samples
+(depending on sample rate);
+#X msg 150 113 vasp 44100 buf1 22050 0;
+#X text 60 69 - vasp index counting starts from 0;
+#X text 104 81 e.g: channel 0 in a vasp message means first channel
+in the buffer;
+#X obj 51 27 cnv 15 15 15 empty empty vasp_units 0 10 1 14 -262144
+-1 0;
+#X restore 233 451 pd units;
+#X text 112 483 vasp data types;
+#N canvas 218 38 524 621 data_types 0;
+#X text 68 48 vasp \, float \, envelope \, complex number \, double
+;
+#X text 83 84 vasp;
+#X text 83 196 float;
+#X text 96 130 vectors are always processed in parallel;
+#X text 81 280 envelope;
+#X text 95 216 (real) pd-style numbers;
+#X text 100 298 list of pairs setting value and position;
+#X text 79 380 complex numbers;
+#X msg 96 155 vasp buf1 buf2;
+#X floatatom 98 239 5 0 0;
+#X msg 100 323 env 0.5 0 -1 100 34.77 500;
+#X text 100 402 selector "complex" and pair of numbers;
+#X msg 100 427 complex 2.6 5.99;
+#X text 225 428 2.6+5.99i;
+#X text 83 477 double;
+#X msg 105 526 double 1 1e-13;
+#X text 101 501 for double precision of numbers;
+#X text 96 106 a vasp consists of one or more vectors of data;
+#X text 209 520 the two components are added internally;
+#X text 209 532 to represent a double precision number;
+#X restore 233 484 pd data_types;
+#X text 121 515 vasp glossary;
+#N canvas 69 118 655 553 glossary 0;
+#X text 100 84 buffer~ (MaxMSP) / array (Pd);
+#X text 120 100 resident data-field (can be channel-interleaved in
+Max/MSP) in system memory containing a number of frames;
+#X text 100 313 channel;
+#X text 100 379 vector;
+#X text 100 435 vasp;
+#X text 120 397 reference (with an offset and length \, with frames
+as units) to one channel of a buffer~ or array vector;
+#X text 120 452 contains one or more vectors in parallel with one common
+length but in general different offsets/channels per vector;
+#X text 120 330 a buffer~ (in MaxMSP) consists of one or more channels
+\, resulting in 1 \, 2 or 4 data elements per frame \, 0-indexed;
+#X text 121 183 32 bit IEEE floating point value \, typically (but
+not necessarily) normalized to the range -1...1 \;;
+#X text 100 161 data element (representing a sample);
+#X text 120 247 (aka "sample") time unit of sampled data - if multiple
+channels (typically 2 or 4) are sampled \, there are multiple data
+elements per frame;
+#X text 100 227 frame;
+#X obj 82 40 cnv 15 15 15 empty empty glossary 0 10 1 14 -262144 -1
+0;
+#X restore 233 516 pd glossary;
diff --git a/externals/grill/vasp/pd/bass.aif b/externals/grill/vasp/pd/bass.aif
new file mode 100644
index 00000000..97a7851e
--- /dev/null
+++ b/externals/grill/vasp/pd/bass.aif
Binary files differ
diff --git a/externals/grill/vasp/pd/beat.aif b/externals/grill/vasp/pd/beat.aif
new file mode 100644
index 00000000..0967480d
--- /dev/null
+++ b/externals/grill/vasp/pd/beat.aif
Binary files differ
diff --git a/externals/grill/vasp/pd/change2.pd b/externals/grill/vasp/pd/change2.pd
new file mode 100644
index 00000000..2b93562d
--- /dev/null
+++ b/externals/grill/vasp/pd/change2.pd
@@ -0,0 +1,25 @@
+#N canvas 216 304 478 265 10;
+#X obj 121 46 inlet;
+#X obj 121 71 unpack;
+#X text 207 41 change for pairs;
+#X obj 193 155 t b f;
+#X obj 152 97 t f f;
+#X obj 117 97 t f f;
+#X obj 152 219 outlet;
+#X obj 152 191 pack 0 0;
+#X obj 121 133 sel \$1;
+#X obj 162 133 sel \$2;
+#X text 209 57 args: other default values than 0 0;
+#X text 249 240 used in vasp-help-patches;
+#X connect 0 0 1 0;
+#X connect 1 0 5 0;
+#X connect 1 1 4 0;
+#X connect 3 0 7 0;
+#X connect 3 1 7 1;
+#X connect 4 0 9 1;
+#X connect 4 1 9 0;
+#X connect 5 0 8 1;
+#X connect 5 1 8 0;
+#X connect 7 0 6 0;
+#X connect 8 1 7 0;
+#X connect 9 1 3 0;
diff --git a/externals/grill/vasp/pd/filelist.pd b/externals/grill/vasp/pd/filelist.pd
new file mode 100644
index 00000000..4d6366f6
--- /dev/null
+++ b/externals/grill/vasp/pd/filelist.pd
@@ -0,0 +1,24 @@
+#N canvas 100 100 118 78 10;
+#X obj 0 0 cnv 14 118 78 empty empty read 0 7 0 8 -262144 -66577 0
+;
+#X obj 34 16 hdl 14 0 524928 6 \$1-beat empty empty 0 -6 128 8 -262144
+-1 -1 3;
+#X obj 34 16 cnv 14 84 14 empty \$1-beat-color beat.aif 5 7 64 8 -166441
+-233017 8214;
+#X obj 34 32 hdl 14 0 524800 6 \$1-fly empty empty 0 -6 128 8 -262144
+-1 -1 3;
+#X obj 34 0 hdl 14 0 524928 6 \$1-bass empty empty 0 -6 128 8 -262144
+-1 -1 3;
+#X obj 34 0 cnv 14 84 14 empty \$1-bass-color bass.aif 5 7 64 8 -166441
+-233017 8214;
+#X obj 34 48 hdl 14 0 525312 6 \$1-plastic empty empty 0 -6 128 8 -262144
+-1 -1 3;
+#X obj 34 48 cnv 14 84 14 empty \$1-plastic-color plastic.aif 5 7 64
+8 -166441 -233017 8220;
+#X obj 34 64 hdl 14 0 524800 6 \$1-own empty empty 0 -6 128 8 -262144
+-1 -1 0;
+#X obj 34 64 cnv 14 84 14 empty \$1-own-color own_sample 5 7 64 8 -166441
+-233017 8212;
+#X obj 34 32 cnv 14 84 14 empty \$1-fly-color fly.aif 5 7 64 8 -166441
+-233017 8212;
+#X coords 0 0 1 1 118 78 1;
diff --git a/externals/grill/vasp/pd/filelisthandler.pd b/externals/grill/vasp/pd/filelisthandler.pd
new file mode 100644
index 00000000..3d7dbd11
--- /dev/null
+++ b/externals/grill/vasp/pd/filelisthandler.pd
@@ -0,0 +1,102 @@
+#N canvas 0 0 769 523 10;
+#X obj 38 390 outlet;
+#X msg 80 267 color \$1 \$2;
+#X msg 194 267 color \$1 \$2;
+#X msg 308 267 color \$1 \$2;
+#X msg 422 267 color \$1 \$2;
+#X obj 38 155 t b b b;
+#X obj 152 155 t b b b;
+#X obj 266 155 t b b b;
+#X obj 380 155 t b b b;
+#X msg 80 184 6 12;
+#X msg 48 184 1 10;
+#X msg 160 184 1 10;
+#X msg 194 184 6 12;
+#X msg 275 184 1 10;
+#X msg 308 184 6 12;
+#X msg 388 184 1 10;
+#X msg 422 184 6 12;
+#X msg 38 331 symbol bass.aif;
+#X msg 151 331 symbol beat.aif;
+#X msg 266 331 symbol fly.aif;
+#X msg 381 331 symbol plastic.aif;
+#X obj 532 61 inlet;
+#X obj 532 81 sel 1 2 3 4;
+#X text 517 35 for loadbang;
+#X obj 38 130 r \$1-bass;
+#X obj 152 130 r \$1-beat;
+#X obj 266 130 r \$1-fly;
+#X obj 380 130 r \$1-plastic;
+#X obj 80 292 s \$1-bass-color;
+#X obj 194 292 s \$1-beat-color;
+#X obj 308 292 s \$1-fly-color;
+#X obj 422 292 s \$1-plastic-color;
+#X text 164 397 used in connection with filelist. arg: \$0 of parent
+patch.;
+#X obj 516 331 openpanel;
+#X msg 558 266 color \$1 \$2;
+#X obj 516 154 t b b b;
+#X msg 524 183 1 10;
+#X msg 558 183 6 12;
+#X obj 558 291 s \$1-own-color;
+#X obj 516 129 r \$1-own;
+#X connect 1 0 28 0;
+#X connect 2 0 29 0;
+#X connect 3 0 30 0;
+#X connect 4 0 31 0;
+#X connect 5 0 17 0;
+#X connect 5 1 10 0;
+#X connect 5 2 9 0;
+#X connect 6 0 18 0;
+#X connect 6 1 11 0;
+#X connect 6 2 12 0;
+#X connect 7 0 19 0;
+#X connect 7 1 13 0;
+#X connect 7 2 14 0;
+#X connect 8 0 20 0;
+#X connect 8 1 15 0;
+#X connect 8 2 16 0;
+#X connect 9 0 1 0;
+#X connect 10 0 2 0;
+#X connect 10 0 3 0;
+#X connect 10 0 4 0;
+#X connect 10 0 34 0;
+#X connect 11 0 1 0;
+#X connect 11 0 3 0;
+#X connect 11 0 4 0;
+#X connect 11 0 34 0;
+#X connect 12 0 2 0;
+#X connect 13 0 1 0;
+#X connect 13 0 2 0;
+#X connect 13 0 4 0;
+#X connect 13 0 34 0;
+#X connect 14 0 3 0;
+#X connect 15 0 3 0;
+#X connect 15 0 2 0;
+#X connect 15 0 1 0;
+#X connect 15 0 34 0;
+#X connect 16 0 4 0;
+#X connect 17 0 0 0;
+#X connect 18 0 0 0;
+#X connect 19 0 0 0;
+#X connect 20 0 0 0;
+#X connect 21 0 22 0;
+#X connect 22 0 5 0;
+#X connect 22 1 6 0;
+#X connect 22 2 7 0;
+#X connect 22 3 8 0;
+#X connect 24 0 5 0;
+#X connect 25 0 6 0;
+#X connect 26 0 7 0;
+#X connect 27 0 8 0;
+#X connect 33 0 0 0;
+#X connect 34 0 38 0;
+#X connect 35 0 33 0;
+#X connect 35 1 36 0;
+#X connect 35 2 37 0;
+#X connect 36 0 4 0;
+#X connect 36 0 3 0;
+#X connect 36 0 2 0;
+#X connect 36 0 1 0;
+#X connect 37 0 34 0;
+#X connect 39 0 35 0;
diff --git a/externals/grill/vasp/pd/filter_example.pd b/externals/grill/vasp/pd/filter_example.pd
new file mode 100644
index 00000000..3a3f8438
--- /dev/null
+++ b/externals/grill/vasp/pd/filter_example.pd
@@ -0,0 +1,190 @@
+#N canvas 11 0 973 640 10;
+#X obj 75 32 cnv 15 15 15 empty empty filter_example 0 10 1 14 -262144
+-1 0;
+#X obj 523 555 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 657 556 pd clear_buffers;
+#X obj 304 113 filelist \$0;
+#X obj 67 133 vasp.noise;
+#X text 151 112 generate white noise or;
+#X obj 67 153 vasp.* 0.5;
+#X obj 67 173 vasp.update;
+#X obj 67 193 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 66 547 vasp.update;
+#X obj 66 567 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 66 527 vasp.c!fft;
+#X obj 67 241 vasp.cfft;
+#X obj 67 301 vasp.update;
+#X obj 67 321 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#N canvas 132 132 405 385 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 214 159 loadbang;
+#X obj 67 53 loadbang;
+#X msg 214 180 88200;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X obj 214 228 s bufre1;
+#X obj 224 252 s bufim1;
+#X msg 67 133 read -resize \$1 bufre1;
+#X msg 67 79 3;
+#X connect 0 0 7 0;
+#X connect 3 0 9 0;
+#X connect 3 0 10 0;
+#X connect 4 0 6 0;
+#X connect 5 0 12 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 2 0;
+#X connect 7 1 1 0;
+#X connect 7 2 3 0;
+#X connect 8 0 11 0;
+#X connect 11 0 0 0;
+#X connect 12 0 8 0;
+#X restore 813 559 pd inside;
+#X text 67 64 clear a region in the frequency domain to get a filter
+;
+#X msg 67 113 vasp bufre1;
+#X msg 67 221 vasp bufre1 bufim1;
+#X obj 67 261 vasp.upper;
+#X obj 67 281 vasp.= 0;
+#X obj 523 532 tabplay~ bufre1;
+#X msg 657 533 vasp bufre1 bufim1;
+#X text 157 283 clear upper (mirrored frequencies);
+#X text 539 374 0 Hz;
+#X text 677 379 sr/2;
+#X text 816 377 44.1 kHz;
+#X text 190 506 invers transform back to the time domain;
+#X obj 66 434 vasp.= 0;
+#X msg 66 414 set vasp \$1 bufre1 \$2 bufim1 \$2;
+#X obj 290 348 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 66 455 vasp.update;
+#X obj 66 475 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X msg 66 507 vasp bufre1 bufim1;
+#X obj 545 110 synchrodisplay bufre1 bufim1 \$0;
+#X text 818 94 real;
+#X text 789 235 imaginary;
+#X obj 545 395 s \$0-data;
+#N canvas 109 162 271 247 tovasp 0;
+#N canvas 0 0 577 409 conversion 0;
+#X obj 123 53 inlet;
+#X obj 123 93 unpack;
+#X obj 160 182 r \$0-sample-length;
+#X obj 123 242 / 1;
+#X obj 154 242 / 1;
+#X obj 123 268 * 44100;
+#X obj 202 207 loadbang;
+#X obj 202 230 samplerate~;
+#X obj 123 299 outlet;
+#X obj 180 269 * 44100;
+#X obj 180 300 outlet;
+#X obj 366 253 runden;
+#X obj 366 231 - 0;
+#X text 450 272 offset;
+#X obj 366 177 t b f;
+#X obj 366 206 0;
+#X obj 366 317 outlet;
+#X obj 123 116 t f f f;
+#X text 370 271 length;
+#X obj 447 254 runden;
+#X text 121 326 lb (Hz);
+#X text 183 325 rb (Hz);
+#X obj 366 295 pack;
+#X obj 123 73 change2;
+#X floatatom 459 223 12 0 0;
+#X floatatom 453 310 5 0 0;
+#X connect 0 0 23 0;
+#X connect 1 0 17 0;
+#X connect 1 1 4 0;
+#X connect 1 1 15 1;
+#X connect 2 0 3 1;
+#X connect 2 0 4 1;
+#X connect 3 0 5 0;
+#X connect 4 0 9 0;
+#X connect 5 0 8 0;
+#X connect 6 0 7 0;
+#X connect 7 0 5 1;
+#X connect 7 0 9 1;
+#X connect 9 0 10 0;
+#X connect 11 0 22 0;
+#X connect 12 0 11 0;
+#X connect 14 0 15 0;
+#X connect 14 1 12 1;
+#X connect 15 0 12 0;
+#X connect 17 0 3 0;
+#X connect 17 1 14 0;
+#X connect 17 2 19 0;
+#X connect 17 2 24 0;
+#X connect 19 0 22 1;
+#X connect 19 0 25 0;
+#X connect 22 0 16 0;
+#X connect 23 0 1 0;
+#X restore 89 64 pd conversion;
+#X obj 89 44 r \$0-data;
+#X obj 162 153 outlet;
+#X obj 89 98 s \$0-freqdisplayl;
+#X obj 125 124 s \$0-freqdisplayr;
+#X connect 0 0 3 0;
+#X connect 0 1 4 0;
+#X connect 0 2 2 0;
+#X connect 1 0 0 0;
+#X restore 66 393 pd tovasp;
+#X text 193 224 transform;
+#N canvas 0 0 140 20 Herznumbers 0;
+#X obj 0 0 cnv 15 140 20 empty empty empty 20 12 0 14 -262144 -66577
+0;
+#X floatatom 0 3 8 0 0;
+#X floatatom 83 3 8 0 0;
+#X obj 28 30 r \$0-freqdisplayl;
+#X obj 28 54 r \$0-freqdisplayr;
+#X connect 3 0 1 0;
+#X connect 4 0 2 0;
+#X coords 0 0 1 1 140 20 1;
+#X restore 642 434 pd Herznumbers;
+#X text 547 436 selection from;
+#X text 701 436 to;
+#X text 66 348 select a region (frequecy band) and;
+#X obj 523 512 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 545 509 play;
+#X text 657 511 clear;
+#X text 785 436 Hz;
+#X text 65 360 draw inside the wavedisplay and press spacebar (select)
+or "s" (shift).;
+#X connect 4 0 6 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 9 0 10 0;
+#X connect 11 0 9 0;
+#X connect 12 0 19 0;
+#X connect 13 0 14 0;
+#X connect 17 0 4 0;
+#X connect 18 0 12 0;
+#X connect 19 0 20 0;
+#X connect 20 0 13 0;
+#X connect 21 0 1 0;
+#X connect 21 0 1 1;
+#X connect 22 0 2 0;
+#X connect 28 0 31 0;
+#X connect 29 0 28 0;
+#X connect 30 0 28 0;
+#X connect 31 0 32 0;
+#X connect 33 0 11 0;
+#X connect 34 0 37 0;
+#X connect 38 0 29 0;
+#X connect 44 0 21 0;
diff --git a/externals/grill/vasp/pd/filter_examplei.pd b/externals/grill/vasp/pd/filter_examplei.pd
new file mode 100644
index 00000000..8ab0fd5b
--- /dev/null
+++ b/externals/grill/vasp/pd/filter_examplei.pd
@@ -0,0 +1,191 @@
+#N canvas 11 0 977 644 10;
+#X obj 75 32 cnv 15 15 15 empty empty filter_example! 0 10 1 14 -262144
+-1 0;
+#X obj 523 555 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 657 556 pd clear_buffers;
+#X obj 304 113 filelist \$0;
+#X obj 67 133 vasp.noise;
+#X text 151 112 generate white noise or;
+#X obj 67 153 vasp.* 0.5;
+#X obj 67 173 vasp.update;
+#X obj 67 193 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 66 557 vasp.update;
+#X obj 66 577 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 66 537 vasp.c!fft;
+#X obj 67 241 vasp.cfft;
+#X obj 67 301 vasp.update;
+#X obj 67 321 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#N canvas 132 132 409 389 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 214 159 loadbang;
+#X obj 67 53 loadbang;
+#X msg 214 180 88200;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X msg 67 79 3;
+#X msg 67 133 read -resize \$1 bufrei1;
+#X obj 214 228 s bufrei1;
+#X obj 224 252 s bufimi1;
+#X connect 0 0 7 0;
+#X connect 3 0 11 0;
+#X connect 3 0 12 0;
+#X connect 4 0 6 0;
+#X connect 5 0 9 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 2 0;
+#X connect 7 1 1 0;
+#X connect 7 2 3 0;
+#X connect 8 0 10 0;
+#X connect 9 0 8 0;
+#X connect 10 0 0 0;
+#X restore 813 559 pd inside;
+#X obj 67 261 vasp.upper;
+#X obj 67 281 vasp.= 0;
+#X text 157 283 clear upper (mirrored frequencies);
+#X text 536 375 0 Hz;
+#X text 674 379 sr/2;
+#X text 813 377 44.1 kHz;
+#X text 198 515 invers transform back to the time domain;
+#X obj 424 352 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 66 465 vasp.update;
+#X obj 66 485 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 544 395 s \$0-data;
+#N canvas 109 162 271 247 tovasp 0;
+#N canvas 0 0 577 409 conversion 0;
+#X obj 123 53 inlet;
+#X obj 123 93 unpack;
+#X obj 160 182 r \$0-sample-length;
+#X obj 123 242 / 1;
+#X obj 154 242 / 1;
+#X obj 123 268 * 44100;
+#X obj 202 207 loadbang;
+#X obj 202 230 samplerate~;
+#X obj 123 299 outlet;
+#X obj 180 269 * 44100;
+#X obj 180 300 outlet;
+#X obj 366 253 runden;
+#X obj 366 231 - 0;
+#X text 450 272 offset;
+#X obj 366 177 t b f;
+#X obj 366 206 0;
+#X obj 366 317 outlet;
+#X obj 123 116 t f f f;
+#X text 370 271 length;
+#X obj 447 254 runden;
+#X text 121 326 lb (Hz);
+#X text 183 325 rb (Hz);
+#X obj 366 295 pack;
+#X obj 123 73 change2;
+#X floatatom 459 223 12 0 0 0 - - -;
+#X floatatom 453 310 5 0 0 0 - - -;
+#X connect 0 0 23 0;
+#X connect 1 0 17 0;
+#X connect 1 1 4 0;
+#X connect 1 1 15 1;
+#X connect 2 0 3 1;
+#X connect 2 0 4 1;
+#X connect 3 0 5 0;
+#X connect 4 0 9 0;
+#X connect 5 0 8 0;
+#X connect 6 0 7 0;
+#X connect 7 0 5 1;
+#X connect 7 0 9 1;
+#X connect 9 0 10 0;
+#X connect 11 0 22 0;
+#X connect 12 0 11 0;
+#X connect 14 0 15 0;
+#X connect 14 1 12 1;
+#X connect 15 0 12 0;
+#X connect 17 0 3 0;
+#X connect 17 1 14 0;
+#X connect 17 2 19 0;
+#X connect 17 2 24 0;
+#X connect 19 0 22 1;
+#X connect 19 0 25 0;
+#X connect 22 0 16 0;
+#X connect 23 0 1 0;
+#X restore 89 64 pd conversion;
+#X obj 89 44 r \$0-data;
+#X obj 162 153 outlet;
+#X obj 89 98 s \$0-freqdisplayl;
+#X obj 125 124 s \$0-freqdisplayr;
+#X connect 0 0 3 0;
+#X connect 0 1 4 0;
+#X connect 0 2 2 0;
+#X connect 1 0 0 0;
+#X restore 66 403 pd tovasp;
+#N canvas 0 0 140 20 Herznumbers 0;
+#X obj 0 0 cnv 15 140 20 empty empty empty 20 12 0 14 -262144 -66577
+0;
+#X floatatom 0 3 8 0 0 0 - - -;
+#X floatatom 83 3 8 0 0 0 - - -;
+#X obj 28 30 r \$0-freqdisplayl;
+#X obj 28 54 r \$0-freqdisplayr;
+#X connect 3 0 1 0;
+#X connect 4 0 2 0;
+#X coords 0 0 1 1 140 20 1;
+#X restore 642 434 pd Herznumbers;
+#X text 547 436 selection from;
+#X text 701 436 to;
+#X obj 523 512 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 545 509 play;
+#X text 657 511 clear;
+#X text 785 436 Hz;
+#X text 65 370 draw inside the wavedisplay and press spacebar (select)
+or "s" (shift).;
+#X msg 67 221 vasp bufrei1 bufimi1;
+#X msg 66 424 set vasp \$1 bufrei1 \$2 bufimi1 \$2;
+#X msg 66 517 vasp bufrei1 bufimi1;
+#X msg 657 533 vasp bufrei1 bufimi1;
+#X msg 67 113 vasp bufrei1;
+#X text 67 64 change gain of a region in the frequency domain to filter
+a buffer content;
+#X text 205 221 transform to frequency domain;
+#X text 65 355 select a region (frequecy band) \, a gainfactor;
+#X floatatom 348 353 5 0 0 0 - - -;
+#X obj 66 444 vasp.* 1;
+#X text 395 353 and;
+#X obj 544 113 synchrodisplay bufrei1 bufimi1 \$0;
+#X obj 523 532 tabplay~ bufrei1;
+#X connect 4 0 6 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 9 0 10 0;
+#X connect 11 0 9 0;
+#X connect 12 0 16 0;
+#X connect 13 0 14 0;
+#X connect 16 0 17 0;
+#X connect 17 0 13 0;
+#X connect 23 0 45 0;
+#X connect 24 0 25 0;
+#X connect 27 0 37 0;
+#X connect 31 0 48 0;
+#X connect 36 0 12 0;
+#X connect 37 0 45 0;
+#X connect 38 0 11 0;
+#X connect 39 0 2 0;
+#X connect 40 0 4 0;
+#X connect 44 0 45 1;
+#X connect 45 0 24 0;
+#X connect 47 0 26 0;
+#X connect 48 0 1 0;
+#X connect 48 0 1 1;
diff --git a/externals/grill/vasp/pd/fly.aif b/externals/grill/vasp/pd/fly.aif
new file mode 100644
index 00000000..0439b85a
--- /dev/null
+++ b/externals/grill/vasp/pd/fly.aif
Binary files differ
diff --git a/externals/grill/vasp/pd/phase-random_example.pd b/externals/grill/vasp/pd/phase-random_example.pd
new file mode 100644
index 00000000..740f9ea4
--- /dev/null
+++ b/externals/grill/vasp/pd/phase-random_example.pd
@@ -0,0 +1,86 @@
+#N canvas 77 150 893 542 10;
+#X obj 75 32 cnv 15 15 15 empty empty phase-random_example 0 10 1 14
+-262144 -1 0;
+#N canvas 92 108 411 413 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 214 159 loadbang;
+#X obj 67 53 loadbang;
+#X msg 214 180 88200;
+#X obj 66 178 t b f f;
+#X obj 67 101 filelisthandler \$0;
+#X obj 214 228 s bufpol3;
+#X msg 67 133 read -resize \$1 bufpol3;
+#X msg 67 79 3;
+#X obj 226 254 s bufpol4;
+#X connect 0 0 7 0;
+#X connect 3 0 9 0;
+#X connect 3 0 12 0;
+#X connect 4 0 6 0;
+#X connect 5 0 11 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 2 0;
+#X connect 7 1 1 0;
+#X connect 7 2 3 0;
+#X connect 8 0 10 0;
+#X connect 10 0 0 0;
+#X connect 11 0 8 0;
+#X restore 781 472 pd inside;
+#X obj 427 469 dac~;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 561 469 pd clear_buffers;
+#X obj 427 426 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 449 423 play;
+#X text 561 424 clear;
+#X obj 495 192 wavedisplay-simple bufpol3 \$0;
+#X obj 69 95 filelist \$0;
+#X obj 427 446 tabplay~ bufpol3;
+#X msg 68 188 vasp bufpol3 bufpol4;
+#X obj 68 213 vasp.cfft;
+#X obj 68 237 vasp.polar;
+#X obj 68 261 vasp.split 2;
+#X obj 101 284 vasp.noise;
+#X obj 101 308 vasp.* 3.14159;
+#X obj 68 336 vasp.join 2;
+#X obj 68 359 vasp.rect;
+#X obj 68 381 vasp.c!fft;
+#X obj 68 405 vasp.update;
+#X obj 68 428 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 720 449 table bufpol4 88200;
+#X msg 561 446 vasp bufpol3 bufpol4;
+#X text 157 213 complex fourier transformation;
+#X text 158 236 cartesian to polar coordinate conversion;
+#X text 158 258 split amplitude and phase;
+#X text 202 280 random phase;
+#X text 205 307 scale from 0 to 2*Pi;
+#X text 156 335 polar to cartesian coordinate conversion;
+#X obj 69 472 vasp.freeze;
+#X text 152 472 is an abstraction that does the same;
+#X connect 4 0 9 0;
+#X connect 9 0 2 0;
+#X connect 9 0 2 1;
+#X connect 10 0 11 0;
+#X connect 11 0 12 0;
+#X connect 12 0 13 0;
+#X connect 13 0 16 0;
+#X connect 13 1 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 16 1;
+#X connect 16 0 17 0;
+#X connect 17 0 18 0;
+#X connect 18 0 19 0;
+#X connect 19 0 20 0;
+#X connect 22 0 3 0;
diff --git a/externals/grill/vasp/pd/plastic.aif b/externals/grill/vasp/pd/plastic.aif
new file mode 100644
index 00000000..06237c02
--- /dev/null
+++ b/externals/grill/vasp/pd/plastic.aif
Binary files differ
diff --git a/externals/grill/vasp/pd/ringmod_example.pd b/externals/grill/vasp/pd/ringmod_example.pd
new file mode 100644
index 00000000..5ed9c3c0
--- /dev/null
+++ b/externals/grill/vasp/pd/ringmod_example.pd
@@ -0,0 +1,63 @@
+#N canvas 34 28 860 444 10;
+#X obj 71 32 cnv 15 15 15 empty empty ringmod_example 0 10 1 14 -262144
+-1 0;
+#X obj 73 283 vasp.update;
+#X obj 391 309 dac~;
+#X obj 391 265 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 413 264 play;
+#N canvas 40 55 281 170 clear_buffer 0;
+#X obj 54 79 vasp.update;
+#X obj 54 56 vasp.= 0;
+#X obj 54 26 inlet;
+#X obj 54 108 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 3 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 523 309 pd clear_buffer;
+#X obj 73 306 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 428 95 wavedisplay-simple bufmosc1 \$0;
+#X msg 73 215 vasp bufmosc1;
+#X obj 73 260 vasp.*osc 220;
+#X text 177 214 modulate with 200 Hz;
+#X msg 523 286 vasp bufmosc1;
+#X obj 391 286 tabplay~ bufmosc1;
+#N canvas 92 108 388 353 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 214 159 loadbang;
+#X obj 66 50 loadbang;
+#X msg 214 180 88200;
+#X obj 66 178 t b f f;
+#X obj 66 98 filelisthandler \$0;
+#X msg 66 76 3;
+#X obj 214 228 s bufmosc1;
+#X msg 66 130 read -resize \$1 bufmosc1;
+#X connect 0 0 7 0;
+#X connect 3 0 10 0;
+#X connect 4 0 6 0;
+#X connect 5 0 9 0;
+#X connect 6 0 3 0;
+#X connect 6 0 1 0;
+#X connect 7 0 2 0;
+#X connect 7 1 1 0;
+#X connect 7 2 3 0;
+#X connect 8 0 11 0;
+#X connect 9 0 8 0;
+#X connect 11 0 0 0;
+#X restore 682 310 pd inside;
+#X floatatom 146 239 5 0 0;
+#X text 192 238 value;
+#X obj 79 99 filelist \$0;
+#X connect 1 0 6 0;
+#X connect 3 0 12 0;
+#X connect 8 0 9 0;
+#X connect 9 0 1 0;
+#X connect 11 0 5 0;
+#X connect 12 0 2 0;
+#X connect 12 0 2 1;
+#X connect 14 0 9 1;
diff --git a/externals/grill/vasp/pd/runden.pd b/externals/grill/vasp/pd/runden.pd
new file mode 100644
index 00000000..e73faeb5
--- /dev/null
+++ b/externals/grill/vasp/pd/runden.pd
@@ -0,0 +1,27 @@
+#N canvas 25 60 429 365 10;
+#X msg 159 115 10;
+#X obj 159 92 loadbang;
+#X obj 159 137 pow \$1;
+#X obj 79 120 * 1;
+#X obj 79 90 inlet;
+#X obj 120 167 / 1;
+#X msg 120 145 1;
+#X obj 79 145 + 0.5;
+#X obj 79 170 div;
+#X obj 79 217 outlet;
+#X obj 79 193 * 1;
+#X text 41 297 rounds to a certain number of kommadigits;
+#X text 32 267 USE: arg for number of kommavalues(?) default = 0;
+#X text 41 309 0.123456 --> runden 2 --> 0.12;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 1;
+#X connect 2 0 5 1;
+#X connect 2 0 6 0;
+#X connect 3 0 7 0;
+#X connect 4 0 3 0;
+#X connect 5 0 10 1;
+#X connect 6 0 5 0;
+#X connect 7 0 8 0;
+#X connect 8 0 10 0;
+#X connect 10 0 9 0;
diff --git a/externals/grill/vasp/pd/synchrodisplay.pd b/externals/grill/vasp/pd/synchrodisplay.pd
new file mode 100644
index 00000000..39a93222
--- /dev/null
+++ b/externals/grill/vasp/pd/synchrodisplay.pd
@@ -0,0 +1,13 @@
+#N canvas 134 215 300 250 10;
+#X text 440 100 synchronizes two displays.;
+#X text 440 110 args: buffername1 buffername2 \$0 of parent patch;
+#X obj 0 0 cnv 15 304 250 empty empty empty 20 12 0 14 -262144 -66577
+0;
+#X obj -2 0 wavedisplay-select \$1 \$3;
+#X obj -2 142 wavedisplay-select \$2 \$3;
+#X obj 363 225 outlet;
+#X connect 3 0 5 0;
+#X connect 3 1 4 0;
+#X connect 4 0 5 0;
+#X connect 4 1 3 0;
+#X coords 0 0 1 1 300 250 1;
diff --git a/externals/grill/vasp/pd/vasp.clr0.pd b/externals/grill/vasp/pd/vasp.clr0.pd
new file mode 100644
index 00000000..188b3667
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.clr0.pd
@@ -0,0 +1,12 @@
+#N canvas 371 329 454 304 12;
+#X obj 47 36 inlet;
+#X obj 48 181 outlet;
+#X obj 48 149 vasp.sync 2;
+#X obj 110 82 vasp.frames 1;
+#X obj 110 109 vasp.= 0;
+#X text 44 1 clears the sample 0;
+#X connect 0 0 2 0;
+#X connect 0 0 3 0;
+#X connect 2 0 1 0;
+#X connect 3 0 4 0;
+#X connect 4 0 2 1;
diff --git a/externals/grill/vasp/pd/vasp.conv.pd b/externals/grill/vasp/pd/vasp.conv.pd
new file mode 100644
index 00000000..93390159
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.conv.pd
@@ -0,0 +1,28 @@
+#N canvas 30 70 406 306 12;
+#X obj 53 224 vasp.c!fft;
+#X obj 162 131 vasp.sync 2;
+#X obj 178 104 vasp.= 0;
+#X obj 179 80 vasp.im;
+#X obj 161 158 vasp.cfft;
+#X obj 54 198 vasp.c*;
+#X obj 54 131 vasp.sync 2;
+#X obj 70 104 vasp.= 0;
+#X obj 71 80 vasp.im;
+#X obj 53 158 vasp.cfft;
+#X obj 54 51 inlet;
+#X obj 168 52 inlet;
+#X obj 52 252 outlet;
+#X connect 0 0 12 0;
+#X connect 1 0 4 0;
+#X connect 2 0 1 1;
+#X connect 3 0 2 0;
+#X connect 4 0 5 1;
+#X connect 5 0 0 0;
+#X connect 6 0 9 0;
+#X connect 7 0 6 1;
+#X connect 8 0 7 0;
+#X connect 9 0 5 0;
+#X connect 10 0 6 0;
+#X connect 10 0 8 0;
+#X connect 11 0 1 0;
+#X connect 11 0 3 0;
diff --git a/externals/grill/vasp/pd/vasp.even.pd b/externals/grill/vasp/pd/vasp.even.pd
new file mode 100644
index 00000000..d93030c4
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.even.pd
@@ -0,0 +1,12 @@
+#N canvas 0 0 247 229 12;
+#X obj 40 15 inlet;
+#X obj 40 48 vasp.frames?;
+#X obj 40 80 % 2;
+#X obj 40 110 == 0;
+#X obj 40 142 outlet;
+#X text 130 106 1 if even;
+#X text 131 131 0 if odd;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
diff --git a/externals/grill/vasp/pd/vasp.freeze.pd b/externals/grill/vasp/pd/vasp.freeze.pd
new file mode 100644
index 00000000..5c7f89e2
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.freeze.pd
@@ -0,0 +1,22 @@
+#N canvas 641 14 270 354 12;
+#X obj 27 46 vasp.cfft;
+#X obj 108 133 vasp.noise;
+#X obj 27 104 vasp.split 2;
+#X obj 27 190 vasp.join 2;
+#X obj 27 8 inlet;
+#X obj 27 286 outlet;
+#X obj 27 74 vasp.polar;
+#X obj 106 160 vasp.* 3.14159;
+#X text 88 7 produce static sound;
+#X obj 27 254 vasp.c!fft;
+#X obj 27 220 vasp.rect;
+#X connect 0 0 6 0;
+#X connect 1 0 7 0;
+#X connect 2 0 3 0;
+#X connect 2 1 1 0;
+#X connect 3 0 10 0;
+#X connect 4 0 0 0;
+#X connect 6 0 2 0;
+#X connect 7 0 3 1;
+#X connect 9 0 5 0;
+#X connect 10 0 9 0;
diff --git a/externals/grill/vasp/pd/vasp.hilbert.pd b/externals/grill/vasp/pd/vasp.hilbert.pd
new file mode 100644
index 00000000..875484b4
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.hilbert.pd
@@ -0,0 +1,28 @@
+#N canvas 449 154 295 470 12;
+#X obj 20 35 inlet;
+#X obj 20 335 outlet;
+#X obj 20 150 vasp.cfft;
+#X obj 125 225 vasp.= 0;
+#X text 19 8 Hilbert transformation;
+#X obj 125 197 vasp.upper;
+#X obj 54 63 vasp.im;
+#X obj 54 91 vasp.= 0;
+#X obj 20 120 vasp.sync 2;
+#X obj 20 301 vasp.c!fft;
+#X obj 20 269 vasp.sync 3;
+#X obj 33 197 vasp.lower;
+#X obj 33 225 vasp.* 2;
+#X connect 0 0 6 0;
+#X connect 0 0 8 0;
+#X connect 2 0 10 0;
+#X connect 2 0 5 0;
+#X connect 2 0 11 0;
+#X connect 3 0 10 2;
+#X connect 5 0 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 1;
+#X connect 8 0 2 0;
+#X connect 9 0 1 0;
+#X connect 10 0 9 0;
+#X connect 11 0 12 0;
+#X connect 12 0 10 1;
diff --git a/externals/grill/vasp/pd/vasp.im.pd b/externals/grill/vasp/pd/vasp.im.pd
new file mode 100644
index 00000000..a0ba9480
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.im.pd
@@ -0,0 +1,6 @@
+#N canvas 409 205 190 154 12;
+#X obj 38 17 inlet;
+#X obj 39 90 outlet;
+#X obj 39 53 vasp.n 1;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
diff --git a/externals/grill/vasp/pd/vasp.lower.pd b/externals/grill/vasp/pd/vasp.lower.pd
new file mode 100644
index 00000000..2c12dd09
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.lower.pd
@@ -0,0 +1,19 @@
+#N canvas 42 186 290 378 12;
+#X obj 117 129 vasp.frames?;
+#X obj 23 224 vasp.frames;
+#X obj 23 35 inlet;
+#X obj 23 254 outlet;
+#X text 24 9 lower half of a vasp;
+#X obj 117 162 / 2;
+#X obj 117 192 + 0.9;
+#X text 164 191 round up;
+#X obj 64 101 vasp.radio;
+#X obj 22 71 vasp.multi;
+#X connect 0 0 5 0;
+#X connect 1 0 3 0;
+#X connect 2 0 9 0;
+#X connect 5 0 6 0;
+#X connect 6 0 1 1;
+#X connect 8 1 0 0;
+#X connect 9 0 1 0;
+#X connect 9 1 8 0;
diff --git a/externals/grill/vasp/pd/vasp.odd.pd b/externals/grill/vasp/pd/vasp.odd.pd
new file mode 100644
index 00000000..fe2327c5
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.odd.pd
@@ -0,0 +1,10 @@
+#N canvas 0 0 198 227 12;
+#X obj 40 15 inlet;
+#X obj 40 48 vasp.frames?;
+#X obj 40 80 % 2;
+#X obj 40 142 outlet;
+#X obj 39 110 != 0;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X connect 4 0 3 0;
diff --git a/externals/grill/vasp/pd/vasp.opt.pd b/externals/grill/vasp/pd/vasp.opt.pd
new file mode 100644
index 00000000..283d24da
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.opt.pd
@@ -0,0 +1,35 @@
+#N canvas 504 38 462 476 12;
+#X obj 27 11 inlet;
+#X obj 90 158 vasp.amax?;
+#X obj 35 206 route 0 1;
+#X obj 107 393 outlet;
+#X obj 165 393 outlet;
+#X obj 27 306 vasp;
+#X obj 47 255 t b;
+#X obj 90 116 vasp.m 2;
+#X obj 105 345 vasp./;
+#X obj 117 253 t b f;
+#X obj 106 301 vasp;
+#X obj 90 78 vasp;
+#X text 131 79 catch messages ("to" not handled);
+#X obj 28 41 vasp.radio;
+#X connect 0 0 13 0;
+#X connect 1 1 2 0;
+#X connect 1 1 4 0;
+#X connect 2 0 6 0;
+#X connect 2 1 6 0;
+#X connect 2 2 9 0;
+#X connect 5 0 3 0;
+#X connect 6 0 5 0;
+#X connect 7 0 1 0;
+#X connect 7 1 5 1;
+#X connect 7 1 10 1;
+#X connect 8 0 3 0;
+#X connect 9 0 10 0;
+#X connect 9 1 8 1;
+#X connect 10 0 8 0;
+#X connect 11 0 7 0;
+#X connect 13 0 10 0;
+#X connect 13 0 5 0;
+#X connect 13 0 1 0;
+#X connect 13 1 11 0;
diff --git a/externals/grill/vasp/pd/vasp.ov.pd b/externals/grill/vasp/pd/vasp.ov.pd
new file mode 100644
index 00000000..f70adaa2
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.ov.pd
@@ -0,0 +1,10 @@
+#N canvas 38 67 456 306 12;
+#X obj 28 23 inlet;
+#X obj 26 80 vasp.update;
+#X obj 29 111 outlet;
+#X obj 27 51 vasp.opt;
+#X obj 98 112 outlet;
+#X connect 0 0 3 0;
+#X connect 1 0 2 0;
+#X connect 3 0 1 0;
+#X connect 3 1 4 0;
diff --git a/externals/grill/vasp/pd/vasp.pwrap.pd b/externals/grill/vasp/pd/vasp.pwrap.pd
new file mode 100644
index 00000000..83ea062d
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.pwrap.pd
@@ -0,0 +1,10 @@
+#N canvas 40 55 404 304 12;
+#X obj 50 149 vasp.- 3.14159;
+#X obj 50 120 vasp.% 6.28319;
+#X obj 50 88 vasp.+ 3.14159;
+#X obj 50 49 inlet;
+#X obj 50 223 outlet;
+#X connect 0 0 4 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X connect 3 0 2 0;
diff --git a/externals/grill/vasp/pd/vasp.re.pd b/externals/grill/vasp/pd/vasp.re.pd
new file mode 100644
index 00000000..1e18c922
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.re.pd
@@ -0,0 +1,6 @@
+#N canvas 409 205 190 154 12;
+#X obj 38 17 inlet;
+#X obj 39 53 vasp.n 0;
+#X obj 39 90 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
diff --git a/externals/grill/vasp/pd/vasp.ropt.pd b/externals/grill/vasp/pd/vasp.ropt.pd
new file mode 100644
index 00000000..f02e5cd0
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.ropt.pd
@@ -0,0 +1,30 @@
+#N canvas 50 31 462 451 12;
+#X obj 114 14 inlet;
+#X obj 114 42 vasp;
+#X text 154 41 catch messages ("to" not handled);
+#X obj 84 169 route 0 1;
+#X obj 85 302 vasp;
+#X obj 85 238 t b;
+#X obj 108 89 vasp.m 2;
+#X obj 165 221 t b f;
+#X obj 110 126 vasp.rmax?;
+#X obj 151 309 vasp.c/;
+#X obj 155 270 vasp;
+#X obj 117 390 outlet;
+#X obj 277 397 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 6 0;
+#X connect 3 0 5 0;
+#X connect 3 1 5 0;
+#X connect 3 2 7 0;
+#X connect 4 0 11 0;
+#X connect 5 0 4 0;
+#X connect 6 0 8 0;
+#X connect 6 1 4 1;
+#X connect 6 1 10 1;
+#X connect 7 0 10 0;
+#X connect 7 1 9 1;
+#X connect 8 1 3 0;
+#X connect 8 1 12 0;
+#X connect 9 0 11 0;
+#X connect 10 0 9 0;
diff --git a/externals/grill/vasp/pd/vasp.spin.pd b/externals/grill/vasp/pd/vasp.spin.pd
new file mode 100644
index 00000000..a2c55273
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.spin.pd
@@ -0,0 +1,22 @@
+#N canvas 486 219 326 391 12;
+#X obj 71 171 vasp.pwrap;
+#X obj 25 285 vasp.rect;
+#X obj 25 259 vasp.join 2;
+#X obj 71 223 vasp.int;
+#X obj 71 197 vasp.* \$1;
+#X obj 70 145 vasp.dif;
+#X obj 25 81 vasp.polar;
+#X obj 25 110 vasp.split 2;
+#X text 26 31 multiply phase velocity by argument factor;
+#X obj 25 56 inlet;
+#X obj 24 316 outlet;
+#X connect 0 0 4 0;
+#X connect 1 0 10 0;
+#X connect 2 0 1 0;
+#X connect 3 0 2 1;
+#X connect 4 0 3 0;
+#X connect 5 0 0 0;
+#X connect 6 0 7 0;
+#X connect 7 0 2 0;
+#X connect 7 1 5 0;
+#X connect 9 0 6 0;
diff --git a/externals/grill/vasp/pd/vasp.upper.pd b/externals/grill/vasp/pd/vasp.upper.pd
new file mode 100644
index 00000000..415fc267
--- /dev/null
+++ b/externals/grill/vasp/pd/vasp.upper.pd
@@ -0,0 +1,22 @@
+#N canvas 488 210 290 362 12;
+#X obj 87 158 / 2;
+#X obj 22 34 inlet;
+#X obj 22 300 outlet;
+#X text 18 6 upper half of a vasp;
+#X obj 125 191 + 0.9;
+#X text 175 191 round up;
+#X obj 59 98 vasp.radio;
+#X obj 22 66 vasp.multi;
+#X obj 88 130 vasp.frames?;
+#X obj 22 264 vasp.frames;
+#X obj 22 222 vasp.offset+;
+#X connect 0 0 4 0;
+#X connect 0 0 9 1;
+#X connect 1 0 7 0;
+#X connect 4 0 10 1;
+#X connect 6 1 8 0;
+#X connect 7 0 10 0;
+#X connect 7 1 6 0;
+#X connect 8 0 0 0;
+#X connect 9 0 2 0;
+#X connect 10 0 9 0;
diff --git a/externals/grill/vasp/pd/vaspset_examples.pd b/externals/grill/vasp/pd/vaspset_examples.pd
new file mode 100644
index 00000000..706f5474
--- /dev/null
+++ b/externals/grill/vasp/pd/vaspset_examples.pd
@@ -0,0 +1,109 @@
+#N canvas 27 56 975 554 10;
+#X obj 519 287 wavedisplay-simple bufsetb \$0;
+#X obj 519 265 r bufsetb-length;
+#X obj 71 125 filelist \$0;
+#N canvas 92 108 429 349 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 66 52 loadbang;
+#X obj 66 178 t b f f;
+#X obj 66 100 filelisthandler \$0;
+#X msg 66 78 2;
+#X msg 66 132 read -resize \$1 bufseta;
+#X obj 214 237 s bufseta;
+#X obj 279 238 s bufsetb;
+#X connect 0 0 5 0;
+#X connect 3 0 9 0;
+#X connect 3 0 10 0;
+#X connect 4 0 7 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 8 0;
+#X connect 7 0 6 0;
+#X connect 8 0 0 0;
+#X restore 780 485 pd inside;
+#X obj 515 83 wavedisplay-select bufseta \$0;
+#X text 467 82 A;
+#X text 465 286 B;
+#X text 67 46 use vasp.= to copy from buffer a to buffer b;
+#X text 92 218 choose a selection from buffer a;
+#X obj 94 450 vasp.= 0;
+#X obj 94 297 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X obj 94 473 vasp.update;
+#X obj 94 493 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#N canvas 117 414 435 378 to_length_offset 0;
+#X obj 154 309 outlet;
+#X obj 107 92 unpack;
+#X obj 107 232 runden;
+#X obj 107 210 - 0;
+#X text 176 249 offset;
+#X obj 107 156 t b f;
+#X obj 107 185 0;
+#X text 111 250 length;
+#X obj 173 231 runden;
+#X obj 154 278 pack;
+#X obj 107 72 change2;
+#X obj 107 115 t f f;
+#X obj 107 47 inlet;
+#X obj 107 309 outlet;
+#X obj 200 75 unpack;
+#X floatatom 190 112 12 0 0 0 - - -;
+#X floatatom 278 112 12 0 0 0 - - -;
+#X floatatom 194 149 12 0 0 0 - - -;
+#X floatatom 282 149 12 0 0 0 - - -;
+#X connect 1 0 11 0;
+#X connect 1 0 17 0;
+#X connect 1 1 6 1;
+#X connect 1 1 18 0;
+#X connect 2 0 9 0;
+#X connect 2 0 13 0;
+#X connect 3 0 2 0;
+#X connect 5 0 6 0;
+#X connect 5 1 3 1;
+#X connect 6 0 3 0;
+#X connect 8 0 9 1;
+#X connect 9 0 0 0;
+#X connect 10 0 1 0;
+#X connect 11 0 5 0;
+#X connect 11 1 8 0;
+#X connect 12 0 10 0;
+#X connect 12 0 14 0;
+#X connect 14 0 15 0;
+#X connect 14 1 16 0;
+#X restore 324 287 pd to_length_offset;
+#X msg 94 423 vasp \$1 bufsetb;
+#X msg 211 423 vasp \$1 bufseta \$2;
+#X obj 94 322 0;
+#X obj 94 348 t f f;
+#X obj 119 371 s bufsetb-length;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 532 483 pd clear_buffers;
+#X msg 532 457 vasp bufseta \, vasp bufsetb;
+#X text 495 50 space-bar + mouse to select \, "s" + mouse to shift
+selection;
+#X connect 1 0 0 0;
+#X connect 4 0 13 0;
+#X connect 9 0 11 0;
+#X connect 10 0 16 0;
+#X connect 11 0 12 0;
+#X connect 13 0 16 1;
+#X connect 13 1 15 0;
+#X connect 14 0 9 0;
+#X connect 15 0 9 1;
+#X connect 16 0 17 0;
+#X connect 17 0 14 0;
+#X connect 17 1 18 0;
+#X connect 20 0 19 0;
diff --git a/externals/grill/vasp/pd/wavedisplay-select.pd b/externals/grill/vasp/pd/wavedisplay-select.pd
new file mode 100644
index 00000000..04b92cc9
--- /dev/null
+++ b/externals/grill/vasp/pd/wavedisplay-select.pd
@@ -0,0 +1,617 @@
+#N canvas 212 260 300 120 10;
+#N canvas 166 101 669 345 inside 0;
+#N canvas 149 25 652 578 positions 0;
+#N canvas 74 268 410 336 setpositions 0;
+#X obj 60 102 inlet;
+#X obj 220 102 inlet;
+#X text 60 270 sets numberbox (left);
+#X text 220 270 (right);
+#X obj 60 180 runden;
+#X obj 220 180 runden;
+#X msg 60 205 set \$1;
+#X msg 220 205 set \$1;
+#X obj 60 138 change;
+#X obj 220 138 change;
+#X obj 60 246 s \$2-nboxlr;
+#X obj 220 246 s \$2-nboxrr;
+#X connect 0 0 8 0;
+#X connect 1 0 9 0;
+#X connect 4 0 6 0;
+#X connect 5 0 7 0;
+#X connect 6 0 10 0;
+#X connect 7 0 11 0;
+#X connect 8 0 4 0;
+#X connect 9 0 5 0;
+#X restore 122 446 pd setpositions;
+#N canvas 100 40 610 460 sendpositions 0;
+#X obj 66 58 inlet;
+#X obj 137 59 inlet;
+#X obj 127 264 / 1;
+#X obj 193 262 / 1;
+#X obj 127 287 runden;
+#X obj 193 287 runden;
+#X obj 127 322 s \$0-selection_l;
+#X obj 193 348 s \$0-selection_r;
+#X text 138 365 to selectioncanvas (drawselection);
+#X obj 229 155 s \$0-spos_lb;
+#X obj 312 154 s \$0-spos_rb;
+#X text 247 172 for playselections;
+#X obj 66 244 -;
+#X obj 66 408 s \$0-selection;
+#X text 197 62 in samples;
+#X text 65 425 length in samples;
+#X obj 431 174 pack 0 0;
+#X obj 431 148 t b f;
+#X obj 137 81 t f f f f;
+#X obj 66 81 t b f f f f;
+#X obj 431 196 s \$0-borderpair;
+#X obj 228 219 / 300;
+#X obj 228 197 r \$2-sample-length;
+#X connect 0 0 19 0;
+#X connect 1 0 18 0;
+#X connect 2 0 4 0;
+#X connect 3 0 5 0;
+#X connect 4 0 6 0;
+#X connect 5 0 7 0;
+#X connect 12 0 13 0;
+#X connect 16 0 20 0;
+#X connect 17 0 16 0;
+#X connect 17 1 16 1;
+#X connect 18 0 12 0;
+#X connect 18 1 3 0;
+#X connect 18 2 10 0;
+#X connect 18 3 17 0;
+#X connect 19 0 12 0;
+#X connect 19 1 12 1;
+#X connect 19 2 2 0;
+#X connect 19 3 9 0;
+#X connect 19 4 16 0;
+#X connect 21 0 3 1;
+#X connect 21 0 2 1;
+#X connect 22 0 21 0;
+#X restore 313 443 pd sendpositions;
+#X text 333 462 to graphics;
+#X obj 122 137 * 1;
+#X obj 197 137 * 1;
+#X obj 371 61 r \$0-shiftsel;
+#X obj 371 136 * 1;
+#X obj 169 247 +;
+#X obj 122 219 0;
+#X obj 170 315 t f f f;
+#X obj 333 222 0;
+#X obj 371 249 +;
+#X obj 354 317 t f f f;
+#X obj 122 61 r \$0-sel_lb;
+#X obj 197 61 r \$0-sel_rb;
+#X obj 145 174 r \$0-nboxls;
+#X obj 347 184 r \$0-nboxrs;
+#X floatatom 162 201 5 0 0;
+#X floatatom 360 211 5 0 0;
+#X text 174 31 (from sliderhandling);
+#X text 310 384 right border of sel;
+#X text 79 340 leftborder of sel;
+#X obj 333 365 t f f;
+#X obj 122 361 t f f;
+#N canvas 336 13 613 533 testborders 0;
+#X obj 90 52 inlet;
+#X obj 190 52 inlet;
+#X obj 111 488 outlet;
+#X obj 202 492 outlet;
+#X obj 177 219 0;
+#X obj 90 163 moses 0;
+#X obj 127 189 t b f;
+#X obj 139 347 0;
+#X msg 57 345 0;
+#X obj 177 270 t b f;
+#X text 259 164 test if lb < 0 and if not if rb > sample-length;
+#X obj 95 298 r \$0-selection;
+#X obj 82 345 0;
+#X obj 314 304 r \$0-selection;
+#X obj 57 200 t b b;
+#X obj 264 399 -;
+#X obj 314 326 t b f;
+#X obj 251 422 0;
+#X obj 226 270 t b b;
+#X obj 264 361 300;
+#X obj 177 244 moses 300;
+#X obj 226 296 300;
+#X obj 226 216 r \$2-sample-length;
+#X obj 264 283 r \$2-sample-length;
+#X connect 0 0 5 0;
+#X connect 1 0 4 1;
+#X connect 4 0 20 0;
+#X connect 5 0 14 0;
+#X connect 5 1 6 0;
+#X connect 6 0 4 0;
+#X connect 6 1 7 1;
+#X connect 7 0 2 0;
+#X connect 8 0 2 0;
+#X connect 9 0 7 0;
+#X connect 9 1 3 0;
+#X connect 11 0 12 1;
+#X connect 12 0 3 0;
+#X connect 13 0 16 0;
+#X connect 14 0 8 0;
+#X connect 14 1 12 0;
+#X connect 15 0 17 1;
+#X connect 16 0 19 0;
+#X connect 16 1 15 1;
+#X connect 17 0 2 0;
+#X connect 18 0 21 0;
+#X connect 18 1 17 0;
+#X connect 19 0 15 0;
+#X connect 20 0 9 0;
+#X connect 20 1 18 0;
+#X connect 21 0 3 0;
+#X connect 22 0 20 1;
+#X connect 22 0 21 1;
+#X connect 23 0 19 0;
+#X restore 233 285 pd testborders;
+#X obj 371 157 t f f;
+#X obj 245 104 / 300;
+#X obj 245 82 r \$2-sample-length;
+#X connect 3 0 8 0;
+#X connect 4 0 10 0;
+#X connect 5 0 6 0;
+#X connect 6 0 25 0;
+#X connect 7 0 24 0;
+#X connect 8 0 7 1;
+#X connect 8 0 23 0;
+#X connect 9 0 23 0;
+#X connect 9 1 8 1;
+#X connect 9 2 7 1;
+#X connect 10 0 11 1;
+#X connect 10 0 22 0;
+#X connect 11 0 24 1;
+#X connect 12 0 22 0;
+#X connect 12 1 10 1;
+#X connect 12 2 11 1;
+#X connect 13 0 3 0;
+#X connect 14 0 4 0;
+#X connect 15 0 17 0;
+#X connect 15 0 8 0;
+#X connect 16 0 18 0;
+#X connect 16 0 10 0;
+#X connect 22 0 0 1;
+#X connect 22 1 1 1;
+#X connect 23 0 0 0;
+#X connect 23 1 1 0;
+#X connect 24 0 9 0;
+#X connect 24 1 12 0;
+#X connect 25 0 7 0;
+#X connect 25 1 11 0;
+#X connect 26 0 6 1;
+#X connect 26 0 4 1;
+#X connect 26 0 3 1;
+#X connect 27 0 26 0;
+#X restore 90 129 pd positions;
+#N canvas 0 0 410 161 wavetable 0;
+#X obj 124 82 table \$1 44100;
+#X restore 91 211 pd wavetable;
+#X text 186 210 contains the sample;
+#N canvas 228 148 445 446 loadsample 0;
+#X obj 39 199 soundfiler;
+#X obj 39 66 openpanel;
+#X text 229 39 load a (new) sample to a table;
+#X text 176 313 draw the large display;
+#X msg 39 174 read -resize \$1 \$2;
+#X obj 82 121 symbol \$1;
+#X obj 39 144 pack s s;
+#X obj 39 89 t s b;
+#X obj 39 40 r \$2-load_new_sample;
+#X obj 64 272 s \$2-sample-length;
+#X obj 39 308 s \$2-draw_display;
+#X obj 39 236 t b f;
+#X connect 0 0 11 0;
+#X connect 1 0 7 0;
+#X connect 4 0 0 0;
+#X connect 5 0 6 1;
+#X connect 6 0 4 0;
+#X connect 7 0 6 0;
+#X connect 7 1 5 0;
+#X connect 8 0 1 0;
+#X connect 11 0 10 0;
+#X connect 11 1 9 0;
+#X restore 91 188 pd loadsample;
+#X text 198 187 load a new sample;
+#N canvas 46 30 520 602 drawdisplay 0;
+#X obj 193 422 vasp.frames 20;
+#X obj 193 449 vasp.offset 0;
+#X msg 83 83 bang;
+#X obj 168 137 0;
+#X obj 168 225 t f f f;
+#X obj 181 114 + 1;
+#X obj 168 252 *;
+#X text 45 80 start;
+#X text 262 215 (reset);
+#X obj 193 470 vasp.max?;
+#X obj 193 496 vasp.min?;
+#X obj 325 275 t f f;
+#X obj 168 281 t b b f;
+#X obj 76 129 until 1;
+#X obj 76 108 300;
+#X obj 276 518 tabwrite \$0+;
+#X obj 242 564 tabwrite \$0-;
+#X msg 193 336 vasp \$1;
+#X obj 193 308 symbol \$1;
+#X obj 83 46 r \$2-draw_display;
+#X obj 325 229 r \$2-sample-length;
+#X obj 325 254 / 300;
+#X obj 276 495 clip -1 1;
+#X obj 242 539 clip -1 1;
+#X obj 168 162 moses 299;
+#X msg 242 217 0;
+#X obj 217 196 t f b;
+#X connect 0 0 1 0;
+#X connect 1 0 9 0;
+#X connect 2 0 14 0;
+#X connect 3 0 5 0;
+#X connect 3 0 24 0;
+#X connect 4 0 6 0;
+#X connect 4 1 15 1;
+#X connect 4 2 16 1;
+#X connect 5 0 3 1;
+#X connect 6 0 12 0;
+#X connect 9 0 10 0;
+#X connect 9 1 22 0;
+#X connect 10 1 23 0;
+#X connect 11 0 6 1;
+#X connect 11 1 0 1;
+#X connect 12 1 18 0;
+#X connect 12 2 1 1;
+#X connect 13 0 3 0;
+#X connect 14 0 13 0;
+#X connect 17 0 0 0;
+#X connect 18 0 17 0;
+#X connect 19 0 2 0;
+#X connect 20 0 21 0;
+#X connect 21 0 11 0;
+#X connect 22 0 15 0;
+#X connect 23 0 16 0;
+#X connect 24 0 4 0;
+#X connect 24 1 26 0;
+#X connect 25 0 1 1;
+#X connect 25 0 3 1;
+#X connect 26 0 4 0;
+#X connect 26 1 25 0;
+#X restore 91 234 pd drawdisplay;
+#X text 200 233 draws the large display;
+#N canvas 123 371 417 309 sliderhandling 0;
+#X floatatom 112 145 5 0 0;
+#X floatatom 220 143 5 0 0;
+#N canvas 83 38 570 521 keyinput_s 0;
+#X obj 186 25 keyname;
+#X obj 84 446 spigot;
+#X obj 179 172 0;
+#X obj 179 116 symbol;
+#X msg 179 88 bang;
+#X obj 179 369 sel 1;
+#X msg 179 393 1;
+#X msg 152 393 0;
+#X obj 152 414 s \$0-spig1;
+#X obj 227 415 s \$0-spig1;
+#X msg 227 394 1;
+#X msg 254 394 0;
+#X obj 179 345 change;
+#X obj 84 67 inlet;
+#X obj 84 472 outlet;
+#X obj 179 144 sel s;
+#X text 276 67 if key "s" is down \, then input is let through;
+#X text 332 85 shifts display;
+#X obj 297 473 outlet;
+#X obj 179 223 t b b 0;
+#X obj 201 266 delay 100;
+#X msg 201 245 stop;
+#X obj 179 201 sel 0 1;
+#X obj 179 313 0;
+#X msg 179 289 1;
+#X text 255 242 linux and win have different up/down behaviour...;
+#X text 232 297 only if there is no new input for 100 ms after 0 \,
+0 is sent out;
+#X connect 0 0 2 1;
+#X connect 0 0 4 0;
+#X connect 0 1 3 1;
+#X connect 1 0 14 0;
+#X connect 2 0 22 0;
+#X connect 3 0 15 0;
+#X connect 4 0 3 0;
+#X connect 5 0 6 0;
+#X connect 5 0 7 0;
+#X connect 5 0 18 0;
+#X connect 5 1 10 0;
+#X connect 5 1 11 0;
+#X connect 6 0 1 1;
+#X connect 7 0 8 0;
+#X connect 10 0 9 0;
+#X connect 11 0 1 1;
+#X connect 12 0 5 0;
+#X connect 13 0 1 0;
+#X connect 15 0 2 0;
+#X connect 19 0 20 0;
+#X connect 19 1 21 0;
+#X connect 19 2 23 1;
+#X connect 20 0 23 0;
+#X connect 21 0 20 0;
+#X connect 22 0 19 0;
+#X connect 22 1 24 0;
+#X connect 23 0 12 0;
+#X connect 24 0 23 0;
+#X restore 206 117 pd keyinput_s;
+#N canvas 49 247 417 326 spacehandling 0;
+#X obj 60 26 inlet;
+#X obj 164 26 inlet;
+#X obj 138 119 0;
+#X obj 60 157 moses 0;
+#X obj 85 205 0;
+#X obj 60 180 t f b;
+#X obj 160 209 0;
+#X obj 135 184 t f b;
+#X text 188 186 checks range direction;
+#X obj 60 236 s \$0-sel_lb;
+#X obj 135 236 s \$0-sel_rb;
+#X text 141 61 first position after hit is ref;
+#X obj 214 133 spigot;
+#X msg 245 99 1;
+#X obj 214 162 t f b;
+#X msg 219 99 0;
+#X text 159 45 down;
+#X obj 60 60 t f b f f;
+#X connect 0 0 17 0;
+#X connect 1 0 13 0;
+#X connect 2 0 3 1;
+#X connect 2 0 4 1;
+#X connect 2 0 6 1;
+#X connect 3 0 5 0;
+#X connect 3 1 7 0;
+#X connect 4 0 10 0;
+#X connect 5 0 9 0;
+#X connect 5 1 4 0;
+#X connect 6 0 9 0;
+#X connect 7 0 10 0;
+#X connect 7 1 6 0;
+#X connect 12 0 14 0;
+#X connect 13 0 12 1;
+#X connect 14 0 2 1;
+#X connect 14 1 15 0;
+#X connect 15 0 12 1;
+#X connect 17 0 3 0;
+#X connect 17 1 2 0;
+#X connect 17 2 12 0;
+#X restore 80 178 pd spacehandling;
+#N canvas 523 338 360 357 s_handling 0;
+#X obj 85 27 inlet;
+#X obj 85 305 s \$0-sliderr;
+#X msg 85 279 set \$1;
+#X obj 85 249 0;
+#X obj 85 202 -;
+#X obj 85 225 t b f;
+#X obj 171 264 s \$0-shiftsel;
+#X floatatom 200 295 5 0 0;
+#X obj 204 28 inlet;
+#X text 146 48 first position after hit is ref;
+#X obj 173 116 spigot;
+#X msg 204 82 1;
+#X obj 173 145 t f b;
+#X msg 178 82 0;
+#X text 203 12 down;
+#X obj 85 84 t f f;
+#X connect 0 0 15 0;
+#X connect 2 0 1 0;
+#X connect 3 0 2 0;
+#X connect 4 0 5 0;
+#X connect 5 0 3 0;
+#X connect 5 1 6 0;
+#X connect 5 1 7 0;
+#X connect 8 0 11 0;
+#X connect 10 0 12 0;
+#X connect 11 0 10 1;
+#X connect 12 0 4 1;
+#X connect 12 0 3 1;
+#X connect 12 1 13 0;
+#X connect 13 0 10 1;
+#X connect 15 0 4 0;
+#X connect 15 1 10 0;
+#X restore 206 179 pd s_handling;
+#X obj 80 33 r \$0-sliders;
+#X floatatom 124 58 5 0 0;
+#N canvas 578 111 637 561 keyinput_space2 0;
+#X obj 82 464 spigot;
+#X floatatom 94 498 5 0 0;
+#X msg 141 414 1;
+#X msg 114 414 0;
+#X obj 114 435 s \$0-spig1;
+#X obj 194 436 s \$0-spig1;
+#X msg 194 415 1;
+#X msg 221 415 0;
+#X obj 150 119 key;
+#X obj 177 119 keyup;
+#X obj 141 168 sel 32;
+#X obj 141 191 0;
+#X obj 141 145 0;
+#X obj 218 144 t b f;
+#X obj 218 119 keyname;
+#X obj 82 86 inlet;
+#X obj 82 528 outlet;
+#X text 84 53 if spacebar is down \, then input is let through;
+#X obj 141 357 change;
+#X obj 141 380 sel 1 0;
+#X obj 171 525 outlet;
+#X text 174 505 down;
+#X obj 223 526 outlet;
+#X text 226 506 up;
+#X obj 141 235 t b b 0;
+#X obj 163 278 delay 100;
+#X msg 163 257 stop;
+#X obj 141 213 sel 0 1;
+#X obj 141 325 0;
+#X msg 141 301 1;
+#X text 217 254 linux and win have different up/down behaviour...;
+#X text 194 309 only if there is no new input for 100 ms after 0 \,
+0 is sent out;
+#X connect 0 0 1 0;
+#X connect 0 0 16 0;
+#X connect 2 0 0 1;
+#X connect 3 0 4 0;
+#X connect 6 0 5 0;
+#X connect 7 0 0 1;
+#X connect 8 0 12 1;
+#X connect 9 0 12 1;
+#X connect 10 0 11 0;
+#X connect 11 0 27 0;
+#X connect 12 0 10 0;
+#X connect 13 0 12 0;
+#X connect 13 1 11 1;
+#X connect 14 0 13 0;
+#X connect 15 0 0 0;
+#X connect 18 0 19 0;
+#X connect 19 0 2 0;
+#X connect 19 0 3 0;
+#X connect 19 0 20 0;
+#X connect 19 1 6 0;
+#X connect 19 1 7 0;
+#X connect 19 1 22 0;
+#X connect 24 0 25 0;
+#X connect 24 1 26 0;
+#X connect 24 2 28 1;
+#X connect 25 0 28 0;
+#X connect 26 0 25 0;
+#X connect 27 0 24 0;
+#X connect 27 1 29 0;
+#X connect 28 0 18 0;
+#X connect 29 0 28 0;
+#X restore 80 117 pd keyinput_space2;
+#X obj 80 79 t f f;
+#X obj 176 33 r \$0-fromothers;
+#X connect 2 0 1 0;
+#X connect 2 0 4 0;
+#X connect 2 1 4 1;
+#X connect 5 0 6 0;
+#X connect 5 0 8 0;
+#X connect 7 0 0 0;
+#X connect 7 0 3 0;
+#X connect 7 1 3 1;
+#X connect 8 0 7 0;
+#X connect 8 1 2 0;
+#X connect 9 0 8 0;
+#X restore 91 94 pd sliderhandling;
+#X text 186 124 receiving inputs \, conversions and settings of slider-
+and graphic-positions;
+#X text 233 96 the slider sets curser and borders...;
+#N canvas 217 166 683 484 drawselection 0;
+#X obj 445 186 t b f;
+#X obj 61 221 t b f;
+#X obj 223 187 -;
+#X obj 223 139 t b f;
+#X obj 61 88 runden 0;
+#X obj 234 86 runden 0;
+#X msg 61 293 \; \$1-selectionr pos \$2 \$3;
+#X obj 61 197 + 0;
+#X obj 61 269 pack \$0 0 0;
+#X msg 445 232 \; \$1-selectionr vis_size \$2 \$3;
+#X obj 61 60 r \$0-selection_l;
+#X obj 234 58 r \$0-selection_r;
+#X obj 124 198 loadbang;
+#X obj 223 209 sel 0;
+#X obj 479 378 pack 0 \$0;
+#X msg 479 402 \; \$2-selectionr color \$1;
+#X msg 479 309 17;
+#X obj 479 354 change;
+#X obj 479 331 0;
+#X text 45 6 shows a light-blue colored canvas;
+#X text 44 21 when a part is selected;
+#X obj 61 142 change;
+#X obj 445 164 change;
+#X obj 445 208 pack \$0 300 120;
+#X obj 223 163 300;
+#X msg 446 309 6;
+#X msg 248 294 \; \$1-selectionr vis_size \$2 \$3;
+#X obj 248 270 pack \$0 0 120;
+#X obj 223 234 t b b;
+#X msg 122 223 0;
+#X msg 89 197 3;
+#X text 477 291 if size=0 then it will be hidden;
+#X connect 0 0 23 0;
+#X connect 0 1 23 1;
+#X connect 1 0 8 0;
+#X connect 1 1 8 1;
+#X connect 2 0 13 0;
+#X connect 3 0 24 0;
+#X connect 3 1 2 1;
+#X connect 4 0 3 0;
+#X connect 4 0 21 0;
+#X connect 5 0 24 0;
+#X connect 7 0 1 0;
+#X connect 8 0 6 0;
+#X connect 10 0 4 0;
+#X connect 11 0 5 0;
+#X connect 12 0 29 0;
+#X connect 12 0 30 0;
+#X connect 13 0 28 0;
+#X connect 13 1 16 0;
+#X connect 13 1 22 0;
+#X connect 14 0 15 0;
+#X connect 16 0 18 0;
+#X connect 17 0 14 0;
+#X connect 18 0 17 0;
+#X connect 21 0 7 0;
+#X connect 22 0 0 0;
+#X connect 23 0 9 0;
+#X connect 24 0 2 0;
+#X connect 25 0 18 0;
+#X connect 27 0 26 0;
+#X connect 28 0 25 0;
+#X connect 28 1 27 0;
+#X connect 29 0 8 2;
+#X connect 30 0 7 1;
+#X restore 91 166 pd drawselection;
+#X text 211 163 draws the light blue selection;
+#N canvas 149 160 490 235 init 0;
+#X obj 33 19 loadbang;
+#X obj 33 86 s \$0-;
+#X msg 33 44 xticks 0 30 5 \, ylabel 315 -1 -0.5 0 0.5 \, yticks 0
+0.25 2;
+#X msg 33 150 44100;
+#X obj 33 128 loadbang;
+#X obj 33 173 s \$2-sample-length;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X connect 3 0 5 0;
+#X connect 4 0 3 0;
+#X restore 92 261 pd init;
+#N canvas 0 0 445 185 synchronize_several_displays 0;
+#X obj 232 68 r \$0-sliders;
+#X obj 126 67 r \$0-synchroin;
+#X obj 232 104 s \$0-synchroout;
+#X obj 126 104 s \$0-fromothers;
+#X connect 0 0 2 0;
+#X connect 1 0 3 0;
+#X restore 92 285 pd synchronize_several_displays;
+#X restore 332 83 pd inside;
+#X obj 399 96 outlet;
+#X obj 3 0 hsl 300 120 0 299 0 0 \$0-sliders \$0-sliderr empty -2 -6
+1728 8 -262144 -1 -1 14500 0;
+#X obj 0 0 cnv 15 305 120 empty empty empty 20 12 0 14 -262144 -66577
+0;
+#X obj 2 0 cnv 15 300 120 empty empty empty 20 12 0 14 -225271 -66577
+0;
+#X obj 3 0 cnv 1 1 120 \$0-selections \$0-selectionr empty 20 12 1728
+14 -225271 -262144 0;
+#N canvas 0 0 450 300 graph1 0;
+#X array \$0- 300 float 0;
+#X array \$0+ 300 float 0;
+#X coords 0 1 299 -1 300 120 1;
+#X restore 2 0 graph;
+#X obj 399 75 r \$0-borderpair;
+#X text 328 10 this display shows the min and max of all samples that
+a pixel represents;
+#X text 328 52 arguments: name of array \, \$0 of the parent patch
+;
+#X text 328 38 select with spacebar and shift with "s";
+#X obj 509 95 outlet;
+#X obj 614 75 inlet;
+#X obj 509 75 r \$0-synchroout;
+#X obj 560 94 s \$0-synchroin;
+#X connect 7 0 1 0;
+#X connect 12 0 14 0;
+#X connect 13 0 11 0;
+#X coords 0 0 1 1 305 120 1;
diff --git a/externals/grill/vasp/pd/wavedisplay-simple.pd b/externals/grill/vasp/pd/wavedisplay-simple.pd
new file mode 100644
index 00000000..e735fa0a
--- /dev/null
+++ b/externals/grill/vasp/pd/wavedisplay-simple.pd
@@ -0,0 +1,135 @@
+#N canvas 200 200 300 120 10;
+#N canvas 154 41 402 182 inside 0;
+#N canvas 183 206 183 114 wavetable 0;
+#X obj 30 22 table \$1 44100;
+#X restore 62 51 pd wavetable;
+#X text 146 50 contains the sample;
+#N canvas 46 30 530 612 drawdisplay 0;
+#X obj 168 398 vasp.frames 20;
+#X obj 168 429 vasp.offset 0;
+#X msg 83 83 bang;
+#X obj 168 137 0;
+#X obj 168 225 t f f f;
+#X obj 181 114 + 1;
+#X obj 168 252 *;
+#X text 45 80 start;
+#X text 262 215 (reset);
+#X obj 168 479 vasp.max?;
+#X obj 168 505 vasp.min?;
+#X obj 325 275 t f f;
+#X obj 83 128 until 1;
+#X obj 83 107 300;
+#X obj 251 527 tabwrite \$0+;
+#X obj 217 573 tabwrite \$0-;
+#X msg 168 345 vasp \$1;
+#X obj 168 317 symbol \$1;
+#X obj 325 254 / 300;
+#X obj 251 504 clip -1 1;
+#X obj 217 548 clip -1 1;
+#X obj 168 162 moses 299;
+#X msg 242 217 0;
+#X obj 217 196 t f b;
+#X obj 325 229 r \$0-sample-length;
+#X obj 83 46 r \$0-draw_display;
+#X obj 168 281 t b f;
+#X obj 344 449 r \$0-bounds-;
+#X obj 344 475 r \$0-bounds+;
+#X connect 0 0 1 0;
+#X connect 1 0 9 0;
+#X connect 2 0 13 0;
+#X connect 3 0 5 0;
+#X connect 3 0 21 0;
+#X connect 4 0 6 0;
+#X connect 4 1 14 1;
+#X connect 4 2 15 1;
+#X connect 5 0 3 1;
+#X connect 6 0 26 0;
+#X connect 9 0 10 0;
+#X connect 9 1 19 0;
+#X connect 10 1 20 0;
+#X connect 11 0 6 1;
+#X connect 11 1 0 1;
+#X connect 12 0 3 0;
+#X connect 13 0 12 0;
+#X connect 16 0 0 0;
+#X connect 17 0 16 0;
+#X connect 18 0 11 0;
+#X connect 19 0 14 0;
+#X connect 20 0 15 0;
+#X connect 21 0 4 0;
+#X connect 21 1 23 0;
+#X connect 22 0 1 1;
+#X connect 22 0 3 1;
+#X connect 23 0 4 0;
+#X connect 23 1 22 0;
+#X connect 24 0 18 0;
+#X connect 25 0 2 0;
+#X connect 26 0 17 0;
+#X connect 26 1 1 1;
+#X connect 27 0 19 1;
+#X connect 27 0 20 1;
+#X connect 28 0 19 2;
+#X connect 28 0 20 2;
+#X restore 62 74 pd drawdisplay;
+#X text 160 73 draws the display;
+#N canvas 149 160 294 134 init 0;
+#X obj 33 19 loadbang;
+#X obj 33 86 s \$0-;
+#X msg 33 44 xticks 0 30 5 \, ylabel 315 -1 -0.5 0 0.5 \, yticks 0
+0.25 2;
+#X connect 0 0 2 0;
+#X connect 2 0 1 0;
+#X restore 61 97 pd init;
+#N canvas 0 0 424 148 makelocal 0;
+#X obj 83 72 s \$0-draw_display;
+#X obj 83 46 r \$2-draw_display;
+#X obj 216 45 r \$2-sample-length;
+#X obj 216 71 s \$0-sample-length;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 61 129 pd makelocal;
+#X restore 369 90 pd inside;
+#X text 374 15 this display shows the min and max of all samples that
+a pixel represents;
+#X text 375 46 arguments: name of array \, \$0 of the parent patch
+;
+#X obj 0 0 cnv 15 300 120 empty empty empty 20 12 0 14 -225271 -66577
+0;
+#N canvas 0 0 450 300 graph1 0;
+#X array \$0- 300 float 0;
+#X array \$0+ 300 float 0;
+#X coords 0 1 300 -1 300 120 1;
+#X restore 0 0 graph;
+#X obj 438 70 inlet;
+#X text 480 69 individual length;
+#N canvas 71 382 599 303 individual 0;
+#X obj 319 150 s \$0-sample-length;
+#X obj 73 58 inlet;
+#X msg 369 173 resize \$1;
+#X obj 369 196 s \$1;
+#X obj 127 253 send \$0-;
+#X text 139 73 resize and sample-length;
+#X text 138 58 for individual bounds \, ticks and label \,;
+#X obj 41 182 unpack 0 0 0 0;
+#X obj 40 230 s \$0-bounds-;
+#X obj 40 207 s \$0-bounds+;
+#X msg 127 150 bounds \$1 \$2 \$3 \$4;
+#X obj 127 124 route bounds ylabel yticks;
+#X msg 151 175 ylabel \$1 \$2 \$3 \$4;
+#X msg 166 197 yticks \$1 \$2 \$3 \$4;
+#X connect 1 0 11 0;
+#X connect 2 0 3 0;
+#X connect 7 1 9 0;
+#X connect 7 3 8 0;
+#X connect 10 0 4 0;
+#X connect 11 0 7 0;
+#X connect 11 0 10 0;
+#X connect 11 1 12 0;
+#X connect 11 2 13 0;
+#X connect 11 3 0 0;
+#X connect 11 3 2 0;
+#X connect 12 0 4 0;
+#X connect 13 0 4 0;
+#X restore 438 90 pd individual;
+#X connect 5 0 7 0;
+#X coords 0 0 1 1 300 120 1;
diff --git a/externals/grill/vasp/pd/xtilt_example.pd b/externals/grill/vasp/pd/xtilt_example.pd
new file mode 100644
index 00000000..63acc12b
--- /dev/null
+++ b/externals/grill/vasp/pd/xtilt_example.pd
@@ -0,0 +1,88 @@
+#N canvas 27 56 975 554 10;
+#X text 467 82 A;
+#X text 465 286 B;
+#N canvas 0 0 413 295 clear_buffers 0;
+#X obj 49 73 vasp.= 0;
+#X obj 49 49 inlet;
+#X obj 49 97 vasp.u;
+#X obj 49 118 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X restore 604 494 pd clear_buffers;
+#X obj 510 85 wavedisplay-simple bufxtilt3 \$0;
+#X obj 512 273 wavedisplay-simple bufxtilt4 \$0;
+#X obj 269 69 filelist \$0;
+#X msg 603 467 vasp bufxtilt4;
+#X obj 403 487 dac~;
+#X obj 403 444 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 425 441 play;
+#N canvas 86 280 431 351 inside 0;
+#X obj 66 154 soundfiler;
+#X obj 84 238 s \$0-sample-length;
+#X obj 66 208 s \$0-draw_display;
+#X msg 214 206 resize \$1;
+#X obj 66 52 loadbang;
+#X obj 66 178 t b f f;
+#X obj 66 100 filelisthandler \$0;
+#X msg 66 132 read -resize \$1 bufxtilt3;
+#X obj 214 237 s bufxtilt3;
+#X obj 224 267 s bufxtilt4;
+#X msg 66 78 3;
+#X connect 0 0 5 0;
+#X connect 3 0 8 0;
+#X connect 3 0 9 0;
+#X connect 4 0 10 0;
+#X connect 5 0 2 0;
+#X connect 5 1 1 0;
+#X connect 5 2 3 0;
+#X connect 6 0 7 0;
+#X connect 7 0 0 0;
+#X connect 10 0 6 0;
+#X restore 780 485 pd inside;
+#X obj 404 464 tabplay~ bufxtilt4;
+#X obj 276 487 dac~;
+#X obj 276 444 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+-1;
+#X text 298 441 play;
+#X obj 277 464 tabplay~ bufxtilt3;
+#X msg 76 127 vasp bufxtilt3;
+#X obj 76 149 vasp.-> bufxtilt4;
+#X obj 173 195 vasp.rfft;
+#X floatatom 270 259 5 0 0;
+#X obj 173 432 vasp.u;
+#X obj 173 454 bng 15 250 50 0 \$0-draw_display empty empty 0 -6 1152
+8 -262144 -1 -1;
+#X obj 173 409 vasp.r!fft;
+#X obj 172 222 vasp.upper;
+#X obj 172 245 vasp.mirr;
+#X obj 173 326 vasp.upper;
+#X obj 173 349 vasp.mirr;
+#X msg 151 271 vasp bufxtilt4;
+#X msg 157 381 vasp bufxtilt4;
+#X obj 76 98 bng 20 250 50 0 empty empty start 0 -6 0 8 -258699 -1
+-1;
+#X obj 173 299 vasp.xtilt 2.9;
+#X connect 6 0 2 0;
+#X connect 8 0 11 0;
+#X connect 11 0 7 0;
+#X connect 11 0 7 1;
+#X connect 13 0 15 0;
+#X connect 15 0 12 0;
+#X connect 15 0 12 1;
+#X connect 16 0 17 0;
+#X connect 17 1 18 0;
+#X connect 18 0 23 0;
+#X connect 19 0 30 1;
+#X connect 20 0 21 0;
+#X connect 22 0 20 0;
+#X connect 23 0 24 0;
+#X connect 24 0 27 0;
+#X connect 25 0 26 0;
+#X connect 26 0 28 0;
+#X connect 27 0 30 0;
+#X connect 28 0 22 0;
+#X connect 29 0 16 0;
+#X connect 30 0 25 0;
diff --git a/externals/grill/vasp/source/arg.cpp b/externals/grill/vasp/source/arg.cpp
new file mode 100644
index 00000000..89a6729c
--- /dev/null
+++ b/externals/grill/vasp/source/arg.cpp
@@ -0,0 +1,216 @@
+#include "arg.h"
+//#include <math.h>
+#include "classes.h"
+
+Argument::Argument(): tp(tp_none),nxt(NULL) {}
+Argument::~Argument() { ClearAll(); }
+
+Argument &Argument::Parse(I argc,t_atom *argv)
+{
+ if(argc == 0)
+ Clear();
+ else // real?
+ if(argc == 1 && flext::CanbeFloat(argv[0]))
+ SetR(flext::GetAFloat(argv[0]));
+ else // complex?
+ if(argc == 2 && flext::CanbeFloat(argv[0]) && flext::CanbeFloat(argv[1]))
+ SetCX(flext::GetAFloat(argv[1]),flext::GetAFloat(argv[2]));
+ else // double?
+ if(argc >= 2 && flext::GetASymbol(argv[0]) == vasp_base::sym_double &&
+ flext::CanbeFloat(argv[1]) && (argc == 2 || flext::CanbeFloat(argv[2]))
+ )
+ SetR((D)flext::GetAFloat(argv[1])+(D)flext::GetAFloat(argv[2]));
+ else // envelope?
+ if(Env::ChkArgs(argc,argv)) {
+ Env *e = new Env(argc,argv);
+ if(e && e->Ok()) SetEnv(e);
+ else {
+ Clear();
+ post("vasp - env argument is invalid");
+ delete e;
+ }
+ }
+ else // vasp?
+ if(Vasp::ChkArgs(argc,argv)) {
+ Vasp *v = new Vasp(argc,argv);
+ if(v && v->Ok()) SetVasp(v);
+ else {
+ Clear();
+ post("vasp - vasp argument is invalid");
+ delete v;
+ }
+ }
+ else {
+ Clear();
+ post("vasp - invalid arguments");
+ }
+ return *this;
+}
+
+
+Argument &Argument::Clear()
+{
+ switch(tp) {
+ case tp_none:
+ break;
+ case tp_list:
+ if(dt.atoms) { delete dt.atoms; dt.atoms = NULL; }
+ break;
+ case tp_vasp:
+ if(dt.v) { delete dt.v; dt.v = NULL; }
+ break;
+ case tp_env:
+ if(dt.env) { delete dt.env; dt.env = NULL; }
+ break;
+ case tp_vx:
+ if(dt.vx) { delete dt.vx; dt.vx = NULL; }
+ break;
+ case tp_cx:
+ if(dt.cx) { delete dt.cx; dt.cx = NULL; }
+ break;
+ case tp_int:
+ case tp_float:
+ case tp_double:
+ break;
+ default:
+ error("Argument: Internal error - type unknown!");
+ }
+ tp = tp_none;
+ return *this;
+}
+
+Argument &Argument::ClearAll()
+{
+ Clear();
+ if(nxt) { delete nxt; nxt = NULL; }
+ return *this;
+}
+
+Argument &Argument::SetVasp(Vasp *v)
+{
+ if(tp != tp_none) Clear();
+ dt.v = v; tp = tp_vasp;
+ return *this;
+}
+
+Argument &Argument::SetEnv(Env *e)
+{
+ if(tp != tp_none) Clear();
+ dt.env = e; tp = tp_env;
+ return *this;
+}
+
+Argument &Argument::SetList(I argc,t_atom *argv)
+{
+ if(tp != tp_none) Clear();
+ dt.atoms = new flext::AtomList(argc,argv); tp = tp_list;
+ return *this;
+}
+
+Argument &Argument::SetR(F f)
+{
+ if(tp != tp_none) Clear();
+ dt.f = f; tp = tp_float;
+ return *this;
+}
+
+Argument &Argument::SetR(D f)
+{
+ if(tp != tp_none) Clear();
+ dt.d = f; tp = tp_double;
+ return *this;
+}
+
+Argument &Argument::SetI(I i)
+{
+ if(tp != tp_none) Clear();
+ dt.i = i; tp = tp_int;
+ return *this;
+}
+
+Argument &Argument::SetCX(F re,F im)
+{
+ if(tp != tp_none) Clear();
+ dt.cx = new CX(re,im); tp = tp_cx;
+ return *this;
+}
+
+Argument &Argument::SetVX(VX *vec)
+{
+ if(tp != tp_none) Clear();
+ dt.vx = vec; tp = tp_vx;
+ return *this;
+}
+
+I Argument::GetAInt() const { return (I)GetADouble(); }
+
+F Argument::GetAFloat() const { return GetADouble(); }
+
+D Argument::GetADouble() const
+{
+ if(IsInt()) return GetInt();
+ else if(IsFloat()) return GetFloat();
+ else if(IsDouble()) return GetDouble();
+ else return 0;
+}
+
+CX Argument::GetAComplex() const
+{
+ if(IsInt()) return (F)GetInt();
+ else if(IsFloat()) return GetFloat();
+ else if(IsDouble()) return GetDouble();
+ else if(IsComplex()) return GetComplex();
+ else return 0;
+}
+
+Vasp Argument::GetAVasp() const
+{
+ if(IsVasp()) return GetVasp();
+ else if(IsList()) return Vasp(dt.atoms->Count(),dt.atoms->Atoms());
+ else return Vasp();
+}
+
+Env Argument::GetAEnv() const
+{
+ if(IsEnv()) return GetEnv();
+ else if(IsList()) return Env(dt.atoms->Count(),dt.atoms->Atoms());
+ else return Env();
+}
+
+
+Argument &Argument::Add(Argument *n)
+{
+ if(nxt) nxt->Add(n);
+ else nxt = n;
+ return *n;
+}
+
+Argument &Argument::Next(I i)
+{
+ if(i <= 0) return *this;
+ else {
+ Argument *n = Next();
+ if(n) return n->Next(i-1);
+ else {
+ error("Argument: index not found!");
+ return *this;
+ }
+ }
+}
+
+Argument &Argument::AddVasp(Vasp *v) { Argument *a = new Argument; a->SetVasp(v); return Add(a); }
+
+Argument &Argument::AddEnv(Env *e) { Argument *a = new Argument; a->SetEnv(e); return Add(a); }
+
+Argument &Argument::AddList(I argc,t_atom *argv) { Argument *a = new Argument; a->SetList(argc,argv); return Add(a); }
+
+Argument &Argument::AddI(I i) { Argument *a = new Argument; a->SetI(i); return Add(a); }
+
+Argument &Argument::AddR(F f) { Argument *a = new Argument; a->SetR(f); return Add(a); }
+
+Argument &Argument::AddCX(F re,F im) { Argument *a = new Argument; a->SetCX(re,im); return Add(a); }
+
+Argument &Argument::AddVX(VX *vec) { Argument *a = new Argument; a->SetVX(vec); return Add(a); }
+
+
+
diff --git a/externals/grill/vasp/source/arg.h b/externals/grill/vasp/source/arg.h
new file mode 100644
index 00000000..d6ebc378
--- /dev/null
+++ b/externals/grill/vasp/source/arg.h
@@ -0,0 +1,108 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_ARG_H
+#define __VASP_ARG_H
+
+#include "vasp.h"
+#include "env.h"
+
+#define VASP_ARG() Argument()
+#define VASP_ARG_I(VAL) Argument().SetR(VAL)
+#define VASP_ARG_R(VAL) Argument().SetR(VAL)
+#define VASP_ARG_CX(RV,IV) Argument().SetCX(RV,IV)
+
+class Argument
+{
+public:
+ Argument();
+ ~Argument();
+
+ Argument &Parse(I argc,t_atom *argv);
+ Argument &Clear();
+ Argument &ClearAll();
+
+ Argument &SetVasp(Vasp *v);
+ Argument &SetEnv(Env *e);
+ Argument &SetList(I argc,t_atom *argv);
+ Argument &SetI(I i);
+ Argument &SetR(F f);
+ Argument &SetR(D d);
+ Argument &SetR(I i) { return SetR((F)i); }
+ Argument &SetCX(F re,F im);
+ Argument &SetVX(VX *vec);
+
+ Argument *Next() { return nxt; }
+ Argument &Next(I i);
+ Argument &Add(Argument *a);
+
+ Argument &AddVasp(Vasp *v);
+ Argument &AddEnv(Env *e);
+ Argument &AddList(I argc,t_atom *argv);
+ Argument &AddI(I i);
+ Argument &AddR(F f);
+ Argument &AddR(D d);
+ Argument &AddR(I i) { return AddR((F)i); }
+ Argument &AddCX(F re,F im);
+ Argument &AddVX(VX *vec);
+
+ BL IsNone() const { return tp == tp_none; }
+ BL IsList() const { return tp == tp_list; }
+ BL IsVasp() const { return tp == tp_vasp; }
+ BL CanbeVasp() const { return tp == tp_vasp || (tp == tp_list && Vasp::ChkArgs(dt.atoms->Count(),dt.atoms->Atoms())); }
+ BL IsEnv() const { return tp == tp_env; }
+ BL CanbeEnv() const { return tp == tp_env || (tp == tp_env && Env::ChkArgs(dt.atoms->Count(),dt.atoms->Atoms())); }
+ BL IsInt() const { return tp == tp_int; }
+ BL CanbeInt() const { return tp == tp_int || tp == tp_float || tp_double; }
+ BL IsFloat() const { return tp == tp_float; }
+ BL CanbeFloat() const { return tp == tp_float || tp == tp_double || tp == tp_int; }
+ BL IsDouble() const { return tp == tp_double; }
+ BL CanbeDouble() const { return tp == tp_double || tp == tp_float || tp == tp_int; }
+ BL IsComplex() const { return tp == tp_cx; }
+ BL CanbeComplex() const { return tp == tp_cx || CanbeFloat(); }
+ BL IsVector() const { return tp == tp_vx; }
+ BL CanbeVector() const { return tp == tp_vx || CanbeComplex(); }
+
+ const flext::AtomList &GetList() const { return *dt.atoms; }
+ const Vasp &GetVasp() const { return *dt.v; }
+ Vasp GetAVasp() const;
+ const Env &GetEnv() const { return *dt.env; }
+ Env GetAEnv() const;
+ I GetInt() const { return dt.i; }
+ I GetAInt() const;
+ F GetFloat() const { return dt.f; }
+ F GetAFloat() const;
+ D GetDouble() const { return dt.d; }
+ D GetADouble() const;
+ const CX &GetComplex() const { return *dt.cx; }
+ CX GetAComplex() const;
+ const VX &GetVector() const { return *dt.vx; }
+ VX GetAVector() const;
+
+protected:
+ enum {
+ tp_none,tp_vasp,tp_env,tp_list,tp_int,tp_float,tp_double,tp_cx,tp_vx
+ } tp;
+
+ union {
+ Vasp *v;
+ Env *env;
+ flext::AtomList *atoms;
+ F f;
+ D d;
+ I i;
+ CX *cx;
+ VX *vx;
+ } dt;
+
+ Argument *nxt;
+};
+
+#endif
diff --git a/externals/grill/vasp/source/buflib.cpp b/externals/grill/vasp/source/buflib.cpp
new file mode 100644
index 00000000..30b500c4
--- /dev/null
+++ b/externals/grill/vasp/source/buflib.cpp
@@ -0,0 +1,258 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "buflib.h"
+#include <stdio.h>
+
+#define LIBTICK 100 // tick time in ms
+#define LIBTOL 2 // how many ticks till release
+
+#define REUSE_MAXLOSEREL 0.1 // max. fraction of lost buffer size
+#define REUSE_MAXLOSEABS 10000 // max. lost buffer size
+
+#define LIBMAGIC 12349876L // magic number for s_thing data check
+
+
+class FreeEntry
+{
+public:
+ FreeEntry(t_symbol *s): sym(s),nxt(NULL) {}
+
+ t_symbol *sym;
+ FreeEntry *nxt;
+};
+
+class BufEntry
+{
+public:
+ BufEntry(t_symbol *s,I fr);
+ ~BufEntry();
+
+ V IncRef();
+ V DecRef();
+
+// UL magic;
+ t_symbol *sym;
+ I refcnt,tick;
+ BufEntry *nxt;
+
+ I alloc,len;
+ S *data;
+};
+
+
+static BufEntry *libhead = NULL,*libtail = NULL;
+static FreeEntry *freehead = NULL,*freetail = NULL;
+static I libcnt = 0,libtick = 0;
+static t_clock *libclk = NULL;
+
+#ifdef FLEXT_THREADS
+static flext::ThrMutex libmtx;
+#endif
+
+static V FreeLibSym(t_symbol *s);
+
+
+
+
+BufEntry::BufEntry(t_symbol *s,I fr):
+ sym(s), //magic(LIBMAGIC),
+ alloc(fr),len(fr),data(new S[fr]),
+ refcnt(0),nxt(NULL)
+{
+// ASSERT(!flext_base::GetThing(sym));
+// flext_base::SetThing(sym,this);
+}
+
+BufEntry::~BufEntry()
+{
+ if(sym) FreeLibSym(sym);
+ if(data) delete[] data;
+}
+
+V BufEntry::IncRef() { ++refcnt; }
+V BufEntry::DecRef() { --refcnt; tick = libtick; }
+
+static BufEntry *FindInLib(const t_symbol *s)
+{
+ BufEntry *e;
+ for(e = libhead; e && e->sym != s; e = e->nxt) (void)0;
+ return e?e:NULL;
+}
+
+VBuffer *BufLib::Get(const VSymbol &s,I chn,I len,I offs)
+{
+ BufEntry *e = FindInLib(s.Symbol());
+ if(e)
+ return new ImmBuf(e,len,offs);
+ else
+ return new SysBuf(s,chn,len,offs);
+}
+
+V BufLib::IncRef(t_symbol *s)
+{
+ if(s) {
+ BufEntry *e = FindInLib(s);
+ if(e) e->IncRef();
+ }
+}
+
+V BufLib::DecRef(t_symbol *s)
+{
+ if(s) {
+ BufEntry *e = FindInLib(s);
+ if(e) e->DecRef();
+ }
+}
+
+static t_symbol *GetLibSym()
+{
+ if(freehead) {
+ // reuse from free-list
+ FreeEntry *r = freehead;
+ freehead = r->nxt;
+ if(!freehead) freetail = NULL;
+ t_symbol *s = r->sym;
+ delete r;
+ return s;
+ }
+ else {
+ // allocate new symbol
+ char tmp[20];
+ #ifdef __MWERKS__
+ std::
+ #endif
+ sprintf(tmp,"vasp!%04i",libcnt); // what if libcnt has > 4 digits?
+ libcnt++;
+ return gensym(tmp);
+ }
+
+ clock_delay(libclk,LIBTICK);
+}
+
+static V FreeLibSym(t_symbol *sym)
+{
+ FreeEntry *f = new FreeEntry(sym);
+ if(!freehead) freehead = f;
+ else freetail->nxt = f;
+ freetail = f;
+}
+
+static V LibTick(V *)
+{
+#ifdef FLEXT_THREADS
+ libmtx.Lock();
+#endif
+
+ // collect garbage
+ BufEntry *e,*p;
+ for(p = NULL,e = libhead; e; ) {
+ if(e->refcnt <= 0 && e->tick+LIBTOL < libtick) {
+ ASSERT(e->refcnt == 0);
+
+ BufEntry *n = e->nxt;
+
+ if(p) p->nxt = n;
+ else libhead = n;
+
+ if(!n) libtail = p;
+ else e->nxt = NULL;
+
+ delete e;
+
+ e = n;
+ }
+ else
+ p = e,e = e->nxt;
+ }
+
+ ++libtick;
+ clock_delay(libclk,LIBTICK);
+
+#ifdef FLEXT_THREADS
+ libmtx.Unlock();
+#endif
+}
+
+BufEntry *BufLib::NewImm(I fr)
+{
+ if(!libclk) {
+ libclk = (t_clock *)clock_new(NULL,(t_method)LibTick);
+ clock_delay(libclk,LIBTICK);
+ }
+
+ t_symbol *s = NULL;
+// do {
+ s = GetLibSym();
+// } while(s->s_thing);
+
+ BufEntry *entry = new BufEntry(s,fr);
+
+#ifdef FLEXT_THREADS
+ libmtx.Lock();
+#endif
+
+ if(libtail) libtail->nxt = entry;
+ else libhead = entry;
+ libtail = entry;
+
+#ifdef FLEXT_THREADS
+ libmtx.Unlock();
+#endif
+
+ return entry;
+}
+
+static F reuse_maxloserel = (F)REUSE_MAXLOSEREL;
+static I reuse_maxloseabs = REUSE_MAXLOSEABS;
+
+BufEntry *BufLib::Resize(BufEntry *e,I fr,BL keep)
+{
+ if(e->alloc >= fr && fr >= e->alloc*(1-reuse_maxloserel) && fr >= (e->alloc-reuse_maxloseabs)) {
+ // reuse buffer
+ e->len = fr;
+ }
+ else {
+ S *nd = new S[fr];
+ if(keep) {
+ I l = fr;
+ if(e->len < l) l = e->len;
+ flext::CopyMem(e->data,nd,l);
+ }
+
+ delete[] e->data;
+ e->data = nd;
+ e->len = e->alloc = fr;
+ }
+ return e;
+}
+
+
+
+ImmBuf::ImmBuf(I len):
+ VBuffer(0,len),
+ entry(BufLib::NewImm(len))
+{}
+
+ImmBuf::ImmBuf(BufEntry *e,I len,I offs):
+ VBuffer(0,len,offs),
+ entry(e)
+{}
+
+VSymbol ImmBuf::Symbol() const { return entry->sym; }
+
+I ImmBuf::Frames() const { return entry->len; }
+
+V ImmBuf::Frames(I fr,BL keep) { entry = BufLib::Resize(entry,fr,keep); }
+
+S *ImmBuf::Data() { return entry->data; }
+
+
+
diff --git a/externals/grill/vasp/source/buflib.h b/externals/grill/vasp/source/buflib.h
new file mode 100644
index 00000000..f64bd8d1
--- /dev/null
+++ b/externals/grill/vasp/source/buflib.h
@@ -0,0 +1,37 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+/*! \file buflib.h
+ \brief Routines for buffer management
+*/
+
+#ifndef __VASP_BUFLIB_H
+#define __VASP_BUFLIB_H
+
+#include "classes.h"
+#include "vbuffer.h"
+
+class BufEntry;
+
+namespace BufLib
+{
+ VBuffer *Get(const VSymbol &s,I chn = 0,I len = -1,I offs = 0);
+
+ BufEntry *NewImm(I fr);
+
+ V IncRef(t_symbol *s);
+ V DecRef(t_symbol *s);
+
+ BufEntry *Resize(BufEntry *e,I fr,BL keep = false);
+}
+
+
+
+#endif
diff --git a/externals/grill/vasp/source/classes.cpp b/externals/grill/vasp/source/classes.cpp
new file mode 100644
index 00000000..658cf0a7
--- /dev/null
+++ b/externals/grill/vasp/source/classes.cpp
@@ -0,0 +1,405 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+//#include <stdarg.h>
+
+
+///////////////////////////////////////////////////////////////////////////
+// vasp_base class
+///////////////////////////////////////////////////////////////////////////
+
+const t_symbol *vasp_base::sym_radio;
+const t_symbol *vasp_base::sym_vasp;
+const t_symbol *vasp_base::sym_env;
+const t_symbol *vasp_base::sym_double;
+const t_symbol *vasp_base::sym_complex;
+const t_symbol *vasp_base::sym_vector;
+
+V vasp_base::setup(t_class *)
+{
+ sym_radio = MakeSymbol("radio");
+ sym_vasp = MakeSymbol("vasp");
+ sym_env = MakeSymbol("env");
+ sym_double = MakeSymbol("double");
+ sym_complex = MakeSymbol("complex");
+ sym_vector = MakeSymbol("vector");
+}
+
+vasp_base::vasp_base():
+ refresh(false),argchk(false),
+ unit(xsu_sample),loglvl(0)
+{
+ FLEXT_ADDMETHOD_(0,"radio",m_radio);
+ FLEXT_ADDMETHOD_(0,"argchk",m_argchk);
+ FLEXT_ADDMETHOD_(0,"loglvl",m_loglvl);
+ FLEXT_ADDMETHOD_E(0,"unit",m_unit);
+}
+
+vasp_base::~vasp_base() {}
+
+
+V vasp_base::m_radio(I argc,t_atom *argv)
+{
+ if(argc > 0 && IsSymbol(argv[0])) {
+ // send command to self!
+ m_methodmain(0,GetSymbol(argv[0]),argc-1,argv+1);
+
+ // send command to the next objects in line
+ ToOutAnything(0,sym_radio,argc,argv);
+ }
+ else
+ post("%s - radio message invalid",thisName());
+}
+
+
+V vasp_base::m_unit(xs_unit u) { unit = u; }
+V vasp_base::m_argchk(BL chk) { argchk = chk; }
+V vasp_base::m_loglvl(I lvl) { loglvl = lvl; }
+
+
+BL vasp_base::ToOutVasp(I oix,Vasp &v)
+{
+ AtomList *lst = v.MakeList(false);
+ if(lst) {
+ ToOutAnything(oix,sym_vasp,lst->Count(),lst->Atoms());
+ delete lst;
+ return true;
+ }
+ else return false;
+}
+
+///////////////////////////////////////////////////////////////////////////
+// vasp_op class
+///////////////////////////////////////////////////////////////////////////
+
+vasp_op::vasp_op(BL op)
+#ifdef FLEXT_THREADS
+ :detach(false),prior(-2),
+ thrid(0)
+#endif
+{
+ FLEXT_ADDBANG(0,m_dobang);
+ FLEXT_ADDMETHOD_(0,"vasp",m_vasp);
+ FLEXT_ADDMETHOD_(0,"set",m_set);
+ if(op) FLEXT_ADDMETHOD_(0,"to",m_to);
+
+ FLEXT_ADDMETHOD_(0,"update",m_update);
+
+ FLEXT_ADDMETHOD_(0,"detach",m_detach);
+ FLEXT_ADDMETHOD_(0,"stop",m_stop);
+ FLEXT_ADDMETHOD_(0,"prior",m_prior);
+}
+
+V vasp_op::m_dobang()
+{
+#ifdef FLEXT_THREADS
+ if(detach)
+ FLEXT_CALLMETHOD(m_bang);
+ else
+#endif
+ m_bang();
+}
+
+I vasp_op::m_set(I argc,t_atom *argv)
+{
+ Vasp arg(argc,argv);
+
+ if(argc && !arg.Ok()) {
+ ref.Clear();
+ post("%s - invalid vasp detected and ignored",thisName());
+ }
+ else {
+ if(arg.Check())
+ ref = arg;
+ else {
+ ref.Clear();
+ post("%s - vasp reference is invalid",thisName());
+ }
+ }
+
+ return 0;
+}
+
+V vasp_op::m_vasp(I argc,t_atom *argv)
+{
+ m_set(argc,argv);
+ m_dobang();
+}
+
+V vasp_op::m_to(I argc,t_atom *argv)
+{
+ Vasp to(argc,argv);
+
+ if(argc && !to.Ok()) {
+ // empty vasp
+ dst.Clear();
+ }
+ else
+ dst = to;
+}
+
+V vasp_op::m_update(I argc,t_atom *argv)
+{
+ if(argc == 0)
+ ref.Refresh();
+ else {
+ if(CanbeInt(argv[0]))
+ refresh = GetAInt(argv[0]) != 0;
+ else
+ post("%s(update) - argument should be omitted or integer",thisName());
+ }
+}
+
+V vasp_op::m_detach(BL thr)
+{
+#ifdef FLEXT_THREADS
+ detach = thr;
+#endif
+}
+
+V vasp_op::m_prior(I p)
+{
+#ifdef FLEXT_THREADS
+ prior = p;
+#endif
+}
+
+V vasp_op::m_stop() {}
+
+///////////////////////////////////////////////////////////////////////////
+// vasp_tx class
+///////////////////////////////////////////////////////////////////////////
+
+vasp_tx::vasp_tx(BL to): vasp_op(to) {}
+
+V vasp_tx::m_bang()
+{
+ // Thread has to wait until previous is finished
+ Lock();
+
+#ifdef FLEXT_THREADS
+// ChangePriority(prior);
+#endif
+
+ if(ref.Ok())
+ {
+ Vasp *ret = x_work();
+ if(ret) {
+ AtomList *lst = ret->MakeList(false);
+ if(lst) {
+ ToOutAnything(0,sym_vasp,lst->Count(),lst->Atoms());
+ delete lst;
+ }
+ else
+ post("%s - empty list",thisName());
+ if(refresh) ret->Refresh();
+ delete ret;
+ }
+ else {
+#ifdef _DEBUG
+ post("%s - no valid return",thisName());
+#endif
+ }
+ }
+ else {
+ post("%s - no valid vasp to work with",thisName());
+ }
+
+#ifdef FLEXT_THREADS
+ thrid = 0;
+#endif
+ Unlock();
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+// vasp_unop class
+///////////////////////////////////////////////////////////////////////////
+
+vasp_unop::vasp_unop(BL op,UL outcode):
+ vasp_tx(op)
+{
+ AddInAnything();
+ AddOutAnything(1);
+ AddOutlets(outcode);
+}
+
+Vasp *vasp_unop::x_work() { return tx_work(); }
+
+Vasp *vasp_unop::tx_work()
+{
+ error("%s - no work method implemented",thisName());
+ return NULL;
+}
+
+///////////////////////////////////////////////////////////////////////////
+// vasp_binop class
+///////////////////////////////////////////////////////////////////////////
+
+
+vasp_binop::vasp_binop(I argc,t_atom *argv,const Argument &def,BL op,UL outcode):
+ vasp_tx(op)
+{
+ a_list(argc,argv);
+ if(arg.IsNone() && !def.IsNone()) arg = def;
+
+ AddInAnything(2);
+ AddOutAnything(1);
+ AddOutlets(outcode);
+
+ FLEXT_ADDMETHOD(1,a_list);
+ FLEXT_ADDMETHOD_(1,"vasp",a_vasp);
+ FLEXT_ADDMETHOD_(1,"env",a_env);
+ FLEXT_ADDMETHOD_(1,"float",a_float);
+ FLEXT_ADDMETHOD_(1,"double",a_double);
+ FLEXT_ADDMETHOD_(1,"int",a_int);
+ FLEXT_ADDMETHOD_(1,"complex",a_complex);
+ FLEXT_ADDMETHOD_(1,"vector",a_vector);
+ FLEXT_ADDMETHOD_(1,"radio",a_radio);
+}
+
+V vasp_binop::a_list(I argc,t_atom *argv)
+{
+ if(argc) {
+ arg.Parse(argc,argv);
+ if(arg.IsNone())
+ post("%s - list argument could not be evaluated (ignored)",thisName());
+ else if(argchk) {
+ // check argument feasibility
+ }
+ }
+ else {
+// post("%s - Empty list argument (ignored)",thisName());
+ }
+}
+
+V vasp_binop::a_vasp(I argc,t_atom *argv)
+{
+ Vasp *v = new Vasp(argc,argv);
+ if(v->Ok()) {
+ arg.SetVasp(v);
+ if(argchk) {
+ // check argument feasibility
+ }
+ }
+ else {
+ post("%s - invalid vasp argument (ignored)",thisName());
+ delete v;
+ }
+}
+
+V vasp_binop::a_env(I argc,t_atom *argv)
+{
+ Env *bp = new Env(argc,argv);
+ if(bp->Ok()) {
+ arg.SetEnv(bp);
+ if(argchk) {
+ // check argument feasibility
+ }
+ }
+ else {
+ post("%s - invalid env argument (ignored)",thisName());
+ delete bp;
+ }
+}
+
+V vasp_binop::a_float(F v) { arg.SetR(v); }
+
+V vasp_binop::a_double(I argc,t_atom *argv)
+{
+ if(
+ (argc == 1 && CanbeFloat(argv[0])) ||
+ (argc == 2 && CanbeFloat(argv[0]) && CanbeFloat(argv[1]))
+ ) {
+ arg.SetR((D)GetAFloat(argv[0])+(D)GetAFloat(argv[1]));
+ if(argchk) {
+ // check argument feasibility
+ }
+ }
+ else
+ post("%s - invalid double argument (ignored)",thisName());
+}
+
+V vasp_binop::a_int(I v) { arg.SetI(v); }
+
+V vasp_binop::a_complex(I argc,t_atom *argv)
+{
+ if(
+ (argc == 1 && CanbeFloat(argv[0])) ||
+ (argc == 2 && CanbeFloat(argv[0]) && CanbeFloat(argv[1]))
+ ) {
+ arg.SetCX(GetAFloat(argv[0]),GetAFloat(argv[1]));
+ if(argchk) {
+ // check argument feasibility
+ }
+ }
+ else
+ post("%s - invalid complex argument (ignored)",thisName());
+}
+
+V vasp_binop::a_vector(I argc,t_atom *argv)
+{
+ error("%s - vector type not implemented",thisName());
+}
+
+
+Vasp *vasp_binop::x_work() { return tx_work(arg); }
+
+Vasp *vasp_binop::tx_work(const Argument &arg)
+{
+ error("%s - no work method implemented",thisName());
+ return NULL;
+}
+
+
+///////////////////////////////////////////////////////////////////////////
+// vasp_anyop class
+///////////////////////////////////////////////////////////////////////////
+
+
+vasp_anyop::vasp_anyop(I argc,t_atom *argv,const Argument &def,BL op,UL outcode):
+ vasp_tx(op)
+{
+ a_list(argc,argv);
+ if(arg.IsNone() && !def.IsNone()) arg = def;
+
+ AddInAnything(2);
+ AddOutAnything(1);
+ AddOutlets(outcode);
+
+ FLEXT_ADDMETHOD(1,a_list);
+ FLEXT_ADDMETHOD_(1,"vasp",a_list);
+ FLEXT_ADDMETHOD_(1,"radio",a_radio);
+}
+
+V vasp_anyop::a_list(I argc,t_atom *argv)
+{
+ if(argc) {
+ arg.SetList(argc,argv);
+ if(arg.IsNone())
+ post("%s - argument could not be evaluated (ignored)",thisName());
+ else if(argchk) {
+ // check argument feasibility
+ }
+ }
+ else {
+// post("%s - Empty list argument (ignored)",thisName());
+ }
+}
+
+Vasp *vasp_anyop::x_work() { return tx_work(arg); }
+
+Vasp *vasp_anyop::tx_work(const Argument &arg)
+{
+ error("%s - no work method implemented",thisName());
+ return NULL;
+}
+
diff --git a/externals/grill/vasp/source/classes.h b/externals/grill/vasp/source/classes.h
new file mode 100644
index 00000000..5344f585
--- /dev/null
+++ b/externals/grill/vasp/source/classes.h
@@ -0,0 +1,278 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_CLASSES_H
+#define __VASP_CLASSES_H
+
+#include "vasp.h"
+#include "arg.h"
+
+
+class vasp_base:
+ public flext_base
+{
+ FLEXT_HEADER_S(vasp_base,flext_base,setup)
+
+public:
+ enum xs_unit {
+ xsu__ = -1, // don't change
+ xsu_sample = 0,xsu_buffer,xsu_ms,xsu_s
+ };
+
+ static const t_symbol *sym_vasp;
+ static const t_symbol *sym_env;
+ static const t_symbol *sym_double;
+ static const t_symbol *sym_complex;
+ static const t_symbol *sym_vector;
+ static const t_symbol *sym_radio;
+
+protected:
+ vasp_base();
+ virtual ~vasp_base();
+
+ virtual V m_radio(I argc,t_atom *argv); // commands for all
+
+ V m_argchk(BL chk); // precheck argument on arrival
+ V m_loglvl(I lvl); // noise level of log messages
+ V m_unit(xs_unit u); // unit command
+
+ BL refresh; // immediate graphics refresh?
+ BL argchk; // pre-operation argument feasibility check
+ xs_unit unit; // time units
+ I loglvl; // noise level for log messages
+
+ friend class Vasp;
+
+ BL ToOutVasp(I outlet,Vasp &v);
+
+private:
+ static V setup(t_class *);
+
+ FLEXT_CALLBACK_V(m_radio)
+
+ FLEXT_CALLBACK_B(m_argchk)
+ FLEXT_CALLBACK_I(m_loglvl)
+ FLEXT_CALLBACK_1(m_unit,xs_unit)
+};
+
+
+class vasp_op:
+ public vasp_base
+{
+ FLEXT_HEADER(vasp_op,vasp_base)
+
+protected:
+ vasp_op(BL withto = false);
+
+ virtual V m_dobang(); // bang method
+
+ virtual V m_vasp(I argc,t_atom *argv); // trigger
+ virtual I m_set(I argc,t_atom *argv); // non trigger
+ virtual V m_to(I argc,t_atom *argv); // set destination
+ V m_detach(BL thr); // detached thread
+ virtual V m_prior(I dp); // thread priority +-
+ virtual V m_stop(); // stop working
+
+ virtual V m_update(I argc = 0,t_atom *argv = NULL); // graphics update
+
+ // destination vasp
+ Vasp ref,dst;
+
+ FLEXT_CALLBACK_V(m_to)
+
+ FLEXT_CALLBACK(m_dobang)
+#ifdef FLEXT_THREADS
+ FLEXT_THREAD(m_bang)
+
+ ThrMutex runmtx;
+ V Lock() { runmtx.Lock(); }
+ V Unlock() { runmtx.Unlock(); }
+
+ BL detach; // detached operation?
+ I prior; // thread priority
+ thrid_t thrid;
+#else
+ FLEXT_CALLBACK(m_bang)
+
+ V Lock() {}
+ V Unlock() {}
+#endif
+ FLEXT_CALLBACK_V(m_vasp)
+ FLEXT_CALLBACK_V(m_set)
+ FLEXT_CALLBACK_V(m_update)
+ FLEXT_CALLBACK_B(m_detach)
+ FLEXT_CALLBACK_I(m_prior)
+ FLEXT_CALLBACK(m_stop)
+
+private:
+ virtual V m_bang() = 0; // do! and output current Vasp
+};
+
+
+
+class vasp_tx:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_tx,vasp_op)
+
+protected:
+ vasp_tx(BL withto = false);
+
+ virtual V m_bang(); // do! and output current Vasp
+
+ virtual Vasp *x_work() = 0;
+};
+
+
+
+
+#define VASP_SETUP(op) FLEXT_SETUP(vasp_##op);
+
+
+
+// base class for unary operations
+
+class vasp_unop:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_unop,vasp_tx)
+
+protected:
+ vasp_unop(BL withto = false,UL outcode = 0);
+
+ virtual Vasp *x_work();
+ virtual Vasp *tx_work();
+};
+
+
+// base class for binary operations
+
+class vasp_binop:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_binop,vasp_tx)
+
+protected:
+ vasp_binop(I argc,t_atom *argv,const Argument &def = Argument(),BL withto = false,UL outcode = 0);
+
+ // assignment functions
+ virtual V a_list(I argc,t_atom *argv);
+ /*virtual*/ V a_vasp(I argc,t_atom *argv);
+ /*virtual*/ V a_env(I argc,t_atom *argv);
+ /*virtual*/ V a_float(F f);
+ /*virtual*/ V a_int(I f);
+ /*virtual*/ V a_double(I argc,t_atom *argv);
+ /*virtual*/ V a_complex(I argc,t_atom *argv);
+ /*virtual*/ V a_vector(I argc,t_atom *argv);
+
+ V a_radio(I,t_atom *) {}
+
+ virtual Vasp *x_work();
+ virtual Vasp *tx_work(const Argument &arg);
+
+ Argument arg;
+
+private:
+ FLEXT_CALLBACK_V(a_list)
+ FLEXT_CALLBACK_V(a_vasp)
+ FLEXT_CALLBACK_V(a_env)
+ FLEXT_CALLBACK_1(a_float,F)
+ FLEXT_CALLBACK_1(a_int,I)
+ FLEXT_CALLBACK_V(a_double)
+ FLEXT_CALLBACK_V(a_complex)
+ FLEXT_CALLBACK_V(a_vector)
+ FLEXT_CALLBACK_V(a_radio)
+};
+
+
+// base class for non-parsed (list) arguments
+
+class vasp_anyop:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_anyop,vasp_tx)
+
+protected:
+ vasp_anyop(I argc,t_atom *argv,const Argument &def = Argument(),BL withto = false,UL outcode = 0);
+
+ // assignment functions
+ virtual V a_list(I argc,t_atom *argv);
+
+ V a_radio(I,t_atom *) {}
+
+ virtual Vasp *x_work();
+ virtual Vasp *tx_work(const Argument &arg);
+
+ Argument arg;
+
+private:
+ FLEXT_CALLBACK_V(a_list)
+ FLEXT_CALLBACK_V(a_radio)
+};
+
+
+
+#define VASP_UNARY(name,op,to,help) \
+class vasp_##op: \
+ public vasp_unop \
+{ \
+ FLEXT_HEADER(vasp_##op,vasp_unop) \
+public: \
+ vasp_##op(): vasp_unop(to) {} \
+protected: \
+ virtual Vasp *tx_work() \
+ { \
+ OpParam p(thisName(),0); \
+ return VaspOp::m_##op(p,ref,&dst); \
+ } \
+ virtual V m_help() { post("%s - " help,thisName()); } \
+}; \
+FLEXT_LIB("vasp," name,vasp_##op)
+
+
+#define VASP_BINARY(name,op,to,def,help) \
+class vasp_ ## op: \
+ public vasp_binop \
+{ \
+ FLEXT_HEADER(vasp_##op,vasp_binop) \
+public: \
+ vasp_##op(I argc,t_atom *argv): vasp_binop(argc,argv,def,to) {} \
+protected: \
+ virtual Vasp *tx_work(const Argument &arg) \
+ { \
+ OpParam p(thisName(),1); \
+ return VaspOp::m_##op(p,ref,arg,&dst); \
+ } \
+ virtual V m_help() { post("%s - " help,thisName()); } \
+}; \
+FLEXT_LIB_V("vasp," name,vasp_##op)
+
+
+#define VASP_ANYOP(name,op,args,to,def,help) \
+class vasp_ ## op: \
+ public vasp_anyop \
+{ \
+ FLEXT_HEADER(vasp_##op,vasp_anyop) \
+public: \
+ vasp_##op(I argc,t_atom *argv): vasp_anyop(argc,argv,def,to) {} \
+protected: \
+ virtual Vasp *tx_work(const Argument &arg) \
+ { \
+ OpParam p(thisName(),args); \
+ return VaspOp::m_##op(p,ref,arg,&dst); \
+ } \
+ virtual V m_help() { post("%s - " help,thisName()); } \
+}; \
+FLEXT_LIB_V("vasp," name,vasp_##op)
+
+
+#define VASP__SETUP(op) FLEXT_SETUP(vasp_##op);
+
+#endif
diff --git a/externals/grill/vasp/source/env.cpp b/externals/grill/vasp/source/env.cpp
new file mode 100644
index 00000000..f846a227
--- /dev/null
+++ b/externals/grill/vasp/source/env.cpp
@@ -0,0 +1,144 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "env.h"
+#include "classes.h"
+#include "util.h"
+
+Env::Env(I argc,const t_atom *argv)
+{
+ I ix = 0;
+ t_symbol *v = ix < argc?flext::GetASymbol(argv[ix]):NULL;
+ if(v && v == vasp_base::sym_env) ix++; // if it is "env" ignore it
+
+ cnt = (argc-ix)/2;
+ pos = new R[cnt];
+ val = new R[cnt];
+
+ R prev = -BIG;
+ BL ok = true;
+ for(I i = 0; i < cnt; ++i) {
+ val[i] = flext::GetAFloat(argv[ix++]);
+ pos[i] = flext::GetAFloat(argv[ix++]);
+ if(pos[i] < prev) ok = false;
+ prev = pos[i];
+ }
+
+ if(ix < argc) {
+ post("vasp - env pos/value pairs incomplete, omitted dangling value");
+ }
+
+ if(!ok) Clear();
+}
+
+/*
+Env::Env(const Env &s):
+ cnt(s.cnt),pos(new R[s.cnt]),val(new R[s.cnt])
+{
+ for(I i = 0; i < cnt; ++i) pos[i] = s.pos[i],val[i] = s.val[i];
+}
+*/
+
+Env::~Env() { Clear(); }
+
+
+BL Env::ChkArgs(I argc,const t_atom *argv)
+{
+ I ix = 0;
+
+ // vasp keyword
+ t_symbol *v = ix < argc?flext::GetASymbol(argv[ix]):NULL;
+ if(v && v == vasp_base::sym_env) ix++; // if it is "env" ignore it
+
+ while(argc > ix) {
+ // check for position
+ if(flext::CanbeFloat(argv[ix])) ix++;
+ else
+ return false;
+
+ // check for value
+ if(argc > ix)
+ if(flext::CanbeFloat(argv[ix])) ix++;
+ else
+ return false;
+ }
+
+ return true;
+}
+
+
+
+V Env::Clear()
+{
+ cnt = 0;
+ if(pos) delete[] pos; pos = NULL;
+ if(val) delete[] val; val = NULL;
+}
+
+
+Env::Iter::Iter(const Env &bpl): bp(bpl),ppt(-BIG),npt(BIG),pvl(0),k(0) {}
+
+V Env::Iter::Init(R p)
+{
+ I cnt = bp.Count();
+ ASSERT(cnt > 0);
+
+ if(p < bp.Pos(0)) {
+ // position is before the head
+ ix = -1;
+ ppt = -BIG; pvl = bp.Val(0);
+ }
+ else if(p > bp.Pos(cnt-1)) {
+ // position is after the tail
+ ix = cnt-1;
+ ppt = bp.Pos(ix); pvl = bp.Val(ix);
+ }
+ else {
+ // somewhere in the list
+ for(ix = 0; ix < cnt; ++ix)
+ if(p >= bp.Pos(ix)) break;
+ ppt = bp.Pos(ix); pvl = bp.Val(ix);
+
+ ASSERT(ix < cnt);
+ }
+
+ if(ix >= cnt) {
+ npt = BIG; nvl = pvl;
+ k = 0;
+ }
+ else {
+ npt = bp.Pos(ix+1); nvl = bp.Val(ix+1);
+ k = (nvl-pvl)/(npt-ppt);
+ }
+}
+
+// \todo iteration first, then calculation of k
+V Env::Iter::UpdateFwd(R p)
+{
+ do {
+ ppt = npt,pvl = nvl;
+ if(++ix >= bp.Count()-1) npt = BIG,k = 0;
+ else {
+ k = ((nvl = bp.Val(ix+1))-pvl)/((npt = bp.Pos(ix+1))-ppt);
+ }
+ } while(p > npt);
+}
+
+// \todo iteration first, then calculation of k
+V Env::Iter::UpdateBwd(R p)
+{
+ do {
+ npt = ppt,nvl = pvl;
+ if(--ix < 0) ppt = -BIG,k = 0;
+ else {
+ k = (nvl-(pvl = bp.Val(ix)))/(npt-(ppt = bp.Pos(ix)));
+ }
+ } while(p < ppt);
+}
diff --git a/externals/grill/vasp/source/env.h b/externals/grill/vasp/source/env.h
new file mode 100644
index 00000000..e9f8dae7
--- /dev/null
+++ b/externals/grill/vasp/source/env.h
@@ -0,0 +1,73 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_ENV_H
+#define __VASP_ENV_H
+
+#include "vasp.h"
+
+class Env
+{
+public:
+ Env(): cnt(0),pos(NULL),val(NULL) {}
+ Env(I argc,const t_atom *argv);
+// Env(const Env &p);
+ ~Env();
+
+ static BL ChkArgs(I argc,const t_atom *argv);
+
+ V Clear();
+
+ BL Ok() const { return cnt && pos != NULL && val != NULL; }
+
+// friend class Iter;
+
+ class Iter
+ {
+ public:
+ Iter(const Env &e);
+ V Init(R p);
+
+ R ValFwd(R p)
+ {
+ if(p > npt) UpdateFwd(p);
+ return pvl+k*(p-ppt);
+ }
+
+ R ValBwd(R p)
+ {
+ if(p < ppt) UpdateBwd(p);
+ return pvl+k*(p-ppt);
+ }
+
+ protected:
+ V UpdateFwd(R p);
+ V UpdateBwd(R p);
+
+ const Env &bp;
+ I ix;
+ R ppt,npt;
+ R pvl,nvl;
+ R k;
+ };
+
+ I Count() const { return cnt; }
+ const R *Pos() const { return pos; }
+ const R *Val() const { return val; }
+ R Pos(I ix) const { return pos[ix]; }
+ R Val(I ix) const { return val[ix]; }
+
+protected:
+ I cnt;
+ R *pos,*val;
+};
+
+#endif
+
diff --git a/externals/grill/vasp/source/main.cpp b/externals/grill/vasp/source/main.cpp
new file mode 100644
index 00000000..def63a43
--- /dev/null
+++ b/externals/grill/vasp/source/main.cpp
@@ -0,0 +1,209 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+
+
+const C *VASP_VERSION = "0.1.1";
+
+V lib_setup()
+{
+ post("");
+ post("-----------------------------------------");
+ post(" VASP modular %s ",VASP_VERSION);
+ post(" vector assembling signal processor ");
+ post(" (C)2002 Thomas Grill ");
+#if defined(_DEBUG) && !defined(__MWERKS__)
+ post(" DEBUG BUILD - " __DATE__ " " __TIME__);
+#endif
+ post("");
+ post(" http://www.parasitaere-kapazitaeten.net ");
+ post("-----------------------------------------");
+ post("");
+
+ // call the objects' setup routines
+
+ VASP_SETUP(v); // vasp
+ VASP_SETUP(multi); // vasp.m
+
+ VASP_SETUP(check); // vasp.check
+ VASP_SETUP(update); // vasp.update
+
+ VASP_SETUP(sync); // vasp.sync
+
+ VASP_SETUP(radio); // vasp.radio
+
+ VASP_SETUP(vector); // vasp.vector
+ VASP_SETUP(qvectors); // vasp.vectors?
+
+ VASP_SETUP(size); // vasp.size
+ VASP_SETUP(dsize); // vasp.size+
+ VASP_SETUP(qsize); // vasp.size?
+ VASP_SETUP(msize); // vasp.size*
+ VASP_SETUP(rsize); // vasp.size/
+
+ VASP_SETUP(offset); // vasp.offset
+ VASP_SETUP(doffset); // vasp.offset+
+ VASP_SETUP(qoffset); // vasp.offset?
+
+ VASP_SETUP(frames); // vasp.frames
+ VASP_SETUP(dframes); // vasp.frames+
+ VASP_SETUP(qframes); // vasp.frames?
+ VASP_SETUP(mframes); // vasp.frames*
+ VASP_SETUP(rframes); // vasp.frames/
+
+ VASP_SETUP(channel); // vasp.channel
+ VASP_SETUP(qchannel); // vasp.channel?
+
+ VASP_SETUP(split);
+ VASP_SETUP(join);
+ VASP_SETUP(spit);
+ VASP_SETUP(gather);
+ VASP_SETUP(part);
+
+ VASP_SETUP(list);
+ VASP_SETUP(nonzero);
+
+ VASP_SETUP(imm); // vasp.imm
+
+ VASP__SETUP(set);
+ VASP__SETUP(cset);
+ VASP_SETUP(copy);
+ VASP_SETUP(ccopy);
+
+ VASP__SETUP(add);
+ VASP__SETUP(cadd);
+ VASP__SETUP(sub);
+ VASP__SETUP(csub);
+ VASP__SETUP(subr);
+ VASP__SETUP(csubr);
+ VASP__SETUP(mul);
+ VASP__SETUP(cmul);
+ VASP__SETUP(div);
+ VASP__SETUP(cdiv);
+ VASP__SETUP(divr);
+ VASP__SETUP(cdivr);
+ VASP__SETUP(mod);
+
+ VASP__SETUP(sign)
+ VASP__SETUP(abs)
+ VASP__SETUP(cabs)
+
+ VASP__SETUP(lwr)
+ VASP__SETUP(gtr)
+ VASP__SETUP(alwr)
+ VASP__SETUP(agtr)
+ VASP__SETUP(leq)
+ VASP__SETUP(geq)
+ VASP__SETUP(aleq)
+ VASP__SETUP(ageq)
+ VASP__SETUP(equ)
+ VASP__SETUP(neq)
+
+ VASP__SETUP(min)
+ VASP__SETUP(rmin)
+ VASP__SETUP(max)
+ VASP__SETUP(rmax)
+
+ VASP__SETUP(minmax)
+
+ VASP_SETUP(qmin)
+ VASP_SETUP(qmax)
+ VASP_SETUP(qamin)
+ VASP_SETUP(qamax)
+ VASP_SETUP(qrmin)
+ VASP_SETUP(qrmax)
+
+ VASP__SETUP(gate);
+ VASP__SETUP(rgate);
+// VASP__SETUP(igate);
+// VASP__SETUP(rigate);
+
+ VASP_SETUP(peaks)
+ VASP_SETUP(valleys)
+ VASP_SETUP(rpeaks)
+ VASP_SETUP(rvalleys)
+
+ VASP_SETUP(qpeaks);
+
+/*
+ VASP_SETUP(qvalleys);
+ VASP_SETUP(qrpeaks);
+ VASP_SETUP(qrvalleys);
+*/
+
+ VASP__SETUP(sqr)
+ VASP__SETUP(ssqr)
+ VASP__SETUP(csqr)
+ VASP__SETUP(sqrt)
+ VASP__SETUP(ssqrt)
+ VASP__SETUP(pow)
+ VASP__SETUP(cpowi)
+ VASP__SETUP(rpow);
+ VASP__SETUP(radd);
+
+ VASP__SETUP(exp)
+ VASP__SETUP(log)
+
+ VASP__SETUP(polar)
+ VASP__SETUP(rect)
+
+ VASP__SETUP(cnorm)
+// VASP__SETUP(cswap)
+ VASP__SETUP(cconj)
+
+ VASP_SETUP(shift)
+ VASP_SETUP(xshift)
+ VASP__SETUP(rot)
+ VASP__SETUP(xrot)
+ VASP__SETUP(mirr)
+ VASP__SETUP(xmirr)
+
+ VASP__SETUP(osc)
+ VASP__SETUP(mosc)
+ VASP__SETUP(cosc)
+ VASP__SETUP(mcosc)
+ VASP__SETUP(phasor)
+ VASP__SETUP(mphasor)
+ VASP__SETUP(noise)
+ VASP__SETUP(cnoise)
+
+ VASP__SETUP(window)
+ VASP__SETUP(mwindow)
+ VASP__SETUP(iwindow)
+ VASP__SETUP(miwindow)
+ VASP__SETUP(xwindow)
+ VASP__SETUP(mxwindow)
+
+ VASP__SETUP(flp)
+ VASP__SETUP(fhp)
+
+ VASP__SETUP(int)
+ VASP__SETUP(dif)
+
+ VASP__SETUP(fix)
+
+ VASP__SETUP(tilt)
+ VASP__SETUP(xtilt)
+
+ VASP__SETUP(soffset)
+ VASP__SETUP(sframes)
+
+ VASP__SETUP(rfft)
+ VASP__SETUP(rifft)
+ VASP__SETUP(cfft)
+ VASP__SETUP(cifft)
+}
+
+FLEXT_LIB_SETUP(vasp,lib_setup)
+
+///////////////////////////////////////////////////////////////////////////
+
+
diff --git a/externals/grill/vasp/source/main.h b/externals/grill/vasp/source/main.h
new file mode 100644
index 00000000..53d732c2
--- /dev/null
+++ b/externals/grill/vasp/source/main.h
@@ -0,0 +1,83 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_H
+#define __VASP_H
+
+#include <flext.h>
+
+#if !defined(FLEXT_VERSION) || (FLEXT_VERSION < 400)
+#error You need at least flext version 0.4.0
+#endif
+
+
+#include <typeinfo>
+#include <stdlib.h>
+
+class complex;
+class vector;
+
+#if 0
+ #define I int
+ #define L long
+ #define UL unsigned long
+ #define F float
+ #define D double
+ #define C char
+ #define BL bool
+ #define V void
+ #define S t_sample // type for samples
+ #define R double // type for internal calculations
+ #define CX complex
+ #define VX vector
+#else
+ typedef int I;
+ typedef long L;
+ typedef unsigned long UL;
+ typedef float F;
+ typedef double D;
+ typedef char C;
+ typedef bool BL;
+ typedef void V;
+ typedef t_sample S; // type for samples
+ typedef double R; // type for internal calculations
+ typedef complex CX;
+ typedef vector VX;
+#endif
+
+#ifdef PD
+// buffers are never interleaved - special optimizations may occur
+// attention: possibly obsolete when immediate file access is implemented
+#define VASP_CHN1
+#endif
+
+class complex
+{
+public:
+ complex() {}
+ complex(F re,F im = 0): real(re),imag(im) {}
+
+ F real,imag;
+};
+
+class vector
+{
+public:
+ vector(): dim(0),data(NULL) {}
+ ~vector() { if(data) delete[] data; }
+
+ I Dim() const { return dim; }
+ F *Data() { return data; }
+ const F *Data() const { return data; }
+protected:
+ I dim; F *data;
+};
+
+#endif
diff --git a/externals/grill/vasp/source/mixfft.cpp b/externals/grill/vasp/source/mixfft.cpp
new file mode 100644
index 00000000..975e8cb1
--- /dev/null
+++ b/externals/grill/vasp/source/mixfft.cpp
@@ -0,0 +1,588 @@
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4244)
+#endif
+
+/************************************************************************
+ fft(int n, double xRe[], double xIm[], double yRe[], double yIm[])
+ ------------------------------------------------------------------------
+ NOTE : This is copyrighted material, Not public domain. See below.
+ ------------------------------------------------------------------------
+ Input/output:
+ int n transformation length.
+ double xRe[] real part of input sequence.
+ double xIm[] imaginary part of input sequence.
+ double yRe[] real part of output sequence.
+ double yIm[] imaginary part of output sequence.
+ ------------------------------------------------------------------------
+ Function:
+ The procedure performs a fast discrete Fourier transform (FFT) of
+ a complex sequence, x, of an arbitrary length, n. The output, y,
+ is also a complex sequence of length n.
+
+ y[k] = sum(x[m]*exp(-i*2*pi*k*m/n), m=0..(n-1)), k=0,...,(n-1)
+
+ The largest prime factor of n must be less than or equal to the
+ constant maxPrimeFactor defined below.
+ ------------------------------------------------------------------------
+ Author:
+ Jens Joergen Nielsen For non-commercial use only.
+ Bakkehusene 54 A $100 fee must be paid if used
+ DK-2970 Hoersholm commercially. Please contact.
+ DENMARK
+
+ E-mail : jjn@get2net.dk All rights reserved. October 2000.
+ Homepage : http://home.get2net.dk/jjn
+ ------------------------------------------------------------------------
+ Implementation notes:
+ The general idea is to factor the length of the DFT, n, into
+ factors that are efficiently handled by the routines.
+
+ A number of short DFT's are implemented with a minimum of
+ arithmetical operations and using (almost) straight line code
+ resulting in very fast execution when the factors of n belong
+ to this set. Especially radix-10 is optimized.
+
+ Prime factors, that are not in the set of short DFT's are handled
+ with direct evaluation of the DFP expression.
+
+ Please report any problems to the author.
+ Suggestions and improvements are welcomed.
+ ------------------------------------------------------------------------
+ Benchmarks:
+ The Microsoft Visual C++ compiler was used with the following
+ compile options:
+ /nologo /Gs /G2 /W4 /AH /Ox /D "NDEBUG" /D "_DOS" /FR
+ and the FFTBENCH test executed on a 50MHz 486DX :
+
+ Length Time [s] Accuracy [dB]
+
+ 128 0.0054 -314.8
+ 256 0.0116 -309.8
+ 512 0.0251 -290.8
+ 1024 0.0567 -313.6
+ 2048 0.1203 -306.4
+ 4096 0.2600 -291.8
+ 8192 0.5800 -305.1
+ 100 0.0040 -278.5
+ 200 0.0099 -280.3
+ 500 0.0256 -278.5
+ 1000 0.0540 -278.5
+ 2000 0.1294 -280.6
+ 5000 0.3300 -278.4
+ 10000 0.7133 -278.5
+ ------------------------------------------------------------------------
+ The following procedures are used :
+ factorize : factor the transformation length.
+ transTableSetup : setup table with sofar-, actual-, and remainRadix.
+ permute : permutation allows in-place calculations.
+ twiddleTransf : twiddle multiplications and DFT's for one stage.
+ initTrig : initialise sine/cosine table.
+ fft_4 : length 4 DFT, a la Nussbaumer.
+ fft_5 : length 5 DFT, a la Nussbaumer.
+ fft_10 : length 10 DFT using prime factor FFT.
+ fft_odd : length n DFT, n odd.
+*************************************************************************/
+
+/************************************************************************
+
+ changes by Thomas Grill:
+
+ - introduced REAL type for numbers
+ - made functions static
+ - threw fft_n functions out of twiddleTransf
+ if feasible, these will be inlined by the compiler
+ - changed log prints (to post)
+
+************************************************************************/
+
+#define REAL float
+extern "C" void post(const char *c,...);
+
+/************************************************************************/
+
+
+#define maxPrimeFactor 8000 // all static data should fit into 256kB of cache
+#define maxPrimeFactorDiv2 (maxPrimeFactor+1)/2
+#define maxFactorCount 100
+
+static double c3_1 = -1.5000000000000E+00; /* c3_1 = cos(2*pi/3)-1; */
+static double c3_2 = 8.6602540378444E-01; /* c3_2 = sin(2*pi/3); */
+
+static double u5 = 1.2566370614359E+00; /* u5 = 2*pi/5; */
+static double c5_1 = -1.2500000000000E+00; /* c5_1 = (cos(u5)+cos(2*u5))/2-1;*/
+static double c5_2 = 5.5901699437495E-01; /* c5_2 = (cos(u5)-cos(2*u5))/2; */
+static double c5_3 = -9.5105651629515E-01; /* c5_3 = -sin(u5); */
+static double c5_4 = -1.5388417685876E+00; /* c5_4 = -(sin(u5)+sin(2*u5)); */
+static double c5_5 = 3.6327126400268E-01; /* c5_5 = (sin(u5)-sin(2*u5)); */
+static double c8 = 7.0710678118655E-01; /* c8 = 1/sqrt(2); */
+
+static double pi;
+static int groupOffset,dataOffset,blockOffset,adr;
+static int groupNo,dataNo,blockNo,twNo;
+static double omega;
+static REAL tw_re,tw_im;
+static REAL twiddleRe[maxPrimeFactor], twiddleIm[maxPrimeFactor];
+static REAL trigRe[maxPrimeFactor], trigIm[maxPrimeFactor];
+static REAL zRe[maxPrimeFactor], zIm[maxPrimeFactor];
+static REAL vRe[maxPrimeFactorDiv2], vIm[maxPrimeFactorDiv2];
+static REAL wRe[maxPrimeFactorDiv2], wIm[maxPrimeFactorDiv2];
+
+
+static void factorize(int n, int *nFact, int fact[])
+{
+ int i,j,k;
+ int nRadix;
+ int radices[7];
+ int factors[maxFactorCount];
+
+ nRadix = 6;
+ radices[1]= 2;
+ radices[2]= 3;
+ radices[3]= 4;
+ radices[4]= 5;
+ radices[5]= 8;
+ radices[6]= 10;
+
+ if (n==1)
+ {
+ j=1;
+ factors[1]=1;
+ }
+ else j=0;
+ i=nRadix;
+ while ((n>1) && (i>0))
+ {
+ if ((n % radices[i]) == 0)
+ {
+ n=n / radices[i];
+ j=j+1;
+ factors[j]=radices[i];
+ }
+ else i=i-1;
+ }
+ if (factors[j] == 2) /*substitute factors 2*8 with 4*4 */
+ {
+ i = j-1;
+ while ((i>0) && (factors[i] != 8)) i--;
+ if (i>0)
+ {
+ factors[j] = 4;
+ factors[i] = 4;
+ }
+ }
+ if (n>1)
+ {
+ for (k=2; k<sqrt(n)+1; k++)
+ while ((n % k) == 0)
+ {
+ n=n / k;
+ j=j+1;
+ factors[j]=k;
+ }
+ if (n>1)
+ {
+ j=j+1;
+ factors[j]=n;
+ }
+ }
+ for (i=1; i<=j; i++)
+ {
+ fact[i] = factors[j-i+1];
+ }
+ *nFact=j;
+} /* factorize */
+
+/****************************************************************************
+ After N is factored the parameters that control the stages are generated.
+ For each stage we have:
+ sofar : the product of the radices so far.
+ actual : the radix handled in this stage.
+ remain : the product of the remaining radices.
+ ****************************************************************************/
+
+static bool transTableSetup(int sofar[], int actual[], int remain[],
+ int *nFact,
+ int *nPoints)
+{
+ int i;
+
+ factorize(*nPoints, nFact, actual);
+ if (actual[1] > maxPrimeFactor)
+ {
+ // T.Grill - replaced the printfs by a post
+ post("FFT: Prime factor of FFT length is too large (%d) - aborted",actual[1]);
+ return false;
+ }
+
+ remain[0]=*nPoints;
+ sofar[1]=1;
+ remain[1]=*nPoints / actual[1];
+ for (i=2; i<=*nFact; i++)
+ {
+ sofar[i]=sofar[i-1]*actual[i-1];
+ remain[i]=remain[i-1] / actual[i];
+ }
+ return true;
+} /* transTableSetup */
+
+/****************************************************************************
+ The sequence y is the permuted input sequence x so that the following
+ transformations can be performed in-place, and the final result is the
+ normal order.
+ ****************************************************************************/
+
+static void permute(int nPoint, int nFact,
+ int fact[], int remain[],
+ REAL xRe[], REAL xIm[],
+ REAL yRe[], REAL yIm[])
+
+{
+ int i,j,k;
+ int count[maxFactorCount];
+
+ for (i=1; i<=nFact; i++) count[i]=0;
+ k=0;
+ for (i=0; i<=nPoint-2; i++)
+ {
+ yRe[i] = xRe[k];
+ yIm[i] = xIm[k];
+ j=1;
+ k=k+remain[j];
+ count[1] = count[1]+1;
+ while (count[j] >= fact[j])
+ {
+ count[j]=0;
+ k=k-remain[j-1]+remain[j+1];
+ j=j+1;
+ count[j]=count[j]+1;
+ }
+ }
+ yRe[nPoint-1]=xRe[nPoint-1];
+ yIm[nPoint-1]=xIm[nPoint-1];
+} /* permute */
+
+
+/****************************************************************************
+ Twiddle factor multiplications and transformations are performed on a
+ group of data. The number of multiplications with 1 are reduced by skipping
+ the twiddle multiplication of the first stage and of the first group of the
+ following stages.
+ ***************************************************************************/
+
+static void initTrig(int radix)
+{
+ int i;
+ double w,xre,xim,xre1,xim1;
+
+ w=2*pi/radix;
+ trigRe[0]=1; trigIm[0]=0;
+ xre1=xre=cos(w);
+ xim1=xim=-sin(w);
+ trigRe[1]=xre; trigIm[1]=xim;
+ for (i=2; i<radix; i++)
+ {
+ trigRe[i] = xre1 = xre*trigRe[i-1] - xim*trigIm[i-1];
+ trigIm[i] = xim1 = xim*trigRe[i-1] + xre*trigIm[i-1];
+// trigRe[i] = xre1 = xre*xre1 - xim*xim1;
+// trigIm[i] = xim1 = xim*xre1 + xre*xim1;
+ }
+} /* initTrig */
+
+static void fft_2(REAL aRe[], REAL aIm[])
+{
+ double gem;
+ gem=zRe[0] + zRe[1];
+ zRe[1]=zRe[0] - zRe[1]; zRe[0]=gem;
+ gem=zIm[0] + zIm[1];
+ zIm[1]=zIm[0] - zIm[1]; zIm[0]=gem;
+}
+
+static void fft_3(REAL aRe[], REAL aIm[])
+{
+ REAL t1_re,t1_im;
+ REAL m2_re,m2_im;
+ REAL m1_re,m1_im;
+ REAL s1_re,s1_im;
+ t1_re=zRe[1] + zRe[2]; t1_im=zIm[1] + zIm[2];
+ zRe[0]=zRe[0] + t1_re; zIm[0]=zIm[0] + t1_im;
+ m1_re=c3_1*t1_re; m1_im=c3_1*t1_im;
+ m2_re=c3_2*(zIm[1] - zIm[2]);
+ m2_im=c3_2*(zRe[2] - zRe[1]);
+ s1_re=zRe[0] + m1_re; s1_im=zIm[0] + m1_im;
+ zRe[1]=s1_re + m2_re; zIm[1]=s1_im + m2_im;
+ zRe[2]=s1_re - m2_re; zIm[2]=s1_im - m2_im;
+}
+
+static void fft_4(REAL aRe[], REAL aIm[])
+{
+ REAL t1_re,t1_im, t2_re,t2_im;
+ REAL m2_re,m2_im, m3_re,m3_im;
+
+ t1_re=aRe[0] + aRe[2]; t1_im=aIm[0] + aIm[2];
+ t2_re=aRe[1] + aRe[3]; t2_im=aIm[1] + aIm[3];
+
+ m2_re=aRe[0] - aRe[2]; m2_im=aIm[0] - aIm[2];
+ m3_re=aIm[1] - aIm[3]; m3_im=aRe[3] - aRe[1];
+
+ aRe[0]=t1_re + t2_re; aIm[0]=t1_im + t2_im;
+ aRe[2]=t1_re - t2_re; aIm[2]=t1_im - t2_im;
+ aRe[1]=m2_re + m3_re; aIm[1]=m2_im + m3_im;
+ aRe[3]=m2_re - m3_re; aIm[3]=m2_im - m3_im;
+} /* fft_4 */
+
+
+static void fft_5(REAL aRe[], REAL aIm[])
+{
+ REAL t1_re,t1_im, t2_re,t2_im, t3_re,t3_im;
+ REAL t4_re,t4_im, t5_re,t5_im;
+ REAL m2_re,m2_im, m3_re,m3_im, m4_re,m4_im;
+ REAL m1_re,m1_im, m5_re,m5_im;
+ REAL s1_re,s1_im, s2_re,s2_im, s3_re,s3_im;
+ REAL s4_re,s4_im, s5_re,s5_im;
+
+ t1_re=aRe[1] + aRe[4]; t1_im=aIm[1] + aIm[4];
+ t2_re=aRe[2] + aRe[3]; t2_im=aIm[2] + aIm[3];
+ t3_re=aRe[1] - aRe[4]; t3_im=aIm[1] - aIm[4];
+ t4_re=aRe[3] - aRe[2]; t4_im=aIm[3] - aIm[2];
+ t5_re=t1_re + t2_re; t5_im=t1_im + t2_im;
+ aRe[0]=aRe[0] + t5_re; aIm[0]=aIm[0] + t5_im;
+ m1_re=c5_1*t5_re; m1_im=c5_1*t5_im;
+ m2_re=c5_2*(t1_re - t2_re); m2_im=c5_2*(t1_im - t2_im);
+
+ m3_re=-c5_3*(t3_im + t4_im); m3_im=c5_3*(t3_re + t4_re);
+ m4_re=-c5_4*t4_im; m4_im=c5_4*t4_re;
+ m5_re=-c5_5*t3_im; m5_im=c5_5*t3_re;
+
+ s3_re=m3_re - m4_re; s3_im=m3_im - m4_im;
+ s5_re=m3_re + m5_re; s5_im=m3_im + m5_im;
+ s1_re=aRe[0] + m1_re; s1_im=aIm[0] + m1_im;
+ s2_re=s1_re + m2_re; s2_im=s1_im + m2_im;
+ s4_re=s1_re - m2_re; s4_im=s1_im - m2_im;
+
+ aRe[1]=s2_re + s3_re; aIm[1]=s2_im + s3_im;
+ aRe[2]=s4_re + s5_re; aIm[2]=s4_im + s5_im;
+ aRe[3]=s4_re - s5_re; aIm[3]=s4_im - s5_im;
+ aRe[4]=s2_re - s3_re; aIm[4]=s2_im - s3_im;
+} /* fft_5 */
+
+static void fft_8()
+{
+ REAL aRe[4], aIm[4], bRe[4], bIm[4], gem;
+
+ aRe[0] = zRe[0]; bRe[0] = zRe[1];
+ aRe[1] = zRe[2]; bRe[1] = zRe[3];
+ aRe[2] = zRe[4]; bRe[2] = zRe[5];
+ aRe[3] = zRe[6]; bRe[3] = zRe[7];
+
+ aIm[0] = zIm[0]; bIm[0] = zIm[1];
+ aIm[1] = zIm[2]; bIm[1] = zIm[3];
+ aIm[2] = zIm[4]; bIm[2] = zIm[5];
+ aIm[3] = zIm[6]; bIm[3] = zIm[7];
+
+ fft_4(aRe, aIm); fft_4(bRe, bIm);
+
+ gem = c8*(bRe[1] + bIm[1]);
+ bIm[1] = c8*(bIm[1] - bRe[1]);
+ bRe[1] = gem;
+ gem = bIm[2];
+ bIm[2] =-bRe[2];
+ bRe[2] = gem;
+ gem = c8*(bIm[3] - bRe[3]);
+ bIm[3] =-c8*(bRe[3] + bIm[3]);
+ bRe[3] = gem;
+
+ zRe[0] = aRe[0] + bRe[0]; zRe[4] = aRe[0] - bRe[0];
+ zRe[1] = aRe[1] + bRe[1]; zRe[5] = aRe[1] - bRe[1];
+ zRe[2] = aRe[2] + bRe[2]; zRe[6] = aRe[2] - bRe[2];
+ zRe[3] = aRe[3] + bRe[3]; zRe[7] = aRe[3] - bRe[3];
+
+ zIm[0] = aIm[0] + bIm[0]; zIm[4] = aIm[0] - bIm[0];
+ zIm[1] = aIm[1] + bIm[1]; zIm[5] = aIm[1] - bIm[1];
+ zIm[2] = aIm[2] + bIm[2]; zIm[6] = aIm[2] - bIm[2];
+ zIm[3] = aIm[3] + bIm[3]; zIm[7] = aIm[3] - bIm[3];
+} /* fft_8 */
+
+static void fft_10()
+{
+ REAL aRe[5], aIm[5], bRe[5], bIm[5];
+
+ aRe[0] = zRe[0]; bRe[0] = zRe[5];
+ aRe[1] = zRe[2]; bRe[1] = zRe[7];
+ aRe[2] = zRe[4]; bRe[2] = zRe[9];
+ aRe[3] = zRe[6]; bRe[3] = zRe[1];
+ aRe[4] = zRe[8]; bRe[4] = zRe[3];
+
+ aIm[0] = zIm[0]; bIm[0] = zIm[5];
+ aIm[1] = zIm[2]; bIm[1] = zIm[7];
+ aIm[2] = zIm[4]; bIm[2] = zIm[9];
+ aIm[3] = zIm[6]; bIm[3] = zIm[1];
+ aIm[4] = zIm[8]; bIm[4] = zIm[3];
+
+ fft_5(aRe, aIm); fft_5(bRe, bIm);
+
+ zRe[0] = aRe[0] + bRe[0]; zRe[5] = aRe[0] - bRe[0];
+ zRe[6] = aRe[1] + bRe[1]; zRe[1] = aRe[1] - bRe[1];
+ zRe[2] = aRe[2] + bRe[2]; zRe[7] = aRe[2] - bRe[2];
+ zRe[8] = aRe[3] + bRe[3]; zRe[3] = aRe[3] - bRe[3];
+ zRe[4] = aRe[4] + bRe[4]; zRe[9] = aRe[4] - bRe[4];
+
+ zIm[0] = aIm[0] + bIm[0]; zIm[5] = aIm[0] - bIm[0];
+ zIm[6] = aIm[1] + bIm[1]; zIm[1] = aIm[1] - bIm[1];
+ zIm[2] = aIm[2] + bIm[2]; zIm[7] = aIm[2] - bIm[2];
+ zIm[8] = aIm[3] + bIm[3]; zIm[3] = aIm[3] - bIm[3];
+ zIm[4] = aIm[4] + bIm[4]; zIm[9] = aIm[4] - bIm[4];
+} /* fft_10 */
+
+static void fft_odd(int radix)
+{
+ REAL rere, reim, imre, imim;
+ int i,j,k,n,max;
+
+ n = radix;
+ max = (n + 1)/2;
+ for (j=1; j < max; j++)
+ {
+ vRe[j] = zRe[j] + zRe[n-j];
+ vIm[j] = zIm[j] - zIm[n-j];
+ wRe[j] = zRe[j] - zRe[n-j];
+ wIm[j] = zIm[j] + zIm[n-j];
+ }
+
+ for (j=1; j < max; j++)
+ {
+ zRe[j]=zRe[0];
+ zIm[j]=zIm[0];
+ zRe[n-j]=zRe[0];
+ zIm[n-j]=zIm[0];
+ k=j;
+ for (i=1; i < max; i++)
+ {
+ rere = trigRe[k] * vRe[i];
+ imim = trigIm[k] * vIm[i];
+ reim = trigRe[k] * wIm[i];
+ imre = trigIm[k] * wRe[i];
+
+ zRe[n-j] += rere + imim;
+ zIm[n-j] += reim - imre;
+ zRe[j] += rere - imim;
+ zIm[j] += reim + imre;
+
+ k = k + j;
+ if (k >= n) k = k - n;
+ }
+ }
+ for (j=1; j < max; j++)
+ {
+ zRe[0]=zRe[0] + vRe[j];
+ zIm[0]=zIm[0] + wIm[j];
+ }
+} /* fft_odd */
+
+
+static void twiddleTransf(int sofarRadix, int radix, int remainRadix,
+ REAL yRe[], REAL yIm[])
+
+{ /* twiddleTransf */
+ double cosw, sinw, gem;
+
+ initTrig(radix);
+ omega = 2*pi/(double)(sofarRadix*radix);
+ cosw = cos(omega);
+ sinw = -sin(omega);
+ tw_re = 1.0;
+ tw_im = 0;
+ dataOffset=0;
+ groupOffset=dataOffset;
+ adr=groupOffset;
+ for (dataNo=0; dataNo<sofarRadix; dataNo++)
+ {
+ if (sofarRadix>1)
+ {
+ twiddleRe[0] = 1.0;
+ twiddleIm[0] = 0.0;
+ twiddleRe[1] = tw_re;
+ twiddleIm[1] = tw_im;
+ for (twNo=2; twNo<radix; twNo++)
+ {
+ twiddleRe[twNo]=tw_re*twiddleRe[twNo-1]
+ - tw_im*twiddleIm[twNo-1];
+ twiddleIm[twNo]=tw_im*twiddleRe[twNo-1]
+ + tw_re*twiddleIm[twNo-1];
+ }
+ gem = cosw*tw_re - sinw*tw_im;
+ tw_im = sinw*tw_re + cosw*tw_im;
+ tw_re = gem;
+ }
+ for (groupNo=0; groupNo<remainRadix; groupNo++)
+ {
+ if ((sofarRadix>1) && (dataNo > 0))
+ {
+ zRe[0]=yRe[adr];
+ zIm[0]=yIm[adr];
+ blockNo=1;
+ do {
+ adr = adr + sofarRadix;
+ zRe[blockNo]= twiddleRe[blockNo] * yRe[adr]
+ - twiddleIm[blockNo] * yIm[adr];
+ zIm[blockNo]= twiddleRe[blockNo] * yIm[adr]
+ + twiddleIm[blockNo] * yRe[adr];
+
+ blockNo++;
+ } while (blockNo < radix);
+ }
+ else
+ for (blockNo=0; blockNo<radix; blockNo++)
+ {
+ zRe[blockNo]=yRe[adr];
+ zIm[blockNo]=yIm[adr];
+ adr=adr+sofarRadix;
+ }
+ switch(radix) {
+ // T.Grill - replaced the inlined code by their function counterparts
+ case 2 : fft_2(zRe,zIm); break;
+ case 3 : fft_3(zRe,zIm); break;
+ case 4 : fft_4(zRe,zIm); break;
+ case 5 : fft_5(zRe,zIm); break;
+ case 8 : fft_8(); break;
+ case 10 : fft_10(); break;
+ default : fft_odd(radix); break;
+ }
+ adr=groupOffset;
+ for (blockNo=0; blockNo<radix; blockNo++)
+ {
+ yRe[adr]=zRe[blockNo]; yIm[adr]=zIm[blockNo];
+ adr=adr+sofarRadix;
+ }
+ groupOffset=groupOffset+sofarRadix*radix;
+ adr=groupOffset;
+ }
+ dataOffset=dataOffset+1;
+ groupOffset=dataOffset;
+ adr=groupOffset;
+ }
+} /* twiddleTransf */
+
+bool mixfft(int n, REAL *xRe, REAL *xIm,REAL *yRe, REAL *yIm)
+{
+ int sofarRadix[maxFactorCount],
+ actualRadix[maxFactorCount],
+ remainRadix[maxFactorCount];
+ int nFactor;
+ int count;
+
+ pi = 4*atan(1);
+
+ if(!transTableSetup(sofarRadix, actualRadix, remainRadix, &nFactor, &n)) return false;
+ permute(n, nFactor, actualRadix, remainRadix, xRe, xIm, yRe, yIm);
+
+ for (count=1; count<=nFactor; count++)
+ twiddleTransf(sofarRadix[count], actualRadix[count], remainRadix[count],
+ yRe, yIm);
+ return true;
+} /* fft */
+
diff --git a/externals/grill/vasp/source/obj_chns.cpp b/externals/grill/vasp/source/obj_chns.cpp
new file mode 100755
index 00000000..1cd15c30
--- /dev/null
+++ b/externals/grill/vasp/source/obj_chns.cpp
@@ -0,0 +1,107 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_channel
+ \remark \b vasp.channel
+ \brief Sets channel index of vasp.
+ \since 0.0.8
+ \param cmdln.1 int - index of vasp vector
+ \param inlet vasp - is stored and indexed vasp vector output
+ \param inlet bang - triggers indexed vasp vector output
+ \param inlet set - vasp to be stored (and not immediately output)
+ \retval outlet modified vasp
+*/
+class vasp_channel:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_channel,vasp_tx)
+
+public:
+ vasp_channel(I argc,t_atom *argv):
+ ix(0)
+ {
+ if(argc >= 1 && CanbeInt(argv[0]))
+ ix = GetAInt(argv[0]);
+ else if(argc)
+ post("%s - Index argument invalid -> set to 0",thisName());
+
+ AddInAnything(2);
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD(1,m_ix);
+ }
+
+ V m_ix(I i) { ix = i; }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ ret->Channel(ix);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Set channel index of vectors in vasp",thisName()); }
+
+protected:
+ I ix;
+
+private:
+ FLEXT_CALLBACK_I(m_ix);
+};
+
+FLEXT_LIB_V("vasp, vasp.channel vasp.c",vasp_channel)
+
+
+
+/*! \class vasp_qc
+ \remark \b vasp.c?
+ \brief Gets channel index of a vasp.
+ \since 0.0.8
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet int - channel index of stored vasp
+
+ \note Always returns index of 0th vasp
+ \note No output for invalid vasp?
+*/
+class vasp_qchannel:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_qchannel,vasp_op)
+
+public:
+ vasp_qchannel()
+ {
+ AddInAnything();
+ AddOutInt();
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+ if(ref.Ok())
+ ToOutInt(0,ref.Vector(0).Channel());
+ else
+ post("%s - Invalid vasp, no output",thisName());
+ }
+
+ virtual V m_help() { post("%s - Get channel index of 0th vector in vasp",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.channel? vasp.c?",vasp_qchannel)
+
+
+
diff --git a/externals/grill/vasp/source/obj_frames.cpp b/externals/grill/vasp/source/obj_frames.cpp
new file mode 100644
index 00000000..70210d61
--- /dev/null
+++ b/externals/grill/vasp/source/obj_frames.cpp
@@ -0,0 +1,228 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_frames
+ \remark \b vasp.frames
+ \brief Sets frame count of vasp.
+ \since 0.0.1
+ \param cmdln.1 [_time=0] - frame count in time units
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _time - frame count in time units
+ \retval outlet vasp - modified vasp
+
+ \todo Implement unit processing.
+*/
+class vasp_frames:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_frames,vasp_tx)
+
+public:
+ vasp_frames(I argc,t_atom *argv):
+ frms(0),setf(false)
+ {
+ if(argc && CanbeFloat(argv[0]))
+ m_arg(GetAFloat(argv[0]));
+ else if(argc) {
+ post("%s - argument invalid -> ignored",thisName());
+ }
+
+ AddInAnything();
+ AddInFloat();
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD(1,m_arg);
+ }
+
+ virtual V m_arg(F f)
+ {
+ frms = (I)f; //! \todo unit processing
+ setf = true;
+ }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(setf) ret->Frames(frms);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Set a vasp's frame count",thisName()); }
+protected:
+ I frms;
+ BL setf;
+
+private:
+ FLEXT_CALLBACK_F(m_arg);
+};
+
+FLEXT_LIB_V("vasp, vasp.frames vasp.f",vasp_frames)
+
+
+
+
+/*! \class vasp_dframes
+ \remark \b vasp.frames+
+ \brief Sets frame count of vasp differentially.
+ \since 0.0.1
+ \param cmdln.1 [_time=0] - increase of frame count in time units
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _time - increase of frame count in time units
+ \retval outlet vasp - modified vasp
+
+ \todo Implement unit processing.
+*/
+class vasp_dframes:
+ public vasp_frames
+{
+ FLEXT_HEADER(vasp_dframes,vasp_frames)
+
+public:
+ vasp_dframes(I argc,t_atom *argv): vasp_frames(argc,argv) {}
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(setf) ret->FramesD(frms);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Raise/lower a vasp's frame count",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.frames+ vasp.f+",vasp_dframes)
+
+
+
+/*! \class vasp_mframes
+ \remark \b vasp.frames*
+ \brief Sets frame count of vasp by a factor
+ \since 0.0.6
+ \param cmdln.1 [_number=1] - multiply of frame count
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _number - multiply of frame count
+ \retval outlet vasp - modified vasp
+*/
+class vasp_mframes:
+ public vasp_frames
+{
+ FLEXT_HEADER(vasp_mframes,vasp_frames)
+
+public:
+ vasp_mframes(I argc,t_atom *argv):
+ vasp_frames(argc,argv)
+ {
+ if(argc && CanbeFloat(argv[0])) m_arg(GetAFloat(argv[0]));
+ }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(setf) ret->FramesM(frms);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Multiply a vasp's frame count",thisName()); }
+
+ virtual V m_arg(F f)
+ {
+ factor = f;
+ setf = true;
+ }
+
+protected:
+ F factor;
+};
+
+FLEXT_LIB_V("vasp, vasp.frames* vasp.f*",vasp_mframes)
+
+
+
+/*! \class vasp_rframes
+ \remark \b vasp.frames/
+ \brief Sets frame count of vasp by a divisor
+ \since 0.0.6
+ \param cmdln.1 [_number=1] - multiply of frame count
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _number - divisor of frame count
+ \retval outlet vasp - modified vasp
+*/
+class vasp_rframes:
+ public vasp_mframes
+{
+ FLEXT_HEADER(vasp_rframes,vasp_mframes)
+
+public:
+ vasp_rframes(I argc,t_atom *argv): vasp_mframes(argc,argv) {}
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(setf) ret->FramesR(factor);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Divide a vasp's frame count",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.frames/ vasp.f/",vasp_rframes)
+
+
+
+/*! \class vasp_qframes
+ \remark \b vasp.frames?
+ \brief Get frame count in time units
+ \since 0.0.1
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet _time - frame count of vasp in time units
+
+ \note Outputs 0 if vasp is undefined or invalid
+
+ \todo Implement unit processing
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+*/
+class vasp_qframes:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_qframes,vasp_op)
+
+public:
+
+ vasp_qframes()
+ {
+ AddInAnything();
+ AddOutInt();
+ SetupInOut();
+ }
+
+ virtual V m_bang() { ToOutInt(0,ref.ChkFrames()); } //! \todo unit processing
+
+ virtual V m_help() { post("%s - Get a vasp's frame count",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.frames? vasp.f?",vasp_qframes)
+
+
diff --git a/externals/grill/vasp/source/obj_imm.cpp b/externals/grill/vasp/source/obj_imm.cpp
new file mode 100644
index 00000000..d1ca5da0
--- /dev/null
+++ b/externals/grill/vasp/source/obj_imm.cpp
@@ -0,0 +1,104 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+/*! \file vasp_imm.cpp
+ \brief Definitions for immediate vasps
+*/
+
+
+#include "classes.h"
+#include "util.h"
+#include "buflib.h"
+#include "oploop.h"
+
+
+/*! \class vasp_imm
+ \remark \b vasp.imm
+ \brief Get vasp immediate.
+ \since 0.0.6
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.1 frames - minimum frame length
+ \param inlet.2 int - minimum frame length
+ \retval outlet vasp! - vasp immediate
+
+*/
+class vasp_imm:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_imm,vasp_op)
+
+public:
+ vasp_imm(I argc,t_atom *argv):
+ frms(0)
+ {
+ if(argc >= 1 && CanbeInt(argv[0]))
+ m_frames(GetAInt(argv[0]));
+ else if(argc)
+ post("%s - Frame count argument invalid -> ignored",thisName());
+
+ AddInAnything();
+ AddInInt();
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD_(0,"frames",m_frames);
+ FLEXT_ADDMETHOD(1,m_frames);
+ }
+
+ V m_frames(I n) { frms = n; }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok() || !ref.Check()) {
+/*
+ if(!frms)
+ post("%s - No length defined!",thisName());
+ else
+*/
+ {
+ ImmBuf ibuf(frms);
+ Vasp ret(frms,Vasp::Ref(ibuf));
+ ToOutVasp(0,ret);
+ }
+ }
+ else if(ref.Vectors() > 1)
+ post("%s - More than one vector in vasp!",thisName());
+ else {
+ VBuffer *buf = ref.Buffer(0);
+ I len = buf->Length(),chns = buf->Channels();
+ if(frms > len) len = frms;
+
+ ImmBuf imm(len);
+
+ S *dst = imm.Pointer();
+ const S *src = buf->Pointer();
+ register int i;
+ _D_LOOP(i,len) *(dst++) = *src,src += chns; _E_LOOP
+
+ Vasp ret(len,Vasp::Ref(imm));
+ ToOutVasp(0,ret);
+ }
+ }
+
+ virtual V m_help() { post("%s - Get immediate vasp vectors",thisName()); }
+
+protected:
+
+ I frms;
+
+private:
+ FLEXT_CALLBACK_I(m_frames)
+};
+
+FLEXT_LIB_V("vasp, vasp.imm vasp.!",vasp_imm)
+
+
diff --git a/externals/grill/vasp/source/obj_offs.cpp b/externals/grill/vasp/source/obj_offs.cpp
new file mode 100644
index 00000000..e424056f
--- /dev/null
+++ b/externals/grill/vasp/source/obj_offs.cpp
@@ -0,0 +1,174 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_offset
+ \remark \b vasp.offset
+ \brief Sets offset of vasp vectors.
+ \since 0.0.1
+ \param cmdln.1 [_time=0] - offset into buffer(s)
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _time - offset into buffer(s)
+ \retval outlet vasp - modified vasp
+
+ \attention Normally vasp vectors have individual offsets - this operations sets all the offsets to equal values.
+ \todo Implement unit processing.
+*/
+class vasp_offset:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_offset,vasp_tx)
+
+public:
+ vasp_offset(I argc,t_atom *argv):
+ offs(0),seto(false)
+ {
+ if(argc >= 1 && CanbeFloat(argv[0]))
+ m_offs(GetAFloat(argv[0]));
+ else if(argc)
+ post("%s - Offset argument invalid -> ignored",thisName());
+
+ AddInAnything();
+ AddInFloat();
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD(1,m_offs);
+ }
+
+ V m_offs(F o)
+ {
+ offs = (I)o; //! \todo unit processing
+ seto = true;
+ }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(seto) ret->Offset(offs);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Set a vasp's offset(s) into the vector buffers",thisName()); }
+protected:
+ I offs;
+ BL seto;
+
+private:
+ FLEXT_CALLBACK_F(m_offs);
+};
+
+FLEXT_LIB_V("vasp, vasp.offset vasp.o",vasp_offset)
+
+
+
+
+/*! \class vasp_doffset
+ \remark \b vasp.offset+
+ \brief Sets offset of vasp vectors differentially.
+ \since 0.0.1
+ \param cmdln.1 [_time=0] - increase offset of into buffer(s)
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _time - increase of offset into buffer(s)
+ \retval outlet vasp - modified vasp
+
+ \todo Implement unit processing
+*/
+class vasp_doffset:
+ public vasp_offset
+{
+ FLEXT_HEADER(vasp_doffset,vasp_offset)
+
+public:
+ vasp_doffset(I argc,t_atom *argv): vasp_offset(argc,argv) {}
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(seto) ret->OffsetD(offs);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Shift a vasp's offset(s) into the vector buffers",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.offset+ vasp.o+",vasp_doffset)
+
+
+
+/*! \class vasp_qoffset
+ \remark \b vasp.offset?
+ \brief Get offset of singled vector vasp.
+ \since 0.0.1
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet _time - offset into vector buffer
+
+ \note Outputs 0 if vasp is undefined or invalid
+ \note Only works for a vasp with one vector. No output otherwise.
+
+ \todo Implement unit processing
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+*/
+class vasp_qoffset:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_qoffset,vasp_op)
+
+public:
+
+ vasp_qoffset()
+ {
+ AddInAnything();
+// AddOutAnything();
+ AddOutFloat();
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok())
+ post("%s - Invalid vasp!",thisName());
+ else if(ref.Vectors() > 1)
+ post("%s - More than one vector in vasp!",thisName());
+ else {
+ I o = 0;
+ if(ref.Vectors() == 1) {
+ o = ref.Vector(0).Offset();
+ if(o < 0) o = 0;
+ else {
+ VBuffer *buf = ref.Buffer(0);
+ if(buf) {
+ I f = buf->Frames();
+ if(o > f) o = f;
+ delete buf;
+ }
+ }
+ }
+ //! \todo unit processing
+// ToOutVasp(0,ref);
+ ToOutFloat(0,o);
+ }
+ }
+
+ virtual V m_help() { post("%s - Get a single vectored vasp's offset into the buffer",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.offset? vasp.o?",vasp_qoffset)
+
diff --git a/externals/grill/vasp/source/obj_part.cpp b/externals/grill/vasp/source/obj_part.cpp
new file mode 100644
index 00000000..2b0aa256
--- /dev/null
+++ b/externals/grill/vasp/source/obj_part.cpp
@@ -0,0 +1,102 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_part
+ \remark \b vasp.part
+ \brief Gets parts of vasp vectors.
+ \since 0.0.1
+ \param cmdln.1 list - list of part lengts
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 list - list of part lengts
+ \retval outlet.1 vasp - consecutive vasp parts
+ \retval outlet.2 vasp - remainder
+
+ \todo Implement unit processing.
+ \remarks Output zero length vasps?
+*/
+class vasp_part:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_part,vasp_op)
+
+public:
+ vasp_part(I argc,t_atom *argv):
+ part(NULL),parts(0)
+ {
+ m_part(argc,argv);
+
+ AddInAnything(2);
+ AddOutAnything(2);
+ SetupInOut();
+
+ FLEXT_ADDMETHOD_(1,"list",m_part);
+ }
+
+ ~vasp_part() { if(part) delete[] part; }
+
+ V m_part(I argc,t_atom *argv)
+ {
+ if(part) delete[] part; parts = 0;
+ part = new I[argc];
+ for(I i = 0; i < argc; ++i) {
+ BL warn = false;
+ I p = (I)GetAFloat(argv[i]); // \todo unit processing
+ if(p < 0 && !warn) {
+ post("%s - invalid part length(s) -> set to 0",thisName());
+ p = 0; warn = true;
+ }
+ part[i] = p; ++parts;
+ }
+ }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok()) {
+ post("%s - Invalid vasp!",thisName());
+ return;
+ }
+
+ I fr = ref.Frames(),o = 0,f = 0;
+ for(I i = 0; i < parts && (fr < 0 || fr); ++i) {
+ I p = part[i];
+ if(fr >= 0) { p = min(p,fr); fr -= p; }
+
+ Vasp ret(ref);
+ ret.Frames(p);
+ ret.OffsetD(o);
+ ToOutVasp(0,ret);
+
+ o += p;
+ }
+
+ if(fr) {
+ Vasp ret(ref);
+ ret.Frames(fr);
+ ret.OffsetD(o);
+ ToOutVasp(1,ret);
+ }
+ }
+
+ virtual V m_help() { post("%s - Return consecutive vasps with lengths given by argument list",thisName()); }
+protected:
+ I parts,*part;
+
+ FLEXT_CALLBACK_V(m_part)
+};
+
+FLEXT_LIB_V("vasp, vasp.part",vasp_part)
+
+
diff --git a/externals/grill/vasp/source/obj_peaks.cpp b/externals/grill/vasp/source/obj_peaks.cpp
new file mode 100644
index 00000000..1c1a218d
--- /dev/null
+++ b/externals/grill/vasp/source/obj_peaks.cpp
@@ -0,0 +1,111 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+#include <math.h>
+
+
+/*! \class vasp_qpeaks
+ \remark \b vasp.peaks?
+ \brief Get most pronounced peaks of a single vasp vector.
+ \since 0.0.6
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet.0 list - peak positions
+ \retval outlet.1 list - peak values
+
+ \note Outputs nothing if vasp is undefined or invalid
+ \note Only works for a vasp with one vector. No output otherwise.
+ \todo Units for peak position list
+*/
+class vasp_qpeaks:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_qpeaks,vasp_op)
+
+public:
+ vasp_qpeaks(I argc,t_atom *argv):
+ peaks(1)
+ {
+ if(argc >= 1 && CanbeInt(argv[0]))
+ m_peaks(GetAInt(argv[0]));
+ else if(argc)
+ post("%s - Number argument invalid -> ignored",thisName());
+
+ AddInAnything();
+ AddInInt();
+ AddOutAnything(2);
+ SetupInOut();
+
+ FLEXT_ADDMETHOD(1,m_peaks);
+ }
+
+ V m_peaks(I n) { peaks = n; }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok())
+ post("%s - Invalid vasp!",thisName());
+ else if(ref.Vectors() > 1)
+ post("%s - More than one vector in vasp!",thisName());
+ else {
+ VBuffer *buf = ref.Buffer(0);
+ I i,cnt = buf->Length(),pkfnd = 0;
+ S *p = buf->Pointer();
+
+ I mxpk = min(cnt,peaks);
+ t_atom *pos = new t_atom[mxpk],*lst = new t_atom[mxpk];
+ for(i = 0; i < mxpk; ++i) SetFloat(lst[i],0);
+
+ for(i = 0; i < cnt; ++i) {
+ const F v = fabs(p[i]);
+
+ if(v && v > GetFloat(lst[mxpk-1])) {
+ I ix;
+
+ for(ix = min(pkfnd-1,mxpk-1); ix >= 0; --ix) {
+ if(v > GetFloat(lst[ix])) {
+ if(ix < mxpk-1) {
+ pos[ix+1] = pos[ix];
+ lst[ix+1] = lst[ix];
+ }
+ }
+ else break;
+ }
+ ++ix;
+
+ SetFloat(pos[ix],i);
+ SetFloat(lst[ix],v);
+
+ if(++pkfnd > mxpk) pkfnd = mxpk;
+ }
+ }
+
+ ToOutAnything(0,sym_list,pkfnd,pos);
+ ToOutAnything(1,sym_list,pkfnd,lst);
+ delete[] pos;
+ delete[] lst;
+ }
+ }
+
+ virtual V m_help() { post("%s - Get list of most pronounced peaks of a vasp vector",thisName()); }
+
+protected:
+ I peaks;
+
+private:
+ FLEXT_CALLBACK_I(m_peaks);
+};
+
+FLEXT_LIB_V("vasp, vasp.peaks?",vasp_qpeaks)
+
+
diff --git a/externals/grill/vasp/source/obj_q.cpp b/externals/grill/vasp/source/obj_q.cpp
new file mode 100644
index 00000000..f0465109
--- /dev/null
+++ b/externals/grill/vasp/source/obj_q.cpp
@@ -0,0 +1,121 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_list
+ \remark \b vasp.list
+ \brief Get samples of a single vasp vector.
+ \since 0.0.1
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet vector - vasp samples
+
+ \note Outputs 0 if vasp is undefined or invalid
+ \note Only works for a vasp with one vector. No output otherwise.
+*/
+class vasp_list:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_list,vasp_op)
+
+public:
+
+ vasp_list()
+ {
+ AddInAnything();
+ AddOutList();
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok())
+ post("%s - Invalid vasp!",thisName());
+ else if(ref.Vectors() > 1)
+ post("%s - More than one vector in vasp!",thisName());
+ else {
+ VBuffer *buf = ref.Buffer(0);
+ I cnt = buf->Length();
+ S *p = buf->Pointer();
+ AtomList lst(cnt);
+ for(I i = 0; i < cnt; ++i,++p) SetFloat(lst[i],*p);
+ ToOutList(0,lst);
+ }
+ }
+
+ virtual V m_help() { post("%s - Get list of samples of a vasp vector",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.list vasp.?",vasp_list)
+
+
+
+/*! \class vasp_nonzero
+ \remark \b vasp.nonzero
+ \brief Get samples of a single vasp vector.
+ \since 0.0.2
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet.0 list - non-zero samples positions
+ \retval outlet.1 list - non-zero sample values
+
+ \note Outputs 0 if vasp is undefined or invalid
+ \note Only works for a vasp with one vector. No output otherwise.
+ \todo units for position list
+*/
+class vasp_nonzero:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_nonzero,vasp_op)
+
+public:
+
+ vasp_nonzero()
+ {
+ AddInAnything();
+ AddOutList(2);
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok())
+ post("%s - Invalid vasp!",thisName());
+ else if(ref.Vectors() > 1)
+ post("%s - More than one vector in vasp!",thisName());
+ else {
+ VBuffer *buf = ref.Buffer(0);
+ I i,cnt = buf->Length(),cp,ci;
+ S *p = buf->Pointer();
+ for(cp = i = 0; i < cnt; ++i,++p) if(*p) ++cp;
+
+ AtomList pos(cp),lst(cp);
+ p = buf->Pointer();
+ for(ci = i = 0; ci < cp; ++i,++p)
+ if(*p) {
+ SetFloat(pos[ci],i);
+ SetFloat(lst[ci],*p);
+ ++ci;
+ }
+ ToOutList(0,pos);
+ ToOutList(1,lst);
+ }
+ }
+
+ virtual V m_help() { post("%s - Get list of non-zero samples of a vasp vector",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.nonzero vasp.??",vasp_nonzero)
+
diff --git a/externals/grill/vasp/source/obj_radio.cpp b/externals/grill/vasp/source/obj_radio.cpp
new file mode 100644
index 00000000..7b0608e3
--- /dev/null
+++ b/externals/grill/vasp/source/obj_radio.cpp
@@ -0,0 +1,57 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+/*! \file obj_radio.cpp
+ \brief objects for radio messages.
+*/
+
+
+#include "classes.h"
+
+
+/*! \class vasp_radio
+ \remark \b vasp.radio
+ \brief Lets only radio messages pass through.
+ \since 0.0.6
+ \param inlet.1 * - any message
+ \retval outlet.1 radio messages
+ \retval outlet.2 other messages
+*/
+class vasp_radio:
+ public flext_base
+{
+ FLEXT_HEADER(vasp_radio,flext_base)
+
+public:
+
+ vasp_radio()
+ {
+ AddInAnything();
+ AddOutAnything(2);
+ SetupInOut();
+
+ FLEXT_ADDMETHOD(0,m_any);
+ }
+
+ virtual V m_any(const t_symbol *s,I argc,t_atom *argv);
+
+ virtual V m_help() { post("%s - split into radio and non-radio messages",thisName()); }
+private:
+ FLEXT_CALLBACK_A(m_any);
+};
+
+FLEXT_LIB("vasp, vasp.radio",vasp_radio)
+
+
+V vasp_radio::m_any(const t_symbol *s,I argc,t_atom *argv)
+{
+ ToOutAnything(s == vasp_base::sym_radio?0:1,s,argc,argv);
+}
+
diff --git a/externals/grill/vasp/source/obj_size.cpp b/externals/grill/vasp/source/obj_size.cpp
new file mode 100644
index 00000000..9a535e60
--- /dev/null
+++ b/externals/grill/vasp/source/obj_size.cpp
@@ -0,0 +1,248 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_size
+ \remark \b vasp.size
+ \brief Resize buffer.
+ \since 0.0.6
+ \param cmdln.1 [_time=0] - size of buffer
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _time - offset into buffer(s)
+ \retval outlet vasp - modified vasp
+
+ \attention Normally vasp vectors have individual offsets - this operations sets all the buffer sizes to equal values.
+ \todo Implement unit processing.
+*/
+class vasp_size:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_size,vasp_tx)
+
+public:
+ vasp_size(I argc,t_atom *argv):
+ size(0),sets(false)
+ {
+ if(argc >= 1 && CanbeFloat(argv[0]))
+ m_arg(GetAFloat(argv[0]));
+ else if(argc)
+ post("%s - Offset argument invalid -> ignored",thisName());
+
+ AddInAnything();
+ AddInFloat();
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD(1,m_arg);
+ }
+
+ virtual V m_arg(F s)
+ {
+ size = (I)s; // \todo unit processing
+ sets = true;
+ }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(sets) ret->Size(size);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Set the size of the vector buffers",thisName()); }
+protected:
+ I size;
+ BL sets;
+
+private:
+ FLEXT_CALLBACK_F(m_arg);
+};
+
+FLEXT_LIB_V("vasp, vasp.size vasp.s",vasp_size)
+
+
+
+
+/*! \class vasp_dsize
+ \remark \b vasp.size+
+ \brief Sets vector buffer sizes differentially.
+ \since 0.0.6
+ \param cmdln.1 [_time=0] - increase offset of into buffer(s)
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _time - increase of offset into buffer(s)
+ \retval outlet vasp - modified vasp
+
+ \todo Implement unit processing
+*/
+class vasp_dsize:
+ public vasp_size
+{
+ FLEXT_HEADER(vasp_dsize,vasp_size)
+
+public:
+ vasp_dsize(I argc,t_atom *argv): vasp_size(argc,argv) {}
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(sets) ret->SizeD(size);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Increase the size of the vector buffers",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.size+ vasp.s+",vasp_dsize)
+
+
+
+/*! \class vasp_msize
+ \remark \b vasp.size*
+ \brief Sets vector buffer sizes by a factor
+ \since 0.0.6
+ \param cmdln.1 [_number=1] - factor for size
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _number - factor for size
+ \retval outlet vasp - modified vasp
+*/
+class vasp_msize:
+ public vasp_size
+{
+ FLEXT_HEADER(vasp_msize,vasp_size)
+
+public:
+ vasp_msize(I argc,t_atom *argv):
+ vasp_size(argc,argv)
+ {
+ if(argc && CanbeFloat(argv[0])) m_arg(GetAFloat(argv[0]));
+ }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(sets) ret->SizeM(factor);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Multiply the size of the vector buffers",thisName()); }
+
+ virtual V m_arg(F f)
+ {
+ factor = f;
+ sets = true;
+ }
+
+protected:
+ R factor;
+};
+
+FLEXT_LIB_V("vasp, vasp.size* vasp.s*",vasp_msize)
+
+
+
+/*! \class vasp_rsize
+ \remark \b vasp.size/
+ \brief Sets vector buffer sizes by a factor
+ \since 0.0.6
+ \param cmdln.1 [_number=1] - divisor for size
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.2 _number - divisor for size
+ \retval outlet vasp - modified vasp
+*/
+class vasp_rsize:
+ public vasp_msize
+{
+ FLEXT_HEADER(vasp_rsize,vasp_msize)
+
+public:
+ vasp_rsize(I argc,t_atom *argv): vasp_msize(argc,argv) {}
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ if(sets) ret->SizeR(factor);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Divide the size of the vector buffers",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.size/ vasp.s/",vasp_rsize)
+
+
+
+/*! \class vasp_qsize
+ \remark \b vasp.size?
+ \brief Get size of a vector buffer.
+ \since 0.0.6
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet _time - offset into vector buffer
+
+ \note Outputs 0 if vasp is undefined or invalid
+ \note Only works for a vasp with one vector. No output otherwise.
+
+ \todo Implement unit processing
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+*/
+class vasp_qsize:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_qsize,vasp_op)
+
+public:
+
+ vasp_qsize()
+ {
+ AddInAnything();
+// AddOutAnything();
+ AddOutFloat();
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok())
+ post("%s - Invalid vasp!",thisName());
+ else if(ref.Vectors() > 1)
+ post("%s - More than one vector in vasp!",thisName());
+ else {
+ I s = 0;
+ if(ref.Vectors() == 1) {
+ VBuffer *buf = ref.Buffer(0);
+ if(buf) {
+ s = buf->Frames();
+ delete buf;
+ }
+ }
+ //! \todo unit processing
+// ToOutVasp(0,ref);
+ ToOutFloat(0,s);
+ }
+ }
+
+ virtual V m_help() { post("%s - Get the buffer size of a vector",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.size? vasp.s?",vasp_qsize)
+
diff --git a/externals/grill/vasp/source/obj_split.cpp b/externals/grill/vasp/source/obj_split.cpp
new file mode 100644
index 00000000..42921d2a
--- /dev/null
+++ b/externals/grill/vasp/source/obj_split.cpp
@@ -0,0 +1,288 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_split
+ \remark \b vasp.split
+ \brief Splits a vasp into a number of vectors and the remainder.
+ \since 0.0.1
+ \param cmdln.1 int - number of vectors to split vasp into (excl. one for the remainder vectors)
+ \param inlet.1 vasp - is stored and triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \retval outlet.n vasp - vector of stored vasp
+ \retval outlet.+ vasp - remainder of stored vasp
+
+ \note if there is no remainder outputs a bang
+*/
+class vasp_split:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_split,vasp_op)
+
+public:
+ vasp_split(I argc,t_atom *argv)
+ {
+ I cnt = -1;
+ if(argc) {
+ if(CanbeInt(argv[0])) cnt = GetAInt(argv[0]);
+ if(cnt <= 1) {
+ post("%s - integer argument invalid: set to 2",thisName());
+ cnt = 2;
+ }
+ }
+ else cnt = 2;
+
+ AddInAnything();
+ AddOutAnything(cnt+1);
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok()) {
+ post("%s - Invalid vasp!",thisName());
+ return;
+ }
+
+ I outs = CntOut()-1,rem = ref.Vectors()-outs;
+ for(I i = min(outs,ref.Vectors())-1; i >= 0; --i) {
+ Vasp v(ref.Frames(),ref.Vector(i));
+ ToOutVasp(i,v);
+ }
+ if(rem > 0) {
+ Vasp v(ref.Frames(),ref.Vector(outs));
+ for(I i = 1; i < rem; ++i) v += ref.Vector(outs+i);
+ ToOutVasp(outs,v);
+ }
+ else
+ ToOutBang(outs);
+ }
+
+ virtual V m_help() { post("%s - Split a vasp into its vectors",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.split",vasp_split)
+
+
+/*! \class vasp_join
+ \remark \b vasp.join
+ \brief Joins several vasps into one.
+ \since 0.0.1
+ \param cmdln.1 int - number of vasp slots
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.1 reset - clears slots
+ \param inlet.+n vasp - is stored in this slot
+ \retval outlet vasp - joined vasp
+
+ The several vectors of the several vasps are all joined into one vasp.
+
+ \note On different vasp frame count the minmum frame count is taken.
+ \note The latest vector input to a slot is taken for the resulting vasp
+*/
+class vasp_join:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_join,vasp_tx)
+
+public:
+ vasp_join(I argc,t_atom *argv):
+ cnt(-1),vi(NULL)
+ {
+ if(argc) {
+ if(CanbeInt(argv[0])) cnt = GetAInt(argv[0]);
+ if(cnt <= 1) {
+ post("%s - integer argument invalid: set to 2",thisName());
+ cnt = 2;
+ }
+ }
+ else cnt = 2;
+
+ vi = new Vasp *[cnt-1];
+ for(I i = 0; i < cnt-1; ++i) vi[i] = NULL;
+
+ AddInAnything(cnt);
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD_(0,"reset",m_reset);
+ }
+
+ ~vasp_join() { if(vi) delete[] vi; }
+
+ virtual Vasp *x_work() {
+ Vasp *ret = new Vasp(ref);
+ for(I i = 0; i < cnt-1; ++i) if(vi[i]) *ret += *vi[i];
+ return ret;
+ }
+
+ V m_reset()
+ {
+ ref.Clear();
+ for(I i = 0; i < cnt-1; ++i) if(vi[i]) { delete vi[i]; vi[i] = NULL; }
+ }
+
+ virtual bool m_method_(I inlet,const t_symbol *s,I argc,t_atom *argv)
+ {
+ if(inlet > 0 && s == sym_vasp) {
+ if(vi[inlet-1]) delete vi[inlet-1];
+ vi[inlet-1] = new Vasp(argc,argv);
+ return true;
+ }
+ else
+ return vasp_tx::m_method_(inlet,s,argc,argv);
+ }
+
+ virtual V m_help() { post("%s - Join several vasps into one",thisName()); }
+private:
+ I cnt;
+ Vasp **vi;
+
+ FLEXT_CALLBACK(m_reset)
+};
+
+FLEXT_LIB_V("vasp, vasp.join",vasp_join)
+
+
+
+/*! \class vasp_spit
+ \remark \b vasp.spit
+ \brief Spit out vectors of a vasp consecutively.
+ \since 0.0.1
+ \param inlet.1 vasp - is stored and triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \retval outlet.n vasp - vectors of stored vasp
+ \retval outlet.+ bang - triggered after last spit
+*/
+class vasp_spit:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_spit,vasp_op)
+
+public:
+ vasp_spit(I argc,t_atom *argv)
+ {
+ I n = 1;
+ if(argc >= 1) n = GetAInt(argv[0]);
+ if(n < 1) {
+ post("%s - illegal outlet count (%i) -> set to 1",thisName(),n);
+ n = 1;
+ }
+
+ AddInAnything();
+ AddOutAnything(n);
+ AddOutBang();
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+ if(!ref.Ok()) {
+ post("%s - Invalid vasp!",thisName());
+ return;
+ }
+
+ I outs = CntOut()-1,rem = ref.Vectors();
+ for(I vi = 0; rem;) {
+ I r = min(rem,outs);
+ for(I i = 0; i < r; ++i) {
+ Vasp v(ref.Frames(),ref.Vector(vi+i));
+ ToOutVasp(r-1-i,v);
+ }
+ vi += r;
+ rem -= r;
+ }
+ ToOutBang(outs);
+ }
+
+ virtual V m_help() { post("%s - Spit out vectors of a vasp",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.spit",vasp_spit)
+
+
+/*! \class vasp_gather
+ \remark \b vasp.gather
+ \brief Gathers several consecutive vasps into one.
+ \since 0.0.1
+ \param cmdln.1 int - number of vasp slots
+ \param inlet.1 vasp - is stored and output triggered
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - sets result vasp
+ \param inlet.1 reset - clears result
+ \param inlet.2 vasp - add to result vasp
+ \retval outlet vasp - gathered vasp
+
+ The several incoming vectors are all gathered into one vasp.
+
+ \note On different vasp frame count the minimum frame count is taken.
+*/
+class vasp_gather:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_gather,vasp_tx)
+
+public:
+ vasp_gather(I argc,t_atom *argv)
+ {
+ cnt = 0;
+ if(argc >= 1) cnt = GetAInt(argv[0]);
+ if(cnt < 0) {
+ post("%s - illegal count (%i) -> set to 0 (triggered mode)",thisName(),cnt);
+ cnt = 0;
+ }
+ rem = cnt;
+
+ AddInAnything(2);
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD_(0,"reset",m_reset);
+ FLEXT_ADDMETHOD_(1,"vasp",m_add);
+ }
+
+ ~vasp_gather() { }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ *ret += dst;
+ m_reset();
+ return ret;
+ }
+
+ V m_reset() { ref.Clear(); dst.Clear(); rem = cnt; }
+
+ virtual I m_set(I argc,t_atom *argv) { rem = cnt; return vasp_tx::m_set(argc,argv); }
+
+ V m_add(I argc,t_atom *argv)
+ {
+ dst += Vasp(argc,argv);
+ if(cnt && !--rem) m_bang();
+ }
+
+ virtual V m_help() { post("%s - Gather several vasps into one",thisName()); }
+private:
+ I cnt,rem;
+
+ FLEXT_CALLBACK(m_reset)
+ FLEXT_CALLBACK_V(m_add)
+};
+
+FLEXT_LIB_V("vasp, vasp.gather",vasp_gather)
+
+
+
diff --git a/externals/grill/vasp/source/obj_sync.cpp b/externals/grill/vasp/source/obj_sync.cpp
new file mode 100644
index 00000000..35f81409
--- /dev/null
+++ b/externals/grill/vasp/source/obj_sync.cpp
@@ -0,0 +1,123 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_sync
+ \remark \b vasp.sync
+ \brief Waits for all inlets to be hit (by vasps/anything) to trigger output.
+ \since 0.0.1
+ \param cmdln.1 int - number of sync inlets
+ \param inlet.1 vasp - is stored
+ \param inlet.1 bang - triggers output
+ \param inlet.1 set - vasp to be stored
+ \param inlet.1 reset - clear all hit flags
+ \param inlet.+n vasp/anything - sets hit flag
+ \retval outlet.* vasp - stored vasps
+
+ \todo Message for selection if only vasp input triggers (or any one).
+ \todo Message for selection of manual or auto reset upon trigger
+*/
+class vasp_sync:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_sync,vasp_op)
+
+public:
+ vasp_sync(I argc,t_atom *argv):
+ autoreset(true),vasponly(false)
+ {
+ I cnt = -1;
+ if(argc) {
+ if(CanbeInt(argv[0])) cnt = GetAInt(argv[0]);
+ if(cnt <= 1) {
+ post("%s - integer argument invalid: set to 2",thisName());
+ cnt = 2;
+ }
+ }
+ else cnt = 2;
+
+ flags = new BL[cnt];
+ stored = new Vasp[cnt-1];
+
+ AddInAnything(cnt);
+ AddOutAnything(cnt);
+ SetupInOut();
+
+ FLEXT_ADDMETHOD_(0,"reset",m_reset);
+
+ }
+
+ virtual BL Init() { BL ret = vasp_op::Init(); m_reset(); return ret; }
+
+ ~vasp_sync()
+ {
+ if(flags) delete[] flags;
+ if(stored) delete[] stored;
+ }
+
+ V chkbang(I n,Vasp *a = NULL)
+ {
+ if(a && n > 0) {
+ stored[n-1] = *a;
+ delete a;
+ }
+
+ BL f = flags[n];
+ flags[n] = true;
+ if(!f) { // flags have changed
+
+ BL all = true;
+ for(I i = 0; i < CntIn(); ++i) all = all && flags[i];
+
+ if(all) {
+ if(ref.Ok()) {
+ for(I i = CntIn()-1; i > 0; --i) ToOutVasp(i,stored[i-1]);
+ ToOutVasp(0,ref);
+ }
+ else ToOutBang(0);
+
+ if(autoreset) m_reset();
+ }
+ }
+ }
+
+ virtual V m_bang() { chkbang(0); }
+
+ V m_reset()
+ {
+ for(I i = 0; i < CntIn(); ++i) flags[i] = false;
+ }
+
+ virtual bool m_method_(I inlet,const t_symbol *s,I argc,t_atom *argv)
+ {
+ if(inlet > 0 && (!vasponly || s == sym_vasp)) {
+ Vasp *a = new Vasp(argc,argv);
+ chkbang(inlet,a);
+ return true;
+ }
+ else
+ return vasp_op::m_method_(inlet,s,argc,argv);
+ }
+
+ virtual V m_help() { post("%s - Synchronize a number of vasps (default 2)",thisName()); }
+private:
+ BL autoreset,vasponly;
+ BL *flags;
+ Vasp *stored;
+
+ FLEXT_CALLBACK(m_reset)
+};
+
+FLEXT_LIB_V("vasp, vasp.sync",vasp_sync)
+
+
diff --git a/externals/grill/vasp/source/obj_vasp.cpp b/externals/grill/vasp/source/obj_vasp.cpp
new file mode 100644
index 00000000..3b52d253
--- /dev/null
+++ b/externals/grill/vasp/source/obj_vasp.cpp
@@ -0,0 +1,200 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+/*! \file obj_vasp.cpp
+ \brief basic vasp objects.
+*/
+
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_v
+ \remark \b vasp
+ \brief Stores vasp messages.
+ \since 0.0.1
+ \param cmdln.* vasp - to be stored
+ \param inlet.1 vasp - is stored and output
+ \param inlet.1 list - if possible list is converted to vasp format
+ \param inlet.1 bang - triggers stored Vasp output
+ \param inlet.1 set vasp - Vasp is stored (and not immediately output)
+ \param inlet.2 vasp - Vasp is stored (and not immediately output)
+ \retval outlet vasp
+*/
+class vasp_v:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_v,vasp_tx)
+
+public:
+
+ vasp_v(I argc,t_atom *argv)
+ {
+ m_set(argc,argv);
+
+ AddInAnything(2);
+ AddOutAnything();
+
+ FLEXT_ADDMETHOD_(0,"list",m_vasp);
+
+ FLEXT_ADDMETHOD_(1,"list",m_set);
+ FLEXT_ADDMETHOD_(1,"vasp",m_set);
+ FLEXT_ADDMETHOD_(1,"radio",a_radio);
+ }
+
+ V a_radio(I,t_atom *) {}
+
+ virtual Vasp *x_work() { return new Vasp(ref); }
+
+ virtual V m_help() { post("%s - Store and output a vasp",thisName()); }
+private:
+ FLEXT_CALLBACK_V(a_radio);
+};
+
+FLEXT_LIB_V("vasp, vasp",vasp_v)
+
+
+
+/*! \class vasp_update
+ \remark \b vasp.update
+ \brief Refreshes buffer graphics for a vasp.
+ \since 0.0.1
+ \param inlet vasp - is stored and output
+ \param inlet bang - triggers stored vasp output
+ \param inlet set - vasp to be stored (and not immediately output)
+ \retval outlet vasp
+
+ \note In MaxMSP only necessary when buffer is in another window.
+*/
+class vasp_update:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_update,vasp_tx)
+
+public:
+ vasp_update()
+ {
+ AddInAnything();
+ AddOutAnything();
+ }
+
+ virtual Vasp *x_work()
+ {
+ ref.Refresh();
+ return new Vasp(ref);
+ }
+
+ virtual V m_help() { post("%s - Update graphics of a vasp",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.update vasp.u",vasp_update)
+
+
+
+/*! \class vasp_check
+ \remark \b vasp.check
+ \brief Check vasp dimensions.
+ \since 0.0.1
+ \param inlet vasp - is stored and output
+ \param inlet bang - triggers stored vasp output
+ \param inlet set - vasp to be stored (and not immediately output)
+ \retval outlet vasp
+
+ \remark checks and corrects frame count
+ \remark checks channel index... no correction, no output on error!
+*/
+class vasp_check:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_check,vasp_tx)
+
+public:
+ vasp_check()
+ {
+ AddInAnything();
+ AddOutAnything();
+ }
+
+ virtual Vasp *x_work()
+ {
+ Vasp *ret = new Vasp(ref);
+ I fr = ret->ChkFrames(); // maximum common frame length
+ ret->Frames(fr);
+
+ BL chok = true;
+
+ for(I i = 0; i < ret->Vectors(); ++i) {
+ VBuffer *buf = ret->Buffer(i);
+ chok = chok && buf->Ok() && buf->Channel() == ret->Vector(i).Channel();
+ delete buf;
+ }
+
+ if(chok)
+ return ret;
+ else {
+ delete ret;
+ return NULL;
+ }
+ }
+
+ virtual V m_help() { post("%s - Check vasp dimensions",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.check vasp.chk",vasp_check)
+
+
+
+/*! \class vasp_multi
+ \remark \b vasp.m
+ \brief Outputs multiple (identical) vasps.
+ \since 0.0.1
+ \param cmdln.1 int - number of vasp outlets
+ \param inlet vasp - is stored and output
+ \param inlet bang - triggers stored Vasp output
+ \param inlet set - vasp to be stored (and not immediately output)
+ \retval outlet.* vasp
+
+ \note Outputs in right to left order.
+*/
+class vasp_multi:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_multi,vasp_op)
+
+public:
+
+ vasp_multi(I argc,t_atom *argv)
+ {
+ I cnt = -1;
+ if(argc) {
+ if(CanbeInt(argv[0])) cnt = GetAInt(argv[0]);
+ if(cnt <= 1) {
+ post("%s - integer argument invalid: set to 2",thisName());
+ cnt = 2;
+ }
+ }
+ else cnt = 2;
+
+ AddInAnything();
+ AddOutAnything(cnt);
+ }
+
+ virtual V m_bang()
+ {
+ Vasp r(ref);
+ for(I i = CntOut()-1; i >= 0; --i) ToOutVasp(i,r);
+ }
+
+ virtual V m_help() { post("%s - Output a vasp multiple times",thisName()); }
+};
+
+FLEXT_LIB_V("vasp, vasp.multi vasp.m",vasp_multi)
+
diff --git a/externals/grill/vasp/source/obj_vecs.cpp b/externals/grill/vasp/source/obj_vecs.cpp
new file mode 100644
index 00000000..fd24d273
--- /dev/null
+++ b/externals/grill/vasp/source/obj_vecs.cpp
@@ -0,0 +1,106 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+
+
+/*! \class vasp_vector
+ \remark \b vasp.vector
+ \brief Gets indexed vector of a vasp.
+ \since 0.0.1
+ \param cmdln.1 int - index of vasp vector
+ \param inlet vasp - is stored and indexed vasp vector output
+ \param inlet bang - triggers indexed vasp vector output
+ \param inlet set - vasp to be stored (and not immediately output)
+ \retval outlet.1 vasp - single indexed vector of vasp
+ \retval outlet.2 vasp - remainder of vasp
+
+ \note Outputs only on valid index
+ \todo Output remainder as vasp.
+*/
+class vasp_vector:
+ public vasp_tx
+{
+ FLEXT_HEADER(vasp_vector,vasp_tx)
+
+public:
+ vasp_vector(I argc,t_atom *argv):
+ ix(0)
+ {
+ if(argc >= 1 && CanbeInt(argv[0]))
+ ix = GetAInt(argv[0]);
+ else if(argc)
+ post("%s - Index argument invalid -> set to 0",thisName());
+
+ AddInAnything(2);
+ AddOutAnything();
+ SetupInOut();
+
+ FLEXT_ADDMETHOD(1,m_ix);
+ }
+
+ V m_ix(I i) { ix = i; }
+
+ virtual Vasp *x_work() { return ix < ref.Vectors()?new Vasp(ref.Frames(),ref.Vector(ix)):NULL; }
+
+ virtual V m_help() { post("%s - Get one vector of a vasp",thisName()); }
+
+protected:
+ I ix;
+
+private:
+ FLEXT_CALLBACK_I(m_ix);
+};
+
+FLEXT_LIB_V("vasp, vasp.vector vasp.n",vasp_vector)
+
+
+
+/*! \class vasp_qn
+ \remark \b vasp.n?
+ \brief Gets number of vector of a vasp.
+ \since 0.0.1
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet int - number of vectors in stored vasp
+
+ \note Outputs 0 if vasp is undefined or invalid.
+
+ \todo Should we disable output with invalid vasp?
+*/
+class vasp_qvectors:
+ public vasp_op
+{
+ FLEXT_HEADER(vasp_qvectors,vasp_op)
+
+public:
+ vasp_qvectors()
+ {
+ AddInAnything();
+// AddOutAnything();
+ AddOutInt();
+ SetupInOut();
+ }
+
+ virtual V m_bang()
+ {
+// ToOutVasp(0,ref);
+ ToOutInt(0,ref.Ok()?ref.Vectors():0);
+ }
+
+ virtual V m_help() { post("%s - Get number of vectors of a vasp",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.vectors? vasp.n?",vasp_qvectors)
+
+
+
diff --git a/externals/grill/vasp/source/opbase.cpp b/externals/grill/vasp/source/opbase.cpp
new file mode 100644
index 00000000..2ea9a13c
--- /dev/null
+++ b/externals/grill/vasp/source/opbase.cpp
@@ -0,0 +1,94 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "opbase.h"
+#include "opdefs.h"
+
+Vasp *VaspOp::m_run(OpParam &p,Vasp &src,Vasp *dst,VecOp::opfun *fun)
+{
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ ret = DoOp(vecs,fun,p);
+ delete vecs;
+ }
+
+ return ret;
+}
+
+Vasp *VaspOp::m_cun(OpParam &p,Vasp &src,Vasp *dst,VecOp::opfun *fun)
+{
+ Vasp *ret = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ ret = DoOp(vecs,fun,p);
+ delete vecs;
+ }
+
+ return ret;
+}
+
+Vasp *VaspOp::m_rbin(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,VecOp::opfun *fun)
+{
+ Vasp *ret = NULL;
+ BL argvasp = arg.IsVasp();
+
+ RVecBlock *vecs = argvasp?GetRVecs(p.opname,src,arg.GetVasp(),dst):GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ if(arg.CanbeDouble()) p.rbin.arg = arg.GetADouble();
+ else if(arg.IsEnv()) {
+ if(p.args != 1)
+ ERRINTERNAL();
+ else
+ p.arg[0].SetE(&arg.GetEnv());
+ }
+
+ ret = DoOp(vecs,fun,p);
+ delete vecs;
+ }
+
+ return ret;
+}
+
+Vasp *VaspOp::m_cbin(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,VecOp::opfun *fun)
+{
+ Vasp *ret = NULL;
+ BL argvasp = arg.IsVasp();
+
+ CVecBlock *vecs = argvasp?GetCVecs(p.opname,src,arg.GetVasp(),dst):GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ if(arg.CanbeComplex()) {
+ CX z = arg.GetAComplex();
+ p.cbin.rarg = z.real;
+ p.cbin.iarg = z.imag;
+ }
+ else if(arg.IsEnv()) {
+ if(p.args != 1)
+ ERRINTERNAL();
+ else
+ p.arg[0].SetE(&arg.GetEnv());
+ }
+
+ ret = DoOp(vecs,fun,p);
+ delete vecs;
+ }
+
+ return ret;
+}
+
+
+BL VecOp::_d__run(V fun(S &v,S a),OpParam &p) { _D__run(fun,p); }
+BL VecOp::_d__cun(V fun(S &rv,S &iv,S ra,S ia),OpParam &p) { _D__cun(fun,p); }
+BL VecOp::_d__rbin(V fun(S &v,S a,S b),OpParam &p) { _D__rbin(fun,p); }
+BL VecOp::_d__cbin(V fun(S &rv,S &iv,S ra,S ia,S rb,S ib),OpParam &p) { _D__cbin(fun,p); }
+BL VecOp::_d__rop(V fun(S &v,S a,OpParam &p),OpParam &p) { _D__rop(fun,p); }
+BL VecOp::_d__cop(V fun(S &rv,S &iv,S ra,S ia,OpParam &p),OpParam &p) { _D__cop(fun,p); }
+
+
diff --git a/externals/grill/vasp/source/opbase.h b/externals/grill/vasp/source/opbase.h
new file mode 100644
index 00000000..a4d1347b
--- /dev/null
+++ b/externals/grill/vasp/source/opbase.h
@@ -0,0 +1,50 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPBASE_H
+#define __VASP_OPBASE_H
+
+#include "main.h"
+#include "classes.h"
+#include "vecblk.h"
+#include "opparam.h"
+
+namespace VecOp {
+ typedef BL opfun(OpParam &p);
+
+ BL _d__run(V fun(S &v,S a),OpParam &p);
+ BL _d__cun(V fun(S &rv,S &iv,S ra,S ia),OpParam &p);
+ BL _d__rbin(V fun(S &v,S a,S b),OpParam &p);
+ BL _d__cbin(V fun(S &rv,S &iv,S ra,S ia,S rb,S ib),OpParam &p);
+ BL _d__rop(V fun(S &v,S a,OpParam &p),OpParam &p);
+ BL _d__cop(V fun(S &rv,S &iv,S ra,S ia,OpParam &p),OpParam &p);
+}
+
+
+namespace VaspOp {
+ RVecBlock *GetRVecs(const C *op,Vasp &src,Vasp *dst = NULL);
+ CVecBlock *GetCVecs(const C *op,Vasp &src,Vasp *dst = NULL,BL full = false);
+ RVecBlock *GetRVecs(const C *op,Vasp &src,const Vasp &arg,Vasp *dst = NULL,I multi = -1,BL ssize = true);
+ CVecBlock *GetCVecs(const C *op,Vasp &src,const Vasp &arg,Vasp *dst = NULL,I multi = -1,BL ssize = true,BL full = false);
+
+ Vasp *DoOp(RVecBlock *vecs,VecOp::opfun *fun,OpParam &p,BL symm = false);
+ Vasp *DoOp(CVecBlock *vecs,VecOp::opfun *fun,OpParam &p,BL symm = false);
+
+ // -------- transformations -----------------------------------
+
+ // unary functions
+ Vasp *m_run(OpParam &p,Vasp &src,Vasp *dst,VecOp::opfun *fun); // real unary (one vec or real)
+ Vasp *m_cun(OpParam &p,Vasp &src,Vasp *dst,VecOp::opfun *fun); // complex unary (one vec or complex)
+ // binary functions
+ Vasp *m_rbin(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,VecOp::opfun *fun); // real binary (one vec or real)
+ Vasp *m_cbin(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,VecOp::opfun *fun); // complex binary (one vec or complex)
+}
+
+#endif
diff --git a/externals/grill/vasp/source/opdefs.h b/externals/grill/vasp/source/opdefs.h
new file mode 100644
index 00000000..bf9101f7
--- /dev/null
+++ b/externals/grill/vasp/source/opdefs.h
@@ -0,0 +1,364 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPDEFS_H
+#define __VASP_OPDEFS_H
+
+#include "oploop.h"
+
+#ifdef VASP_CHN1
+#define _D_ALWAYS1 1
+#else
+#define _D_ALWAYS1 0
+#endif
+
+/*! \brief skeleton for unary real operations
+*/
+#define _D__run(fun,p) \
+{ \
+ register const S *sr = p.rsdt; \
+ register S *dr = p.rddt; \
+ register I i; \
+ if(sr == dr) \
+ if(_D_ALWAYS1 || p.rds == 1) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr); dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr); dr += p.rds; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.rds == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr); sr++,dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr); sr += p.rss,dr += p.rds; } \
+ _E_LOOP \
+ return true; \
+}
+
+#define d__run(fun,p) { return _d__run(fun,p); }
+
+/*! \brief skeleton for unary complex operations
+*/
+#define _D__cun(fun,p) \
+{ \
+ register const S *sr = p.rsdt,*si = p.isdt; \
+ register S *dr = p.rddt,*di = p.iddt; \
+ register I i; \
+ if(sr == dr && si == di) \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.ids == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di); dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di); dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.iss == 1 && p.rds == 1 && p.ids == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si); sr++,si++,dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si); sr += p.rss,si += p.iss,dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ return true; \
+}
+
+#define d__cun(fun,p) { return _d__cun(fun,p); }
+
+
+/*! \brief skeleton for binary real operations
+*/
+#define _D__rbin(fun,p) \
+{ \
+ register const S *sr = p.rsdt; \
+ register S *dr = p.rddt; \
+ register I i; \
+ if(p.HasArg() && p.arg[0].Is()) { \
+ switch(p.arg[0].argtp) { \
+ case OpParam::Arg::arg_v: { \
+ register const S *ar = p.arg[0].v.rdt; \
+ if(p.rsdt == p.rddt) \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.arg[0].v.rs == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,*ar); dr++,ar++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,*ar); dr += p.rds,ar += p.arg[0].v.rs; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.rds == 1 && p.arg[0].v.rs == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,*ar); sr++,dr++,ar++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,*ar); sr += p.rss,dr += p.rds,ar += p.arg[0].v.rs; } \
+ _E_LOOP \
+ break; \
+ } \
+ case OpParam::Arg::arg_env: { \
+ Env::Iter it(*p.arg[0].e.env); it.Init(0); \
+ if(p.rsdt == p.rddt) \
+ if(_D_ALWAYS1 || p.rds == 1) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,it.ValFwd(i)); dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,it.ValFwd(i)); dr += p.rds; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.rds == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,it.ValFwd(i)); sr++,dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,it.ValFwd(i)); sr += p.rss,dr += p.rds; } \
+ _E_LOOP \
+ break; \
+ } \
+ case OpParam::Arg::arg_x: { \
+ const R v = p.arg[0].x.r; \
+ if(p.rsdt == p.rddt) \
+ if(_D_ALWAYS1 || p.rds == 1) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,v); dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,v); dr += p.rds; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.rds == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,v); sr++,dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,v); sr += p.rss,dr += p.rds; } \
+ _E_LOOP \
+ break; \
+ } \
+ } \
+ } \
+ else { \
+ register const S v = p.rbin.arg; \
+ if(p.rsdt == p.rddt) \
+ if(_D_ALWAYS1 || p.rds == 1) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,v); dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,v); dr += p.rds; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.rds == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,v); sr++,dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,v); sr += p.rss,dr += p.rds; } \
+ _E_LOOP \
+ } \
+ return true; \
+}
+
+#define d__rbin(fun,p) { return _d__rbin(fun,p); }
+
+
+/*! \brief skeleton for binary complex operations
+*/
+#define _D__cbin(fun,p) \
+{ \
+ register const S *sr = p.rsdt,*si = p.isdt; \
+ register S *dr = p.rddt,*di = p.iddt; \
+ register I i; \
+ if(p.HasArg() && p.arg[0].Is()) { \
+ switch(p.arg[0].argtp) { \
+ case OpParam::Arg::arg_v: { \
+ register const S *ar = p.arg[0].v.rdt,*ai = p.arg[0].v.idt; \
+ if(ai) \
+ if(sr == dr && si == di) \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.ids == 1 && p.arg[0].v.rs == 1 && p.arg[0].v.is == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,*ar,*ai); dr++,di++,ar++,ai++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,*ar,*ai); dr += p.rds,di += p.ids,ar += p.arg[0].v.rs,ai += p.arg[0].v.is; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,*ar,*ai); sr += p.rss,si += p.iss,dr += p.rds,di += p.ids,ar += p.arg[0].v.rs,ai += p.arg[0].v.is; } \
+ _E_LOOP \
+ else \
+ if(sr == dr && si == di) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,*ar,0); dr += p.rds,di += p.ids,ar += p.arg[0].v.rs; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,*ar,0); sr += p.rss,si += p.iss,dr += p.rds,di += p.ids,ar += p.arg[0].v.rs; } \
+ _E_LOOP \
+ break; \
+ } \
+ case OpParam::Arg::arg_env: { \
+ Env::Iter it(*p.arg[0].e.env); it.Init(0); \
+ if(sr == dr && si == di) \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.ids == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,it.ValFwd(i),0); dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,it.ValFwd(i),0); dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,it.ValFwd(i),0); sr += p.rss,si += p.iss,dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ break; \
+ } \
+ case OpParam::Arg::arg_x: { \
+ register const R ar = p.arg[0].x.r,ai = p.arg[0].x.i; \
+ if(sr == dr && si == di) \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.ids == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,ar,ai); dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,ar,ai); dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,ar,ai); sr += p.rss,si += p.iss,dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ break; \
+ } \
+ } \
+ } \
+ else { \
+ register const S rv = p.cbin.rarg,iv = p.cbin.iarg; \
+ if(sr == dr && si == di) \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.ids == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,rv,iv); dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,rv,iv); dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.ids == 1 && p.rss == 1 && p.iss == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,rv,iv); sr++,si++,dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,rv,iv); sr += p.rss,si += p.iss,dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ } \
+ return true; \
+}
+
+#define d__cbin(fun,p) { return _d__cbin(fun,p); }
+
+
+/*! \brief skeleton for real operations with parameter block
+*/
+#define _D__rop(fun,p) \
+{ \
+ register const S *sr = p.rsdt; \
+ register S *dr = p.rddt; \
+ register I i; \
+ if(sr == dr) \
+ if(_D_ALWAYS1 || p.rds == 1) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,p); dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*dr,p); dr += p.rds; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.rds == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,p); sr++,dr++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*sr,p); sr += p.rss,dr += p.rds; } \
+ _E_LOOP \
+ return true; \
+}
+
+#define d__rop(fun,p) { return _d__rop(fun,p); }
+
+
+/*! \brief skeleton for complex operations with parameter block
+*/
+#define _D__cop(fun,p) \
+{ \
+ register const S *sr = p.rsdt,*si = p.isdt; \
+ register S *dr = p.rddt,*di = p.iddt; \
+ register I i; \
+ if(sr == dr && si == di) \
+ if(_D_ALWAYS1 || (p.rds == 1 && p.ids == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,p); dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*dr,*di,p); dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ else \
+ if(_D_ALWAYS1 || (p.rss == 1 && p.iss == 1 && p.rds == 1 && p.ids == 1)) \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,p); sr++,si++,dr++,di++; } \
+ _E_LOOP \
+ else \
+ _D_LOOP(i,p.frames) \
+ { fun(*dr,*di,*sr,*si,p); sr += p.rss,si += p.iss,dr += p.rds,di += p.ids; } \
+ _E_LOOP \
+ return true; \
+}
+
+#define d__cop(fun,p) { return _d__cop(fun,p); }
+
+
+#ifdef VASP_COMPACT
+#define D__run(fun,p) d__run(fun,p)
+#define D__cun(fun,p) d__cun(fun,p)
+#define D__rbin(fun,p) d__rbin(fun,p)
+#define D__cbin(fun,p) d__cbin(fun,p)
+#define D__rop(fun,p) d__rop(fun,p)
+#define D__cop(fun,p) d__cop(fun,p)
+#else
+#define D__run(fun,p) _D__run(fun,p)
+#define D__cun(fun,p) _D__cun(fun,p)
+#define D__rbin(fun,p) _D__rbin(fun,p)
+#define D__cbin(fun,p) _D__cbin(fun,p)
+#define D__rop(fun,p) _D__rop(fun,p)
+#define D__cop(fun,p) _D__cop(fun,p)
+#endif
+
+#endif
diff --git a/externals/grill/vasp/source/oploop.h b/externals/grill/vasp/source/oploop.h
new file mode 100755
index 00000000..6b268022
--- /dev/null
+++ b/externals/grill/vasp/source/oploop.h
@@ -0,0 +1,38 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPLOOP_H
+#define __VASP_OPLOOP_H
+
+#define _D_BLOCK 1024
+
+#define _D_MIN(a,b) ((a) < (b)?(a):(b))
+
+#ifdef FLEXT_THREADS
+#define _D_LOOP(VAR,LEN) { \
+ register I __i__; \
+ for(__i__ = 0; __i__ < LEN; flext_base::ThrYield()) { \
+ I __m__ = _D_MIN(LEN,__i__+_D_BLOCK); for(; (VAR = __i__) < __m__; ++__i__) {
+#define _E_LOOP } if(__i__ < __m__) break; }}
+#define _D_WHILE(COND) { \
+ for(; (COND) ; flext_base::ThrYield()) { \
+ register I __i__ = 0; \
+ for(; __i__ < _D_BLOCK && (COND); ++__i__) {
+#define _E_WHILE } if(__i__ < _D_BLOCK) break; }}
+#else
+#define _D_LOOP(VAR,LEN) { \
+ for(VAR = 0; VAR < LEN; ++VAR) {
+#define _E_LOOP }}
+#define _D_WHILE(COND) { \
+ while(COND) {
+#define _E_WHILE }}
+#endif
+
+#endif
diff --git a/externals/grill/vasp/source/opparam.cpp b/externals/grill/vasp/source/opparam.cpp
new file mode 100644
index 00000000..9925e4dd
--- /dev/null
+++ b/externals/grill/vasp/source/opparam.cpp
@@ -0,0 +1,223 @@
+#include "opparam.h"
+//#include <math.h>
+
+/*
+// Duplication of breakpoint lists should be avoided
+OpParam::Arg &OpParam::Arg::operator =(const Arg &op)
+{
+ Clear();
+
+ switch(argtp = op.argtp) {
+ case arg_x: x = op.x; break;
+ case arg_v: v = op.v; break;
+ case arg_bp: {
+ // Copy breakpoint list (find a different way, e.g. store them in a pool)
+ bp.pts = op.bp.pts;
+ bp.pt = new R[bp.pts];
+ for(I i = 0; i < bp.pts; ++i)
+ bp.pt[i] = op.bp.pt[i];
+ break;
+ }
+ }
+
+ return *this;
+}
+*/
+V OpParam::Arg::Clear()
+{
+// if(argtp == arg_bp && bp.pt) delete[] bp.pt;
+ argtp = arg_;
+}
+
+OpParam::Arg &OpParam::Arg::SetX(S r,S i)
+{
+ Clear();
+ argtp = arg_x;
+ x.r = r,x.i = i;
+ return *this;
+}
+
+OpParam::Arg &OpParam::Arg::SetV(S *r,I rs,S *i,I is)
+{
+ Clear();
+ argtp = arg_v;
+ v.rdt = r,v.rs = rs;
+ v.idt = i,v.is = is;
+ return *this;
+}
+
+/*
+OpParam::Arg &OpParam::Arg::SetB(I pts,const R *pt)
+{
+ Clear();
+ argtp = arg_bp;
+ bp.pts = pts;
+ bp.pt = new R[pts];
+ for(I ix = 0; ix < pts; ix) bp.pt[ix] = pt[ix];
+ return *this;
+}
+*/
+
+OpParam::Arg &OpParam::Arg::SetE(const Env *env)
+{
+ Clear();
+ argtp = arg_env;
+ e.env = env;
+ return *this;
+}
+
+
+/*
+V OpParam::SDR_Rev() { SR_Rev(); DR_Rev(); }
+V OpParam::SDI_Rev() { SI_Rev(); DI_Rev(); }
+V OpParam::SDC_Rev() { SDR_Rev(); SDI_Rev(); }
+V OpParam::ADR_Rev() { AR_Rev(); DR_Rev(); }
+V OpParam::ADI_Rev() { AI_Rev(); DI_Rev(); }
+V OpParam::ADC_Rev() { ADR_Rev(); ADI_Rev(); }
+V OpParam::SADR_Rev() { SR_Rev(); AR_Rev(); DR_Rev(); }
+V OpParam::SADI_Rev() { SI_Rev(); AI_Rev(); DI_Rev(); }
+V OpParam::SADC_Rev() { SADR_Rev(); SADI_Rev(); }
+*/
+
+OpParam::OpParam(const C *opnm,I nargs):
+ opname(opnm),frames(0),args(0),arg(NULL),
+ /*part(false),*/ ovrlap(false),revdir(false),oddrem(false)
+{
+ InitArgs(nargs);
+}
+
+OpParam::~OpParam() { Clear(); }
+
+V OpParam::InitArgs(I n)
+{
+ if(arg) Clear();
+ args = n;
+ if(args) arg = new Arg[args];
+}
+
+V OpParam::Clear()
+{
+ if(arg) { delete[] arg; arg = NULL; }
+ args = 0;
+}
+
+
+/*! \brief Reverse direction of real vector operation
+ \todo Check for existence of vectors!
+*/
+V OpParam::R_Rev()
+{
+
+ SR_Rev();
+ DR_Rev();
+ AR_Rev();
+ revdir = true;
+}
+
+/*! \brief Reverse direction of complex vector operation
+ \todo Check for existence of vectors!
+*/
+V OpParam::C_Rev()
+{
+ SR_Rev(); SI_Rev();
+ DR_Rev(); DI_Rev();
+ AR_Rev(); AI_Rev();
+ revdir = true;
+}
+
+
+V OpParam::AR_Rev(I bl)
+{
+ if(arg[bl].argtp == Arg::arg_v && arg[bl].v.rdt)
+ arg[bl].v.rdt -= (frames-1)*(arg[bl].v.rs = -arg[bl].v.rs);
+}
+
+V OpParam::AI_Rev(I bl)
+{
+ if(arg[bl].argtp == Arg::arg_v && arg[bl].v.idt)
+ arg[bl].v.idt -= (frames-1)*(arg[bl].v.is = -arg[bl].v.is);
+}
+
+BL OpParam::AR_In(I bl) const { return arg[bl].argtp == Arg::arg_v && arg[bl].v.rdt && rddt > arg[bl].v.rdt && rddt < arg[bl].v.rdt+frames*arg[bl].v.rs; }
+BL OpParam::AI_In(I bl) const { return arg[bl].argtp == Arg::arg_v && arg[bl].v.idt && iddt > arg[bl].v.idt && iddt < arg[bl].v.idt+frames*arg[bl].v.is; }
+
+BL OpParam::AR_Can(I bl) const { return arg[bl].argtp != Arg::arg_v || !arg[bl].v.rdt || arg[bl].v.rdt <= rddt || arg[bl].v.rdt >= rddt+frames*rds; }
+BL OpParam::AI_Can(I bl) const { return arg[bl].argtp != Arg::arg_v || !arg[bl].v.idt || arg[bl].v.idt <= iddt || arg[bl].v.idt >= iddt+frames*ids; }
+
+BL OpParam::AR_Ovr(I bl) const { return arg[bl].argtp == Arg::arg_v && arg[bl].v.rdt && rddt != arg[bl].v.rdt && rddt < arg[bl].v.rdt+frames*arg[bl].v.rs && arg[bl].v.rdt < rddt+frames*rds; }
+BL OpParam::AI_Ovr(I bl) const { return arg[bl].argtp == Arg::arg_v && arg[bl].v.idt && iddt != arg[bl].v.idt && iddt < arg[bl].v.idt+frames*arg[bl].v.is && arg[bl].v.idt < iddt+frames*ids; }
+
+
+
+BL OpParam::AR_In() const
+{
+ for(I i = 0; i < args; ++i)
+ if(AR_In(i)) return true;
+ return false;
+}
+
+BL OpParam::AI_In() const
+{
+ for(I i = 0; i < args; ++i)
+ if(!AI_In(i)) return true;
+ return false;
+}
+
+BL OpParam::AR_Can() const
+{
+ for(I i = 0; i < args; ++i)
+ if(!AR_Can(i)) return false;
+ return true;
+}
+
+BL OpParam::AI_Can() const
+{
+ for(I i = 0; i < args; ++i)
+ if(!AI_Can(i)) return false;
+ return true;
+}
+
+BL OpParam::AR_Ovr() const
+{
+ for(I i = 0; i < args; ++i)
+ if(!AR_Ovr(i)) return false;
+ return true;
+}
+
+BL OpParam::AI_Ovr() const
+{
+ for(I i = 0; i < args; ++i)
+ if(!AI_Ovr(i)) return false;
+ return true;
+}
+
+
+V OpParam::AR_Rev()
+{
+ for(I i = 0; i < args; ++i) AR_Rev(i);
+}
+
+V OpParam::AI_Rev()
+{
+ for(I i = 0; i < args; ++i) AI_Rev(i);
+}
+
+V OpParam::SkipOddMiddle()
+{
+ if(symm == 0 && oddrem) {
+ // don't process middle sample!
+ if(revdir) rsdt += rss,rddt += rds;
+ frames--;
+ }
+}
+
+V OpParam::SkipOddMiddle(S m)
+{
+ if(symm == 0 && oddrem) {
+ // set and skip middle sample!
+ frames--;
+ if(revdir) *rddt = m,rsdt += rss,rddt += rds;
+ else rddt[frames] = m;
+ }
+}
+
diff --git a/externals/grill/vasp/source/opparam.h b/externals/grill/vasp/source/opparam.h
new file mode 100644
index 00000000..0b6e5bd5
--- /dev/null
+++ b/externals/grill/vasp/source/opparam.h
@@ -0,0 +1,128 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPPARAM_H
+#define __VASP_OPPARAM_H
+
+#include "vecblk.h"
+#include "arg.h"
+
+class OpParam {
+public:
+ OpParam(const C *opnm,I args);
+ ~OpParam();
+
+ V InitArgs(I nargs);
+ V Clear();
+
+ BL HasArg() const { return arg != NULL; }
+
+ const C *opName() const { return opname; }
+
+ // check for overlap
+ // \remark if on same vector, stride is the same for src, arg, dst!
+ inline BL SR_In() const { return rddt > rsdt && rddt < rsdt+frames*rss; }
+ inline BL SI_In() const { return iddt > isdt && iddt < isdt+frames*iss; }
+ BL AR_In(I bl) const;
+ BL AI_In(I bl) const;
+ BL AR_In() const;
+ BL AI_In() const;
+
+ // Can we reverse direction?
+ inline BL SR_Can() const { return rsdt <= rddt || rsdt >= rddt+frames*rds; }
+ inline BL SI_Can() const { return isdt <= iddt || isdt >= iddt+frames*ids; }
+ BL AR_Can(I bl) const;
+ BL AI_Can(I bl) const;
+ BL AR_Can() const;
+ BL AI_Can() const;
+
+ // does it overlap? (works only with rss,rds,ras.... > 0)
+ inline BL SR_Ovr() const { return rddt != rsdt && rddt < rsdt+frames*rss && rsdt < rddt+frames*rds; }
+ inline BL SI_Ovr() const { return iddt != isdt && iddt < isdt+frames*iss && isdt < iddt+frames*ids; }
+ BL AR_Ovr(I bl) const;
+ BL AI_Ovr(I bl) const;
+ BL AR_Ovr() const;
+ BL AI_Ovr() const;
+
+ V AR_Rev();
+ V AI_Rev();
+
+ V R_Rev();
+ V C_Rev();
+
+ V SkipOddMiddle();
+ V SkipOddMiddle(S m);
+
+ const C *opname;
+ I frames,symm,args;
+ BL ovrlap,revdir,oddrem;
+ S *rsdt,*isdt; I rss,iss;
+ S *rddt,*iddt; I rds,ids;
+
+ class Arg
+ {
+ public:
+ Arg(): argtp(arg_) {}
+// Arg(const Arg &op) { operator =(op); }
+ ~Arg() { Clear(); }
+ V Clear();
+
+ BL Is() const { return argtp != arg_; }
+
+// Arg &operator =(const Arg &op);
+// Arg &operator =(const Argument &arg);
+
+ Arg &SetX(S r,S i = 0);
+ Arg &SetV(S *r,I rs,S *i = NULL,I is = 0);
+ Arg &SetE(const Env *bp);
+
+ typedef struct env_t { const Env *env; };
+ typedef struct v_t { S *rdt,*idt; I rs,is; };
+ typedef struct x_t { R r,i; };
+
+ enum { arg_ = 0,arg_x,arg_v,arg_env } argtp;
+ union {
+ x_t x;
+ v_t v;
+ env_t e;
+ };
+ };
+
+ Arg *arg;
+
+ union {
+ struct { R coef,carry; I rep; } flt;
+ struct { R carry; I rep; } intdif;
+ struct { BL cx; R density; I cnt; } peaks;
+ struct { R ph,phinc; } gen;
+ struct { R factor,center; I mode,fill; } tilt;
+ struct { R cur,inc; } bvl;
+ struct { R sh; I ish; I fill; } sh;
+ struct { I wndtp; BL inv,mul; R p1,p2,p3; } wnd;
+ struct { R minmax,scl; } norm;
+ struct { I arg; } ibin;
+ struct { R arg; } rbin;
+ struct { R rarg,iarg; } cbin;
+ struct { I *order; } perm;
+ struct { R val; I offs,dif,dir,slope; } srch;
+ };
+
+private:
+ // reverse direction
+ inline V SR_Rev() { rsdt -= (frames-1)*(rss = -rss); }
+ inline V SI_Rev() { isdt -= (frames-1)*(iss = -iss); }
+ V AR_Rev(I bl);
+ V AI_Rev(I bl);
+ inline V DR_Rev() { rddt -= (frames-1)*(rds = -rds); }
+ inline V DI_Rev() { iddt -= (frames-1)*(ids = -ids); }
+
+};
+
+#endif
diff --git a/externals/grill/vasp/source/oppermute.h b/externals/grill/vasp/source/oppermute.h
new file mode 100644
index 00000000..c307a3ae
--- /dev/null
+++ b/externals/grill/vasp/source/oppermute.h
@@ -0,0 +1,121 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPPERMUTE_H
+#define __VASP_OPPERMUTE_H
+
+#include "opparam.h"
+#include "oploop.h"
+
+#define PERMTMPL
+#define MAXPERMDIM 2
+
+template<class T>
+inline void permswap(T &a,T &b) { register T t = a; a = b; b = t; }
+
+#ifdef PERMTMPL
+template<class T,int origination(int pos, int sz,OpParam &p)>
+void permutation1(OpParam &p)
+#else
+template<class T>
+void permutation1(OpParam &p,int (*origination)(int pos, int sz,OpParam &p))
+#endif
+{
+ T *ddt = p.rddt;
+ const I ds = p.rds;
+ const I sz = p.frames;
+
+ if(ddt != p.rsdt) {
+ // not in place
+ const T *sdt = p.rsdt;
+ const I ss = p.rss;
+ I i;
+ _D_LOOP(i,sz) ddt[origination(i,sz,p)*ds] = sdt[i*ss]; _E_LOOP
+ }
+ else {
+ // in place
+ // \todo try to come from both sides!
+ I i;
+ _D_LOOP(i,sz-1)
+ int cur = i;
+ do { cur = origination(cur,sz,p); } while(cur < i);
+ if(cur > i) {
+ // swap
+ permswap(ddt[cur*ds],ddt[i*ds]);
+ }
+ _E_LOOP
+ }
+}
+
+#ifdef PERMTMPL
+template<class T,int origination(int pos, int sz,OpParam &p)>
+void permutation2(OpParam &p)
+#else
+template<class T>
+void permutation2(OpParam &p,int (*origination)(int pos, int sz,OpParam &p))
+#endif
+{
+ T *rddt = p.rddt,*iddt = p.iddt;
+ const I rds = p.rds,ids = p.ids;
+ const I sz = p.frames;
+ bool rinpl = rddt == p.rsdt,iinpl = iddt == p.isdt;
+
+ if(rinpl == iinpl) {
+ // re and im both in place
+ I i;
+ _D_LOOP(i,sz-1)
+ int cur = i;
+ do { cur = origination(cur,sz,p); } while(cur < i);
+ if(cur > i) {
+ // swap
+ permswap(rddt[cur*rds],rddt[i*rds]);
+ permswap(iddt[cur*ids],iddt[i*ids]);
+ }
+ _E_LOOP
+ }
+ else {
+ if(!rinpl) {
+ const T *sdt = p.rsdt;
+ const I ss = p.rss;
+ I i;
+ if(ss == 1 && rds == 1)
+ _D_LOOP(i,sz) *(rddt++) = *(sdt++); _E_LOOP
+ else
+ _D_LOOP(i,sz) *rddt = *sdt,rddt += rds,sdt += ss; _E_LOOP
+ rddt = p.rddt;
+ }
+ else permutation1<T>(p,origination);
+
+ if(!iinpl) {
+ const T *sdt = p.isdt;
+ const I ss = p.iss;
+ I i;
+ if(ss == 1 && ids == 1)
+ _D_LOOP(i,sz) *(iddt++) = *(sdt++); _E_LOOP
+ else
+ _D_LOOP(i,sz) *iddt = *sdt,iddt += ids,sdt += ss; _E_LOOP
+ iddt = p.iddt;
+ }
+ else {
+ permswap(p.rddt,p.iddt); permswap(p.rds,p.ids);
+ permutation1<T>(p,origination);
+ permswap(p.rddt,p.iddt); permswap(p.rds,p.ids);
+ }
+ }
+}
+
+#ifdef PERMTMPL
+#define PERMUTATION(tp,dim,p,func) permutation ## dim <tp,func>(p)
+#else
+#define PERMUTATION(tp,dim,p,func) permutation ## dim <tp>(p,func)
+#endif
+
+#endif
+
diff --git a/externals/grill/vasp/source/ops.h b/externals/grill/vasp/source/ops.h
new file mode 100644
index 00000000..00dc8e44
--- /dev/null
+++ b/externals/grill/vasp/source/ops.h
@@ -0,0 +1,27 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_H
+#define __VASP_OPS_H
+
+#include "ops_assign.h"
+#include "ops_arith.h"
+#include "ops_trnsc.h"
+#include "ops_cmp.h"
+#include "ops_cplx.h"
+#include "ops_flt.h"
+#include "ops_dft.h"
+#include "ops_gen.h"
+#include "ops_wnd.h"
+#include "ops_rearr.h"
+#include "ops_resmp.h"
+#include "ops_feature.h"
+
+#endif
diff --git a/externals/grill/vasp/source/ops_arith.cpp b/externals/grill/vasp/source/ops_arith.cpp
new file mode 100644
index 00000000..5d62e2c6
--- /dev/null
+++ b/externals/grill/vasp/source/ops_arith.cpp
@@ -0,0 +1,64 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_arith.h"
+#include "opdefs.h"
+#include "util.h"
+#include <math.h>
+
+template<class T> inline V f_radd(T &v,T a,T b) { v = a+b; }
+template<class T> inline V f_rsub(T &v,T a,T b) { v = a-b; }
+template<class T> inline V f_rsubr(T &v,T a,T b) { v = b-a; }
+template<class T> inline V f_rmul(T &v,T a,T b) { v = a*b; }
+template<class T> inline V f_rdiv(T &v,T a,T b) { v = a/b; }
+template<class T> inline V f_rdivr(T &v,T a,T b) { v = b/a; }
+template<class T> inline V f_rmod(T &v,T a,T b) { v = fmod(a,b); }
+
+BL VecOp::d_add(OpParam &p) { D__rbin(f_radd<S>,p); }
+BL VecOp::d_sub(OpParam &p) { D__rbin(f_rsub<S>,p); }
+BL VecOp::d_subr(OpParam &p) { D__rbin(f_rsubr<S>,p); }
+BL VecOp::d_mul(OpParam &p) { D__rbin(f_rmul<S>,p); }
+BL VecOp::d_div(OpParam &p) { D__rbin(f_rdiv<S>,p); }
+BL VecOp::d_divr(OpParam &p) { D__rbin(f_rdivr<S>,p); }
+BL VecOp::d_mod(OpParam &p) { D__rbin(f_rmod<S>,p); }
+
+
+VASP_BINARY("vasp.+",add,true,VASP_ARG_R(0),"Adds a value, envelope or vasp")
+VASP_BINARY("vasp.-",sub,true,VASP_ARG_R(0),"Subtracts a value, envelope or vasp")
+VASP_BINARY("vasp.!-",subr,true,VASP_ARG_R(0),"Reverse subtracts a value, envelope or vasp")
+VASP_BINARY("vasp.*",mul,true,VASP_ARG_R(1),"Multiplies with a value, envelope or vasp")
+VASP_BINARY("vasp./",div,true,VASP_ARG_R(1),"Divides by a value, envelope or vasp")
+VASP_BINARY("vasp.!/",divr,true,VASP_ARG_R(1),"Reverse divides by a value, envelope or vasp")
+VASP_BINARY("vasp.%",mod,true,VASP_ARG_R(0),"Calculates the remainder of the division by a value, envelope or vasp")
+
+// -----------------------------------------------------
+
+template<class T> inline V f_rsqr(T &v,T a) { v = a*a; }
+template<class T> inline V f_rssqr(T &v,T a) { v = a*fabs(a); }
+
+BL VecOp::d_sqr(OpParam &p) { D__run(f_rsqr<S>,p); }
+BL VecOp::d_ssqr(OpParam &p) { d__run(f_rssqr<S>,p); }
+
+VASP_UNARY("vasp.sqr",sqr,true,"Calculates the square")
+VASP_UNARY("vasp.ssqr",ssqr,true,"Calculates the square with preservation of the sign")
+
+
+// -----------------------------------------------------
+
+template<class T> inline V f_rsign(T &v,T a) { v = (a == 0?0:(a < 0?-1.:1.)); }
+template<class T> inline V f_rabs(T &v,T a) { v = fabs(a); }
+
+BL VecOp::d_sign(OpParam &p) { D__run(f_rsign<S>,p); }
+BL VecOp::d_abs(OpParam &p) { D__run(f_rabs<S>,p); }
+
+
+VASP_UNARY("vasp.sign",sign,true,"Calculates the sign (signum function)")
+VASP_UNARY("vasp.abs",abs,true,"Calulates the absolute value")
+
diff --git a/externals/grill/vasp/source/ops_arith.h b/externals/grill/vasp/source/ops_arith.h
new file mode 100644
index 00000000..6e2bb879
--- /dev/null
+++ b/externals/grill/vasp/source/ops_arith.h
@@ -0,0 +1,72 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_ARITH_H
+#define __VASP_OPS_ARITH_H
+
+#include "opbase.h"
+
+// Arithmetic math functions
+
+namespace VecOp {
+ BL d_add(OpParam &p);
+ BL d_sub(OpParam &p);
+ BL d_subr(OpParam &p);
+ BL d_mul(OpParam &p);
+ BL d_div(OpParam &p);
+ BL d_divr(OpParam &p);
+ BL d_mod(OpParam &p);
+
+ BL d_cadd(OpParam &p);
+ BL d_csub(OpParam &p);
+ BL d_csubr(OpParam &p);
+ BL d_cmul(OpParam &p);
+ BL d_cdiv(OpParam &p);
+ BL d_cdivr(OpParam &p);
+
+ BL d_sqr(OpParam &p);
+ BL d_ssqr(OpParam &p);
+ BL d_csqr(OpParam &p);
+ BL d_cpowi(OpParam &p);
+
+ BL d_sign(OpParam &p);
+ BL d_abs(OpParam &p);
+ BL d_cabs(OpParam &p);
+}
+
+namespace VaspOp {
+ inline Vasp *m_add(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_add); } // add to (one vec or real)
+ inline Vasp *m_sub(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_sub); } // sub from (one vec or real)
+ inline Vasp *m_subr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_subr); } // reverse sub from (one vec or real)
+ inline Vasp *m_mul(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_mul); } // mul with (one vec or real)
+ inline Vasp *m_div(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_div); } // div by (one vec or real)
+ inline Vasp *m_divr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_divr); } // reverse div by (one vec or real)
+ inline Vasp *m_mod(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_mod); } // modulo by (one vec or real)
+
+ inline Vasp *m_cadd(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cadd); } // complex add (pairs of vecs or complex)
+ inline Vasp *m_csub(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_csub); } // complex sub (pairs of vecs or complex)
+ inline Vasp *m_csubr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_csubr); } // reverse complex sub (pairs of vecs or complex)
+ inline Vasp *m_cmul(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cmul); } // complex mul (pairs of vecs or complex)
+ inline Vasp *m_cdiv(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cdiv); } // complex div (pairs of vecs or complex)
+ inline Vasp *m_cdivr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cdivr); } // complex reverse div (pairs of vecs or complex)
+
+ inline Vasp *m_sqr(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_sqr); } // unsigned square
+ inline Vasp *m_ssqr(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_ssqr); } // signed square
+ inline Vasp *m_csqr(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_csqr); } // complex square (with each two channels)
+// inline Vasp *m_csqrt(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_csqrt); } // complex square root (how about branches?)
+
+ Vasp *m_cpowi(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // complex integer power (with each two channels)
+
+ inline Vasp *m_sign(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_sign); } // sign function
+ inline Vasp *m_abs(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_abs); } // absolute values
+ inline Vasp *m_cabs(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_cabs); } // absolute values
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_assign.cpp b/externals/grill/vasp/source/ops_assign.cpp
new file mode 100644
index 00000000..96061ce9
--- /dev/null
+++ b/externals/grill/vasp/source/ops_assign.cpp
@@ -0,0 +1,108 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_assign.h"
+#include "opdefs.h"
+
+
+template<class T> inline V f_rcopy(T &v,T a) { v = a; }
+template<class T> inline V f_ccopy(T &rv,T &iv,T ra,T ia) { rv = ra,iv = ia; }
+
+template<class T> inline V f_rset(T &v,T,T b) { v = b; }
+template<class T> inline V f_cset(T &rv,T &iv,T,T,T rb,T ib) { rv = rb,iv = ib; }
+
+
+BL VecOp::d_copy(OpParam &p) { D__run(f_rcopy<S>,p); }
+BL VecOp::d_ccopy(OpParam &p) { D__cun(f_ccopy<S>,p); }
+
+BL VecOp::d_set(OpParam &p) { D__rbin(f_rset<S>,p); }
+BL VecOp::d_cset(OpParam &p) { D__cbin(f_cset<S>,p); }
+
+
+VASP_BINARY("vasp.set vasp.=",set,false,VASP_ARG_R(0),"Assigns a value, envelope or vasp")
+VASP_BINARY("vasp.cset vasp.c=",cset,false,VASP_ARG_R(0),"Assigns a complex value, real envelope or vasp")
+
+
+
+Vasp *VaspOp::m_copy(OpParam &p,Vasp &src,Vasp &arg)
+{
+ Vasp *s = NULL,*d = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,&arg);
+ if(vecs) {
+ d = DoOp(vecs,VecOp::d_copy,p);
+ s = vecs->SrcVasp();
+ if(d) arg = *d; else { arg.Clear(); delete d; }
+ delete vecs;
+ }
+ return s;
+}
+
+Vasp *VaspOp::m_ccopy(OpParam &p,Vasp &src,Vasp &arg)
+{
+ Vasp *s = NULL,*d = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,&arg);
+ if(vecs) {
+ d = DoOp(vecs,VecOp::d_ccopy,p);
+ s = vecs->SrcVasp();
+ if(d) arg = *d; else { arg.Clear(); delete d; }
+ delete vecs;
+ }
+ return s;
+}
+
+
+class vasp_copy:
+ public vasp_anyop
+{
+ FLEXT_HEADER(vasp_copy,vasp_anyop)
+public:
+
+ vasp_copy(I argc,t_atom *argv): vasp_anyop(argc,argv,VASP_ARG(),true,XletCode(xlet::tp_any,0)) {}
+
+ virtual V m_to(I,t_atom *) { post("s - destination vasp is ignored!",thisName()); }
+
+ virtual Vasp *do_copy(OpParam &p,Vasp &dst) { return VaspOp::m_copy(p,ref,dst); }
+
+ virtual Vasp *tx_work(const Argument &arg)
+ {
+ OpParam p(thisName(),0);
+
+ if(arg.CanbeVasp()) {
+ Vasp dst = arg.GetAVasp();
+ Vasp *ret = do_copy(p,dst);
+ ToOutVasp(1,dst);
+ return ret;
+ }
+ else {
+ post("%s - argument is not a valid vasp!",thisName()); // \todo check earlier!
+ return NULL;
+ }
+ }
+
+ virtual V m_help() { post("%s - Copies the triggering vasp to the argument vasp",thisName()); }
+};
+FLEXT_LIB_V("vasp, vasp.copy vasp.->",vasp_copy)
+
+
+class vasp_ccopy:
+ public vasp_copy
+{
+ FLEXT_HEADER(vasp_ccopy,vasp_copy)
+public:
+
+ vasp_ccopy(I argc,t_atom *argv): vasp_copy(argc,argv) {}
+
+ virtual Vasp *do_copy(OpParam &p,Vasp &dst) { return VaspOp::m_ccopy(p,ref,dst); }
+
+ virtual V m_help() { post("%s - Copies complex pairs of the triggering vasp to the argument vasp",thisName()); }
+};
+FLEXT_LIB_V("vasp, vasp.ccopy vasp.c->",vasp_ccopy)
+
+
diff --git a/externals/grill/vasp/source/ops_assign.h b/externals/grill/vasp/source/ops_assign.h
new file mode 100644
index 00000000..e80501f0
--- /dev/null
+++ b/externals/grill/vasp/source/ops_assign.h
@@ -0,0 +1,34 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_ASSIGN_H
+#define __VASP_OPS_ASSIGN_H
+
+#include "opbase.h"
+
+// Assignment functions
+
+namespace VecOp {
+ BL d_copy(OpParam &p);
+ BL d_set(OpParam &p);
+
+ BL d_ccopy(OpParam &p);
+ BL d_cset(OpParam &p);
+}
+
+namespace VaspOp {
+ inline Vasp *m_set(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_set); } // copy to (one vec or real)
+ inline Vasp *m_cset(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cset); } // complex copy (pairs of vecs or complex)
+
+ Vasp *m_copy(OpParam &p,Vasp &src,Vasp &dst);
+ Vasp *m_ccopy(OpParam &p,Vasp &src,Vasp &dst);
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_carith.cpp b/externals/grill/vasp/source/ops_carith.cpp
new file mode 100644
index 00000000..b2464ab2
--- /dev/null
+++ b/externals/grill/vasp/source/ops_carith.cpp
@@ -0,0 +1,125 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_carith.h"
+#include "ops_assign.h"
+#include "opdefs.h"
+#include "util.h"
+#include <math.h>
+
+template<class T> inline V f_cadd(T &rv,T &iv,T ra,T ia,T rb,T ib) { rv = ra+rb,iv = ia+ib; }
+template<class T> inline V f_csub(T &rv,T &iv,T ra,T ia,T rb,T ib) { rv = ra-rb,iv = ia-ib; }
+template<class T> inline V f_csubr(T &rv,T &iv,T ra,T ia,T rb,T ib) { rv = rb-ra,iv = ib-ia; }
+template<class T> inline V f_cmul(T &rv,T &iv,T ra,T ia,T rb,T ib) { rv = ra*rb-ia*ib, iv = ra*ib+rb*ia; }
+
+template<class T> inline V f_cdiv(T &rv,T &iv,T ra,T ia,T rb,T ib)
+{
+ register const R den = sqabs(rb,ib);
+ rv = (ra*rb+ia*ib)/den;
+ iv = (ia*rb-ra*ib)/den;
+}
+
+template<class T> inline V f_cdivr(T &rv,T &iv,T ra,T ia,T rb,T ib)
+{
+ register const R den = sqabs(ra,ia);
+ rv = (rb*ra+ib*ia)/den;
+ iv = (ib*ra-rb*ia)/den;
+}
+
+BL VecOp::d_cadd(OpParam &p) { D__cbin(f_cadd<S>,p); }
+BL VecOp::d_csub(OpParam &p) { D__cbin(f_csub<S>,p); }
+BL VecOp::d_csubr(OpParam &p) { D__cbin(f_csubr<S>,p); }
+BL VecOp::d_cmul(OpParam &p) { D__cbin(f_cmul<S>,p); }
+BL VecOp::d_cdiv(OpParam &p) { d__cbin(f_cdiv<S>,p); }
+BL VecOp::d_cdivr(OpParam &p) { d__cbin(f_cdivr<S>,p); }
+
+
+VASP_BINARY("vasp.c+",cadd,true,VASP_ARG_R(0),"adds a complex value or vasp")
+VASP_BINARY("vasp.c-",csub,true,VASP_ARG_R(0),"subtracts a complex value or vasp")
+VASP_BINARY("vasp.c!-",csubr,true,VASP_ARG_R(0),"reverse subtracts a complex value or vasp")
+VASP_BINARY("vasp.c*",cmul,true,VASP_ARG_R(1),"multiplies by a complex value or vasp")
+VASP_BINARY("vasp.c/",cdiv,true,VASP_ARG_R(1),"divides by a complex value or vasp")
+VASP_BINARY("vasp.c!/",cdivr,true,VASP_ARG_R(1),"reverse divides by a complex value or vasp")
+
+
+// -----------------------------------------------------
+
+
+template<class T> inline V f_csqr(T &rv,T &iv,T ra,T ia) { rv = ra*ra-ia*ia; iv = ra*ia*2; }
+
+BL VecOp::d_csqr(OpParam &p) { D__cun(f_csqr<S>,p); }
+
+VASP_UNARY("vasp.csqr",csqr,true,"complex square")
+
+// -----------------------------------------------------
+
+template<class T> V f_cpowi(T &rv,T &iv,T ra,T ia,OpParam &p)
+{
+ register const I powi = p.ibin.arg;
+ register S rt,it; f_csqr(rt,it,ra,ia);
+ for(I i = 2; i < powi; ++i) f_cmul(rt,it,rt,it,ra,ia);
+ rv = rt,iv = it;
+}
+
+BL VecOp::d_cpowi(OpParam &p) { d__cop(f_cpowi<S>,p); }
+
+Vasp *VaspOp::m_cpowi(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst)
+{
+ Vasp *ret = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ I powi = 1;
+ if(arg.IsList() && arg.GetList().Count() >= 1 && flext::CanbeInt(arg.GetList()[0]))
+ powi = flext::GetAInt(arg.GetList()[0]);
+ else
+ post("%s - power arg is invalid -> set to 1",p.opname);
+
+ if(powi < 0) {
+ post("%s - negative integer power is not allowed",p.opname);
+ }
+ else {
+ switch(powi) {
+ case 0: {
+ p.cbin.rarg = 1,p.cbin.iarg = 0;
+ ret = DoOp(vecs,VecOp::d_cset,p);
+ break;
+ }
+ case 1: {
+ // set arg to src
+ ret = DoOp(vecs,VecOp::d_ccopy,p);
+ break;
+ }
+ case 2: {
+ ret = DoOp(vecs,VecOp::d_csqr,p);
+ break;
+ }
+ default: {
+ p.ibin.arg = powi;
+ ret = DoOp(vecs,VecOp::d_cpowi,p);
+ break;
+ }
+ }
+ }
+
+ delete vecs;
+ }
+ return ret;
+}
+
+VASP_ANYOP("vasp.cpowi",cpowi,0,true,VASP_ARG_I(1),"complex integer power")
+
+// -----------------------------------------------------
+
+template<class T> inline V f_cabs(T &rv,T &iv,T ra,T ia) { rv = sqrt(ra*ra+ia*ia),iv = 0; }
+
+BL VecOp::d_cabs(OpParam &p) { D__cun(f_cabs<S>,p); }
+
+VASP_UNARY("vasp.cabs",cabs,true,"set real part to complex absolute value, imaginary part becomes zero")
+
diff --git a/externals/grill/vasp/source/ops_carith.h b/externals/grill/vasp/source/ops_carith.h
new file mode 100644
index 00000000..7f841750
--- /dev/null
+++ b/externals/grill/vasp/source/ops_carith.h
@@ -0,0 +1,48 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_CARITH_H
+#define __VASP_OPS_CARITH_H
+
+#include "opbase.h"
+
+// Arithmetic math functions
+
+namespace VecOp {
+ BL d_cadd(OpParam &p);
+ BL d_csub(OpParam &p);
+ BL d_csubr(OpParam &p);
+ BL d_cmul(OpParam &p);
+ BL d_cdiv(OpParam &p);
+ BL d_cdivr(OpParam &p);
+
+ BL d_csqr(OpParam &p);
+ BL d_cpowi(OpParam &p);
+
+ BL d_cabs(OpParam &p);
+}
+
+namespace VaspOp {
+ inline Vasp *m_cadd(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cadd); } // complex add (pairs of vecs or complex)
+ inline Vasp *m_csub(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_csub); } // complex sub (pairs of vecs or complex)
+ inline Vasp *m_csubr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_csubr); } // reverse complex sub (pairs of vecs or complex)
+ inline Vasp *m_cmul(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cmul); } // complex mul (pairs of vecs or complex)
+ inline Vasp *m_cdiv(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cdiv); } // complex div (pairs of vecs or complex)
+ inline Vasp *m_cdivr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_cdivr); } // complex reverse div (pairs of vecs or complex)
+
+ inline Vasp *m_csqr(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_csqr); } // complex square (with each two channels)
+// inline Vasp *m_csqrt(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_csqrt); } // complex square root (how about branches?)
+
+ Vasp *m_cpowi(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // complex integer power (with each two channels)
+
+ inline Vasp *m_cabs(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_cabs); } // absolute values
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_cmp.cpp b/externals/grill/vasp/source/ops_cmp.cpp
new file mode 100644
index 00000000..2f632a54
--- /dev/null
+++ b/externals/grill/vasp/source/ops_cmp.cpp
@@ -0,0 +1,99 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_cmp.h"
+#include "opdefs.h"
+#include "util.h"
+#include <math.h>
+
+// --------------------------------------------------------------
+
+template<class T> inline V f_rlwr(T &v,T a,T b) { v = a < b?1:0; }
+template<class T> inline V f_rgtr(T &v,T a,T b) { v = a > b?1:0; }
+template<class T> inline V f_ralwr(T &v,T a,T b) { v = fabs(a) < fabs(b)?1:0; }
+template<class T> inline V f_ragtr(T &v,T a,T b) { v = fabs(a) > fabs(b)?1:0; }
+template<class T> inline V f_rleq(T &v,T a,T b) { v = a <= b?1:0; }
+template<class T> inline V f_rgeq(T &v,T a,T b) { v = a >= b?1:0; }
+template<class T> inline V f_raleq(T &v,T a,T b) { v = fabs(a) <= fabs(b)?1:0; }
+template<class T> inline V f_rageq(T &v,T a,T b) { v = fabs(a) >= fabs(b)?1:0; }
+template<class T> inline V f_requ(T &v,T a,T b) { v = a == b?1:0; }
+template<class T> inline V f_rneq(T &v,T a,T b) { v = a != b?1:0; }
+
+BL VecOp::d_lwr(OpParam &p) { D__rbin(f_rlwr<S>,p); }
+BL VecOp::d_gtr(OpParam &p) { D__rbin(f_rgtr<S>,p); }
+BL VecOp::d_alwr(OpParam &p) { D__rbin(f_ralwr<S>,p); }
+BL VecOp::d_agtr(OpParam &p) { D__rbin(f_ragtr<S>,p); }
+BL VecOp::d_leq(OpParam &p) { D__rbin(f_rleq<S>,p); }
+BL VecOp::d_geq(OpParam &p) { D__rbin(f_rgeq<S>,p); }
+BL VecOp::d_aleq(OpParam &p) { D__rbin(f_raleq<S>,p); }
+BL VecOp::d_ageq(OpParam &p) { D__rbin(f_rageq<S>,p); }
+BL VecOp::d_equ(OpParam &p) { D__rbin(f_requ<S>,p); }
+BL VecOp::d_neq(OpParam &p) { D__rbin(f_rneq<S>,p); }
+
+VASP_BINARY("vasp.<",lwr,true,VASP_ARG_R(0),"set destination to 1 if source < argument, 0 otherwise")
+VASP_BINARY("vasp.>",gtr,true,VASP_ARG_R(0),"set destination to 1 if source > argument, 0 otherwise")
+VASP_BINARY("vasp.a<",alwr,true,VASP_ARG_R(0),"set destination to 1 if abs(source) < abs(argument), 0 otherwise")
+VASP_BINARY("vasp.a>",agtr,true,VASP_ARG_R(0),"set destination to 1 if abs(source) > abs(argument), 0 otherwise")
+VASP_BINARY("vasp.<=",leq,true,VASP_ARG_R(0),"set destination to 1 if source <= argument, 0 otherwise")
+VASP_BINARY("vasp.>=",geq,true,VASP_ARG_R(0),"set destination to 1 if source >= argument, 0 otherwise")
+VASP_BINARY("vasp.a<=",aleq,true,VASP_ARG_R(0),"set destination to 1 if abs(source) <= abs(argument), 0 otherwise")
+VASP_BINARY("vasp.a>=",ageq,true,VASP_ARG_R(0),"set destination to 1 if abs(source) >= abs(argument), 0 otherwise")
+VASP_BINARY("vasp.==",equ,true,VASP_ARG_R(0),"set destination to 1 if source == argument, 0 otherwise")
+VASP_BINARY("vasp.!=",neq,true,VASP_ARG_R(0),"set destination to 1 if source != argument, 0 otherwise")
+
+
+// --------------------------------------------------------------
+
+template<class T> inline V f_min(T &v,T a,T b) { v = a < b?a:b; }
+template<class T> inline V f_max(T &v,T a,T b) { v = a > b?a:b; }
+
+template<class T> inline V f_rmin(T &rv,T &iv,T ra,T ia,T rb,T ib)
+{
+ if(sqabs(ra,ia) < sqabs(rb,ib)) rv = ra,iv = ia;
+ else rv = rb,iv = ib;
+}
+
+template<class T> inline V f_rmax(T &rv,T &iv,T ra,T ia,T rb,T ib)
+{
+ if(sqabs(ra,ia) > sqabs(rb,ib)) rv = ra,iv = ia;
+ else rv = rb,iv = ib;
+}
+
+BL VecOp::d_min(OpParam &p) { D__rbin(f_min<S>,p); }
+BL VecOp::d_max(OpParam &p) { D__rbin(f_max<S>,p); }
+BL VecOp::d_rmin(OpParam &p) { d__cbin(f_rmin<S>,p); }
+BL VecOp::d_rmax(OpParam &p) { d__cbin(f_rmax<S>,p); }
+
+
+VASP_BINARY("vasp.min",min,true,VASP_ARG_R(0),"assigns the minimum of the comparison with a value or vasp")
+VASP_BINARY("vasp.max",max,true,VASP_ARG_R(0),"assigns the maximum of the comparison with a value or vasp")
+
+VASP_BINARY("vasp.rmin",rmin,true,VASP_ARG_R(0),"assigns the minimum of the radius comparison with a complex value or vasp")
+VASP_BINARY("vasp.rmax",rmax,true,VASP_ARG_R(0),"assigns the maximum of the radius comparison with a complex value or vasp")
+
+
+// --------------------------------------------------------------
+
+template<class T> inline V f_minmax(T &rv,T &iv,T ra,T ia)
+{
+ if(ra < ia) rv = ra,iv = ia;
+ else rv = ia,iv = ra;
+}
+
+BL VecOp::d_minmax(OpParam &p) { d__cun(f_minmax<S>,p); }
+
+VASP_UNARY("vasp, vasp.minmax",minmax,true,"compare two vectors, assign the lower values to the first and the higher to the second one")
+
+
+
+
+
+
+
diff --git a/externals/grill/vasp/source/ops_cmp.h b/externals/grill/vasp/source/ops_cmp.h
new file mode 100644
index 00000000..87af3a19
--- /dev/null
+++ b/externals/grill/vasp/source/ops_cmp.h
@@ -0,0 +1,86 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_CMP_H
+#define __VASP_OPS_CMP_H
+
+#include "opbase.h"
+
+// Comparison functions
+
+namespace VecOp {
+ BL d_lwr(OpParam &p);
+ BL d_gtr(OpParam &p);
+ BL d_alwr(OpParam &p);
+ BL d_agtr(OpParam &p);
+ BL d_leq(OpParam &p);
+ BL d_geq(OpParam &p);
+ BL d_aleq(OpParam &p);
+ BL d_ageq(OpParam &p);
+ BL d_equ(OpParam &p);
+ BL d_neq(OpParam &p);
+
+ BL d_min(OpParam &p);
+ BL d_max(OpParam &p);
+
+ BL d_rmin(OpParam &p);
+ BL d_rmax(OpParam &p);
+
+ BL d_minmax(OpParam &p);
+
+ BL d_minq(OpParam &p);
+ BL d_maxq(OpParam &p);
+ BL d_aminq(OpParam &p);
+ BL d_amaxq(OpParam &p);
+
+ BL d_rminq(OpParam &p);
+ BL d_rmaxq(OpParam &p);
+
+ BL d_gate(OpParam &p);
+ BL d_igate(OpParam &p);
+ BL d_rgate(OpParam &p);
+ BL d_rigate(OpParam &p);
+}
+
+namespace VaspOp {
+ inline Vasp *m_lwr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_lwr); } // lower than
+ inline Vasp *m_gtr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_gtr); } // greater than
+ inline Vasp *m_alwr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_alwr); } // abs lower than
+ inline Vasp *m_agtr(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_agtr); } // abs greater than
+ inline Vasp *m_leq(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_leq); } // abs lower than
+ inline Vasp *m_geq(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_geq); } // abs greater than
+ inline Vasp *m_aleq(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_aleq); } // lower than
+ inline Vasp *m_ageq(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_ageq); } // greater than
+ inline Vasp *m_equ(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_equ); } // lower than
+ inline Vasp *m_neq(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_neq); } // greater than
+
+ inline Vasp *m_min(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_min); } // min (one vec or real)
+ inline Vasp *m_max(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_max); } // max (one vec or real)
+
+ inline Vasp *m_rmin(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_rmin); } // complex (radius) min (pairs of vecs or complex)
+ inline Vasp *m_rmax(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_cbin(p,src,arg,dst,VecOp::d_rmax); } // complex (radius) max (pairs of vecs or complex)
+
+ inline Vasp *m_minmax(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_minmax); } // min/max
+
+ inline Vasp *m_qmin(OpParam &p,Vasp &src) { return m_run(p,src,NULL,VecOp::d_minq); } // get minimum sample value
+ inline Vasp *m_qmax(OpParam &p,Vasp &src) { return m_run(p,src,NULL,VecOp::d_maxq); } // get maximum sample value
+ inline Vasp *m_qamin(OpParam &p,Vasp &src) { return m_run(p,src,NULL,VecOp::d_aminq); } // get minimum sample value
+ inline Vasp *m_qamax(OpParam &p,Vasp &src) { return m_run(p,src,NULL,VecOp::d_amaxq); } // get maximum sample value
+
+ inline Vasp *m_qrmin(OpParam &p,Vasp &src) { return m_cun(p,src,NULL,VecOp::d_rminq); } // get minimum sample value
+ inline Vasp *m_qrmax(OpParam &p,Vasp &src) { return m_cun(p,src,NULL,VecOp::d_rmaxq); } // get maximum sample value
+
+ Vasp *m_gate(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // gate
+ Vasp *m_igate(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // inverse gate
+ Vasp *m_rgate(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // radius gate
+ Vasp *m_rigate(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // inverse radius gate
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_cplx.cpp b/externals/grill/vasp/source/ops_cplx.cpp
new file mode 100644
index 00000000..70f8c6e2
--- /dev/null
+++ b/externals/grill/vasp/source/ops_cplx.cpp
@@ -0,0 +1,85 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_cplx.h"
+#include "opdefs.h"
+#include "util.h"
+#include <math.h>
+
+// -----------------------------------------------------
+
+template<class T> V f_polar(T &rv,T &iv,T ra,T ia) { rv = sqrt(sqabs(ra,ia)),iv = arg(ra,ia); }
+template<class T> V f_rect(T &rv,T &iv,T ra,T ia) { rv = ra*cos(ia),iv = ra*sin(ia); }
+
+BL VecOp::d_polar(OpParam &p) { d__cun(f_polar<S>,p); }
+BL VecOp::d_rect(OpParam &p) { d__cun(f_rect<S>,p); }
+
+
+VASP_UNARY("vasp.polar",polar,true,"convert complex vector pair from rectangular to polar coordinates")
+VASP_UNARY("vasp.rect",rect,true,"convert complex vector pair from polar to rectangular coordinates")
+
+
+// -----------------------------------------------------
+
+
+template<class T> V f_radd(T &rv,T &iv,T ra,T ia,T rb,T)
+{
+ register const R _abs = sqrt(sqabs(ra,ia))+rb;
+ register const R _phi = arg(ra,ia);
+
+ rv = _abs*cos(_phi),iv = _abs*sin(_phi);
+}
+
+BL VecOp::d_radd(OpParam &p) { d__cbin(f_radd<S>,p); }
+
+Vasp *VaspOp::m_radd(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst)
+{
+ Vasp *ret = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ if(arg.IsList() && arg.GetList().Count() >= 1 && flext::CanbeFloat(arg.GetList()[0]))
+ p.cbin.rarg = flext::GetAFloat(arg.GetList()[0]);
+ else {
+ post("%s - argument is invalid -> set to 0",p.opname);
+ p.cbin.rarg = 0;
+ }
+ p.cbin.iarg = 0; // not used anyway
+
+ ret = DoOp(vecs,VecOp::d_radd,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+
+VASP_ANYOP("vasp.r+",radd,0,true,VASP_ARG_R(0),"add offset to complex radius (of complex vector pair)")
+
+
+// -----------------------------------------------------
+
+template<class T> V f_cnorm(T &rv,T &iv,T ra,T ia)
+{
+ register T f = sqabs(ra,ia);
+ if(f) { f = 1./sqrt(f); rv = ra*f,iv = ia*f; }
+ else rv = iv = 0;
+}
+
+BL VecOp::d_cnorm(OpParam &p) { d__cun(f_cnorm<S>,p); }
+
+VASP_UNARY("vasp.cnorm",cnorm,true,"normalize complex radius to 1 (but preserve angle)")
+
+// -----------------------------------------------------
+
+template<class T> inline V f_cconj(T &,T &iv,T,T ia) { iv = -ia; }
+
+BL VecOp::d_cconj(OpParam &p) { D__cun(f_cconj<S>,p); }
+
+VASP_UNARY("vasp.cconj",cconj,true,"complex conjugate: multiply imaginary part with -1") // should be replaced by an abstraction
+
diff --git a/externals/grill/vasp/source/ops_cplx.h b/externals/grill/vasp/source/ops_cplx.h
new file mode 100644
index 00000000..de1426f2
--- /dev/null
+++ b/externals/grill/vasp/source/ops_cplx.h
@@ -0,0 +1,42 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_CPLX_H
+#define __VASP_OPS_CPLX_H
+
+#include "opbase.h"
+
+// Complex functions
+
+namespace VecOp {
+ BL d_polar(OpParam &p);
+ BL d_rect(OpParam &p);
+
+ BL d_radd(OpParam &p);
+
+ BL d_cnorm(OpParam &p);
+
+// BL d_cswap(OpParam &p);
+ BL d_cconj(OpParam &p);
+}
+
+namespace VaspOp {
+ inline Vasp *m_polar(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_polar); } // cartesian -> polar (each two)
+ inline Vasp *m_rect(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_rect); } // polar -> cartesian (each two)
+
+ Vasp *m_radd(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // radius offset
+
+ inline Vasp *m_cnorm(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_cnorm); } // complex normalize
+
+// inline Vasp *m_cswap(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_cswap); } // swap real and imaginary parts
+ inline Vasp *m_cconj(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_cconj); } // complex conjugate
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_dft.cpp b/externals/grill/vasp/source/ops_dft.cpp
new file mode 100644
index 00000000..a83d80fc
--- /dev/null
+++ b/externals/grill/vasp/source/ops_dft.cpp
@@ -0,0 +1,651 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+/*! \file ops_dft.cpp
+ \brief Implementation of DFT routines
+
+ \todo align temporary memory allocations
+
+ All DFTs are normalized by 1/sqrt(n), hence the complex ones are repeatable
+
+ - complex FFT radix-2: in-place
+ - real FFT radix-2 (split-radix): in-place
+ - complex DFT radix-n (split-radix): out-of-place
+ - real DFT radix-n: out-of-place / based on complex DFT radix-n (inefficient)
+
+ In-place transformation is only possible for stride=1
+*/
+
+#include "ops_dft.h"
+#include <math.h>
+#include <string.h>
+
+///////////////////////////////////////////////////////////////
+
+BL mixfft(I n,F *xRe,F *xIm,F *yRe,F *yIm);
+
+#ifdef FLEXT_THREADS
+static flext::ThrMutex mixmtx;
+#endif
+
+//! Real forward DFT radix-n (managing routine)
+static BL fft_fwd_real_any(I cnt,F *rsdt,I _rss,F *rddt,I _rds)
+{
+ if(!rddt) rddt = rsdt,_rds = _rss;
+
+#ifdef VASP_CHN1
+ const I rds = 1,rss = 1;
+#else
+ const I rds = _rds,rss = _rss;
+#endif
+
+ const BL rst = rss != 1;
+ const BL rdt = rsdt == rddt || rds != 1;
+
+ F *rstmp,*istmp;
+ register I i;
+
+ if(rst) {
+ rstmp = new F[cnt];
+ // happens only if rss != 1, no optimization necessary
+ for(i = 0; i < cnt; ++i) rstmp[i] = rsdt[i*rss];
+ }
+ else
+ rstmp = rsdt;
+
+ istmp = new F[cnt];
+ memset(istmp,0,cnt*sizeof(*istmp));
+
+ F *rdtmp = rdt?new F[cnt]:rddt;
+ F *idtmp = new F[cnt];
+
+ BL ret;
+ {
+ // mixfft is not thread-safe
+#ifdef FLEXT_THREADS
+ mixmtx.Lock();
+#endif
+ ret = mixfft(cnt,rstmp,istmp,rdtmp,idtmp);
+#ifdef FLEXT_THREADS
+ mixmtx.Unlock();
+#endif
+ }
+ if(ret) {
+ const F nrm = 1./sqrt(cnt);
+ const I n2 = cnt/2;
+
+#ifndef VASP_COMPACT
+ if(rds == 1) {
+ for(i = 0; i <= n2; ++i) rddt[i] = rdtmp[i]*nrm;
+ for(i = 1; i < cnt-n2; ++i) rddt[i+n2] = idtmp[i]*nrm;
+ }
+ else
+#endif
+ {
+ for(i = 0; i <= n2; ++i) rddt[i*rds] = rdtmp[i]*nrm;
+ for(i = 1; i < cnt-n2; ++i) rddt[(i+n2)*rds] = idtmp[i]*nrm;
+ }
+ }
+
+ if(rst) delete[] rstmp;
+ delete[] istmp;
+ if(rdt) delete[] rdtmp;
+ delete[] idtmp;
+
+ return ret;
+}
+
+
+//! Real inverse DFT radix-n (managing routine)
+static BL fft_inv_real_any(I cnt,F *rsdt,I _rss,F *rddt,I _rds)
+{
+ if(!rddt) rddt = rsdt,_rds = _rss;
+
+#ifdef VASP_CHN1
+ const I rds = 1,rss = 1;
+#else
+ const I rds = _rds,rss = _rss;
+#endif
+
+ const BL rst = rss != 1;
+ const BL rdt = rsdt == rddt || rds != 1;
+
+ const I n2 = cnt/2;
+ F *rstmp,*istmp;
+ istmp = new F[cnt];
+ register I i;
+
+ if(rst) {
+ rstmp = new F[cnt];
+ // happens only if rss != 1, no optimization necessary
+ for(i = 0; i <= n2; ++i) rstmp[i] = rsdt[i*rss];
+ for(i = 1; i < cnt-n2; ++i) istmp[cnt-i] = rsdt[(n2+i)*rss];
+ }
+ else {
+ rstmp = rsdt;
+ for(i = 1; i < cnt-n2; ++i) istmp[cnt-i] = rsdt[n2+i];
+ }
+
+ // make symmetric parts
+ for(i = 1; i < cnt-n2; ++i) {
+ istmp[i] = -istmp[cnt-i];
+ rstmp[cnt-i] = rstmp[i];
+ }
+ istmp[0] = 0;
+ if(cnt%2 == 0) istmp[n2] = 0;
+
+
+ F *rdtmp = rdt?new F[cnt]:rddt;
+ F *idtmp = new F[cnt];
+
+ BL ret;
+ {
+#ifdef FLEXT_THREADS
+ mixmtx.Lock();
+#endif
+ // mixfft is not thread-safe
+ ret = mixfft(cnt,rstmp,istmp,rdtmp,idtmp);
+#ifdef FLEXT_THREADS
+ mixmtx.Unlock();
+#endif
+ }
+ if(ret) {
+ const F nrm = 1./sqrt(cnt);
+#ifndef VASP_COMPACT
+ if(rds == 1)
+ for(i = 0; i < cnt; ++i)
+ rddt[i] = rdtmp[i]*nrm;
+ else
+#endif
+ for(i = 0; i < cnt; ++i)
+ rddt[i*rds] = rdtmp[i]*nrm;
+ }
+
+ if(rst) delete[] rstmp;
+ delete[] istmp;
+ if(rdt) delete[] rdtmp;
+ delete[] idtmp;
+
+ return ret;
+}
+
+///////////////////////////////////////////////////////////////
+
+//! Complex forward DFT radix-n (managing routine)
+static BL fft_fwd_complex_any(I cnt,F *rsdt,I _rss,F *isdt,I _iss,F *rddt,I _rds,F *iddt,I _ids)
+{
+ if(!rddt) rddt = rsdt,_rds = _rss;
+ if(!iddt) iddt = isdt,_ids = _iss;
+
+#ifdef VASP_CHN1
+ const I rds = 1,ids = 1,rss = 1,iss = 1;
+#else
+ const I rds = _rds,ids = _ids,rss = _rss,iss = _iss;
+#endif
+
+ const BL rst = rss != 1;
+ const BL ist = iss != 1;
+ const BL rdt = rsdt == rddt || rds != 1;
+ const BL idt = isdt == iddt || ids != 1;
+
+ F *rstmp,*istmp;
+ register I i;
+
+ if(rst) {
+ rstmp = new F[cnt];
+ // happens only if rss != 1, no optimization necessary
+ for(i = 0; i < cnt; ++i) rstmp[i] = rsdt[i*rss];
+ }
+ else
+ rstmp = rsdt;
+
+ if(ist) {
+ istmp = new F[cnt];
+ // happens only if iss != 1, no optimization necessary
+ for(i = 0; i < cnt; ++i) istmp[i] = isdt[i*iss];
+ }
+ else
+ istmp = isdt;
+
+ F *rdtmp = rdt?new F[cnt]:rddt;
+ F *idtmp = idt?new F[cnt]:iddt;
+
+ BL ret;
+ {
+#ifdef FLEXT_THREADS
+ mixmtx.Lock();
+#endif
+ // mixfft is not thread-safe
+ ret = mixfft(cnt,rstmp,istmp,rdtmp,idtmp);
+#ifdef FLEXT_THREADS
+ mixmtx.Unlock();
+#endif
+ }
+ if(ret) {
+ const F nrm = 1./sqrt(cnt);
+
+#ifdef VASP_COMPACT
+ for(i = 0; i < cnt; ++i) {
+ rddt[i*rds] = rdtmp[i]*nrm;
+ iddt[i*ids] = idtmp[i]*nrm;
+ }
+#else
+ if(rdt) {
+ if(rds != 1)
+ for(i = 0; i < cnt; ++i) rddt[i*rds] = rdtmp[i]*nrm;
+ else
+ for(i = 0; i < cnt; ++i) rddt[i] = rdtmp[i]*nrm;
+ }
+ else // ok, this branch is not absolutely necessary
+ if(rds != 1)
+ for(i = 0; i < cnt; ++i) rddt[i*rds] *= nrm;
+ else
+ for(i = 0; i < cnt; ++i) rddt[i] *= nrm;
+
+ if(idt) {
+ if(ids != 1)
+ for(i = 0; i < cnt; ++i) iddt[i*ids] = idtmp[i]*nrm;
+ else
+ for(i = 0; i < cnt; ++i) iddt[i] = idtmp[i]*nrm;
+ }
+ else // ok, this branch is not absolutely necessary
+ if(ids != 1)
+ for(i = 0; i < cnt; ++i) iddt[i*ids] *= nrm;
+ else
+ for(i = 0; i < cnt; ++i) iddt[i] *= nrm;
+#endif
+ }
+
+ if(rst) delete[] rstmp;
+ if(ist) delete[] istmp;
+ if(rdt) delete[] rdtmp;
+ if(idt) delete[] idtmp;
+
+ return ret;
+}
+
+//! Complex inverse DFT radix-n (managing routine)
+static BL fft_inv_complex_any(I cnt,F *rsdt,I _rss,F *isdt,I _iss,F *rddt,I _rds,F *iddt,I _ids)
+{
+ I i;
+
+ if(!rddt) rddt = rsdt,_rds = _rss;
+ if(!iddt) iddt = isdt,_ids = _iss;
+
+#ifdef VASP_CHN1
+ const I rds = 1,ids = 1,rss = 1,iss = 1;
+#else
+ const I rds = _rds,ids = _ids,rss = _rss,iss = _iss;
+#endif
+
+#ifndef VASP_COMPACT
+ if(iss == 1)
+ for(i = 0; i < cnt; ++i) isdt[i] = -isdt[i];
+ else
+#endif
+ for(i = 0; i < cnt; ++i) isdt[i*iss] *= -1;
+
+ BL ret = fft_fwd_complex_any(cnt,rsdt,rss,isdt,iss,rddt,rds,iddt,ids);
+
+ if(ret) {
+#ifndef VASP_COMPACT
+ if(ids == 1)
+ for(i = 0; i < cnt; ++i) iddt[i] = -iddt[i];
+ else
+#endif
+ for(i = 0; i < cnt; ++i) iddt[i*ids] *= -1;
+ }
+
+ // reverse minus on input
+ if(isdt != iddt) {
+#ifndef VASP_COMPACT
+ if(iss == 1)
+ for(i = 0; i < cnt; ++i) isdt[i] = -isdt[i];
+ else
+#endif
+ for(i = 0; i < cnt; ++i) isdt[i*iss] *= -1;
+ }
+ return ret;
+}
+
+///////////////////////////////////////////////////////////////
+
+bool fft_bidir_complex_radix2(int size,float *real,float *imag,int dir);
+
+//! Complex forward FFT radix-2 (managing routine)
+static BL fft_complex_radix2(I cnt,F *rsdt,I _rss,F *isdt,I _iss,F *rddt,I _rds,F *iddt,I _ids,I dir)
+{
+ if(!rddt) rddt = rsdt,_rds = _rss;
+ if(!iddt) iddt = isdt,_ids = _iss;
+
+#ifdef VASP_CHN1
+ const I rds = 1,ids = 1,rss = 1,iss = 1;
+#else
+ const I rds = _rds,ids = _ids,rss = _rss,iss = _iss;
+#endif
+
+ BL rt = false,it = false;
+ F *rtmp,*itmp;
+ register I i;
+
+ if(rss == 1)
+ rtmp = rsdt;
+ else {
+ if(rsdt == rddt || rds != 1)
+ rtmp = new F[cnt],rt = true;
+ else
+ rtmp = rddt;
+ for(i = 0; i < cnt; ++i) rtmp[i] = rsdt[i*rss];
+ }
+
+ if(iss == 1)
+ itmp = isdt;
+ else {
+ if(isdt == iddt || ids != 1)
+ itmp = new F[cnt],it = true;
+ else
+ itmp = iddt;
+ for(i = 0; i < cnt; ++i) itmp[i] = isdt[i*iss];
+ }
+
+ BL ret = fft_bidir_complex_radix2(cnt,rtmp,itmp,dir);
+
+ if(ret) {
+ const F nrm = 1./sqrt(cnt);
+
+#ifndef VASP_COMPACT
+ if(rtmp == rddt)
+ for(i = 0; i < cnt; ++i) rddt[i] *= nrm;
+ else if(rds == 1)
+ for(i = 0; i < cnt; ++i) rddt[i] = rtmp[i]*nrm;
+ else
+#endif
+ for(i = 0; i < cnt; ++i) rddt[i*rds] = rtmp[i]*nrm;
+
+#ifndef VASP_COMPACT
+ if(itmp == iddt)
+ for(i = 0; i < cnt; ++i) iddt[i] *= nrm;
+ else if(ids == 1)
+ for(i = 0; i < cnt; ++i) iddt[i] = itmp[i]*nrm;
+ else
+#endif
+ for(i = 0; i < cnt; ++i) iddt[i*ids] = itmp[i]*nrm;
+ }
+
+ if(rt) delete[] rtmp;
+ if(it) delete[] itmp;
+
+ return ret;
+}
+
+inline BL fft_fwd_complex_radix2(I cnt,F *rsdt,I _rss,F *isdt,I _iss,F *rddt,I _rds,F *iddt,I _ids)
+{
+ return fft_complex_radix2(cnt,rsdt,_rss,isdt,_iss,rddt,_rds,iddt,_ids,1);
+}
+
+inline BL fft_inv_complex_radix2(I cnt,F *rsdt,I _rss,F *isdt,I _iss,F *rddt,I _rds,F *iddt,I _ids)
+{
+ return fft_complex_radix2(cnt,rsdt,_rss,isdt,_iss,rddt,_rds,iddt,_ids,-1);
+}
+
+///////////////////////////////////////////////////////////////
+
+void realfft_split(float *data,int n);
+void irealfft_split(float *data,int n);
+
+// normalize and reverse imaginary part in-place
+static void nrmirev(float *data,int n,float fn)
+{
+ int i;
+ const I n2 = n/2,n4 = n2/2;
+ for(i = 0; i <= n2; ++i) data[i] *= fn;
+ for(i = 1; i < n4; ++i) {
+ register F tmp = data[n2+i];
+ data[n2+i] = data[n-i]*fn;
+ data[n-i] = tmp*fn;
+ }
+ if(n2%2 == 0) data[n2+n4] *= fn;
+}
+
+//! Real forward FFT radix-2 (managing routine)
+BL fft_fwd_real_radix2(I cnt,F *src,I _sstr,F *dst,I _dstr)
+{
+#ifdef VASP_CHN1
+ const I dstr = 1,sstr = 1;
+#else
+ const I dstr = _dstr,sstr = _sstr;
+#endif
+
+ register I i;
+ const I n2 = cnt/2;
+ const F fn = (F)(1./sqrt(cnt));
+ F *stmp;
+ if(!dst || src == dst) {
+ // in-place
+
+ if(sstr == 1)
+ stmp = src;
+ else {
+ stmp = new F[cnt];
+ for(i = 0; i < cnt; ++i) stmp[i] = src[i*sstr];
+ }
+
+ realfft_split(stmp,cnt);
+
+ if(sstr == 1) {
+ // src == stmp !!!
+ nrmirev(stmp,cnt,fn);
+ }
+ else {
+ for(i = 0; i <= n2; ++i) src[i*sstr] = stmp[i]*fn;
+ for(i = 1; i < n2; ++i) src[(n2+i)*sstr] = stmp[cnt-i]*fn;
+ delete[] stmp;
+ }
+ }
+ else {
+ // out of place
+
+ if(sstr == 1)
+ stmp = src;
+ else {
+ stmp = dstr == 1?dst:new F[cnt];
+ for(i = 0; i < cnt; ++i) stmp[i] = src[i*sstr];
+ }
+
+ realfft_split(stmp,cnt);
+
+ if(sstr == 1) {
+#ifdef VASP_COMPACT
+ if(dstr == 1) {
+ for(i = 0; i <= n2; ++i) dst[i] = stmp[i]*fn;
+ for(i = 1; i < n2; ++i) dst[n2+i] = stmp[cnt-i]*fn;
+ }
+ else
+#endif
+ {
+ for(i = 0; i <= n2; ++i) dst[i*dstr] = stmp[i]*fn;
+ for(i = 1; i < n2; ++i) dst[(n2+i)*dstr] = stmp[cnt-i]*fn;
+ }
+ }
+ else {
+ if(dstr == 1) {
+ // dst == stmp !!!
+ nrmirev(stmp,cnt,fn);
+ }
+ else {
+ for(i = 0; i <= n2; ++i) dst[i*dstr] = stmp[i]*fn;
+ for(i = 1; i < n2; ++i) dst[(n2+i)*dstr] = stmp[cnt-i]*fn;
+ delete[] dst;
+ }
+ }
+ }
+
+ return true;
+}
+
+//! Real inverse FFT radix-2 (managing routine)
+BL fft_inv_real_radix2(I cnt,F *src,I _sstr,F *dst,I _dstr)
+{
+#ifdef VASP_CHN1
+ const I dstr = 1,sstr = 1;
+#else
+ const I dstr = _dstr,sstr = _sstr;
+#endif
+
+ register I i;
+ const I n2 = cnt/2;
+ const F fn = (F)(1./sqrt(cnt));
+ F *stmp;
+ if(!dst || src == dst) {
+ // in-place
+
+ if(sstr == 1) {
+ stmp = src;
+ nrmirev(stmp,cnt,fn);
+ }
+ else {
+ stmp = new F[cnt];
+
+#ifdef VASP_COMPACT
+ if(sstr == 1) {
+ for(i = 0; i <= n2; ++i) stmp[i] = src[i]*fn;
+ for(i = 1; i < n2; ++i) stmp[cnt-i] = src[n2+i]*fn;
+ }
+ else
+#endif
+ {
+ for(i = 0; i <= n2; ++i) stmp[i] = src[i*sstr]*fn;
+ for(i = 1; i < n2; ++i) stmp[cnt-i] = src[(n2+i)*sstr]*fn;
+ }
+ }
+
+ irealfft_split(stmp,cnt);
+
+ if(sstr != 1) {
+ for(i = 0; i < cnt; ++i) src[i*sstr] = stmp[i];
+ delete[] stmp;
+ }
+ }
+ else {
+ // out of place
+
+ if(dstr == 1) {
+ stmp = dst;
+#ifdef VASP_COMPACT
+ if(sstr == 1) {
+ for(i = 0; i <= n2; ++i) stmp[i] = src[i]*fn;
+ for(i = 1; i < n2; ++i) stmp[cnt-i] = src[n2+i]*fn;
+ }
+ else
+#endif
+ {
+ for(i = 0; i <= n2; ++i) stmp[i] = src[i*sstr]*fn;
+ for(i = 1; i < n2; ++i) stmp[cnt-i] = src[(n2+i)*sstr]*fn;
+ }
+ }
+ else {
+ stmp = new F[cnt];
+ if(sstr == 1) {
+ // dst == stmp !!!
+ nrmirev(stmp,cnt,fn);
+ }
+ else {
+ for(i = 0; i <= n2; ++i) stmp[i] = src[i*sstr]*fn;
+ for(i = 1; i < n2; ++i) stmp[cnt-i] = src[(n2+i)*sstr]*fn;
+ }
+ }
+
+ irealfft_split(stmp,cnt);
+
+ if(dstr != 1) {
+ for(i = 0; i < cnt; ++i) dst[i*dstr] = stmp[i];
+ delete[] stmp;
+ }
+ }
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////
+
+//! Determine if size is radix-2
+static I radix2(I size)
+{
+ I i,j;
+ for(i = j = 1; j < size; i++,j <<= 1) (void)0;
+ return j == size?i:-1;
+}
+
+Vasp *VaspOp::m_rfft(OpParam &p,Vasp &src,Vasp *dst,BL inv)
+{
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ BL ok = true;
+ for(I i = 0; ok && i < vecs->Vecs(); ++i) {
+ VBuffer *s = vecs->Src(i);
+ VBuffer *d = vecs->Dst(i);
+ if(!d) d = s;
+
+ if(vecs->Frames() > 1)
+ if(radix2(vecs->Frames()) >= 1)
+ // radix-2
+ if(inv)
+ ok = fft_inv_real_radix2(vecs->Frames(),s->Pointer(),s->Channels(),d->Pointer(),d->Channels());
+ else
+ ok = fft_fwd_real_radix2(vecs->Frames(),s->Pointer(),s->Channels(),d->Pointer(),d->Channels());
+ else
+ // radix-n
+ if(inv)
+ ok = fft_inv_real_any(vecs->Frames(),s->Pointer(),s->Channels(),d->Pointer(),d->Channels());
+ else
+ ok = fft_fwd_real_any(vecs->Frames(),s->Pointer(),s->Channels(),d->Pointer(),d->Channels());
+ }
+ return ok?vecs->ResVasp():NULL;
+ }
+ else
+ return NULL;
+}
+
+Vasp *VaspOp::m_cfft(OpParam &p,Vasp &src,Vasp *dst,BL inv)
+{
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst,true);
+ if(vecs) {
+ BL ok = true;
+ for(I i = 0; ok && i < vecs->Pairs(); ++i) {
+ VBuffer *sre = vecs->ReSrc(i),*sim = vecs->ImSrc(i);
+ VBuffer *dre = vecs->ReDst(i),*dim = vecs->ImDst(i);
+ if(!dre) dre = sre;
+ if(!dim) dim = sim;
+
+ if(vecs->Frames() > 1)
+ if(radix2(vecs->Frames()) >= 1)
+ // radix-2
+ if(inv)
+ ok = fft_inv_complex_radix2(vecs->Frames(),sre->Pointer(),sre->Channels(),sim?sim->Pointer():NULL,sim?sim->Channels():0,dre->Pointer(),dre->Channels(),dim->Pointer(),dim->Channels());
+ else
+ ok = fft_fwd_complex_radix2(vecs->Frames(),sre->Pointer(),sre->Channels(),sim?sim->Pointer():NULL,sim?sim->Channels():0,dre->Pointer(),dre->Channels(),dim->Pointer(),dim->Channels());
+ else
+ // radix-n
+ if(inv)
+ ok = fft_inv_complex_any(vecs->Frames(),sre->Pointer(),sre->Channels(),sim?sim->Pointer():NULL,sim?sim->Channels():0,dre->Pointer(),dre->Channels(),dim->Pointer(),dim->Channels());
+ else
+ ok = fft_fwd_complex_any(vecs->Frames(),sre->Pointer(),sre->Channels(),sim?sim->Pointer():NULL,sim?sim->Channels():0,dre->Pointer(),dre->Channels(),dim->Pointer(),dim->Channels());
+ }
+ return ok?vecs->ResVasp():NULL;
+ }
+ else
+ return NULL;
+}
+
+VASP_UNARY("vasp.rfft",rfft,true,"Real DFT")
+VASP_UNARY("vasp.r!fft",rifft,true,"Real inverse DFT")
+VASP_UNARY("vasp.cfft",cfft,true,"Complex DFT")
+VASP_UNARY("vasp.c!fft",cifft,true,"Complex inverse DFT")
+
diff --git a/externals/grill/vasp/source/ops_dft.h b/externals/grill/vasp/source/ops_dft.h
new file mode 100644
index 00000000..f2f3fe40
--- /dev/null
+++ b/externals/grill/vasp/source/ops_dft.h
@@ -0,0 +1,25 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_DFT_H
+#define __VASP_OPS_DFT_H
+
+#include "opbase.h"
+
+// Fourier transforms
+
+namespace VaspOp {
+ Vasp *m_rfft(OpParam &p,Vasp &src,Vasp *dst = NULL,BL inv = false); // real forward
+ inline Vasp *m_rifft(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_rfft(p,src,dst,true); } // real inverse
+ Vasp *m_cfft(OpParam &p,Vasp &src,Vasp *dst = NULL,BL inv = false); // complex forward
+ inline Vasp *m_cifft(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cfft(p,src,dst,true); } // complex inverse
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_feature.cpp b/externals/grill/vasp/source/ops_feature.cpp
new file mode 100644
index 00000000..cb0f57c5
--- /dev/null
+++ b/externals/grill/vasp/source/ops_feature.cpp
@@ -0,0 +1,199 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_feature.h"
+#include "oploop.h"
+#include "util.h"
+#include <math.h>
+
+// --- find peaks
+
+BL higher(S a,S b) { return a > b; }
+BL lower(S a,S b) { return a < b; }
+
+/*! \brief Find peaks or valleys (depending on cmp function)
+ \param rep repetition count
+
+ \remark real peak search is mangled into complex domain
+
+ \todo how to treat <=, >=
+ \todo separate real and complex functionality
+*/
+
+static BL d_vlpk(OpParam &p,BL cmpf(S a,S b))
+{
+ I dpeaks = (I)(p.frames*p.peaks.density);
+ if(dpeaks < 1) dpeaks = 1;
+
+ I cnt;
+ do {
+ cnt = 0;
+
+ I i;
+ S *rdst = p.rddt,*rsrc = p.rsdt;
+ S *idst = p.iddt,*isrc = p.isdt;
+
+ if(!p.peaks.cx || !idst) idst = rdst,p.ids = p.rds;
+ if(!p.peaks.cx || !isrc) isrc = rsrc,p.iss = p.rss;
+
+ // preset sample values
+ S d1 = -1,d0 = -1,dn = -1;
+
+ // search first non-null sample
+ _D_LOOP(i,p.frames)
+ if((dn = sqabs(rsrc[i*p.rss],isrc[i*p.iss])) != 0)
+ break; // non-null -> break!
+ else
+ rdst[i*p.rds] = idst[i*p.ids] = 0; // copy null samples to dst
+ _E_LOOP
+
+ // i points to first non-null sample
+
+ _D_WHILE(i < p.frames)
+ // current samples -> previous samples
+ d1 = d0,d0 = dn;
+
+ // save current index
+ I ci = i;
+
+ // search next non-null sample
+ dn = -1;
+ while(++i < p.frames)
+ if((dn = sqabs(rsrc[i*p.rss],isrc[i*p.iss])) != 0) {
+ break; // non-null -> break!
+ }
+ else
+ rdst[i*p.rds] = idst[i*p.ids] = 0;
+
+ if((d1 < 0 || cmpf(d0,d1)) && (dn < 0 || cmpf(d0,dn))) {
+ // is peak/valley
+ rdst[ci*p.rds] = rsrc[ci*p.rss];
+ idst[ci*p.ids] = isrc[ci*p.iss];
+ ++cnt;
+ }
+ else
+ rdst[ci*p.rds] = idst[ci*p.ids] = 0;
+ _E_WHILE
+ } while(cnt > dpeaks);
+
+ p.peaks.density = p.frames?(R)cnt/p.frames:(cnt?1:0);
+ return true;
+}
+
+inline BL d_peaks(OpParam &p) { return d_vlpk(p,higher); }
+inline BL d_valleys(OpParam &p) { return d_vlpk(p,lower); }
+inline BL d_rpeaks(OpParam &p) { return d_vlpk(p,higher); }
+inline BL d_rvalleys(OpParam &p) { return d_vlpk(p,lower); }
+
+/*! \brief Finds peaks or valleys in a vasp.
+
+ \param arg argument list
+ \param arg.rep repetition count
+ \param dst destination vasp (NULL for in-place operation)
+ \param inv true for valley operation
+ \return normalized destination vasp
+*/
+Vasp *VaspOp::m_peaks(OpParam &p,Vasp &src,Vasp *dst,BL inv)
+{
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ p.peaks.cx = false;
+ ret = DoOp(vecs,inv?d_valleys:d_peaks,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+
+
+/*! \brief Finds peaks or valleys by radius in a complex vasp.
+
+ \param arg argument list
+ \param arg.rep repetition count
+ \param dst destination vasp (NULL for in-place operation)
+ \param inv true for valley operation
+ \return normalized destination vasp
+*/
+Vasp *VaspOp::m_rpeaks(OpParam &p,Vasp &src,Vasp *dst,BL inv)
+{
+ Vasp *ret = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ p.peaks.cx = true;
+ ret = DoOp(vecs,inv?d_rvalleys:d_rpeaks,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+
+class vasp_peaks:
+ public vasp_anyop
+{
+ FLEXT_HEADER(vasp_peaks,vasp_anyop)
+public:
+
+ vasp_peaks(I argc,t_atom *argv): vasp_anyop(argc,argv,VASP_ARG(),true,XletCode(xlet::tp_float,0)) {}
+
+ virtual Vasp *do_peaks(OpParam &p) { return VaspOp::m_peaks(p,ref,&dst); }
+
+ virtual Vasp *tx_work(const Argument &arg)
+ {
+ OpParam p(thisName(),0);
+
+ if(arg.IsList() && arg.GetList().Count() >= 1 && CanbeFloat(arg.GetList()[0])) {
+ p.peaks.density = GetAFloat(arg.GetList()[0]);
+ }
+ else {
+ if(!arg.IsNone()) post("%s - invalid density argument -> set to 1",p.opname);
+ p.peaks.density = 1;
+ }
+
+ Vasp *ret = do_peaks(p);
+ ToOutFloat(1,p.peaks.density);
+ return ret;
+ }
+};
+FLEXT_LIB_V("vasp, vasp.peaks",vasp_peaks)
+
+
+class vasp_valleys:
+ public vasp_peaks
+{
+ FLEXT_HEADER(vasp_valleys,vasp_peaks)
+public:
+ vasp_valleys(I argc,t_atom *argv): vasp_peaks(argc,argv) {}
+ virtual Vasp *do_peaks(OpParam &p) { return VaspOp::m_valleys(p,ref,&dst); }
+};
+FLEXT_LIB_V("vasp, vasp.valleys",vasp_valleys)
+
+
+class vasp_rpeaks:
+ public vasp_peaks
+{
+ FLEXT_HEADER(vasp_rpeaks,vasp_peaks)
+public:
+ vasp_rpeaks(I argc,t_atom *argv): vasp_peaks(argc,argv) {}
+ virtual Vasp *do_peaks(OpParam &p) { return VaspOp::m_rpeaks(p,ref,&dst); }
+};
+FLEXT_LIB_V("vasp, vasp.rpeaks",vasp_rpeaks)
+
+
+class vasp_rvalleys:
+ public vasp_peaks
+{
+ FLEXT_HEADER(vasp_rvalleys,vasp_peaks)
+public:
+ vasp_rvalleys(I argc,t_atom *argv): vasp_peaks(argc,argv) {}
+ virtual Vasp *do_peaks(OpParam &p) { return VaspOp::m_rvalleys(p,ref,&dst); }
+};
+FLEXT_LIB_V("vasp, vasp.rvalleys",vasp_rvalleys)
+
diff --git a/externals/grill/vasp/source/ops_feature.h b/externals/grill/vasp/source/ops_feature.h
new file mode 100644
index 00000000..05efc8b5
--- /dev/null
+++ b/externals/grill/vasp/source/ops_feature.h
@@ -0,0 +1,29 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_FEATURE_H
+#define __VASP_OPS_FEATURE_H
+
+#include "opbase.h"
+
+// Feature extraction functions
+
+namespace VecOp {
+}
+
+namespace VaspOp {
+ // extrema functions
+ Vasp *m_peaks(OpParam &p,Vasp &src,Vasp *dst = NULL,BL inv = false); //! find peaks
+ inline Vasp *m_valleys(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_peaks(p,src,dst,true); } //! find valleys
+ Vasp *m_rpeaks(OpParam &p,Vasp &src,Vasp *dst = NULL,BL inv = false); //! find radius peaks
+ inline Vasp *m_rvalleys(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_rpeaks(p,src,dst,true); } //! find radius valleys
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_flt.cpp b/externals/grill/vasp/source/ops_flt.cpp
new file mode 100644
index 00000000..64fb74ca
--- /dev/null
+++ b/externals/grill/vasp/source/ops_flt.cpp
@@ -0,0 +1,234 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_flt.h"
+#include "opdefs.h"
+#include "util.h"
+
+// --- highpass ---------------------------------------
+
+//! \todo handle carry
+//! \todo handle yield
+
+BL VecOp::d_fhp(OpParam &p)
+{
+ if(p.revdir)
+ post("%s - reversing operation direction due to overlap: opposite sample delay",p.opname);
+
+/*
+ R coef = (2*PI)/perln;
+ if(coef > 1) coef = 1;
+*/
+ const R coef = 1-p.flt.coef;
+ const I arep = abs(p.flt.rep);
+ S *src = p.rsdt,*dst = p.rddt;
+
+ for(I ti = 0; ti < arep; ++ti) {
+ register S v1;
+ I i;
+
+ // t+ direction
+ for(i = 0,v1 = 0; i < p.frames; ++i) {
+ register const S v0 = *src + coef*v1;
+ *dst = v0-v1;
+ v1 = v0;
+ src += p.rss,dst += p.rds;
+ }
+
+ if(p.flt.rep < 0) {
+ if(++ti == arep) break;
+
+ // t- direction
+ for(i = p.frames-1,v1 = 0; i >= 0; --i) {
+ src -= p.rss,dst -= p.rds;
+ register const S v0 = *src + coef*v1;
+ *dst = v0-v1;
+ v1 = v0;
+ }
+ }
+ }
+
+ return true;
+}
+
+
+// --- lowpass ---------------------------------------
+
+//! \todo handle carry
+//! \todo handle yield
+
+BL VecOp::d_flp(OpParam &p)
+{
+ if(p.revdir)
+ post("%s - reversing operation direction due to overlap: opposite sample delay",p.opname);
+
+/*
+ R coef = (2*PI)/perln;
+ if(coef > 1) coef = 1;
+*/
+
+ const R coef = p.flt.coef,feed = 1-coef;
+ const I arep = abs(p.flt.rep);
+
+ for(I ti = 0; ti < arep; ++ti) {
+ register S v1;
+ I i;
+ S *src = p.rsdt,*dst = p.rddt;
+
+ // t+ direction
+ for(i = 0,v1 = 0; i < p.frames; ++i) {
+ v1 = *dst = coef* *src + feed*v1;
+ src += p.rss,dst += p.rds;
+ }
+
+ if(p.flt.rep < 0) {
+ if(++ti == arep) break;
+
+ // t- direction
+ for(i = p.frames-1,v1 = 0; i >= 0; --i) {
+ src -= p.rss,dst -= p.rds;
+ v1 = *dst = coef* *src + feed*v1;
+ }
+ }
+ }
+
+ return true;
+}
+
+
+
+Vasp *VaspOp::m_fhp(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL hp)
+{
+ Vasp *ret = NULL;
+ if(arg.IsList() && arg.GetList().Count() >= 1) {
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ p.flt.coef = 2*PI/flext::GetAFloat(arg.GetList()[0]);
+ if(p.flt.coef > 1) p.flt.coef = 1;
+ p.flt.rep = arg.GetList().Count() >= 2?flext::GetAInt(arg.GetList()[1]):1;
+ p.flt.rep = -p.flt.rep; // fwd/bwd operation
+/*
+ if(p.SROvr()) {
+ p.SDRRev();
+ post("%s - reversing operation direction due to overlap: opposite sample delay",opnm);
+ }
+*/
+ ret = DoOp(vecs,hp?VecOp::d_fhp:VecOp::d_flp,p);
+
+ delete vecs;
+ }
+ }
+
+ return ret;
+}
+
+VASP_ANYOP("vasp.flp",flp,1,true,VASP_ARG(),"Passive low pass filter")
+VASP_ANYOP("vasp.fhp",fhp,1,true,VASP_ARG(),"Passive high pass filter")
+
+
+// --- integrate/differentiate
+
+/*! \brief Integration
+ \remark The delay of the result is +/- one sample, depending on the direction of the calculation
+
+ \todo different modes how to initialize first carry?
+ \todo repetition count
+*/
+BL VecOp::d_int(OpParam &p)
+{
+ if(p.revdir)
+ post("%s - reversed operation direction due to overlap: opposite sample delay",p.opname);
+
+ register S d = p.intdif.carry;
+ register I i;
+ _D_LOOP(i,p.frames)
+ *p.rddt = (d += *p.rsdt);
+ p.rsdt += p.rss,p.rddt += p.rds;
+ _E_LOOP
+ p.intdif.carry = d;
+ return true;
+}
+
+/*! \brief Differentiation
+ \remark The delay of the result is +/- one sample, depending on the direction of the calculation
+
+ \todo different modes how to initialize first carry?
+ \todo repetition count
+*/
+BL VecOp::d_dif(OpParam &p)
+{
+ if(p.revdir)
+ post("%s - reversed operation direction due to overlap: opposite sample delay",p.opname);
+
+ register S d = p.intdif.carry;
+ register I i;
+ _D_LOOP(i,p.frames)
+ register S d1 = *p.rsdt;
+ *p.rddt = d1-d,d = d1;
+ p.rsdt += p.rss,p.rddt += p.rds;
+ _E_LOOP
+ p.intdif.carry = d;
+ return true;
+}
+
+/*! \brief Does vasp integration/differentiation.
+
+ \param arg argument list
+ \param dst destination vasp (NULL for in-place operation)
+ \param inv true for differentiation
+ \return normalized destination vasp
+*/
+Vasp *VaspOp::m_int(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL inv)
+{
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ p.intdif.carry = 0,p.intdif.rep = 1;
+ if(arg.IsList() && arg.GetList().Count() >= 1) p.intdif.rep = flext::GetAInt(arg.GetList()[0]);
+
+ if(p.intdif.rep < 0) {
+ post("%s - invalid repetition count (%i) -> set to 1",p.opname,p.intdif.rep);
+ p.intdif.rep = 1;
+ }
+
+ ret = DoOp(vecs,inv?VecOp::d_dif:VecOp::d_int,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+VASP_ANYOP("vasp.int",int,0,true,VASP_ARG_I(1),"Integration")
+VASP_ANYOP("vasp.dif",dif,0,true,VASP_ARG_I(1),"Differentiation")
+
+
+
+/*! \brief Bashes denormals and NANs to zero
+
+ \param arg argument list
+ \param dst destination vasp (NULL for in-place operation)
+ \return normalized destination vasp
+*/
+template<class T> inline V f_fix(T &v,T a)
+{
+ if(a != a) // NAN
+ v = 0;
+ else {
+ // denormal bashing (doesn't propagate to the next stage)
+
+ static const F anti_denormal = 1e-18F;
+ a += anti_denormal;
+ a -= anti_denormal;
+ v = a;
+ }
+}
+
+BL VecOp::d_fix(OpParam &p) { D__run(f_fix<S>,p); }
+
+VASP_UNARY("vasp.fix",fix,true,"Bashes denormals/NANs to zero")
diff --git a/externals/grill/vasp/source/ops_flt.h b/externals/grill/vasp/source/ops_flt.h
new file mode 100644
index 00000000..0ab37111
--- /dev/null
+++ b/externals/grill/vasp/source/ops_flt.h
@@ -0,0 +1,41 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_FLT_H
+#define __VASP_OPS_FLT_H
+
+#include "opbase.h"
+
+// Filtering functions
+
+namespace VecOp {
+ BL d_flp(OpParam &p);
+ BL d_fhp(OpParam &p);
+
+ BL d_int(OpParam &p);
+ BL d_dif(OpParam &p);
+
+ BL d_fix(OpParam &p);
+}
+
+namespace VaspOp {
+ // passive filters
+ Vasp *m_fhp(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL,BL hp = true); //! hi pass
+ inline Vasp *m_flp(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_fhp(p,src,arg,dst,false); } //! lo pass
+
+ // int/dif functions
+ Vasp *m_int(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL,BL inv = false); //! integrate
+ inline Vasp *m_dif(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_int(p,src,arg,dst,true); } //! differentiate
+
+ // fix denormals/NANs
+ inline Vasp *m_fix(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_fix); } // ! NAN/denormal filter
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_gate.cpp b/externals/grill/vasp/source/ops_gate.cpp
new file mode 100644
index 00000000..f8f9b3e3
--- /dev/null
+++ b/externals/grill/vasp/source/ops_gate.cpp
@@ -0,0 +1,88 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_cmp.h"
+#include "opdefs.h"
+#include "util.h"
+#include <math.h>
+
+// --------------------------------------------------------------
+
+
+template<class T> V f_gate(T &rv,T ra,T rb) { rv = fabs(ra) >= rb?ra:0; }
+template<class T> V f_igate(T &rv,T ra,T rb) { rv = fabs(ra) <= rb?ra:0; }
+
+template<class T> V f_rgate(T &rv,T &iv,T ra,T ia,T rb,T)
+{
+ register const T _abs = sqabs(ra,ia);
+
+ if(_abs >= rb*rb) rv = ra,iv = ia;
+ else rv = iv = 0;
+}
+
+template<class T> V f_rigate(T &rv,T &iv,T ra,T ia,T rb,T)
+{
+ register const T _abs = sqabs(ra,ia);
+
+ if(_abs <= rb*rb) rv = ra,iv = ia;
+ else rv = iv = 0;
+}
+
+BL VecOp::d_gate(OpParam &p) { D__rbin(f_gate<S>,p); }
+BL VecOp::d_igate(OpParam &p) { d__rbin(f_igate<S>,p); }
+BL VecOp::d_rgate(OpParam &p) { d__cbin(f_rgate<S>,p); }
+BL VecOp::d_rigate(OpParam &p) { d__cbin(f_rigate<S>,p); }
+
+
+
+Vasp *VaspOp::m_gate(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst)
+{
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ if(arg.IsList() && arg.GetList().Count() >= 1 && flext::CanbeFloat(arg.GetList()[0]))
+ p.rbin.arg = flext::GetAFloat(arg.GetList()[0]);
+ else {
+ post("%s - argument is invalid -> set to 1",p.opname);
+ p.rbin.arg = 1;
+ }
+
+ ret = DoOp(vecs,VecOp::d_gate,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+
+Vasp *VaspOp::m_rgate(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst)
+{
+ Vasp *ret = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ if(arg.IsList() && arg.GetList().Count() >= 1 && flext::CanbeFloat(arg.GetList()[0]))
+ p.cbin.rarg = flext::GetAFloat(arg.GetList()[0]);
+ else {
+ post("%s - argument is invalid -> set to 1",p.opname);
+ p.cbin.rarg = 1;
+ }
+ p.cbin.iarg = 0; // not used anyway
+
+ ret = DoOp(vecs,VecOp::d_rgate,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+VASP_ANYOP("vasp.gate",gate,1,true,VASP_ARG_R(1),"set destination to 0 if source < argument")
+VASP_ANYOP("vasp.rgate",rgate,1,true,VASP_ARG_R(1),"complex radius gate: set destination to 0 if rad(complex source) < rad(complex argument)")
+
+
+// --------------------------------------------------------------
+
diff --git a/externals/grill/vasp/source/ops_gen.cpp b/externals/grill/vasp/source/ops_gen.cpp
new file mode 100644
index 00000000..eec81701
--- /dev/null
+++ b/externals/grill/vasp/source/ops_gen.cpp
@@ -0,0 +1,265 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_gen.h"
+#include "util.h"
+#include <math.h>
+
+// --- osc ---------------------------------------
+
+/*! \brief Generator for real (cos) oscillations
+*/
+BL VecOp::d_osc(OpParam &p)
+{
+ register R ph = p.gen.ph,phinc = p.gen.phinc;
+ if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc);
+
+ for(I i = 0; i < p.frames; ++i,ph += phinc,p.rddt += p.rds) *p.rddt = cos(ph);
+ return true;
+}
+
+/*! \brief multiplicative generator for real (cos) oscillations
+*/
+BL VecOp::d_mosc(OpParam &p)
+{
+ register R ph = p.gen.ph,phinc = p.gen.phinc;
+ if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc);
+
+ for(I i = 0; i < p.frames; ++i,ph += phinc,p.rsdt += p.rss,p.rddt += p.rds)
+ *p.rddt = *p.rsdt * cos(ph);
+ return true;
+}
+
+/*! \brief Generator for real (cos) oscillations.
+
+ \param arg argument list
+ \param arg.perlen Period length (in samples)
+ \param arg.stph Starting phase
+ \param mul true for multiplication to exisiting date
+ \return normalized destination vasp
+
+ \todo Replace period length by frequency specification
+*/
+Vasp *VaspOp::m_osc(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL mul)
+{
+ Vasp *ret = NULL;
+ if(arg.IsList() && arg.GetList().Count() >= 1) {
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ // period length
+ p.gen.phinc = 2*PI/flext::GetAFloat(arg.GetList()[0]);
+ // starting phase
+ p.gen.ph = arg.GetList().Count() >= 2?flext::GetAFloat(arg.GetList()[1]):0;
+
+ ret = DoOp(vecs,mul?VecOp::d_mosc:VecOp::d_osc,p);
+ delete vecs;
+ }
+ }
+ else
+ post("%s - no arguments: no operation",p.opName());
+
+ return ret;
+}
+
+
+/*! \brief Generator for complex oscillations.
+*/
+BL VecOp::d_cosc(OpParam &p)
+{
+ register R ph = p.gen.ph,phinc = p.gen.phinc;
+ if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc);
+
+ for(; p.frames--; ph += phinc,p.rddt += p.rds,p.iddt += p.ids)
+ *p.rddt = cos(ph),*p.iddt = sin(ph);
+ return true;
+}
+
+/*! \brief Multiplicative generator for complex oscillations.
+*/
+BL VecOp::d_mcosc(OpParam &p)
+{
+ register R ph = p.gen.ph,phinc = p.gen.phinc;
+ if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc);
+
+ for(; p.frames--; ph += phinc,p.rsdt += p.rss,p.isdt += p.iss,p.rddt += p.rds,p.iddt += p.ids) {
+ R zre = cos(ph),zim = sin(ph);
+
+ register const R r = *p.rsdt * zre - *p.isdt * zim;
+ *p.iddt = *p.isdt * zre + *p.rsdt * zim;
+ *p.rddt = r;
+ }
+ return true;
+}
+
+/*! \brief Generator for complex (cos+i sin) oscillations.
+
+ \param arg argument list
+ \param arg.perlen Period length (in samples)
+ \param arg.stph Starting phase
+ \param mul true for multiplication to exisiting date
+ \return normalized destination vasp
+
+ \todo Replace period length by frequency specification
+*/
+Vasp *VaspOp::m_cosc(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL mul)
+{
+ Vasp *ret = NULL;
+ if(arg.IsList() && arg.GetList().Count() >= 1) {
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ // period length
+ p.gen.phinc = 2*PI/flext::GetAFloat(arg.GetList()[0]);
+ // starting phase
+ p.gen.ph = arg.GetList().Count() >= 2?flext::GetAFloat(arg.GetList()[1]):0;
+
+ ret = DoOp(vecs,mul?VecOp::d_mcosc:VecOp::d_cosc,p);
+ delete vecs;
+ }
+ }
+ else
+ post("%s - no arguments: no operation",p.opName());
+
+ return ret;
+}
+
+
+VASP_ANYOP("vasp.osc",osc,1,false,VASP_ARG(),"Calculates a cosine wave")
+VASP_ANYOP("vasp.*osc",mosc,1,true,VASP_ARG(),"Multiplies with a cosine wave")
+VASP_ANYOP("vasp.cosc",cosc,1,false,VASP_ARG(),"Calculates a complex oscillation (cos + i sin)")
+VASP_ANYOP("vasp.*cosc",mcosc,1,true,VASP_ARG(),"Multiplies with a complex oscillation (cos + i sin)")
+
+// --- phasor ---------------------------------------
+
+// ! look up Höldrich's pd phasor code
+
+/*! \brief Generator for saw wave oscillations.
+*/
+BL VecOp::d_phasor(OpParam &p)
+{
+ register R ph = p.gen.ph,phinc = p.gen.phinc;
+ if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc);
+
+ for(; p.frames--; ph += phinc,p.rddt += p.rds) *p.rddt = fmod(ph,1.F);
+ return true;
+}
+
+/*! \brief Multiplicative generator for saw wave oscillations.
+*/
+BL VecOp::d_mphasor(OpParam &p)
+{
+ register R ph = p.gen.ph,phinc = p.gen.phinc;
+ if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc);
+
+ for(; p.frames--; ph += phinc,p.rddt += p.rds,p.rsdt += p.rss) *p.rddt = *p.rsdt * fmod(ph,1.F);
+ return true;
+}
+
+/*! \brief Generator for sawtooth oscillations.
+
+ \param arg argument list
+ \param arg.perlen Period length (in samples)
+ \param arg.stph Starting phase
+ \param mul true for multiplication to exisiting date
+ \return normalized destination vasp
+
+ \todo Replace period length by frequency specification
+*/
+Vasp *VaspOp::m_phasor(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL mul)
+{
+ Vasp *ret = NULL;
+ if(arg.IsList() && arg.GetList().Count() >= 1) {
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ // period length
+ p.gen.phinc = 1./flext::GetAFloat(arg.GetList()[0]);
+ // starting phase
+ p.gen.ph = arg.GetList().Count() >= 2?flext::GetAFloat(arg.GetList()[1]):0;
+
+ ret = DoOp(vecs,mul?VecOp::d_mphasor:VecOp::d_phasor,p);
+ delete vecs;
+ }
+ }
+ else
+ post("%s - no arguments: no operation",p.opName());
+
+ return ret;
+}
+
+
+VASP_ANYOP("vasp.phasor",phasor,1,false,VASP_ARG(),"Calculates a sawtooth wave")
+VASP_ANYOP("vasp.*phasor",mphasor,1,true,VASP_ARG(),"Multiplies with a sawtooth wave")
+
+// --- noise --------------------------------
+
+static F rnd()
+{
+ static I val = 307*1319;
+ F ret = ((F)((val&0x7fffffff)-0x40000000))*(F)(1.0/0x40000000);
+ val = val * 435898247 + 382842987;
+ return ret;
+}
+
+/*! \brief Vector function for pseudorandom noise.
+*/
+BL VecOp::d_noise(OpParam &p)
+{
+ for(; p.frames--; p.rddt += p.rds) *p.rddt = rnd();
+ return true;
+}
+
+
+/*! \brief Generator for real valued noise.
+
+ \return normalized destination vasp
+*/
+Vasp *VaspOp::m_noise(OpParam &p,Vasp &src,Vasp *dst)
+{
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ ret = DoOp(vecs,VecOp::d_noise,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+/*! \brief Vector function for pseudorandom complex noise.
+*/
+BL VecOp::d_cnoise(OpParam &p)
+{
+ for(; p.frames--; p.rddt += p.rds,p.iddt += p.ids) {
+ R amp = rnd();
+ R arg = rnd()*(2.*PI);
+ *p.rddt = amp*cos(arg);
+ *p.iddt = amp*sin(arg);
+ }
+ return true;
+}
+
+/*! \brief Generator for complex noise (complex abs, complex arg).
+
+ \return normalized destination vasp
+
+ \todo Replace period length by frequency specification
+*/
+Vasp *VaspOp::m_cnoise(OpParam &p,Vasp &src,Vasp *dst)
+{
+ Vasp *ret = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ ret = DoOp(vecs,VecOp::d_cnoise,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+VASP_UNARY("vasp.noise",noise,false,"Fills the vectors with white noise")
+VASP_UNARY("vasp.cnoise",cnoise,false,"Fills the vectors with complex white noise (radius and angle are random)")
+
diff --git a/externals/grill/vasp/source/ops_gen.h b/externals/grill/vasp/source/ops_gen.h
new file mode 100644
index 00000000..9d1902d5
--- /dev/null
+++ b/externals/grill/vasp/source/ops_gen.h
@@ -0,0 +1,40 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_GEN_H
+#define __VASP_OPS_GEN_H
+
+#include "opbase.h"
+
+// Generator functions
+
+namespace VecOp {
+ BL d_osc(OpParam &p);
+ BL d_cosc(OpParam &p);
+ BL d_mosc(OpParam &p);
+ BL d_mcosc(OpParam &p);
+ BL d_phasor(OpParam &p);
+ BL d_mphasor(OpParam &p);
+ BL d_noise(OpParam &p);
+ BL d_cnoise(OpParam &p);
+}
+
+namespace VaspOp {
+ Vasp *m_osc(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL mul = false); // real osc
+ inline Vasp *m_mosc(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_osc(p,src,arg,dst,true); } // * real osc
+ Vasp *m_cosc(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL mul = false); // complex osc (phase rotates)
+ inline Vasp *m_mcosc(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_cosc(p,src,arg,dst,true); } // * complex osc (phase rotates)
+ Vasp *m_phasor(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL mul = false); // phasor
+ inline Vasp *m_mphasor(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_phasor(p,src,arg,dst,true); } // * phasor
+ Vasp *m_noise(OpParam &p,Vasp &src,Vasp *dst); // real noise
+ Vasp *m_cnoise(OpParam &p,Vasp &src,Vasp *dst); // complex noise (arg and abs random)
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_qminmax.cpp b/externals/grill/vasp/source/ops_qminmax.cpp
new file mode 100644
index 00000000..05c0e8b5
--- /dev/null
+++ b/externals/grill/vasp/source/ops_qminmax.cpp
@@ -0,0 +1,276 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_cmp.h"
+#include "opdefs.h"
+#include "util.h"
+#include <math.h>
+
+// --------------------------------------------------------------
+
+template<class T> V f_maxq(T &,T ra,OpParam &p)
+{
+ if(ra > p.norm.minmax) p.norm.minmax = ra;
+}
+
+template<class T> V f_minq(T &,T ra,OpParam &p)
+{
+ if(ra < p.norm.minmax) p.norm.minmax = ra;
+}
+
+template<class T> V f_amaxq(T &,T ra,OpParam &p)
+{
+ register T s = fabs(ra);
+ if(s > p.norm.minmax) p.norm.minmax = s;
+}
+
+template<class T> V f_aminq(T &,T ra,OpParam &p)
+{
+ register T s = fabs(ra);
+ if(s < p.norm.minmax) p.norm.minmax = s;
+}
+
+template<class T> V f_rmaxq(T &,T &,T ra,T ia,OpParam &p)
+{
+ register T s = sqabs(ra,ia);
+ if(s > p.norm.minmax) p.norm.minmax = s;
+}
+
+template<class T> V f_rminq(T &,T &,T ra,T ia,OpParam &p)
+{
+ register T s = sqabs(ra,ia);
+ if(s < p.norm.minmax) p.norm.minmax = s;
+}
+
+BL VecOp::d_minq(OpParam &p) { D__rop(f_minq<S>,p); }
+BL VecOp::d_maxq(OpParam &p) { D__rop(f_maxq<S>,p); }
+BL VecOp::d_aminq(OpParam &p) { D__rop(f_aminq<S>,p); }
+BL VecOp::d_amaxq(OpParam &p) { D__rop(f_amaxq<S>,p); }
+BL VecOp::d_rminq(OpParam &p) { d__cop(f_rminq<S>,p); }
+BL VecOp::d_rmaxq(OpParam &p) { d__cop(f_rmaxq<S>,p); }
+
+// --------------------------------------------------------------
+
+
+/*! \class vasp_qmin
+ \remark \b vasp.min?
+ \brief Get minimum sample value
+ \since 0.0.2
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet float - minimum sample value
+
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+ \remark Returns 0 for a vasp with 0 frames
+*/
+class vasp_qmin:
+ public vasp_unop
+{
+ FLEXT_HEADER(vasp_qmin,vasp_unop)
+
+public:
+ vasp_qmin(): vasp_unop(true,XletCode(xlet::tp_float,0)) {}
+
+ virtual Vasp *do_opt(OpParam &p)
+ {
+ p.norm.minmax = BIG;
+ Vasp *ret = VaspOp::m_qmin(p,ref);
+ if(p.norm.minmax == BIG) p.norm.minmax = 0;
+ return ret;
+ }
+
+ virtual Vasp *tx_work()
+ {
+ OpParam p(thisName(),0);
+ Vasp *ret = do_opt(p);
+ ToOutFloat(1,p.norm.minmax);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Get a vasp's minimum sample value",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.min?",vasp_qmin)
+
+
+/*! \class vasp_qamin
+ \remark \b vasp.amin?
+ \brief Get minimum absolute sample value
+ \since 0.0.2
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet float - minimum sample value
+
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+ \remark Returns 0 for a vasp with 0 frames
+*/
+class vasp_qamin:
+ public vasp_qmin
+{
+ FLEXT_HEADER(vasp_qamin,vasp_qmin)
+public:
+ virtual Vasp *do_opt(OpParam &p)
+ {
+ p.norm.minmax = BIG;
+ Vasp *ret = VaspOp::m_qamin(p,ref);
+ if(p.norm.minmax == BIG) p.norm.minmax = 0;
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Get a vasp's minimum absolute sample value",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.amin?",vasp_qamin)
+
+
+
+/*! \class vasp_qmax
+ \remark \b vasp.max?
+ \brief Get maximum sample value
+ \since 0.0.2
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet float - minimum sample value
+
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+ \remark Returns 0 for a vasp with 0 frames
+*/
+class vasp_qmax:
+ public vasp_qmin
+{
+ FLEXT_HEADER(vasp_qmax,vasp_qmin)
+public:
+ virtual Vasp *do_opt(OpParam &p)
+ {
+ p.norm.minmax = -BIG;
+ Vasp *ret = VaspOp::m_qmax(p,ref);
+ if(p.norm.minmax == -BIG) p.norm.minmax = 0;
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Get a vasp's maximum sample value",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.max?",vasp_qmax)
+
+
+
+/*! \class vasp_qamax
+ \remark \b vasp.amax?
+ \brief Get minimum absolute sample value
+ \since 0.0.2
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet float - minimum sample value
+
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+ \remark Returns 0 for a vasp with 0 frames
+*/
+class vasp_qamax:
+ public vasp_qmax
+{
+ FLEXT_HEADER(vasp_qamax,vasp_qmax)
+public:
+ virtual Vasp *do_opt(OpParam &p)
+ {
+ p.norm.minmax = 0;
+ return VaspOp::m_qamax(p,ref);
+ }
+
+ virtual V m_help() { post("%s - Get a vasp's maximum absolute sample value",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.amax?",vasp_qamax)
+
+
+
+
+/*! \class vasp_qrmin
+ \remark \b vasp.rmin?
+ \brief Get minimum complex radius of samples
+ \since 0.0.2
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet float - minimum sample value
+
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+ \remark Returns 0 for a vasp with 0 frames
+*/
+class vasp_qrmin:
+ public vasp_unop
+{
+ FLEXT_HEADER(vasp_qrmin,vasp_unop)
+
+public:
+ vasp_qrmin(): vasp_unop(true,XletCode(xlet::tp_float,0)) {}
+
+ virtual Vasp *do_opt(OpParam &p)
+ {
+ p.norm.minmax = BIG;
+ Vasp *ret = VaspOp::m_qrmin(p,ref);
+ if(p.norm.minmax == BIG) p.norm.minmax = 0;
+ return ret;
+ }
+
+ virtual Vasp *tx_work()
+ {
+ OpParam p(thisName(),0);
+ Vasp *ret = do_opt(p);
+ ToOutFloat(1,sqrt(p.norm.minmax));
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Get a vasp's minimum complex radius",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.rmin?",vasp_qrmin)
+
+
+
+/*! \class vasp_qrmax
+ \remark \b vasp.rmax?
+ \brief Get maximum complex radius of samples
+ \since 0.0.2
+ \param inlet vasp - is stored and output triggered
+ \param inlet bang - triggers output
+ \param inlet set - vasp to be stored
+ \retval outlet float - minimum sample value
+
+ \todo Should we provide a cmdln default vasp?
+ \todo Should we inhibit output for invalid vasps?
+ \remark Returns 0 for a vasp with 0 frames
+*/
+class vasp_qrmax:
+ public vasp_qrmin
+{
+ FLEXT_HEADER(vasp_qrmax,vasp_qrmin)
+public:
+ virtual Vasp *do_opt(OpParam &p)
+ {
+ p.norm.minmax = 0;
+ return VaspOp::m_qrmax(p,ref);
+ }
+
+ virtual V m_help() { post("%s - Get a vasp's maximum complex radius",thisName()); }
+};
+
+FLEXT_LIB("vasp, vasp.rmax?",vasp_qrmax)
+
+
diff --git a/externals/grill/vasp/source/ops_rearr.cpp b/externals/grill/vasp/source/ops_rearr.cpp
new file mode 100644
index 00000000..2aa69aa2
--- /dev/null
+++ b/externals/grill/vasp/source/ops_rearr.cpp
@@ -0,0 +1,243 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_rearr.h"
+#include "oploop.h"
+#include "oppermute.h"
+
+/*! \brief vasp shift or rotation
+ \todo units for shift
+*/
+Vasp *VaspOp::m_shift(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL shift,BL symm)
+{
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ if(arg.IsList() && arg.GetList().Count() >= 1 && flext::CanbeFloat(arg.GetList()[0])) {
+ // shift length
+ p.sh.sh = flext::GetAFloat(arg.GetList()[0]);
+ }
+ else {
+ post("%s - invalid argument -> set to 0",p.opname);
+ p.sh.sh = 0;
+ }
+
+ ret = DoOp(vecs,shift?VecOp::d_shift:VecOp::d_rot,p,symm);
+ delete vecs;
+ }
+
+ return ret;
+}
+
+
+/*! \brief shift buffer
+*/
+BL VecOp::d_shift(OpParam &p)
+{
+ if(p.ovrlap) {
+ post("%s - cannot operate on overlapped vectors",p.opname);
+ return false;
+ }
+
+ I ish = (I)p.sh.sh;
+ if(p.sh.sh != ish) { // integer shift
+ // requires interpolation
+ post("non-integer shift not implemented - truncating to integer");
+ p.sh.sh = ish;
+ }
+
+ p.SkipOddMiddle();
+
+ if(p.symm == 1) ish = -ish;
+
+ I aish = abs(ish);
+ if(aish > p.frames) aish = ish = p.frames;
+
+ I i,cnt = p.frames-aish;
+ const S *sd = p.rsdt-ish*p.rss;
+ S *dd = p.rddt;
+
+ if(ish > 0) {
+ sd += (p.frames-1)*p.rss,dd += (p.frames-1)*p.rds;
+ p.rss = -p.rss,p.rds = -p.rds;
+ }
+
+ // do shift
+ if(cnt > 0) {
+ if(p.rss == 1 && p.rds == 1)
+ _D_LOOP(i,cnt) *(dd++) = *(sd++); _E_LOOP
+ else if(p.rss == -1 && p.rds == -1)
+ _D_LOOP(i,cnt) *(dd--) = *(sd--); _E_LOOP
+ else
+ _D_LOOP(i,cnt) *dd = *sd,sd += p.rss,dd += p.rds; _E_LOOP
+ }
+
+ // fill spaces
+ if(p.sh.fill) {
+ S vfill = p.sh.fill == 1?0:dd[-p.rds];
+ I aish = abs(ish);
+ if(p.rds == 1)
+ _D_LOOP(i,aish) *(dd++) = vfill; _E_LOOP
+ else if(p.rds == -1)
+ _D_LOOP(i,aish) *(dd--) = vfill; _E_LOOP
+ else
+ _D_LOOP(i,aish) *dd = vfill,dd += p.rds; _E_LOOP
+ }
+
+ return true;
+}
+
+
+class vasp_shift:
+ public vasp_anyop
+{
+ FLEXT_HEADER(vasp_shift,vasp_anyop)
+public:
+
+ vasp_shift(I argc,t_atom *argv):
+ vasp_anyop(argc,argv,VASP_ARG_I(0),true),
+ fill(xsf_zero)
+ {
+ FLEXT_ADDMETHOD_E(0,"fill",m_fill);
+ }
+
+ enum xs_fill {
+ xsf__ = -1, // don't change
+ xsf_none = 0,xsf_zero,xsf_edge
+ };
+
+ V m_fill(xs_fill f) { fill = f; }
+
+ virtual Vasp *do_shift(OpParam &p) { return VaspOp::m_shift(p,ref,arg,&dst); }
+
+ virtual Vasp *tx_work(const Argument &arg)
+ {
+ OpParam p(thisName(),0);
+ p.sh.fill = (I)fill;
+
+ Vasp *ret = do_shift(p);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Shifts buffer data",thisName()); }
+
+protected:
+ xs_fill fill;
+
+private:
+ FLEXT_CALLBACK_1(m_fill,xs_fill)
+};
+FLEXT_LIB_V("vasp, vasp.shift",vasp_shift)
+
+
+class vasp_xshift:
+ public vasp_shift
+{
+ FLEXT_HEADER(vasp_xshift,vasp_shift)
+public:
+
+ vasp_xshift(I argc,t_atom *argv): vasp_shift(argc,argv) {}
+
+ virtual Vasp *do_shift(OpParam &p) { return VaspOp::m_xshift(p,ref,arg,&dst); }
+
+ virtual V m_help() { post("%s - Shifts buffer data symmetrically (in two halves)",thisName()); }
+};
+FLEXT_LIB_V("vasp, vasp.xshift",vasp_xshift)
+
+
+inline int rotation(int ij, int n,OpParam &p) { return (ij+n-p.sh.ish)%n; }
+
+#define ROTBLOCK 1024
+
+/*! \brief rotate buffer
+ \todo implement temporary storage for faster transformation (use abstract permute algorithm)
+*/
+BL VecOp::d_rot(OpParam &p)
+{
+ if(p.ovrlap) {
+ post("%s - cannot operate on overlapped vectors",p.opname);
+ return false;
+ }
+
+ p.sh.ish = (I)p.sh.sh;
+ if(p.sh.sh != p.sh.ish) {
+ // requires interpolation
+ post("%s - non-integer shift not implemented - truncating to integer",p.opname);
+ }
+
+ p.SkipOddMiddle();
+
+ p.sh.ish = p.sh.ish%p.frames;
+ if(p.symm == 1) p.sh.ish = -p.sh.ish;
+
+/*
+ if(p.frames >= ROTBLOCK) {
+ //use temporary space;
+ S *tmp = new S[ROTBLOCK];
+
+ delete[] tmp;
+ }
+ else
+*/
+ PERMUTATION(S,1,p,rotation);
+ return true;
+}
+
+VASP_ANYOP("vasp.rot",rot,0,true,VASP_ARG_I(0),"Rotates buffer data")
+VASP_ANYOP("vasp.xrot",xrot,0,true,VASP_ARG_I(0),"Rotates buffer data symmetrically (in two halves)")
+
+
+/*! \brief mirror buffer
+*/
+BL VecOp::d_mirr(OpParam &p)
+{
+ if(p.ovrlap) {
+ post("%s - cannot operate on overlapped vectors",p.opname);
+ return false;
+ }
+
+ p.SkipOddMiddle();
+
+ if(p.rsdt == p.rddt) {
+ S *dl = p.rddt,*du = p.rddt+(p.frames-1)*p.rds;
+ _D_WHILE(dl < du)
+ register S t;
+ t = *dl; *dl = *du; *du = t;
+ dl += p.rds,du -= p.rds;
+ _E_WHILE
+ }
+ else {
+ I i;
+ const S *ds = p.rsdt;
+ S *dd = p.rddt+(p.frames-1)*p.rds;
+ _D_LOOP(i,p.frames)
+ *dd = *ds,ds += p.rss,dd -= p.rds;
+ _E_LOOP
+ }
+ return true;
+}
+
+/*! \brief vasp mirror
+*/
+Vasp *VaspOp::m_mirr(OpParam &p,Vasp &src,Vasp *dst,BL symm)
+{
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ ret = DoOp(vecs,VecOp::d_mirr,p,symm);
+ delete vecs;
+ }
+ return ret;
+}
+
+VASP_UNARY("vasp.mirr",mirr,true,"Mirrors buffer data")
+VASP_UNARY("vasp.xmirr",xmirr,true,"Mirrors buffer data symmetrically (in two halves)")
+
+
diff --git a/externals/grill/vasp/source/ops_rearr.h b/externals/grill/vasp/source/ops_rearr.h
new file mode 100644
index 00000000..d1c6ce73
--- /dev/null
+++ b/externals/grill/vasp/source/ops_rearr.h
@@ -0,0 +1,34 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_REARR_H
+#define __VASP_OPS_REARR_H
+
+#include "opbase.h"
+
+// Rearrange buffer
+
+namespace VecOp {
+ BL d_shift(OpParam &p);
+ BL d_rot(OpParam &p);
+ BL d_mirr(OpParam &p);
+}
+
+namespace VaspOp {
+ Vasp *m_shift(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL,BL sh = true,BL symm = false); // shift buffer
+ inline Vasp *m_xshift(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_shift(p,src,arg,dst,true,true); } // shift buffer (symmetrically)
+ inline Vasp *m_rot(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_shift(p,src,arg,dst,false,false); } // rotate buffer
+ inline Vasp *m_xrot(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_shift(p,src,arg,dst,false,true); } // rotate buffer (symmetrically)
+ Vasp *m_mirr(OpParam &p,Vasp &src,Vasp *dst = NULL,BL symm = false); //! mirror buffer
+ inline Vasp *m_xmirr(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_mirr(p,src,dst,true); } //! mirror buffer (symmetrically)
+
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_resmp.cpp b/externals/grill/vasp/source/ops_resmp.cpp
new file mode 100644
index 00000000..fbeabc07
--- /dev/null
+++ b/externals/grill/vasp/source/ops_resmp.cpp
@@ -0,0 +1,266 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+/*! \file vasp__resmp.cpp
+ \brief Routines for resampling
+*/
+
+#include "ops_resmp.h"
+
+
+// --- resample ---------------------
+
+/*! \brief Subroutine for resampling.
+
+ \param cnt frame count
+ \param src source data
+ \param sstr source data stride
+ \param dst destination data
+ \param dstr destination data stride
+ \param factor resampling factor
+ \param center resampling center (this will remain untouched by the transformation)
+ \param mode interpolation mode
+ \return true on success
+
+ \todo implement averaging interpolation methods
+ \todo check for operation direction!
+ \todo check for src/dst overlap
+ \todo support different frame lengths for src and dst
+*/
+
+static V do_tilt(OpParam &p)
+{
+ I mode = p.tilt.mode;
+ if(mode == 0&& (p.tilt.factor < 0 || p.tilt.center < 0 || p.tilt.factor >= p.frames)) mode = 1;
+
+ const R center = p.tilt.center;
+ const I icenter = (I)center;
+ S fll,flr;
+ if(p.tilt.fill)
+ fll = p.rsdt[0],flr = p.rsdt[p.frames-1];
+ else
+ fll = flr = 0;
+
+ if(mode >= 1 && mode <= 3) {
+ S *tmp;
+ I rss;
+ if(p.rsdt == p.rddt) {
+ tmp = new S[p.frames],rss = 1;
+ for(int i = 0; i < p.frames; ++i) tmp[i] = p.rsdt[i*p.rss];
+ }
+ else tmp = p.rsdt,rss = p.rss;
+
+ switch(mode) {
+ case 1: {
+ // no interpolation
+ for(int i = 0; i < p.frames; ++i) {
+ I pi = (I)(center+(i-center)*p.tilt.factor);
+ p.rddt[i*p.rds] = pi >= 0?(pi < p.frames?tmp[pi*rss]:flr):fll;
+ }
+ break;
+ }
+ case 2: {
+ // linear interpolation
+ for(int i = 0; i < p.frames; ++i) {
+ R pr = center+(i-center)*p.tilt.factor,v;
+ I ip = (I)pr;
+ if(ip >= 0)
+ if(ip < p.frames-1) {
+ R r = pr-ip;
+ v = (1-r)*tmp[ip*rss]+r*tmp[(ip+1)*rss];
+ }
+ else
+ v = ip == p.frames-1?tmp[ip*rss]:flr;
+ else
+ v = fll;
+ p.rddt[i*p.rds] = v;
+ }
+ break;
+ }
+ case 3: {
+ // 4-point interpolation
+ R f[4];
+ for(int i = 0; i < p.frames; ++i) {
+ R pr = center+(i-center)*p.tilt.factor;
+ const I ip = (I)pr;
+ const S *t = tmp+ip*rss;
+ const R r = pr-ip;
+ if(ip >= 1)
+ if(ip < p.frames-2) {
+ f[0] = t[-rss];
+ f[1] = t[0];
+ f[2] = t[rss];
+ f[3] = t[rss*2];
+ }
+ else {
+ f[0] = ip < p.frames+1?t[-rss]:flr;
+ f[1] = ip < p.frames?t[0]:flr;
+ f[2] = ip < p.frames-1?t[rss]:flr;
+ f[3] = flr;
+ }
+ else {
+ f[0] = fll;
+ f[1] = ip >= 0?t[0]:fll;
+ f[2] = ip >= -1?t[rss]:fll;
+ f[3] = ip >= -2?t[rss*2]:fll;
+ }
+
+ const R cmb = f[2]-f[1];
+ p.rddt[i*p.rds] = f[1]+r*(cmb-0.5*(r-1.)*((f[0]-f[3]+3.*cmb)*r+(f[1]-f[0]-cmb)));
+ }
+ break;
+ }
+ }
+
+ if(p.rsdt == p.rddt) delete[] tmp;
+ }
+ else {
+ const R rem = center-icenter; // 0 <= rem < 1
+ // quick and dirty... but in-place!
+
+ if(p.tilt.factor > 1) {
+ I i;
+ for(i = 0; i <= icenter; ++i) {
+ I sp = (I)(center-(i+rem)*p.tilt.factor);
+ p.rddt[(icenter-i)*p.rds] = sp >= 0?(sp < p.frames?p.rsdt[sp*p.rss]:flr):fll;
+ }
+ for(i = 1; i < p.frames-icenter; ++i) {
+ I sp = (I)(center+(i-rem)*p.tilt.factor);
+ p.rddt[(icenter+i)*p.rds] = sp >= 0?(sp < p.frames?p.rsdt[sp*p.rss]:flr):fll;
+ }
+ }
+ else {
+ I i;
+ for(i = icenter; i >= 0; --i) {
+ I sp = (I)(center-(i+rem)*p.tilt.factor);
+ p.rddt[(icenter-i)*p.rds] = p.rsdt[sp*p.rss];
+ }
+ for(i = p.frames-1-icenter; i > 0; --i) {
+ I sp = (I)(center+(i-rem)*p.tilt.factor);
+ p.rddt[(icenter+i)*p.rds] = p.rsdt[sp*p.rss];
+ }
+ }
+ }
+}
+
+
+BL VecOp::d_tilt(OpParam &p)
+{
+ if(p.frames <= 1 || p.tilt.factor == 1) return true;
+
+ // symmetric operation
+ if(p.symm == 1)
+ p.tilt.center = p.frames-1-p.tilt.center;
+
+ do_tilt(p);
+
+ return true;
+}
+
+
+/*! \brief Does vasp resampling.
+
+ \param arg argument list
+ \param arg.factor factor for resampling
+ \param arg.center center of resampling
+ \param dst destination vasp (NULL for in-place operation)
+ \param symm true for symmetric operation
+ \param mode interpolation mode
+ \return normalized destination vasp
+*/
+Vasp *VaspOp::m_tilt(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL symm)
+{
+ Vasp *ret = NULL;
+ if(arg.IsList() && arg.GetList().Count() >= 1) {
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ p.tilt.factor = flext::GetAFloat(arg.GetList()[0]);
+ p.tilt.center = arg.GetList().Count() >= 2?flext::GetAFloat(arg.GetList()[1]):0;
+
+ ret = DoOp(vecs,VecOp::d_tilt,p,symm);
+
+ delete vecs;
+ }
+ }
+ else
+ post("%s - no arguments: no operation",p.opName());
+
+ return ret;
+}
+
+
+
+class vasp_tilt:
+ public vasp_anyop
+{
+ FLEXT_HEADER(vasp_tilt,vasp_anyop)
+public:
+
+ vasp_tilt(I argc,t_atom *argv):
+ vasp_anyop(argc,argv,VASP_ARG_R(1),true),
+ fill(xtf_zero),inter(xti_4p)
+ {
+ FLEXT_ADDMETHOD_E(0,"fill",m_fill);
+ FLEXT_ADDMETHOD_E(0,"inter",m_inter);
+ }
+
+ enum xt_fill {
+ xtf__ = -1, // don't change
+ xtf_zero = 0,xtf_edge
+ };
+
+ enum xt_inter {
+ xti__ = -1, // don't change
+ xti_inpl = 0,xti_none,xti_lin,xti_4p
+ };
+
+ V m_fill(xt_fill f) { fill = f; }
+ V m_inter(xt_inter m) { inter = m; }
+
+ virtual Vasp *do_shift(OpParam &p) { return VaspOp::m_tilt(p,ref,arg,&dst); }
+
+ virtual Vasp *tx_work(const Argument &arg)
+ {
+ OpParam p(thisName(),1);
+ p.tilt.fill = (I)fill;
+ p.tilt.mode = (I)inter;
+
+ Vasp *ret = do_shift(p);
+ return ret;
+ }
+
+ virtual V m_help() { post("%s - Resamples buffer data",thisName()); }
+
+protected:
+ xt_fill fill;
+ xt_inter inter;
+
+private:
+ FLEXT_CALLBACK_1(m_fill,xt_fill)
+ FLEXT_CALLBACK_1(m_inter,xt_inter)
+};
+FLEXT_LIB_V("vasp, vasp.tilt",vasp_tilt)
+
+
+class vasp_xtilt:
+ public vasp_tilt
+{
+ FLEXT_HEADER(vasp_xtilt,vasp_tilt)
+public:
+
+ vasp_xtilt(I argc,t_atom *argv): vasp_tilt(argc,argv) {}
+
+ virtual Vasp *do_shift(OpParam &p) { return VaspOp::m_xtilt(p,ref,arg,&dst); }
+
+ virtual V m_help() { post("%s - Resamples buffer data symmetrically (in two halves)",thisName()); }
+};
+FLEXT_LIB_V("vasp, vasp.xtilt",vasp_xtilt)
+
+
diff --git a/externals/grill/vasp/source/ops_resmp.h b/externals/grill/vasp/source/ops_resmp.h
new file mode 100644
index 00000000..9c4a8bde
--- /dev/null
+++ b/externals/grill/vasp/source/ops_resmp.h
@@ -0,0 +1,28 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_RESMP_H
+#define __VASP_OPS_RESMP_H
+
+#include "opbase.h"
+
+// Resampling (around center sample)
+
+namespace VecOp {
+ BL d_tilt(OpParam &p);
+}
+
+namespace VaspOp {
+ Vasp *m_tilt(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL,BL symm = false);
+ // Symmetric resampling (around center sample)
+ inline Vasp *m_xtilt(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_tilt(p,src,arg,dst,true); }
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_search.cpp b/externals/grill/vasp/source/ops_search.cpp
new file mode 100644
index 00000000..7afc84c2
--- /dev/null
+++ b/externals/grill/vasp/source/ops_search.cpp
@@ -0,0 +1,187 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_search.h"
+#include "util.h"
+#include "oploop.h"
+
+
+BL VecOp::d_search(OpParam &p)
+{
+ const I off = p.srch.offs;
+ const S val = p.srch.val;
+ const R cur = p.rsdt[off];
+
+ I i,ofl = -1,ofr = -1;
+
+ if(p.srch.dir <= 0) {
+ BL y = cur >= val;
+ i = off-1;
+ _D_WHILE(i >= 0)
+ BL y2 = p.rsdt[i] >= val;
+ if(y != y2) {
+ if(p.srch.slope <= 0 && y2) break;
+ if(p.srch.slope >= 0 && !y2) break;
+ }
+ y = y2;
+ --i;
+ _E_WHILE
+
+ if(i >= 0) ofl = i;
+ }
+
+ if(p.srch.dir >= 0) {
+ BL y = cur >= val;
+ i = off+1;
+ _D_WHILE(i < p.frames)
+ BL y2 = p.rsdt[i] >= val;
+ if(y != y2) {
+ if(p.srch.slope <= 0 && !y2) break;
+ if(p.srch.slope >= 0 && y2) break;
+ }
+ y = y2;
+ ++i;
+ _E_WHILE
+
+ if(i < p.frames) ofr = i;
+ }
+
+ if(!p.srch.dir) {
+ if(ofl >= 0) {
+ p.srch.dif = ofl-off;
+ if(ofr >= 0 && abs(p.srch.dif) < abs(ofr-off)) p.srch.dif = ofr-off;
+ }
+ else
+ p.srch.dif = ofr >= 0?ofr-off:0;
+ }
+ else if(p.srch.dir > 0)
+ p.srch.dif = ofr >= 0?ofr-off:0;
+ else
+ p.srch.dif = ofl >= 0?ofl-off:0;
+
+ return true;
+}
+
+Vasp *VaspOp::m_search(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL st)
+{
+ Vasp *ret = NULL;
+ if(src.Vectors() > 1)
+ post("%s - More than one vector in vasp!",p.opName());
+ else if(arg.CanbeFloat() || (arg.IsList() && arg.GetList().Count() >= 1)) {
+ I fr = src.ChkFrames();
+ I o = src.Vector(0).Offset();
+ I sz = src.Buffer(0)->Frames();
+
+ Vasp all(src);
+ if(st) {
+ // search start point
+ p.srch.offs = o;
+
+ // set bounds of search buffer
+ all.Offset(0);
+ all.Frames(fr+o); // all frames of buffer
+ }
+ else {
+ // search end point
+ p.srch.offs = o+fr;
+ // check if current offset is past buffer
+ if(p.srch.offs >= sz) p.srch.offs = sz-1;
+
+ // set bounds of search buffer
+ all.Offset(o);
+ all.Frames(sz-o); // all frames of buffer
+ }
+
+ RVecBlock *vecs = GetRVecs(p.opname,all,dst);
+ if(vecs) {
+ p.srch.val = arg.IsList()?flext::GetAFloat(arg.GetList()[0]):arg.GetAFloat();
+
+ ret = DoOp(vecs,VecOp::d_search,p);
+
+ if(st) o += p.srch.dif,fr -= p.srch.dif;
+ else fr += p.srch.dif;
+
+ if(ret) {
+ ret->Offset(o);
+ ret->Frames(fr);
+ ret->Frames(ret->ChkFrames());
+ }
+
+ delete vecs;
+ }
+ }
+ else
+ post("%s - no arguments: no operation",p.opName());
+
+ return ret;
+}
+
+
+class vasp_search:
+ public vasp_anyop
+{
+ FLEXT_HEADER(vasp_search,vasp_anyop)
+public:
+
+ vasp_search(I argc,t_atom *argv):
+ vasp_anyop(argc,argv,VASP_ARG_R(0),false,XletCode(xlet::tp_float,0)),
+ slope(0),dir(0)
+ {
+ FLEXT_ADDMETHOD_I(0,"dir",m_dir);
+ FLEXT_ADDMETHOD_I(0,"slope",m_slope);
+ }
+
+ virtual Vasp *do_work(OpParam &p) = 0;
+
+ virtual Vasp *tx_work(const Argument &arg)
+ {
+ OpParam p(thisName(),1);
+ p.srch.dir = dir;
+ p.srch.slope = slope;
+
+ Vasp *ret = do_work(p);
+ if(ret) ToOutFloat(1,p.srch.dif);
+ return ret;
+ }
+
+ V m_dir(I d) { dir = d; }
+ V m_slope(I sl) { slope = sl; }
+
+protected:
+ I dir,slope;
+
+private:
+ FLEXT_CALLBACK_I(m_dir)
+ FLEXT_CALLBACK_I(m_slope)
+};
+
+
+class vasp_soffset:
+ public vasp_search
+{
+ FLEXT_HEADER(vasp_soffset,vasp_search)
+public:
+ vasp_soffset(I argc,t_atom *argv): vasp_search(argc,argv) {}
+ virtual Vasp *do_work(OpParam &p) { return VaspOp::m_soffset(p,ref,arg,&dst); }
+};
+FLEXT_LIB_V("vasp, vasp.offset= vasp.o=",vasp_soffset)
+
+
+class vasp_sframes:
+ public vasp_search
+{
+ FLEXT_HEADER(vasp_sframes,vasp_search)
+public:
+ vasp_sframes(I argc,t_atom *argv): vasp_search(argc,argv) {}
+ virtual Vasp *do_work(OpParam &p) { return VaspOp::m_sframes(p,ref,arg,&dst); }
+};
+FLEXT_LIB_V("vasp, vasp.frames= vasp.f=",vasp_sframes)
+
+
diff --git a/externals/grill/vasp/source/ops_search.h b/externals/grill/vasp/source/ops_search.h
new file mode 100644
index 00000000..e7a04e5c
--- /dev/null
+++ b/externals/grill/vasp/source/ops_search.h
@@ -0,0 +1,29 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_SEARCH_H
+#define __VASP_OPS_SEARCH_H
+
+#include "opbase.h"
+
+// Sample search functions
+
+namespace VecOp {
+ BL d_search(OpParam &p); //! find values
+}
+
+namespace VaspOp {
+ // search functions
+ Vasp *m_search(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL st); //! find values
+ inline Vasp *m_soffset(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_search(p,src,arg,dst,true); }
+ inline Vasp *m_sframes(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_search(p,src,arg,dst,false); }
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_trnsc.cpp b/externals/grill/vasp/source/ops_trnsc.cpp
new file mode 100644
index 00000000..1b26f204
--- /dev/null
+++ b/externals/grill/vasp/source/ops_trnsc.cpp
@@ -0,0 +1,83 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_trnsc.h"
+#include "opdefs.h"
+#include "util.h"
+#include <math.h>
+
+// --------------------------------------------------------------
+
+template<class T> V f_rpow(T &v,T a,T b) { v = pow(fabs(a),b)*sgn(a); }
+
+BL VecOp::d_pow(OpParam &p) { d__rbin(f_rpow<S>,p); }
+
+template<class T> V f_crpow(T &rv,T &iv,T ra,T ia,T rb,T)
+{
+ register const R _abs = sqrt(sqabs(ra,ia));
+ if(_abs) {
+ register const R _p = pow(_abs,rb)/_abs;
+ rv = _p*ra,iv = _p*ia;
+ }
+ else
+ rv = iv = 0;
+}
+
+BL VecOp::d_rpow(OpParam &p) { d__cbin(f_crpow<S>,p); }
+
+Vasp *VaspOp::m_rpow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst)
+{
+ Vasp *ret = NULL;
+ CVecBlock *vecs = GetCVecs(p.opname,src,dst);
+ if(vecs) {
+ if(arg.IsList() && arg.GetList().Count() >= 1 && flext::CanbeFloat(arg.GetList()[0]))
+ p.cbin.rarg = flext::GetAFloat(arg.GetList()[0]);
+ else {
+ post("%s - argument is invalid -> set to 1",p.opname);
+ p.cbin.rarg = 1;
+ }
+ p.cbin.iarg = 0; // not used anyway
+
+ ret = DoOp(vecs,VecOp::d_rpow,p);
+ delete vecs;
+ }
+ return ret;
+}
+
+VASP_BINARY("vasp.pow",pow,true,VASP_ARG_R(1),"Real power function")
+VASP_ANYOP("vasp.rpow",rpow,0,true,VASP_ARG_R(1),"Power function acting on complex radius")
+
+
+// --------------------------------------------------------------
+
+template<class T> V f_rsqrt(T &v,T a) { v = sqrt(fabs(a)); }
+template<class T> V f_rssqrt(T &v,T a) { v = sqrt(fabs(a))*sgn(a); }
+
+BL VecOp::d_sqrt(OpParam &p) { d__run(f_rsqrt<S>,p); }
+BL VecOp::d_ssqrt(OpParam &p) { d__run(f_rssqrt<S>,p); }
+
+
+VASP_UNARY("vasp.sqrt",sqrt,true,"Square root")
+VASP_UNARY("vasp.ssqrt",ssqrt,true,"Square root preserving the sign")
+
+// --------------------------------------------------------------
+
+
+template<class T> V f_rexp(T &v,T a) { v = exp(a); }
+template<class T> V f_rlog(T &v,T a) { v = log(a); } // \todo detect NANs
+
+BL VecOp::d_exp(OpParam &p) { d__run(f_rexp<S>,p); }
+BL VecOp::d_log(OpParam &p) { d__run(f_rlog<S>,p); }
+
+
+VASP_UNARY("vasp.exp",exp,true,"Exponential function")
+VASP_UNARY("vasp.log",log,true,"Natural logarithm")
+
+
diff --git a/externals/grill/vasp/source/ops_trnsc.h b/externals/grill/vasp/source/ops_trnsc.h
new file mode 100644
index 00000000..81009298
--- /dev/null
+++ b/externals/grill/vasp/source/ops_trnsc.h
@@ -0,0 +1,47 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_TRNSC_H
+#define __VASP_OPS_TRNSC_H
+
+#include "opbase.h"
+
+// Transcendent math functions
+
+namespace VecOp {
+ BL d_pow(OpParam &p);
+
+ BL d_rpow(OpParam &p);
+
+ BL d_sqrt(OpParam &p);
+ BL d_ssqrt(OpParam &p);
+
+
+ BL d_exp(OpParam &p);
+ BL d_log(OpParam &p);
+}
+
+namespace VaspOp {
+ inline Vasp *m_pow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL) { return m_rbin(p,src,arg,dst,VecOp::d_pow); } // power
+
+ Vasp *m_rpow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst = NULL); // radius power (with each two channels)
+
+ inline Vasp *m_sqrt(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_sqrt); } // square root (from abs value)
+ inline Vasp *m_ssqrt(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_ssqrt); } // square root (from abs value)
+
+ inline Vasp *m_exp(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_exp); } // exponential function
+ inline Vasp *m_log(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_run(p,src,dst,VecOp::d_log); } // natural logarithm
+
+// inline Vasp *m_cexp(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_cexp); } // complex exponential function
+// inline Vasp *m_clog(OpParam &p,Vasp &src,Vasp *dst = NULL) { return m_cun(p,src,dst,VecOp::d_clog); } // complex logarithm (how about branches?)
+
+}
+
+#endif
diff --git a/externals/grill/vasp/source/ops_wnd.cpp b/externals/grill/vasp/source/ops_wnd.cpp
new file mode 100644
index 00000000..232649aa
--- /dev/null
+++ b/externals/grill/vasp/source/ops_wnd.cpp
@@ -0,0 +1,191 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "ops_wnd.h"
+#include "oploop.h"
+#include <math.h>
+#include <string.h>
+
+#ifndef PI
+#define PI 3.1415926535897932384
+#endif
+
+// --- window --------------------------
+
+typedef R (*wfunc)(R i,const OpParam &p);
+
+inline R wf_sin(R i,const OpParam &p) { return sin(i*p.wnd.p1+p.wnd.p2); }
+inline R wf_hanning(R i,const OpParam &p) { return 0.5*(1+cos(i*p.wnd.p1+p.wnd.p2)); }
+inline R wf_hamming(R i,const OpParam &p) { return 0.54 + 0.46 * cos(i*p.wnd.p1+p.wnd.p2); }
+inline R wf_blackman(R i,const OpParam &p) { const R x = i*p.wnd.p1+p.wnd.p2; return 0.42+0.5*cos(x)+0.08*cos(2*x); }
+inline R wf_connes(R i,const OpParam &p) { const R x = i*p.wnd.p1+p.wnd.p2,x2 = 1-x*x; return x2*x2; }
+inline R wf_welch(R i,const OpParam &p) { const R x = i*p.wnd.p1+p.wnd.p2; return 1-x*x; }
+inline R wf_lanczos(R i,const OpParam &p) { const R x = i*p.wnd.p1+p.wnd.p2; return x?sin(x)/x:1; }
+//inline R wf_gaussian(R i,const OpParam &p) { const R x = i*p.wnd.p1+p.wnd.p2; return pow(2, (-1 * (x / p.wnd.p3) * (x / p.wnd.p3))); }
+//inline R wf_kaiser(R i,const OpParam &p) { const R x = i*p.wnd.p1+p.wnd.p2; return i0(p.wnd.p3 * sqrt(1 - (x * x))) / i0(p.wnd.p3); }
+
+
+static V WndOp(wfunc wf,OpParam &p) {
+ register I i;
+
+ if(!p.wnd.mul) {
+ register S *dd = p.rddt;
+ _D_LOOP(i,p.frames) *dd = wf(i,p),dd += p.rds; _E_LOOP
+ }
+ else {
+ register const S *sd = p.rsdt;
+ register S *dd = p.rddt;
+ _D_LOOP(i,p.frames) *dd = *sd*wf(i,p),sd += p.rss,dd += p.rds; _E_LOOP
+ }
+}
+
+#define WNDOP(WFUNC,OPP) WndOp(WFUNC,OPP)
+
+
+
+BL VecOp::d_window(OpParam &p)
+{
+ // reverse direction?
+ BL rev = ((p.revdir?1:0)^(p.symm == 1?1:0)^(p.wnd.inv?1:0)) != 0;
+
+ // set middle sample (if existent) to 1
+ if(p.oddrem) p.SkipOddMiddle(1);
+
+ switch(p.wnd.wndtp) {
+ case 0: { // bevel (Bartlett)
+ register R inc,cur;
+ inc = (rev?-1.:1.)/p.frames; // increase
+ cur = rev?(1+inc/2):inc/2; // start
+
+ if(!p.wnd.mul) {
+ register S *dd = p.rddt;
+ register I i;
+ if(p.rds == 1)
+ _D_LOOP(i,p.frames) *(dd++) = cur,cur += inc; _E_LOOP
+ else
+ _D_LOOP(i,p.frames) *dd = cur,dd += p.rds,cur += inc; _E_LOOP
+ }
+ else {
+ register const S *sd = p.rsdt;
+ register S *dd = p.rddt;
+ register I i;
+ if(sd == dd)
+ if(p.rss == 1 && p.rds == 1)
+ _D_LOOP(i,p.frames) *(dd++) *= cur,cur += inc; _E_LOOP
+ else
+ _D_LOOP(i,p.frames) *dd *= cur,dd += p.rds,cur += inc; _E_LOOP
+ else
+ if(p.rss == 1 && p.rds == 1)
+ _D_LOOP(i,p.frames) *(dd++) = *(sd++) * cur,cur += inc; _E_LOOP
+ else
+ _D_LOOP(i,p.frames) *dd = *sd * cur,sd += p.rss,dd += p.rds,cur += inc; _E_LOOP
+ }
+ break;
+ }
+ case 1: { // sine
+ p.wnd.p1 = (PI/2)/p.frames;
+ p.wnd.p2 = p.wnd.p1/2+(rev?PI/2:0);
+ WNDOP(wf_sin,p);
+ break;
+ }
+ case 2: { // Hanning
+ p.wnd.p1 = PI/p.frames;
+ p.wnd.p2 = p.wnd.p1/2+(rev?0:PI);
+ WNDOP(wf_hanning,p);
+ break;
+ }
+ case 3: { // Hamming
+ p.wnd.p1 = PI/p.frames;
+ p.wnd.p2 = p.wnd.p1/2+(rev?0:PI);
+ WNDOP(wf_hamming,p);
+ break;
+ }
+ case 4: { // Blackman
+ p.wnd.p1 = PI/p.frames;
+ p.wnd.p2 = p.wnd.p1/2+(rev?0:PI);
+ WNDOP(wf_blackman,p);
+ break;
+ }
+ case 5: { // Connes (xxx)
+ p.wnd.p1 = 1./p.frames;
+ p.wnd.p2 = p.wnd.p1/2+(rev?1:0);
+ WNDOP(wf_connes,p);
+ break;
+ }
+ case 6: { // Welch (xxx)
+ p.wnd.p1 = 1./p.frames;
+ p.wnd.p2 = p.wnd.p1/2+(rev?1:0);
+ WNDOP(wf_welch,p);
+ break;
+ }
+ case 7: { // Lanczos (xxx)
+ p.wnd.p1 = PI/p.frames;
+ p.wnd.p2 = p.wnd.p1/2+(rev?0:PI);
+ WNDOP(wf_lanczos,p);
+ break;
+ }
+ default: {
+ post("%s: Window function #%i not known",p.opname,p.wnd.wndtp);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+Vasp *VaspOp::m_window(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL inv,BL mul,BL symm)
+{
+ static const int wndnum = 8;
+ static const char *wndtps[wndnum] = {"lin","sin","hanning","hamming","blackman","connes","welch","lanczos" /*,"gaussian","kaiser"*/};
+
+ Vasp *ret = NULL;
+ RVecBlock *vecs = GetRVecs(p.opname,src,dst);
+ if(vecs) {
+ p.wnd.wndtp = -1;
+
+ if(arg.IsList() && arg.GetList().Count() >= 1) {
+ // window mode
+ const flext::AtomList &l = arg.GetList();
+ if(flext::IsSymbol(l[0])) {
+ I i;
+ const C *s = flext::GetString(l[0]);
+ p.wnd.wndtp = -1;
+ for(i = 0; i < wndnum; ++i)
+ if(!strcmp(wndtps[i],s)) { p.wnd.wndtp = i; break; }
+ }
+ else if(flext::CanbeInt(l[0])) {
+ p.wnd.wndtp = flext::GetAInt(l[0]);
+ }
+ else p.wnd.wndtp = -1;
+ }
+
+ if(p.wnd.wndtp < 0) {
+ post("%s - invalid window type - using lin",p.opname);
+ p.wnd.wndtp = 0;
+ }
+
+ p.wnd.inv = inv;
+ p.wnd.mul = mul;
+ ret = DoOp(vecs,VecOp::d_window,p,symm);
+ delete vecs;
+ }
+
+ return ret;
+}
+
+VASP_ANYOP("vasp.window vasp.wnd",window,0,false,VASP_ARG(),"Sets target vasp to window function")
+VASP_ANYOP("vasp.*window vasp.*wnd",mwindow,0,true,VASP_ARG(),"Multiplies a vasp by window function")
+VASP_ANYOP("vasp.!window vasp.!wnd",iwindow,0,false,VASP_ARG(),"Sets target vasp to reverse window function")
+VASP_ANYOP("vasp.*!window vasp.!wnd",miwindow,0,true,VASP_ARG(),"Multiplies a vasp by reverse window function")
+VASP_ANYOP("vasp.xwindow vasp.xwnd",xwindow,0,false,VASP_ARG(),"Sets target vasp to symmetrical window function")
+VASP_ANYOP("vasp.*xwindow vasp.*xwnd",mxwindow,0,true,VASP_ARG(),"Multiplies a vasp by symmetrical window function")
+
+
+
diff --git a/externals/grill/vasp/source/ops_wnd.h b/externals/grill/vasp/source/ops_wnd.h
new file mode 100644
index 00000000..21bafb59
--- /dev/null
+++ b/externals/grill/vasp/source/ops_wnd.h
@@ -0,0 +1,39 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_OPS_WND_H
+#define __VASP_OPS_WND_H
+
+#include "opbase.h"
+
+// Window functions
+
+namespace VecOp {
+ BL d_bevel(OpParam &p);
+ BL d_mbevel(OpParam &p);
+
+ BL d_window(OpParam &p);
+}
+
+namespace VaspOp {
+ Vasp *m_bevelup(OpParam &p,Vasp &src,Vasp *dst,BL up = true,BL mul = false); // bevel up
+ inline Vasp *m_mbevelup(OpParam &p,Vasp &src,Vasp *dst) { return m_bevelup(p,src,dst,true,true); } // * bevel up (fade in)
+ inline Vasp *m_beveldn(OpParam &p,Vasp &src,Vasp *dst) { return m_bevelup(p,src,dst,false,false); } // bevel down
+ inline Vasp *m_mbeveldn(OpParam &p,Vasp &src,Vasp *dst) { return m_bevelup(p,src,dst,false,true); } // * bevel down (fade out)
+
+ Vasp *m_window(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst,BL inv = false,BL mul = false,BL symm = false); // window curve
+ inline Vasp *m_mwindow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_window(p,src,arg,dst,false,true,false); } // * window curve
+ inline Vasp *m_iwindow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_window(p,src,arg,dst,true,false,false); } // inverse window curve
+ inline Vasp *m_miwindow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_window(p,src,arg,dst,true,true,false); } // * inverse window curve
+ inline Vasp *m_xwindow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_window(p,src,arg,dst,false,false,true); } // symmetrical window curve
+ inline Vasp *m_mxwindow(OpParam &p,Vasp &src,const Argument &arg,Vasp *dst) { return m_window(p,src,arg,dst,false,true,true); } // * symmetrical window curve
+}
+
+#endif
diff --git a/externals/grill/vasp/source/opvecs.cpp b/externals/grill/vasp/source/opvecs.cpp
new file mode 100644
index 00000000..0e476682
--- /dev/null
+++ b/externals/grill/vasp/source/opvecs.cpp
@@ -0,0 +1,630 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+/*! \file vasp__ctrl.cpp
+ \brief Methods for handling of vector data for real, complex and multi-vector cases.
+
+*/
+
+#include "opbase.h"
+#include "classes.h"
+#include "vecblk.h"
+#include "util.h"
+
+/*! \brief Corrects for the common vector frame count
+ \param frms frame count to correct
+ \param bl new frame count
+ \return true if a correction was made
+*/
+static BL corrlen(I &frms,I bl,I bf = -1,I bo = 0)
+{
+ if(bf < 0) bf = bl;
+
+ BL corr = false;
+ BL all = frms < 0;
+ if(all)
+ frms = bl;
+ else if(frms > bl) {
+ // longer than vector length -> correct
+ frms = bl;
+ corr = true;
+ }
+
+ if(bo+frms > bf) {
+ // now check if buffer size is exceeded
+// post("%s - %s vector (%s) exceeds buffer size: cropped",op,bli == 0?"src":"dst",bref->Name());
+ frms = bf-bo;
+ if(frms < 0) frms = 0;
+ corr = true;
+ }
+
+ return corr;
+}
+
+
+inline BL corrlen(I &frms,VBuffer &b)
+{
+ return corrlen(frms,b.Length(),b.Frames(),b.Offset());
+}
+
+
+/*! \brief Make real vector block for unary operations.
+
+ \param op operation name
+ \param src source vasp
+ \param dst optional destination vasp
+ \return struct with vector data
+
+ \remark working size is maximum common vector size
+*/
+RVecBlock *VaspOp::GetRVecs(const C *op,Vasp &src,Vasp *dst)
+{
+ I nvecs = src.Vectors();
+ if(dst && dst->Ok() && dst->Vectors() != nvecs) {
+ nvecs = min(nvecs,dst->Vectors());
+ post("%s - src/dst vector number not equal -> taking minimum",op);
+ }
+
+ RVecBlock *ret = new RVecBlock(nvecs);
+
+ BL ok = true,dlens = false;
+ I tfrms = -1;
+
+ Vasp *vbl[2] = {&src,dst};
+
+ for(I bli = 0; bli < 2; ++bli)
+ for(I ci = 0; ok && ci < nvecs; ++ci) {
+ VBuffer *bref = NULL;
+ if(vbl[bli] && vbl[bli]->Ok()) {
+ bref = vbl[bli]->Buffer(ci);
+ if(!bref->Data()) {
+ post("%s - %s vector (%s) is invalid",op,bli == 0?"src":"dst",bref->Name());
+ delete bref; bref = NULL;
+ ok = false;
+ }
+ else
+ dlens = dlens || corrlen(tfrms,*bref);
+ }
+
+ if(bli == 0)
+ ret->Src(ci,bref);
+ else
+ ret->Dst(ci,bref);
+ }
+
+ if(dlens) post("%s - vector length has been limited to maximum common length (%i)",op,tfrms);
+
+ ret->Frames(tfrms < 0?0:tfrms);
+
+ if(ok) return ret;
+ else { delete ret; return NULL; }
+}
+
+/*! \brief Make real vector block for unary operations.
+
+ \param op operation name
+ \param src source vasp
+ \param dst optional destination vasp
+ \param full true if imaginary part is compulsory
+ \return struct with vector data
+*/
+CVecBlock *VaspOp::GetCVecs(const C *op,Vasp &src,Vasp *dst,BL full)
+{
+ I nvecs = src.Vectors();
+ if(dst && dst->Ok() && dst->Vectors() != nvecs) {
+ nvecs = min(nvecs,dst->Vectors());
+ post("%s - src/dst vector number not equal -> taking minimum",op);
+ }
+
+ I pairs = nvecs/2;
+ if(nvecs != pairs*2)
+ if(full) {
+ post("%s - number of vectors is odd - not allowed",op);
+ return NULL;
+ }
+ else {
+ post("%s - number of vectors is odd - omitting last vector",op);
+ }
+
+ CVecBlock *ret = new CVecBlock(pairs);
+ BL ok = true,dlens = false;
+ I tfrms = -1;
+
+ Vasp *vbl[2] = {&src,dst};
+
+ for(I bli = 0; bli < 2; ++bli)
+ for(I ci = 0; ci < pairs; ++ci) {
+ VBuffer *bre = NULL,*bim = NULL; // complex channels
+ if(vbl[bli] && vbl[bli]->Ok()) {
+ const C *vnm = bli == 0?"src":"dst";
+ bre = vbl[bli]->Buffer(ci*2);
+ bim = vbl[bli]->Buffer(ci*2+1); // complex channels
+
+ if(!bre->Data()) {
+ post("%s - real %s vector (%s) is invalid",op,vnm,bre->Name());
+ delete bre; bre = NULL;
+ ok = false;
+ }
+ if(bim && !bim->Data()) {
+ post("%s - imag %s vector (%s) is invalid",op,vnm,bim->Name());
+ delete bim; bim = NULL;
+ ok = false;
+ }
+
+ // check against common vector length
+ if(bre) {
+ dlens = dlens || corrlen(tfrms,*bre);
+ }
+ if(bim) {
+ dlens = dlens || corrlen(tfrms,*bim);
+ }
+
+ }
+
+ if(bli == 0)
+ ret->Src(ci,bre,bim);
+ else
+ ret->Dst(ci,bre,bim);
+ }
+
+ if(dlens) post("%s - vector src/dst length has been limited to maximum common length (%i)",op,tfrms);
+
+ ret->Frames(tfrms < 0?0:tfrms);
+
+ if(ok) return ret;
+ else { delete ret; return NULL; }
+}
+
+
+/*! \brief Make real vector block for binary operations.
+
+ \param op operation name
+ \param src source vasp
+ \param arg argument vasp
+ \param dst optional destination vasp
+ \param multi 0 off/1 on/-1 auto... controls whether argument vector is single- or multi-vectored
+ \return struct with vector data
+*/
+RVecBlock *VaspOp::GetRVecs(const C *op,Vasp &src,const Vasp &arg,Vasp *dst,I multi,BL ssize)
+{
+ if(!arg.Ok()) {
+ post("%s - invalid argument vasp detected and ignored",op);
+ return NULL;
+ }
+
+ I nvecs = src.Vectors();
+ if(dst && dst->Ok() && dst->Vectors() != nvecs) {
+ nvecs = min(nvecs,dst->Vectors());
+ post("%s - src/dst vector number not equal -> taking minimum",op);
+ }
+
+ RVecBlock *ret;
+
+ if(multi < 0) { // auto mode
+ multi = arg.Vectors() > 1;
+ }
+
+ if(multi) {
+ if(arg.Vectors() < nvecs) {
+ nvecs = arg.Vectors();
+ post("%s - too few arg vectors, operating on only first %i vectors",op,nvecs);
+ }
+ ret = new RVecBlock(nvecs,nvecs,1);
+ for(I i = 0; i < nvecs; ++i)
+ ret->Arg(i,arg.Buffer(i));
+ }
+ else {
+ if(arg.Vectors() > 1) {
+ post("%s - using only first arg vector for all operations",op);
+ }
+ ret = new RVecBlock(nvecs,nvecs,1);
+ for(I i = 0; i < nvecs; ++i)
+ ret->Arg(i,arg.Buffer(0));
+ }
+
+ BL ok = true,dlens = false,dalens = false;
+ I tfrms = -1,afrms = -1;
+
+ for(I ci = 0; ok && ci < nvecs; ++ci) {
+ VBuffer *bref = src.Buffer(ci);
+ VBuffer *barg = ret->Arg(multi?ci:0);
+ VBuffer *bdst = dst && dst->Ok()?dst->Buffer(ci):NULL;
+
+ if(barg && (multi || ci == 0) && !barg->Data()) {
+ post("%s - arg vector (%s) is invalid",op,barg->Name());
+ ok = false; break; // really break?
+ }
+ else if(!bref->Data()) {
+ post("%s - src vector (%s) is invalid",op,bref->Name());
+ ok = false; break; // really break?
+ }
+
+ // check src/dst frame lengths
+ dlens = dlens || corrlen(tfrms,*bref);
+ if(bdst) dlens = dlens || corrlen(tfrms,*bdst);
+
+ // check arg frame length
+ if(barg) dalens = dalens || corrlen(afrms,*barg);
+
+ ret->Src(ci,bref);
+ if(bdst) ret->Dst(ci,bdst);
+ }
+
+ if(dlens) post("%s - vector src/dst length has been limited to maximum common length (%i)",op,tfrms);
+ if(dalens) post("%s - vector arg length has been limited to maximum common length (%i)",op,afrms);
+
+ if(ssize) {
+ if(corrlen(tfrms,afrms))
+ post("%s - vector src/dst and arg lengths are unequal -> set to max. common length (%i)",op,tfrms);
+ afrms = tfrms;
+ }
+
+ ret->Frames(tfrms < 0?0:tfrms);
+ ret->ArgFrames(afrms < 0?0:afrms);
+
+ if(ok) return ret;
+ else { delete ret; return NULL; }
+}
+
+
+/*! \brief Make real complex block for binary operations.
+
+ \param op operation name
+ \param src source vasp
+ \param arg argument vasp
+ \param dst optional destination vasp
+ \param multi 0 off/1 on/-1 auto... controls whether argument vector is single- or multi-vectored
+ \param full true if imaginary part is compulsory
+ \return struct with vector data
+*/
+CVecBlock *VaspOp::GetCVecs(const C *op,Vasp &src,const Vasp &arg,Vasp *dst,I multi,BL ssize,BL full)
+{
+ if(!arg.Ok()) {
+ post("%s - invalid argument vasp detected and ignored",op);
+ return NULL;
+ }
+
+ I nvecs = src.Vectors();
+ if(dst && dst->Ok() && dst->Vectors() != nvecs) {
+ nvecs = min(nvecs,dst->Vectors());
+ post("%s - src/dst vector number not equal -> taking minimum",op);
+ }
+
+ I pairs = nvecs/2;
+ CVecBlock *ret;
+
+ if(multi < 0) { // auto mode
+ multi = arg.Vectors() > 2; // more than one argument pair -> multi
+ }
+
+ if(multi) {
+ I apairs = arg.Vectors()/2;
+ if(arg.Vectors() != apairs*2)
+ if(full) {
+ post("%s - number of arg vectors is odd - not allowed",op);
+ return NULL;
+ }
+ else {
+ post("%s - number of arg vectors is odd - assuming complex part as 0",op);
+ ++apairs;
+ }
+
+ if(apairs < pairs) {
+ pairs = apairs;
+ post("%s - too few arg vectors, operating on only first %i vector pairs",op,pairs);
+ }
+ ret = new CVecBlock(pairs,pairs,1);
+ for(I i = 0; i < pairs; ++i)
+ ret->Arg(i,arg.Buffer(i*2),arg.Buffer(i*2+1));
+ }
+ else {
+ if(arg.Vectors() > 2) {
+ post("%s - using only first arg vector pair for all operations",op);
+ }
+ ret = new CVecBlock(pairs,pairs,1);
+ for(I i = 0; i < pairs; ++i)
+ ret->Arg(i,arg.Buffer(0),arg.Buffer(1));
+ }
+
+ BL ok = true,dlens = false,dalens = false;
+ I tfrms = -1,afrms = -1;
+
+ {
+ if(nvecs != pairs*2) {
+ post("%s - number of src vectors is odd - omitting last vector",op);
+ // clear superfluous vector?
+ }
+
+ for(I ci = 0; ok && ci < pairs; ++ci) {
+ // --- arg stuff ----------------
+
+ VBuffer *brarg = ret->ReArg(ci),*biarg = ret->ImArg(ci);
+
+ if(multi || ci == 0) {
+ if(!brarg->Data()) {
+ post("%s - real arg vector (%s) is invalid",op,brarg->Name());
+ ok = false; break;
+ }
+ else if(biarg && !biarg->Data()) {
+ post("%s - imag arg vector (%s) is invalid",op,biarg->Name());
+ ok = false; break;
+ }
+ }
+
+ // check against common arg length
+ if(brarg) dalens = dalens || corrlen(afrms,*brarg);
+ if(biarg) dalens = dalens || corrlen(afrms,*biarg);
+
+ // --- src/dst stuff ----------------
+
+ VBuffer *brref = src.Buffer(ci*2),*biref = src.Buffer(ci*2+1);
+ VBuffer *brdst,*bidst;
+ if(dst && dst->Ok()) brdst = dst->Buffer(ci*2),bidst = dst->Buffer(ci*2+1);
+ else brdst = bidst = NULL;
+
+ if(!brref->Data()) {
+ post("%s - real src vector (%s) is invalid",op,brref->Name());
+ ok = false; break; // really break?
+ }
+ else if(biref && !biref->Data()) {
+ post("%s - imag src vector (%s) is invalid",op,biref->Name());
+ ok = false; break; // really break?
+ }
+ else {
+ dlens = dlens || corrlen(tfrms,*brref);
+ if(biref) dlens = dlens || corrlen(tfrms,*biref);
+ if(brdst) dlens = dlens || corrlen(tfrms,*brdst);
+ if(bidst) dlens = dlens || corrlen(tfrms,*bidst);
+ }
+
+ ret->Src(ci,brref,biref);
+ if(brdst) ret->Dst(ci,brdst,bidst);
+ }
+ }
+
+ if(dlens) post("%s - vector src/dst length has been limited to maximum common length (%i)",op,tfrms);
+ if(dalens) post("%s - vector arg length has been limited to maximum common length (%i)",op,afrms);
+
+ if(ssize) {
+ if(corrlen(tfrms,afrms))
+ post("%s - vector src/dst and arg lengths are unequal -> set to max. common length (%i)",op,tfrms);
+ afrms = tfrms;
+ }
+
+ ret->Frames(tfrms < 0?0:tfrms);
+ ret->ArgFrames(afrms < 0?0:afrms);
+
+ if(ok) return ret;
+ else { delete ret; return NULL; }
+}
+
+
+/*! \brief Run the operation on the various real vectors.
+
+ \param vecs src/arg/dst vector block
+ \param fun operative function
+ \param p parameter block for operative function
+ \return normalized vasp or NULL on error
+
+ \todo set overlap flag
+
+ \remark operative function must be capable of handling reversed direction
+*/
+Vasp *VaspOp::DoOp(RVecBlock *vecs,VecOp::opfun *fun,OpParam &p,BL symm)
+{
+ BL ok = true;
+
+ if(vecs->ArgBlks() && (!p.arg || p.args < vecs->ArgBlks())) {
+ post("%s - not enough argument blocks",p.opname);
+ ok = false;
+ }
+
+ const I scnt = symm?2:1;
+ for(I i = 0; ok && i < vecs->Vecs(); ++i)
+ for(I si = 0; ok && si < scnt; ++si) {
+ p.frames = vecs->Frames();
+
+ VBuffer *s = vecs->Src(i),*d = vecs->Dst(i);
+ p.rsdt = s->Pointer(),p.rss = s->Channels();
+
+ if(d) p.rddt = d->Pointer(),p.rds = d->Channels();
+ else p.rddt = p.rsdt,p.rds = p.rss;
+
+ for(I bi = 0; bi < vecs->ArgBlks(); ++bi) {
+ VBuffer *a = vecs->Arg(i,bi);
+ p.arg[bi].SetV(a?a->Pointer():NULL,a?a->Channels():0);
+ }
+
+ if(!symm)
+ p.symm = -1;
+ else {
+ const I hcnt = p.frames/2;
+ p.oddrem = p.frames != 2*hcnt;
+
+ if((p.symm = si) == 0) {
+ p.frames = hcnt+(p.oddrem?1:0);
+ }
+ else {
+ const I r = p.frames-hcnt;
+ p.frames = hcnt;
+ p.rsdt += r*p.rss,p.rddt += r*p.rds;
+
+ // What to do with arguments in symmetric mode?
+ // let the object decide!!
+ }
+ }
+
+ { // ---- Check out and try to resolve overlap situation ------------
+
+ BL sovr = p.SR_In(); // check whether dst is before src
+ if(p.HasArg()) {
+ // has argument
+ if(sovr) {
+ // src/dst needs reversal -> check if ok for arg/dst
+ p.ovrlap = true;
+
+ if(p.AR_Can())
+ p.R_Rev(); // Revert vectors
+ else {
+ post("%s - vector overlap situation can't be resolved",p.opname);
+ ok = false;
+ }
+ }
+ else if(p.AR_In()) {
+ // arg/dst needs reversal -> check if ok for src/dst
+ p.ovrlap = true;
+
+ if(p.SR_Can())
+ p.R_Rev(); // Revert vectors
+ else {
+ post("%s - vector overlap situation can't be resolved",p.opname);
+ ok = false;
+ }
+ }
+ }
+ else { // No arg
+ if(sovr) {
+ p.ovrlap = true;
+ p.R_Rev(); // if overlapping revert vectors
+ }
+ else
+ p.ovrlap = p.SR_Ovr();
+ }
+ }
+
+ ok = fun(p);
+
+#ifdef FLEXT_THREAD
+ flext_base::ThrYield();
+#endif
+ }
+ return ok?vecs->ResVasp():NULL;
+}
+
+
+/*! \brief Run the operation on the various complex vector pairs.
+
+ \param vecs src/arg/dst vector block
+ \param fun operative function
+ \param p parameter block for operative function
+ \return normalized vasp or NULL on error
+
+ \todo set overlap flag
+
+ \remark operative function must be capable of handling reversed direction
+*/
+Vasp *VaspOp::DoOp(CVecBlock *vecs,VecOp::opfun *fun,OpParam &p,BL symm)
+{
+ BL ok = true;
+
+ if(vecs->ArgBlks() && (!p.arg || p.args < vecs->ArgBlks())) {
+ post("%s - not enough argument blocks",p.opname);
+ ok = false;
+ }
+
+ const I scnt = symm?2:1;
+ for(I i = 0; ok && i < vecs->Pairs(); ++i)
+ for(I si = 0; ok && si < scnt; ++si) {
+ p.frames = vecs->Frames();
+
+ VBuffer *rsv = vecs->ReSrc(i),*isv = vecs->ImSrc(i);
+ p.rsdt = rsv->Pointer(),p.rss = rsv->Channels();
+ p.isdt = isv->Pointer(),p.iss = isv->Channels();
+
+ VBuffer *rdv = vecs->ReDst(i),*idv = vecs->ImDst(i);
+ if(rdv) {
+ p.rddt = rdv->Pointer(),p.rds = rdv->Channels();
+ if(idv) p.iddt = idv->Pointer(),p.ids = idv->Channels();
+ else p.iddt = NULL; //,p.ids = 0; // Can that be NULL??
+ }
+ else {
+ p.rddt = p.rsdt,p.rds = p.rss,p.iddt = p.isdt,p.ids = p.iss;
+ }
+
+ for(I bi = 0; bi < vecs->ArgBlks(); ++bi) {
+ VBuffer *rav = vecs->ReArg(i,bi),*iav = vecs->ImArg(i,bi);
+ p.arg[bi].SetV(rav?rav->Pointer():NULL,rav?rav->Channels():0,iav?iav->Pointer():NULL,iav?iav->Channels():0);
+ }
+
+ if(!symm)
+ p.symm = -1;
+ else {
+ const I hcnt = p.frames/2;
+ p.oddrem = p.frames != 2*hcnt;
+
+ if((p.symm = si) == 0) {
+ p.frames = hcnt+(p.oddrem?1:0);
+ }
+ else {
+ const I r = p.frames-hcnt;
+ p.frames = hcnt;
+ p.rsdt += r*p.rss,p.isdt += r*p.iss;
+ p.rddt += r*p.rds;
+ if(p.iddt) p.iddt += r*p.ids; // Can that be NULL??
+
+ // What to do with arguments?
+ // let objects decide!!
+ }
+ }
+
+ { // ---- Check out and try to resolve overlap situation ------------
+
+ BL sovr = p.SR_In(); // check whether dst is before src
+ if(sovr && !p.SI_Can()) {
+ post("%s - src/dst overlap of re/im vectors not resolvable",p.opname);
+ ok = false;
+ }
+
+ if(ok && p.HasArg()) {
+ // has argument
+ if(sovr) {
+ // src/dst needs reversal -> check if ok for arg/dst
+ p.ovrlap = true;
+
+ if(p.AR_Can() && p.AI_Can())
+ p.C_Rev(); // Revert vectors
+ else {
+ post("%s - vector overlap situation can't be resolved",p.opname);
+ ok = false;
+ }
+ }
+ else if(p.AR_In() || p.AI_In()) {
+ // arg/dst needs reversal -> check if ok for src/dst
+ p.ovrlap = true;
+
+ if(p.AR_Can() && p.AI_Can() && p.SR_Can() && p.SI_Can())
+ p.C_Rev(); // Revert vectors
+ else {
+ post("%s - vector overlap situation can't be resolved",p.opname);
+ ok = false;
+ }
+ }
+ }
+ else { // No arg
+ if(sovr) {
+ p.ovrlap = true;
+ p.C_Rev(); // if overlapping revert vectors
+ }
+ else
+ p.ovrlap = p.SR_Ovr() || p.SI_Ovr();
+ }
+ }
+
+ ok = fun(p);
+
+#ifdef FLEXT_THREAD
+ flext_base::ThrYield();
+#endif
+ }
+ return ok?vecs->ResVasp():NULL;
+}
+
+
+
diff --git a/externals/grill/vasp/source/rdx2fft.cpp b/externals/grill/vasp/source/rdx2fft.cpp
new file mode 100644
index 00000000..b4ecf6c9
--- /dev/null
+++ b/externals/grill/vasp/source/rdx2fft.cpp
@@ -0,0 +1,82 @@
+#include <math.h>
+
+#define PI 3.1415926535897932384f
+
+//////////////////////////////////////////////////////////////////////////
+
+/* calculate bidirectional fourier transform of complex data radix 2 */
+/* adapted from subroutine FOUREA listed in */
+/* Programs for Digital Signal Processing */
+/* edited by Digital Signal Processing Committee */
+/* IEEE Acoustics Speech and Signal Processing Committee */
+/* Chapter 1 Section 1.1 Page 1.1-4,5 */
+/* direct -1 forward +1 reverse */
+
+bool fft_bidir_complex_radix2(int size,float *real,float *imag,int direct)
+{
+ int i,j,m,mmax,istep;
+ float c,s,treal,timag,theta;
+
+ /* compute transform */
+
+ j=1;
+ for(i=1;i<=size;i++)
+ {
+ if(i<j)
+ {
+ treal=real[j-1];
+ timag=imag[j-1];
+ real[j-1]=real[i-1];
+ imag[j-1]=imag[i-1];
+ real[i-1]=treal;
+ imag[i-1]=timag;
+ }
+ m=size/2;
+ while(j>m)
+ {
+ j-=m;
+ m=(m+1)/2;
+ }
+ j+=m;
+ }
+ mmax=1;
+ while(size>mmax)
+ {
+ istep=2*mmax;
+ for(m=1;m<=mmax;m++)
+ {
+ theta=PI*(float)direct*(float)(m-1)/(float)mmax;
+ c=(float)cos(theta);
+ s=(float)sin(theta);
+ for(i=m;i<=size;i+=istep)
+ {
+ j=i+mmax;
+ treal=real[j-1]*c-imag[j-1]*s;
+ timag=imag[j-1]*c+real[j-1]*s;
+ real[j-1]=real[i-1]-treal;
+ imag[j-1]=imag[i-1]-timag;
+ real[i-1]+=treal;
+ imag[i-1]+=timag;
+ }
+ }
+ mmax=istep;
+ }
+
+ return true;
+}
+
+#if 0
+/* calculate forward fourier transform of complex data radix 2 */
+
+bool fft_fwd_complex_radix2(int size,float *real,float *imag)
+{
+ return fft_bidir_complex_radix2(size,real,imag,-1);
+}
+
+/* calculate inverse fourier transform of complex data radix 2 */
+
+bool fft_inv_complex_radix2(int size,float *real,float *imag)
+{
+ return fft_bidir_complex_radix2(size,real,imag,1);
+}
+#endif
diff --git a/externals/grill/vasp/source/rvfft.cpp b/externals/grill/vasp/source/rvfft.cpp
new file mode 100644
index 00000000..b7d81c93
--- /dev/null
+++ b/externals/grill/vasp/source/rvfft.cpp
@@ -0,0 +1,357 @@
+#include <math.h>
+
+#ifdef _MSC_VER
+#pragma warning(disable: 4244)
+#endif
+
+#define PI 3.14159265358979
+
+/////////////////////////////////////////////////////////
+// Sorensen in-place split-radix FFT for real values
+// data: array of floats:
+// re(0),re(1),re(2),...,re(size-1)
+//
+// output:
+// re(0),re(1),re(2),...,re(size/2),im(size/2-1),...,im(1)
+// normalized by array length
+//
+// Source:
+// Sorensen et al: Real-Valued Fast Fourier Transform Algorithms,
+// IEEE Trans. ASSP, ASSP-35, No. 6, June 1987
+
+void realfft_split(float *data,int n)
+{
+
+ int i,j,k,i5,i6,i7,i8,i0,id,i1,i2,i3,i4,n2,n4,n8;
+ float t1,t2,t3,t4,t5,t6,a3,ss1,ss3,cc1,cc3,a,e,sqrt2;
+
+ sqrt2=sqrt(2.0);
+ n4=n-1;
+
+ //data shuffling
+ for (i=0,j=0,n2=n/2; i<n4 ; i++){
+ if (i<j){
+ t1=data[j];
+ data[j]=data[i];
+ data[i]=t1;
+ }
+ k=n2;
+ while (k<=j){
+ j-=k;
+ k>>=1;
+ }
+ j+=k;
+ }
+
+/*----------------------*/
+
+ //length two butterflies
+ i0=0;
+ id=4;
+ do{
+ for (; i0<n4; i0+=id){
+ i1=i0+1;
+ t1=data[i0];
+ data[i0]=t1+data[i1];
+ data[i1]=t1-data[i1];
+ }
+ id<<=1;
+ i0=id-2;
+ id<<=1;
+ } while ( i0<n4 );
+
+ /*----------------------*/
+ //L shaped butterflies
+n2=2;
+for(k=n;k>2;k>>=1){
+ n2<<=1;
+ n4=n2>>2;
+ n8=n2>>3;
+ e = 2*PI/(n2);
+ i1=0;
+ id=n2<<1;
+ do{
+ for (; i1<n; i1+=id){
+ i2=i1+n4;
+ i3=i2+n4;
+ i4=i3+n4;
+ t1=data[i4]+data[i3];
+ data[i4]-=data[i3];
+ data[i3]=data[i1]-t1;
+ data[i1]+=t1;
+ if (n4!=1){
+ i0=i1+n8;
+ i2+=n8;
+ i3+=n8;
+ i4+=n8;
+ t1=(data[i3]+data[i4])/sqrt2;
+ t2=(data[i3]-data[i4])/sqrt2;
+ data[i4]=data[i2]-t1;
+ data[i3]=-data[i2]-t1;
+ data[i2]=data[i0]-t2;
+ data[i0]+=t2;
+ }
+ }
+ id<<=1;
+ i1=id-n2;
+ id<<=1;
+ } while ( i1<n );
+ a=e;
+ for (j=2; j<=n8; j++){
+ a3=3*a;
+ cc1=cos(a);
+ ss1=sin(a);
+ cc3=cos(a3);
+ ss3=sin(a3);
+ a=j*e;
+ i=0;
+ id=n2<<1;
+ do{
+ for (; i<n; i+=id){
+ i1=i+j-1;
+ i2=i1+n4;
+ i3=i2+n4;
+ i4=i3+n4;
+ i5=i+n4-j+1;
+ i6=i5+n4;
+ i7=i6+n4;
+ i8=i7+n4;
+ t1=data[i3]*cc1+data[i7]*ss1;
+ t2=data[i7]*cc1-data[i3]*ss1;
+ t3=data[i4]*cc3+data[i8]*ss3;
+ t4=data[i8]*cc3-data[i4]*ss3;
+ t5=t1+t3;
+ t6=t2+t4;
+ t3=t1-t3;
+ t4=t2-t4;
+ t2=data[i6]+t6;
+ data[i3]=t6-data[i6];
+ data[i8]=t2;
+ t2=data[i2]-t3;
+ data[i7]=-data[i2]-t3;
+ data[i4]=t2;
+ t1=data[i1]+t5;
+ data[i6]=data[i1]-t5;
+ data[i1]=t1;
+ t1=data[i5]+t4;
+ data[i5]-=t4;
+ data[i2]=t1;
+ }
+ id<<=1;
+ i=id-n2;
+ id<<=1;
+ } while(i<n);
+ }
+ }
+}
+
+
+/////////////////////////////////////////////////////////
+// Sorensen in-place inverse split-radix FFT for real values
+// data: array of doubles:
+// re(0),re(1),re(2),...,re(size/2),im(size/2-1),...,im(1)
+//
+// output:
+// re(0),re(1),re(2),...,re(size-1)
+// NOT normalized by array length
+//
+// Source:
+// Sorensen et al: Real-Valued Fast Fourier Transform Algorithms,
+// IEEE Trans. ASSP, ASSP-35, No. 6, June 1987
+
+void irealfft_split(float *data,int n){
+
+ int i,j,k,i5,i6,i7,i8,i0,id,i1,i2,i3,i4,n2,n4,n8,n1;
+ float t1,t2,t3,t4,t5,a3,ss1,ss3,cc1,cc3,a,e,sqrt2;
+
+ sqrt2=sqrt(2.0);
+
+n1=n-1;
+n2=n<<1;
+for(k=n;k>2;k>>=1){
+ id=n2;
+ n2>>=1;
+ n4=n2>>2;
+ n8=n2>>3;
+ e = 2*PI/(n2);
+ i1=0;
+ do{
+ for (; i1<n; i1+=id){
+ i2=i1+n4;
+ i3=i2+n4;
+ i4=i3+n4;
+ t1=data[i1]-data[i3];
+ data[i1]+=data[i3];
+ data[i2]*=2;
+ data[i3]=t1-2*data[i4];
+ data[i4]=t1+2*data[i4];
+ if (n4!=1){
+ i0=i1+n8;
+ i2+=n8;
+ i3+=n8;
+ i4+=n8;
+ t1=(data[i2]-data[i0])/sqrt2;
+ t2=(data[i4]+data[i3])/sqrt2;
+ data[i0]+=data[i2];
+ data[i2]=data[i4]-data[i3];
+ data[i3]=2*(-t2-t1);
+ data[i4]=2*(-t2+t1);
+ }
+ }
+ id<<=1;
+ i1=id-n2;
+ id<<=1;
+ } while ( i1<n1 );
+ a=e;
+ for (j=2; j<=n8; j++){
+ a3=3*a;
+ cc1=cos(a);
+ ss1=sin(a);
+ cc3=cos(a3);
+ ss3=sin(a3);
+ a=j*e;
+ i=0;
+ id=n2<<1;
+ do{
+ for (; i<n; i+=id){
+ i1=i+j-1;
+ i2=i1+n4;
+ i3=i2+n4;
+ i4=i3+n4;
+ i5=i+n4-j+1;
+ i6=i5+n4;
+ i7=i6+n4;
+ i8=i7+n4;
+ t1=data[i1]-data[i6];
+ data[i1]+=data[i6];
+ t2=data[i5]-data[i2];
+ data[i5]+=data[i2];
+ t3=data[i8]+data[i3];
+ data[i6]=data[i8]-data[i3];
+ t4=data[i4]+data[i7];
+ data[i2]=data[i4]-data[i7];
+ t5=t1-t4;
+ t1+=t4;
+ t4=t2-t3;
+ t2+=t3;
+ data[i3]=t5*cc1+t4*ss1;
+ data[i7]=-t4*cc1+t5*ss1;
+ data[i4]=t1*cc3-t2*ss3;
+ data[i8]=t2*cc3+t1*ss3;
+ }
+ id<<=1;
+ i=id-n2;
+ id<<=1;
+ } while(i<n1);
+ }
+ }
+
+ /*----------------------*/
+ i0=0;
+ id=4;
+ do{
+ for (; i0<n1; i0+=id){
+ i1=i0+1;
+ t1=data[i0];
+ data[i0]=t1+data[i1];
+ data[i1]=t1-data[i1];
+ }
+ id<<=1;
+ i0=id-2;
+ id<<=1;
+ } while ( i0<n1 );
+
+/*----------------------*/
+
+//data shuffling
+ for (i=0,j=0,n2=n/2; i<n1 ; i++){
+ if (i<j){
+ t1=data[j];
+ data[j]=data[i];
+ data[i]=t1;
+ }
+ k=n2;
+ while (k<=j){
+ j-=k;
+ k>>=1;
+ }
+ j+=k;
+ }
+}
+
+
+#if 0
+/////////////////////////////////////////////////////////
+// Sorensen in-place radix-2 FFT for real values
+// data: array of floats:
+// re(0),re(1),re(2),...,re(size-1)
+//
+// output:
+// re(0),re(1),re(2),...,re(size/2),im(size/2-1),...,im(1)
+// normalized by array length
+//
+// Source:
+// Sorensen et al: Real-Valued Fast Fourier Transform Algorithms,
+// IEEE Trans. ASSP, ASSP-35, No. 6, June 1987
+
+void realfft_radix2(float *data,int n){
+
+ float xt,a,e, t1, t2, cc, ss;
+ int i, j, k, n1, n2, n3, n4, i1, i2, i3, i4;
+
+ n4=n-1;
+ //data shuffling
+ for (i=0,j=0,n2=n/2; i<n4 ; i++){
+ if (i<j){
+ xt=data[j];
+ data[j]=data[i];
+ data[i]=xt;
+ }
+ k=n2;
+ while (k<=j){
+ j-=k;
+ k>>=1;
+ }
+ j+=k;
+ }
+
+/* -------------------- */
+ for (i=0; i<n; i += 2)
+ {
+ xt = data[i];
+ data[i] = xt + data[i+1];
+ data[i+1] = xt - data[i+1];
+ }
+/* ------------------------ */
+ n2 = 1;
+ for (k=n;k>2;k>>=1){
+ n4 = n2;
+ n2 = n4 << 1;
+ n1 = n2 << 1;
+ e = 2*PI/(n1);
+ for (i=0; i<n; i+=n1){
+ xt = data[i];
+ data[i] = xt + data[i+n2];
+ data[i+n2] = xt-data[i+n2];
+ data[i+n4+n2] = -data[i+n4+n2];
+ a = e;
+ n3=n4-1;
+ for (j = 1; j <=n3; j++){
+ i1 = i+j;
+ i2 = i - j + n2;
+ i3 = i1 + n2;
+ i4 = i - j + n1;
+ cc = cos(a);
+ ss = sin(a);
+ a += e;
+ t1 = data[i3] * cc + data[i4] * ss;
+ t2 = data[i3] * ss - data[i4] * cc;
+ data[i4] = data[i2] - t2;
+ data[i3] = -data[i2] - t2;
+ data[i2] = data[i1] - t1;
+ data[i1] += t1;
+ }
+ }
+ }
+}
+#endif
diff --git a/externals/grill/vasp/source/util.cpp b/externals/grill/vasp/source/util.cpp
new file mode 100644
index 00000000..c487e3d1
--- /dev/null
+++ b/externals/grill/vasp/source/util.cpp
@@ -0,0 +1,12 @@
+#include "util.h"
+#include <math.h>
+
+R arg(R re,R im)
+{
+ if(re)
+ return fmod(atan(im/re)+(re < 0?2*PI:PI),2*PI)-PI;
+ else
+ if(im || re) return im > 0?PI/2:-PI/2;
+ else return 0;
+}
+
diff --git a/externals/grill/vasp/source/util.h b/externals/grill/vasp/source/util.h
new file mode 100644
index 00000000..1b41c447
--- /dev/null
+++ b/externals/grill/vasp/source/util.h
@@ -0,0 +1,33 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_UTIL_H
+#define __VASP_UTIL_H
+
+#include "main.h"
+
+#ifndef PI
+#define PI 3.1415926535897932385
+#endif
+
+#define BIG 1.e10
+
+
+R arg(R re,R im);
+inline R arg(const CX &c) { return arg(c.real,c.imag); }
+inline F sqabs(F re,F im) { return re*re+im*im; }
+inline F sqabs(const CX &c) { return sqabs(c.real,c.imag); }
+inline F sgn(F x) { return x < 0.?-1.F:1.F; }
+inline V swap(F &a,F &b) { F c = a; a = b; b = c; }
+
+inline I min(I a,I b) { return a < b?a:b; }
+inline I max(I a,I b) { return a > b?a:b; }
+
+#endif
diff --git a/externals/grill/vasp/source/vasp.cpp b/externals/grill/vasp/source/vasp.cpp
new file mode 100644
index 00000000..35bbc5a2
--- /dev/null
+++ b/externals/grill/vasp/source/vasp.cpp
@@ -0,0 +1,353 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#include "classes.h"
+#include "util.h"
+#include "buflib.h"
+
+///////////////////////////////////////////////////////////////////////////
+// Vasp class
+///////////////////////////////////////////////////////////////////////////
+
+Vasp::Ref::Ref(VBuffer &b): sym(b.Symbol()),chn(b.Channel()),offs(b.Offset()) {}
+Vasp::Ref::Ref(VSymbol &s,I c,I o): sym(s),chn(c),offs(o) {}
+Vasp::Ref::~Ref() {}
+
+Vasp::Ref &Vasp::Ref::operator =(const Ref &r)
+{
+ sym = r.sym,chn = r.chn,offs = r.offs;
+ return *this;
+}
+
+V Vasp::Ref::Symbol(const VSymbol &s) { sym = s; }
+
+
+Vasp::Vasp():
+ refs(0),chns(0),ref(NULL),
+ frames(0)
+{
+}
+
+Vasp::Vasp(I argc,const t_atom *argv):
+ refs(0),chns(0),ref(NULL),
+ frames(0)
+{
+ operator ()(argc,argv);
+}
+
+Vasp::Vasp(const Vasp &v):
+ refs(0),chns(0),ref(NULL),
+ frames(0)
+{
+ operator =(v);
+}
+
+Vasp::Vasp(I fr,const Ref &r):
+ refs(0),chns(0),ref(NULL),
+ frames(fr)
+{
+ operator +=(r);
+}
+
+
+Vasp::~Vasp()
+{
+ if(ref) delete[] ref;
+}
+
+
+BL Vasp::ChkArgs(I argc,const t_atom *argv)
+{
+ I ix = 0;
+
+ // vasp keyword
+ t_symbol *v = ix < argc?flext::GetASymbol(argv[ix]):NULL;
+ if(v && v == vasp_base::sym_vasp) ix++; // if it is "vasp" ignore it
+
+ // length argument
+ if(argc > ix && flext::CanbeInt(argv[ix])) ix++;
+
+ while(argc > ix) {
+ // check for symbol
+ t_symbol *bsym = flext::GetASymbol(argv[ix]);
+ if(!bsym || !flext::GetString(bsym) || !flext::GetString(bsym)[0]) { // expect a symbol
+ // not symbol -> bail out
+ return false;
+ }
+ else
+ ix++;
+
+ // check for offset
+ if(argc > ix && flext::CanbeInt(argv[ix])) ix++;
+
+ // check for channel
+ if(argc > ix && flext::CanbeInt(argv[ix])) ix++;
+ }
+
+ return true;
+}
+
+V Vasp::Resize(I rcnt) {
+ if(!ref) {
+ ref = new Ref[refs = rcnt];
+ chns = 0;
+ }
+ else if(rcnt > refs) {
+ Ref *rnew = new Ref[refs = rcnt];
+ for(I ix = 0; ix < chns; ++ix) rnew[ix] = ref[ix];
+ delete[] ref;
+ ref = rnew;
+ }
+}
+
+
+
+Vasp &Vasp::operator =(const Vasp &v)
+{
+ if(!v.Ok())
+ Clear();
+ else {
+ frames = v.frames;
+ if(!ref || v.chns > refs) {
+ if(ref) delete[] ref;
+ ref = new Ref[refs = v.chns];
+ }
+
+ chns = v.chns;
+ for(I ix = 0; ix < chns; ++ix) {
+ ref[ix] = v.ref[ix];
+ }
+ }
+
+ return *this;
+}
+
+
+Vasp &Vasp::operator +=(const Ref &r)
+{
+ Resize(chns+1);
+ ref[chns++] = r;
+ return *this;
+}
+
+
+Vasp &Vasp::operator +=(const Vasp &v)
+{
+ if(v.Ok()) {
+ if(!Ok()) *this = v;
+ else {
+ if(Frames() != v.Frames()) {
+ post("vasp - Frame count of joined vasps is different - taking the minimum");
+ Frames(min(Frames(),v.Frames()));
+ }
+
+ Resize(Vectors()+v.Vectors());
+ for(I i = 0; i < v.Vectors(); ++i) *this += v.Vector(i);
+ }
+ }
+ return *this;
+}
+
+// parse argument list
+Vasp &Vasp::operator ()(I argc,const t_atom *argv)
+{
+ BL lenset = false;
+ I ix = 0;
+
+ I maxneeded = argc; // maximum number of ref'd buffers
+ // rather use a temp storage
+ if(!ref || refs < maxneeded) {
+ if(ref) delete[] ref;
+ ref = new Ref[refs = maxneeded];
+ }
+
+ t_symbol *v = ix < argc?flext::GetASymbol(argv[ix]):NULL;
+ if(v && v == vasp_base::sym_vasp) ix++; // if it is "vasp" ignore it
+
+ if(argc > ix && flext::CanbeInt(argv[ix])) {
+ frames = flext::GetAInt(argv[ix]);
+ lenset = true;
+ ix++;
+ }
+ else
+ frames = -1;
+
+ chns = 0;
+ while(argc > ix) {
+ t_symbol *bsym = flext::GetASymbol(argv[ix]);
+ if(!bsym || !flext::GetString(bsym) || !flext::GetString(bsym)[0]) { // expect a symbol
+ Clear();
+ return *this;
+ }
+ else
+ ix++;
+
+ // is a symbol!
+ Ref &r = ref[chns];
+ r.Symbol(VSymbol(bsym));
+
+ if(argc > ix && flext::CanbeInt(argv[ix])) {
+ r.Offset((I)flext::GetAInt(argv[ix]));
+ ix++;
+ }
+ else
+ r.Offset(0);
+
+ if(argc > ix && flext::CanbeInt(argv[ix])) {
+ r.Channel((I)flext::GetAInt(argv[ix]));
+ ix++;
+ }
+ else
+ r.Channel(0);
+
+ chns++;
+ }
+
+ if(!lenset) {
+ // set length to maximum!
+ // or let it be -1 to represent the maximum?!
+ frames = -1;
+ // if len is already set then where to check for oversize?
+ }
+
+ return *this;
+}
+
+
+VBuffer *Vasp::Buffer(I ix) const
+{
+ if(ix >= Vectors())
+ return NULL;
+ else {
+ const Ref &r = Vector(ix);
+ VBuffer *ret = BufLib::Get(r.Symbol(),r.Channel(),Frames(),r.Offset());
+ return ret;
+ }
+}
+
+// generate Vasp list of buffer references
+flext::AtomList *Vasp::MakeList(BL withvasp)
+{
+ I voffs = withvasp?1:0;
+ I needed = voffs+1+Vectors()*3;
+ flext::AtomList *ret = new flext::AtomList(needed);
+
+ if(withvasp)
+ flext::SetSymbol((*ret)[0],vasp_base::sym_vasp); // VASP
+
+ flext::SetInt((*ret)[voffs],frames); // frames
+
+ for(I ix = 0; ix < Vectors(); ++ix) {
+ Ref &r = Vector(ix);
+ flext::SetSymbol((*ret)[voffs+1+ix*3],r.Symbol().Symbol()); // buf
+ flext::SetInt((*ret)[voffs+2+ix*3],r.Offset()); // offs
+ flext::SetInt((*ret)[voffs+3+ix*3],r.Channel()); // chn
+ }
+
+ return ret;
+}
+
+
+V Vasp::Refresh()
+{
+ for(I i = 0; i < Vectors(); ++i) {
+ VBuffer *vb = Buffer(i);
+ if(vb) {
+ vb->Refresh();
+ delete vb;
+ }
+ }
+}
+
+V Vasp::Offset(I o)
+{
+ for(I i = 0; i < Vectors(); ++i) Vector(i).Offset(o);
+}
+
+V Vasp::OffsetD(I od)
+{
+ for(I i = 0; i < Vectors(); ++i) Vector(i).OffsetD(od);
+}
+
+
+V Vasp::Channel(I c)
+{
+ for(I i = 0; i < Vectors(); ++i) Vector(i).Channel(c);
+}
+
+
+V Vasp::Size(I s)
+{
+ for(I i = 0; i < Vectors(); ++i) {
+ VBuffer *buf = Buffer(i);
+ if(buf) {
+ buf->Frames(s,true);
+ delete buf;
+ }
+ }
+}
+
+V Vasp::SizeD(I sd)
+{
+ for(I i = 0; i < Vectors(); ++i) {
+ VBuffer *buf = Buffer(i);
+ if(buf) {
+ I s = buf->Frames()+sd;
+ buf->Frames(s >= 0?s:0,true);
+ delete buf;
+ }
+ }
+}
+
+
+V Vasp::SizeM(R f)
+{
+ for(I i = 0; i < Vectors(); ++i) {
+ VBuffer *buf = Buffer(i);
+ if(buf) {
+ I s = (I)(buf->Frames()*f);
+ buf->Frames(s >= 0?s:0,true);
+ delete buf;
+ }
+ }
+}
+
+BL Vasp::Check() const
+{
+ BL ok = true;
+ for(I i = 0; ok && i < Vectors(); ++i) {
+ VBuffer *buf = Buffer(i);
+ if(!buf)
+ ok = false;
+ else {
+ ok = buf->Data() != NULL;
+ delete buf;
+ }
+ }
+ return ok;
+}
+
+I Vasp::ChkFrames() const
+{
+ if(Vectors() == 0) return 0;
+
+ I frms = -1;
+ for(I i = 0; i < Vectors(); ++i) {
+ VBuffer *buf = Buffer(i);
+ if(buf) {
+ I f = buf->Length();
+ if(frms < 0 || f < frms) frms = f;
+ delete buf;
+ }
+ }
+
+ return frms < 0?0:frms;
+}
+
diff --git a/externals/grill/vasp/source/vasp.h b/externals/grill/vasp/source/vasp.h
new file mode 100644
index 00000000..ab4530c7
--- /dev/null
+++ b/externals/grill/vasp/source/vasp.h
@@ -0,0 +1,142 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP__H
+#define __VASP__H
+
+#include "vbuffer.h"
+
+class Vasp
+{
+public:
+ class Ref {
+ public:
+ Ref(): sym(NULL) {}
+ Ref(VBuffer &b);
+ Ref(VSymbol &s,I c,I o);
+ Ref(const Ref &r) { operator =(r); }
+ ~Ref();
+
+ Ref &operator =(const Ref &r);
+
+ V Clear() { sym.Clear(); }
+ BL Ok() const { return sym.Ok(); }
+
+ VSymbol &Symbol() { return sym; }
+ const VSymbol &Symbol() const { return sym; }
+ V Symbol(const VSymbol &s);
+ I Channel() const { return chn; }
+ V Channel(I c) { chn = c; }
+ I Offset() const { return offs; }
+ V Offset(I o) { offs = o; }
+ V OffsetD(I o) { offs += o; }
+
+ protected:
+ VSymbol sym;
+ I chn;
+ I offs; // counted in frames
+ };
+
+ Vasp();
+ Vasp(I argc,const t_atom *argv);
+ Vasp(const Vasp &v);
+ Vasp(I frames,const Ref &r);
+ ~Vasp();
+
+ static BL ChkArgs(I argc,const t_atom *argv);
+
+ const C *thisName() const { return typeid(*this).name(); }
+
+ // check if vasp reference is valid
+ BL Check() const;
+
+ Vasp &operator =(const Vasp &v);
+ Vasp &operator ()(I argc,const t_atom *argv /*,BL withvasp = false*/);
+
+ // add another vector
+ Vasp &operator +=(const Ref &r);
+ // add vectors of another vasp
+ Vasp &operator +=(const Vasp &v);
+
+ // set used channels to 0
+ Vasp &Clear() { frames = 0; chns = 0; return *this; }
+
+ // used vectors
+ I Vectors() const { return chns; }
+
+ // length of the vasp (in frames)
+ I Frames() const { return frames; }
+ // set frame count
+ V Frames(I fr) { frames = fr; }
+ // set frame count differentially
+ V FramesD(I frd) { if(frames >= 0) frames += frd; }
+ // set frame count
+ V FramesM(R f) { if(frames >= 0) frames = (int)(frames*f); }
+ // set frame count
+ V FramesR(R f) { if(f) FramesM(1./f); else Frames(0); }
+
+ // set buffer sizes
+ V Size(I fr);
+ // set frame count differentially
+ V SizeD(I frd);
+ // set frame count
+ V SizeM(R f);
+ // set frame count
+ V SizeR(R f) { if(f) SizeM(1./f); else Size(0); }
+
+ // actual length of the vasp (in frames)
+ I ChkFrames() const;
+
+ // set offset(s)
+ V Offset(I fr);
+ // set offset(s) differentially
+ V OffsetD(I fr);
+
+ // set channel(s)
+ V Channel(I ch);
+
+ BL Ok() const { return ref && Vectors() > 0; }
+ BL IsComplex() const { return ref && Vectors() >= 2 && ref[1].Ok(); }
+
+ // get any vector - test if in range 0..Vectors()-1!
+ const Ref &Vector(I ix) const { return ref[ix]; }
+ Ref &Vector(I ix) { return ref[ix]; }
+
+ // get real part - be sure that Ok!
+ const Ref &Real() const { return Vector(0); }
+ Ref &Real() { return Vector(0); }
+
+ // get imaginary part - be sure that Complex!
+ const Ref &Imag() const { return Vector(1); }
+ Ref &Imag() { return Vector(1); }
+
+ // get buffer associated to a channel
+ VBuffer *Buffer(I ix) const;
+
+ // Real/Complex
+ VBuffer *ReBuffer() const { return Buffer(0); }
+ VBuffer *ImBuffer() const { return Buffer(1); }
+
+ // prepare and reference t_atom list for output
+ flext::AtomList *MakeList(BL withvasp = true);
+
+ // make a graphical update of all buffers in vasp
+ V Refresh();
+
+protected:
+ I frames; // length counted in frames
+ I chns; // used channels
+ I refs; // allocated channels (>= chns)
+ Ref *ref;
+
+ V Resize(I rcnt);
+};
+
+#endif
diff --git a/externals/grill/vasp/source/vbuffer.cpp b/externals/grill/vasp/source/vbuffer.cpp
new file mode 100644
index 00000000..137e066c
--- /dev/null
+++ b/externals/grill/vasp/source/vbuffer.cpp
@@ -0,0 +1,40 @@
+#include "vbuffer.h"
+#include "buflib.h"
+
+V VSymbol::Inc() { if(sym) BufLib::IncRef(sym); }
+V VSymbol::Dec() { if(sym) BufLib::DecRef(sym); }
+
+///////////////////////////////////////////////////////////////////////////
+// SysBuf class
+///////////////////////////////////////////////////////////////////////////
+
+SysBuf &SysBuf::Set(const VSymbol &s,I c,I l,I o)
+{
+ buf.Set(s.Symbol());
+
+ chn = c;
+ if(chn > Channels()) {
+ I chn1 = Channels()-1;
+ post("vasp - buffer %s: Channel index (%i) is out of range, set to highest (%i)",s.Name(),chn,chn1);
+ chn = chn1; // simply correct the channel??
+ }
+ offs = o;
+ if(offs < 0) {
+ post("vasp - buffer %s: Offset (%i) is out of range, set to 0",s.Name(),offs);
+ offs = 0;
+ }
+ if(offs > Frames()) {
+// post("vasp - buffer %s: Offset (%i) is out of range, set to %i",s.Name(),offs,Frames());
+ offs = Frames();
+ }
+ len = l >= 0?l:Frames();
+ if(offs+len > Frames()) {
+ I len1 = Frames()-offs;
+ if(l >= 0) post("vasp - buffer %s: Length (%i) is out of range, corrected to %i",s.Name(),len,len1);
+ len = len1;
+ }
+
+ return *this;
+}
+
+
diff --git a/externals/grill/vasp/source/vbuffer.h b/externals/grill/vasp/source/vbuffer.h
new file mode 100644
index 00000000..c3303099
--- /dev/null
+++ b/externals/grill/vasp/source/vbuffer.h
@@ -0,0 +1,127 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_VBUFFER_H
+#define __VASP_VBUFFER_H
+
+#include "main.h"
+
+class VSymbol
+{
+public:
+ VSymbol(t_symbol *s = NULL): sym(s) { Inc(); }
+ VSymbol(const VSymbol &s): sym(s.sym) { Inc(); }
+ ~VSymbol() { Dec(); }
+
+ BL Ok() const { return sym != NULL; }
+ V Clear() { Dec(); sym = NULL; }
+
+// V *Thing() { return sym?flext_base::GetThing(sym):NULL; }
+// V Thing(V *th) { if(sym) flext_base::GetThing(sym); }
+
+ VSymbol &operator =(const VSymbol &s) { Dec(); sym = s.sym; Inc(); return *this; }
+
+ t_symbol *Symbol() { return sym; }
+ const t_symbol *Symbol() const { return sym; }
+ const C *Name() const { return flext::GetAString(Symbol()); }
+
+protected:
+ V Inc();
+ V Dec();
+
+ t_symbol *sym;
+};
+
+class VBuffer
+{
+public:
+ virtual ~VBuffer() {}
+
+ virtual BL Ok() const = 0;
+ virtual I Frames() const = 0;
+ virtual V Frames(I fr,BL keep) = 0;
+
+ virtual I Channels() const = 0;
+ virtual S *Data() = 0;
+
+ virtual V Refresh() {}
+ virtual V Dirty() {}
+
+ S *Pointer() { return Data()+Offset()*Channels()+Channel(); }
+
+ virtual VSymbol Symbol() const = 0;
+ const C *Name() const { return Symbol().Name(); }
+
+ I Channel() const { return chn; }
+ V Channel(I c) { chn = c; }
+
+ I Offset() const { return offs; }
+ V Offset(I o) { offs = o; }
+
+ I Length() const { return len; }
+ V Length(I l) { len = l; }
+
+protected:
+ VBuffer(I c = 0,I l = 0,I o = 0): chn(c),offs(o),len(l) {}
+
+ I chn,offs,len;
+};
+
+
+class SysBuf:
+ public VBuffer
+{
+public:
+ SysBuf(const VSymbol &s,I chn = 0,I len = -1,I offs = 0) { Set(s,chn,len,offs); }
+
+ virtual BL Ok() const { return buf.Ok(); }
+ virtual V Refresh() { buf.Dirty(true); }
+ virtual V Dirty() { buf.Dirty(false); }
+
+ virtual VSymbol Symbol() const { return buf.Symbol(); }
+
+ SysBuf &Set(const VSymbol &s,I chn = 0,I len = -1,I offs = 0);
+
+ virtual I Frames() const { return buf.Frames(); }
+ virtual V Frames(I fr,BL keep) { buf.Frames(fr,keep); }
+
+ virtual I Channels() const { return buf.Channels(); }
+ virtual S *Data() { return buf.Data(); }
+
+protected:
+ flext::buffer buf;
+};
+
+
+class BufEntry;
+
+class ImmBuf:
+ public VBuffer
+{
+public:
+ ImmBuf(I len);
+ ImmBuf(BufEntry *e,I len = -1,I offs = 0);
+
+ virtual BL Ok() const { return entry != NULL; }
+
+ virtual VSymbol Symbol() const;
+
+ virtual I Frames() const;
+ virtual V Frames(I fr,BL keep);
+
+ virtual I Channels() const { return 1; }
+ virtual S *Data();
+
+protected:
+ BufEntry *entry;
+};
+
+
+#endif
diff --git a/externals/grill/vasp/source/vecblk.cpp b/externals/grill/vasp/source/vecblk.cpp
new file mode 100644
index 00000000..1efc3981
--- /dev/null
+++ b/externals/grill/vasp/source/vecblk.cpp
@@ -0,0 +1,49 @@
+#include "vecblk.h"
+//#include <math.h>
+
+
+///////////////////////////////////////////////////////////////////////////
+// VecBlock class
+///////////////////////////////////////////////////////////////////////////
+
+VecBlock::VecBlock(BL cx,I msrc,I mdst,I marg,I blarg):
+ cplx(cx),asrc(msrc),barg(blarg),aarg(marg*blarg),adst(mdst)
+{
+ I i,all = asrc+aarg*blarg+adst;
+ vecs = new VBuffer *[all];
+ for(i = 0; i < all; ++i) vecs[i] = NULL;
+}
+
+VecBlock::~VecBlock()
+{
+ if(vecs) {
+ I all = asrc+aarg*barg+adst;
+ for(I i = 0; i < all; ++i)
+ if(vecs[i]) delete vecs[i];
+ delete[] vecs;
+ }
+}
+
+Vasp *VecBlock::_DstVasp(I n)
+{
+ Vasp *ret = new Vasp;
+ ret->Frames(Frames());
+ for(I i = 0; i < n; ++i) *ret += Vasp::Ref(*_Dst(i));
+ return ret;
+}
+
+Vasp *VecBlock::_SrcVasp(I n)
+{
+ Vasp *ret = new Vasp;
+ ret->Frames(Frames());
+ for(I i = 0; i < n; ++i) *ret += Vasp::Ref(*_Src(i));
+ return ret;
+}
+
+Vasp *VecBlock::_ResVasp(I n)
+{
+ return _Dst(0)?_DstVasp(n):_SrcVasp(n);
+}
+
+
+
diff --git a/externals/grill/vasp/source/vecblk.h b/externals/grill/vasp/source/vecblk.h
new file mode 100644
index 00000000..a938558e
--- /dev/null
+++ b/externals/grill/vasp/source/vecblk.h
@@ -0,0 +1,105 @@
+/*
+
+VASP modular - vector assembling signal processor / objects for Max/MSP and PD
+
+Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+For information on usage and redistribution, and for a DISCLAIMER OF ALL
+WARRANTIES, see the file, "license.txt," in this distribution.
+
+*/
+
+#ifndef __VASP_VECBLK_H
+#define __VASP_VECBLK_H
+
+#include "vasp.h"
+
+class VecBlock
+{
+public:
+
+ I Frames() const { return frms; }
+ V Frames(I fr) { frms = fr; }
+ I ArgFrames() const { return afrms; }
+ V ArgFrames(I fr) { afrms = fr; }
+ I ArgBlks() const { return barg; }
+
+ BL Complex() { return cplx; }
+
+protected:
+ VecBlock(BL cplx,I msrc,I mdst,I marg,I blarg);
+ ~VecBlock();
+
+ Vasp *_SrcVasp(I n);
+ Vasp *_DstVasp(I n);
+ Vasp *_ResVasp(I n); // either Dst or Src
+
+ VBuffer *_Src(I ix) { return vecs[ix]; }
+ VBuffer *_Dst(I ix) { return vecs[asrc+aarg*barg+ix]; }
+ V _Src(I ix,VBuffer *v) { vecs[ix] = v; }
+ V _Dst(I ix,VBuffer *v) { vecs[asrc+aarg*barg+ix] = v; }
+
+ VBuffer *_Arg(I ix,I bl = 0) { return vecs[asrc+bl*aarg+ix]; }
+ V _Arg(I ix,VBuffer *v,I bl = 0) { vecs[asrc+bl*aarg+ix] = v; }
+
+private:
+ BL cplx;
+ I asrc,adst,aarg,barg;
+ VBuffer **vecs;
+ I frms,afrms;
+};
+
+
+class RVecBlock:
+ public VecBlock
+{
+public:
+ RVecBlock(I _n,I _a = 0,I _ba = 0): VecBlock(false,_n,_n,_a,_ba),n(_n),a(_a) {}
+
+ VBuffer *Src(I ix) { return _Src(ix); }
+ VBuffer *Dst(I ix) { return _Dst(ix); }
+ V Src(I ix,VBuffer *v) { _Src(ix,v); }
+ V Dst(I ix,VBuffer *v) { _Dst(ix,v); }
+
+ VBuffer *Arg(I ix,I bl = 0) { return _Arg(ix,bl); }
+ V Arg(I ix,VBuffer *v,I bl = 0) { _Arg(ix,v,bl); }
+
+ I Vecs() const { return n; }
+ I Args() const { return a; }
+
+ Vasp *SrcVasp() { return _SrcVasp(n); }
+ Vasp *DstVasp() { return _DstVasp(n); }
+ Vasp *ResVasp() { return _ResVasp(n); }
+
+protected:
+ I n,a;
+};
+
+class CVecBlock:
+ public VecBlock
+{
+public:
+ CVecBlock(I _np,I _ap = 0,I _bap = 0): VecBlock(true,_np*2,_np*2,_ap*2,_bap),np(_np),ap(_ap) {}
+
+ VBuffer *ReSrc(I ix) { return _Src(ix*2); }
+ VBuffer *ImSrc(I ix) { return _Src(ix*2+1); }
+ VBuffer *ReDst(I ix) { return _Dst(ix*2); }
+ VBuffer *ImDst(I ix) { return _Dst(ix*2+1); }
+ V Src(I ix,VBuffer *vre,VBuffer *vim) { _Src(ix*2,vre); _Src(ix*2+1,vim); }
+ V Dst(I ix,VBuffer *vre,VBuffer *vim) { _Dst(ix*2,vre); _Dst(ix*2+1,vim); }
+
+ VBuffer *ReArg(I ix,I bl = 0) { return _Arg(ix*2,bl); }
+ VBuffer *ImArg(I ix,I bl = 0) { return _Arg(ix*2+1,bl); }
+ V Arg(I ix,VBuffer *vre,VBuffer *vim,I bl = 0) { _Arg(ix*2,vre,bl); _Arg(ix*2+1,vim,bl); }
+
+ I Pairs() const { return np; }
+ I Args() const { return ap; }
+
+ Vasp *SrcVasp() { return _SrcVasp(np*2); }
+ Vasp *DstVasp() { return _DstVasp(np*2); }
+ Vasp *ResVasp() { return _ResVasp(np*2); }
+
+protected:
+ I np,ap;
+};
+
+#endif
diff --git a/externals/grill/vasp/todo/allgemein.txt b/externals/grill/vasp/todo/allgemein.txt
new file mode 100644
index 00000000..325e8ec5
--- /dev/null
+++ b/externals/grill/vasp/todo/allgemein.txt
@@ -0,0 +1,42 @@
+Vasp allgemein:
+---------------
+
+- nicht unwichtig: alle Operationen werden zumeist nur auf 1 (reell) oder 2 (komplex) Buffer angewendet.
+ allerdings funktionieren sie immer auch für mehrere bzw. mehrere Paare
+
+
+Hilfe:
+------
+
+!! bitte die wavedisplays nicht ändern, das ist relativ kompliziert wegen graph on parent einstellungen...
+
+- Hilfe-Seite mit Abkürzungen
+
+- vasp.cnoise... Unterschied zu 2 unabhängigen vasp.noise-Kanälen demonstrieren
+
+ > M: den unterschied musst du erklären, das kannst du am besten, thomas. akustisch ist der eher schwer auszumachen (oder gar nicht)
+
+ >> T: mit den Laptop-Lautsprechern ist er vielleicht nicht zu hören, mit Monitoren aber sehr deutlich
+
+- vasp-xshift eigentlich nur sinnvol in verbindung mit einem fft-beispiel, ... xrot auch.
+
+- neue objekte in die "vasp_main" aufnehmen und entsprechend "gruppieren"
+
+ > T: neue Objekte:
+ > vasp.radio, vasp.!radio, vasp.size, vasp.size?, vasp.size+, vasp.size, vasp.size*, vasp.size/
+ > vasp.frames*, vasp.frames/, vasp.imm, vasp.copy, vasp.ccopy, vasp.peaks?, vasp.fix
+
+
+- genau überlegen, ob noch "standard-soundfiles" hinzugefügt werden sollen
+
+was passiert mit vasp_size, vasp_size?, vasp_vector ??? oder doch vasp_n ???
+alle fft-objekte, erklären, wie das mit dem prime-factor funkt.
+unterschiede zwischen amin?, min?, amax?, max? besser erklären.
+
+- was ist mit abstractions (vasp_opt zum beispiel)
+
+ > T: man sollte die in der Hilfe vielleicht auf eine eigene Seite stellen (vasp.pwrap, vasp.opt, vasp.ropt)
+
+
+- vasp_valleys sollte man gleich optimieren (nicht extra anklicken), oder? bei den peaks ist es dafür nicht so sinnvoll, ...
+
diff --git a/externals/grill/vasp/todo/marius.txt b/externals/grill/vasp/todo/marius.txt
new file mode 100644
index 00000000..15b2fdef
--- /dev/null
+++ b/externals/grill/vasp/todo/marius.txt
@@ -0,0 +1,20 @@
+Thomas' Änderungen:
+
+- vasp.frames: der Ausdruck "framesize" ist eigentlich irreführend
+ ... die kann bei verschiedenen Buffern in MaxMSP tatsächlich verschieden sein
+ framesize = sample-Länge*Bufferkanäle !!
+ besser ist frame count
+ Ich frage mich auch, ob wir die Nummernboxen bei Periodenlängen nicht durch ein
+ paar Standard-float-messages ersetzen sollten (die meisten werden wohl zu kurbeln versuchen....)
+
+- vasp.join / vasp.split.... man sollte vielleicht sagen, dass es sich um EInzelvektoren der vasps handelt=======
+
+- wavedisplay-select überprüfen.
+
+- die default-längen und resize einstellungen noch einmal überprüfen
+
+- vasp.cpowi, vasp.csqr und vasp.rpow vorläufig noch mit resize, ...
+
+- alle unnötigen objekte aus der hilfe rausnehemen.
+
+- schauen ob alle abkürzungen angeführt sind... \ No newline at end of file
diff --git a/externals/grill/vasp/todo/neue-objekte.txt b/externals/grill/vasp/todo/neue-objekte.txt
new file mode 100644
index 00000000..34519619
--- /dev/null
+++ b/externals/grill/vasp/todo/neue-objekte.txt
@@ -0,0 +1,10 @@
+liste aller objekte, die noch in die hilfe aufgenommen werden müssen
+
+envelopes
+immediate vasps
+vasp.->
+NAN-behandlung (vasp.fix)
+threads
+vasp.tilt, vasp.xtilt
+vasp.offset=,vasp.frames=
+vasp.window
diff --git a/externals/grill/vasp/todo/patcher-boys.txt b/externals/grill/vasp/todo/patcher-boys.txt
new file mode 100644
index 00000000..ebf5f846
--- /dev/null
+++ b/externals/grill/vasp/todo/patcher-boys.txt
@@ -0,0 +1,3 @@
+- Hinzufügen der neuen Objekte
+- Hilfen mit PD-Version vergleichen
+- vasp.minmax .... Hilfe ist sehr missverständlich
diff --git a/externals/grill/vasp/todo/thomas.txt b/externals/grill/vasp/todo/thomas.txt
new file mode 100644
index 00000000..4f9bc024
--- /dev/null
+++ b/externals/grill/vasp/todo/thomas.txt
@@ -0,0 +1,5 @@
+Hilfe:
+- Dokumentation (inline?) der abstractions
+
+Objekte:
+- vasp.gather .. nur bang -> Ausgabe vasp 0 ???
diff --git a/externals/grill/vasp/todo/vasp-objects.csv b/externals/grill/vasp/todo/vasp-objects.csv
new file mode 100644
index 00000000..f3757186
--- /dev/null
+++ b/externals/grill/vasp/todo/vasp-objects.csv
@@ -0,0 +1,161 @@
+"internal name
+(also for help files)";"vasp name
+(if empty: internal name)";abbreviation
+
+vasp;;
+vasp.update;;vasp.u
+vasp.check;;vasp.chk
+vasp.multi;;vasp.m
+
+vasp.sync;;
+
+vasp.split;;
+vasp.join;;
+vasp.spit;;
+vasp.gather;;
+vasp.part;;
+
+vasp.imm;;vasp.!
+
+vasp.radio;;
+
+vasp.list;;vasp.?
+vasp.nonzero;;vasp.??
+
+vasp.vector;;vasp.n
+vasp.qvectors;vasp.vectors?;vasp.n?
+
+vasp.channel;;vasp.c
+vasp.qchannel;vasp.channel?;vasp.c?
+
+vasp.frames;;vasp.f
+vasp.dframes;vasp.frames+;vasp.f+
+vasp.mframes;vasp.frames*;vasp.f*
+vasp.rframes;vasp.frames/;vasp.f/
+vasp.qframes;vasp.frames?;vasp.f?
+vasp.sframes;vasp.frames=;vasp.f=
+
+vasp.offset;;vasp.o
+vasp.doffset;vasp.offset+;vasp.o+
+vasp.qoffset;vasp.offset?;vasp.o?
+vasp.soffset;vasp.offset=;vasp.o=
+
+vasp.size;;vasp.s
+vasp.dsize;vasp.size+;vasp.s+
+vasp.msize;vasp.size*;vasp.s*
+vasp.rsize;vasp.size/;vasp.s/
+vasp.qsize;vasp.size?;vasp.s?
+
+vasp.set;;vasp.=
+vasp.cset;;vasp.c=
+vasp.copy;;vasp.->
+vasp.ccopy;;vasp.c->
+
+vasp.add;vasp.+;
+vasp.cadd;vasp.c+;
+vasp.sub;vasp.-;
+vasp.csub;vasp.c-;
+vasp.subr;vasp.!-;
+vasp.csubr;vasp.c!-;
+vasp.mul;vasp.*;
+vasp.cmul;vasp.c*;
+vasp.div;vasp./;
+vasp.cdiv;vasp.c/;
+vasp.divr;vasp.r/;
+vasp.cdivr;vasp.c!/;
+vasp.mod;vasp.%;
+
+vasp.sqr;
+vasp.ssqr;
+vasp.csqr;
+vasp.sqrt;
+vasp.ssqrt;
+vasp.pow;
+vasp.powi;
+vasp.cpowi;
+vasp.rpow;
+vasp.radd;vasp.r+
+
+vasp.exp;
+vasp.log;
+
+vasp.sign;
+vasp.abs;
+vasp.cabs;
+
+vasp.lwr;vasp.<
+vasp.gtr;vasp.>
+vasp.leq;vasp.<=
+vasp.geq;vasp.>=
+vasp.equ;vasp.==
+vasp.neq;vasp.!=
+vasp.alwr;vasp.a<
+vasp.agtr;vasp.a>
+vasp.aleq;vasp.a<=
+vasp.ageq;vasp.a>=
+
+vasp.polar;
+vasp.rect;
+
+vasp.cnorm;
+vasp.cconj;
+
+vasp.min;
+vasp.rmin;
+vasp.max;
+vasp.rmax;
+vasp.qmin;vasp.min?
+vasp.qmax;vasp.max?
+vasp.qamin;vasp.amin?
+vasp.qamax;vasp.amax?
+vasp.qrmin;vasp.rmin?
+vasp.qrmax;vasp.rmax?
+vasp.minmax;
+
+vasp.gate;
+vasp.rgate;
+
+vasp.peaks;
+vasp.rpeaks;
+vasp.valleys;
+vasp.rvalleys;
+vasp.qpeaks;vasp.peaks?
+
+vasp.shift;
+vasp.xshift;
+vasp.rot;
+vasp.xrot;
+vasp.mirr;
+vasp.xmirr;
+
+vasp.osc;
+vasp.mosc;vasp.*osc
+vasp.cosc;
+vasp.mcosc;vasp.*cosc
+vasp.phasor;
+vasp.mphasor;vasp.*phasor
+vasp.noise;
+vasp.cnoise;
+
+vasp.window;
+vasp.mwindow;vasp.*window
+vasp.iwindow;vasp.!window
+vasp.miwindow;vasp.*!window
+vasp.xwindow;
+vasp.mxwindow;vasp.*xwindow
+
+vasp.flp;
+vasp.fhp;
+
+vasp.int;
+vasp.dif;
+
+vasp.fix;
+
+vasp.tilt;
+vasp.xtilt;
+
+vasp.rfft;
+vasp.rifft;vasp.r!fft
+vasp.cfft;
+vasp.cifft;vasp.c!fft