~ubuntu-branches/ubuntu/precise/csound/precise

« back to all changes in this revision

Viewing changes to Opcodes/gab/vectorial.c

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2012-04-19 09:26:46 UTC
  • mfrom: (3.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20120419092646-96xbj1n6atuqosk2
Tags: 1:5.17.6~dfsg-1
* New upstream release
 - Do not build the wiimote opcodes (we need wiiuse).
* Add new API function to symbols file
* Disable lua opcodes, they were broken. Requires OpenMP to be enabled.
* Backport fixes from upstream:
  - Link dssi4cs with dl. Backport
  - Fix building of CsoundAC

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
    Optional arguments to some opcodes and other fixes by Andres Cabrera
21
21
    and Istvan Varga.
22
22
*/
23
 
#include "csdl.h"
 
23
//#include "csdl.h"
 
24
#include "csoundCore.h"
 
25
#include "interlocks.h"
24
26
#include "vectorial.h"
25
27
#include <math.h>
26
28
 
437
439
     if ((elements | (long)*p->kdstoffset) < 0L ||
438
440
          (elements + (long)*p->kdstoffset) > p->len) {
439
441
       return csound->InitError(csound,
440
 
                                Str("vectorop: Destination table length exceeded"));
 
442
                      Str("vectorop: Destination table length exceeded"));
441
443
     } */
442
444
    return OK;
443
445
}
451
453
 
452
454
    ftp = csound->FTnp2Find(csound, p->ifn);
453
455
    if (UNLIKELY(ftp == NULL))  {
454
 
      return csound->InitError(csound,Str("vadd_i: invalid table number %i"),
 
456
      return csound->InitError(csound,
 
457
                               Str("vadd_i: invalid table number %i"),
455
458
                               (int) *p->ifn);
456
459
    }
457
460
    vector = ftp->ftable;
708
711
    p->len2 = (int32) ftp2->flen+1;/*
709
712
    if ((elements | (int32) *p->kdstoffset) < 0L ||
710
713
         (elements + (int32) *p->kdstoffset)  > p->len1) {
711
 
      return csound->Warning(csound, Str("vectorops: Destination table length exceeded"));
 
714
      return csound->Warning(csound,
 
715
                             Str("vectorops: Destination table length exceeded"));
712
716
    }*/
713
717
    return OK;
714
718
}
1532
1536
 
1533
1537
static int vexpv_i(CSOUND *csound, VECTORSOPI *p)
1534
1538
{
1535
 
  FUNC    *ftp1, *ftp2;
1536
 
  MYFLT   *vector1, *vector2;
1537
 
  int32    i, j, n, elements, srcoffset, dstoffset, len1, len2;
 
1539
    FUNC    *ftp1, *ftp2;
 
1540
    MYFLT   *vector1, *vector2;
 
1541
    int32    i, j, n, elements, srcoffset, dstoffset, len1, len2;
1538
1542
 
1539
 
  ftp1 = csound->FTnp2Find(csound, p->ifn1);
1540
 
  ftp2 = csound->FTnp2Find(csound, p->ifn2);
1541
 
  if (UNLIKELY(ftp1 == NULL)) {
 
1543
    ftp1 = csound->FTnp2Find(csound, p->ifn1);
 
1544
    ftp2 = csound->FTnp2Find(csound, p->ifn2);
 
1545
    if (UNLIKELY(ftp1 == NULL)) {
1542
1546
      return csound->InitError(csound,
1543
1547
                               Str("vexpv_i: ifn1 invalid table number %i"),
1544
1548
                               (int) *p->ifn1);
1545
 
  }
1546
 
  else if (UNLIKELY(ftp2 == NULL))  {
1547
 
    return csound->InitError(csound,
1548
 
                             Str("vexpv_i: ifn2 invalid table number %i"),
1549
 
                             (int) *p->ifn2);
 
1549
    }
 
1550
    else if (UNLIKELY(ftp2 == NULL))  {
 
1551
      return csound->InitError(csound,
 
1552
                               Str("vexpv_i: ifn2 invalid table number %i"),
 
1553
                               (int) *p->ifn2);
1550
1554
    }
1551
1555
    /*if (*p->ifn1 == *p->ifn2)
1552
1556
      csound->Warning(csound, Str("vexpv_i: ifn1 = ifn2."));*/
1691
1695
      p->elements = (int) *p->ielements;
1692
1696
    }
1693
1697
    if (UNLIKELY(p->elements > ftp->flen )) {
1694
 
      return csound->InitError(csound, "vectorop: invalid num of elements");
 
1698
      return csound->InitError(csound, Str("vectorop: invalid num of elements"));
1695
1699
    }
1696
1700
    return OK;
1697
1701
}
1720
1724
      elements = (p->elements = (int) *p->ielements);
1721
1725
      if (UNLIKELY(elements > ftp->flen) )
1722
1726
        return csound->InitError(csound,
1723
 
                                 "vport: invalid table length or num of elements");
 
1727
                                 Str("vport: invalid table length or "
 
1728
                                     "num of elements"));
1724
1729
    }
1725
 
    else return csound->InitError(csound, "vport: invalid table");
 
1730
    else return csound->InitError(csound, Str("vport: invalid table"));
1726
1731
    if (LIKELY(*p->ifnInit)) {
1727
1732
      if (LIKELY((ftp = csound->FTnp2Find(csound,p->ifnInit)) != NULL)) {
1728
1733
        vecInit = ftp->ftable;
1729
1734
        if (UNLIKELY(elements > ftp->flen) )
1730
 
          return csound->InitError(csound, "vport: invalid init table length"
1731
 
                                   " or num of elements");
 
1735
          return csound->InitError(csound, Str("vport: invalid init table length"
 
1736
                                               " or num of elements"));
1732
1737
      }
1733
 
      else return csound->InitError(csound, "vport: invalid init table");
 
1738
      else return csound->InitError(csound, Str("vport: invalid init table"));
1734
1739
    }
1735
1740
    if (p->auxch.auxp == NULL)
1736
1741
      csound->AuxAlloc(csound, elements * sizeof(MYFLT), &p->auxch);
1880
1885
        p->elements = (int) *p->ielements;
1881
1886
        p->offset = (int) *p->idstoffset;
1882
1887
      }
1883
 
      else return csound->InitError(csound, "vrandh: Invalid table.");
 
1888
      else return csound->InitError(csound, Str("vrandh: Invalid table."));
1884
1889
      if (UNLIKELY(*p->idstoffset >= ftp->flen))
1885
1890
        return csound->InitError(csound,
1886
 
                                 "vrandh: idstoffset is greater than table length.");
 
1891
                                 Str("vrandh: idstoffset is greater than"
 
1892
                                     " table length."));
1887
1893
      p->vector = ftp->ftable + p->offset;
1888
1894
      if (UNLIKELY(p->elements + p->offset > ftp->flen)) {
1889
1895
        csound->Warning(csound,
1890
 
                        "randh: Table length exceeded, last elements discarded.");
 
1896
                        Str("randh: Table length exceeded, "
 
1897
                            "last elements discarded."));
1891
1898
        p->elements = p->offset - ftp->flen;
1892
1899
      }
1893
1900
    }
1977
1984
        p->elements = (int) *p->ielements;
1978
1985
        p->offset = (int) *p->idstoffset;
1979
1986
      }
1980
 
      else return csound->InitError(csound, "vrandi: Invalid table.");
 
1987
      else return csound->InitError(csound, Str("vrandi: Invalid table."));
1981
1988
      if (UNLIKELY(p->offset >= ftp->flen))
1982
1989
        return csound->InitError(csound,
1983
 
                                 "vrandi: idstoffset is greater than table length.");
 
1990
                                 Str("vrandi: idstoffset is greater than"
 
1991
                                     "table length."));
1984
1992
      p->vector = ftp->ftable + p->offset;
1985
1993
      if (UNLIKELY(p->elements > ftp->flen)) {
1986
1994
        csound->Warning(csound,
1987
 
                        "vrandi: Table length exceeded, last elements discarded.");
 
1995
                        Str("vrandi: Table length exceeded, "
 
1996
                            "last elements discarded."));
1988
1997
        p->elements = p->offset - ftp->flen;
1989
1998
      }
1990
1999
    }
2054
2063
    return OK;
2055
2064
}
2056
2065
 
2057
 
static int vecdly_set(CSOUND *csound,VECDEL *p)
 
2066
static int vecdly_set(CSOUND *csound, VECDEL *p)
2058
2067
{
2059
2068
    FUNC        *ftp;
2060
2069
    int elements = (p->elements = (int) *p->ielements), j;
2064
2073
      p->outvec = ftp->ftable;
2065
2074
      elements = (p->elements = (int) *p->ielements);
2066
2075
      if (UNLIKELY( elements > ftp->flen ))
2067
 
        return csound->InitError(csound, "vecdelay: invalid num of elements");
 
2076
        return csound->InitError(csound,
 
2077
                                 Str("vecdelay: invalid num of elements"));
2068
2078
    }
2069
 
    else return csound->InitError(csound, "vecdly: invalid output table");
 
2079
    else return csound->InitError(csound, Str("vecdly: invalid output table"));
2070
2080
    if (LIKELY((ftp = csound->FTnp2Find(csound,p->ifnIn)) != NULL)) {
2071
2081
      p->invec = ftp->ftable;
2072
2082
      if (UNLIKELY(elements > ftp->flen))
2073
 
        return csound->InitError(csound, "vecdelay: invalid num of elements");
 
2083
        return csound->InitError(csound,
 
2084
                                 Str("vecdelay: invalid num of elements"));
2074
2085
    }
2075
 
    else return csound->InitError(csound, "vecdly: invalid input table");
 
2086
    else return csound->InitError(csound, Str("vecdly: invalid input table"));
2076
2087
    if (LIKELY((ftp = csound->FTnp2Find(csound,p->ifnDel)) != NULL)) {
2077
2088
      p->dlyvec = ftp->ftable;
2078
2089
      if (UNLIKELY( elements > ftp->flen ))
2079
 
        return csound->InitError(csound, "vecdelay: invalid num of elements");
 
2090
        return csound->InitError(csound,
 
2091
                                 Str("vecdelay: invalid num of elements"));
2080
2092
    }
2081
 
    else return csound->InitError(csound, "vecdly: invalid delay table");
 
2093
    else return csound->InitError(csound, Str("vecdly: invalid delay table"));
2082
2094
 
2083
2095
    n = (p->maxd = (int32) (*p->imaxd * csound->ekr));
2084
2096
    if (n == 0) n = (p->maxd = 1);
2123
2135
    MYFLT *outVec = p->outvec, *dlyVec = p->dlyvec;
2124
2136
    int elements = p->elements;
2125
2137
    if (UNLIKELY(buf==NULL)) {
2126
 
      return csound->InitError(csound, "vecdly: not initialized");
 
2138
      return csound->InitError(csound, Str("vecdly: not initialised"));
2127
2139
    }
2128
2140
    do {
2129
2141
      (*buf)[*indx] = *inVec++;
2165
2177
      p->elements = (int) *p->ielements;
2166
2178
    }
2167
2179
    if (UNLIKELY( p->elements > ftp->flen ))
2168
 
      return csound->InitError(csound, "vlinseg/vexpseg: invalid num. of elements");
 
2180
      return csound->InitError(csound,
 
2181
                               Str("vlinseg/vexpseg: invalid num. of elements"));
2169
2182
 
2170
2183
    /* memset(p->vector, 0, sizeof(MYFLT)*p->elements); */
2171
2184
    vector = p->vector;
2175
2188
      *vector++ = FL(0.0);
2176
2189
    } while (--flength);
2177
2190
 
2178
 
    if (UNLIKELY(**argp <= FL(0.0)))  return NOTOK; /* if idur1 <= 0, skip init  */
 
2191
    if (UNLIKELY(**argp <= FL(0.0)))
 
2192
      return NOTOK; /* if idur1 <= 0, skip init */
2179
2193
    p->cursegp = segp;              /* else proceed from 1st seg */
2180
2194
    segp--;
2181
2195
    do {
2206
2220
    MYFLT       *curtab, *nxttab,curval, nxtval, durovercnt=FL(0.0), *vector;
2207
2221
    int32        flength, upcnt;
2208
2222
    if (UNLIKELY(p->auxch.auxp==NULL)) {
2209
 
      return csound->InitError(csound, "tableseg: not initialized");
 
2223
      return csound->InitError(csound, Str("tableseg: not initialised"));
2210
2224
    }
2211
2225
    segp = p->cursegp;
2212
2226
    curtab = segp->function->ftable;
2236
2250
    int32        flength, upcnt;
2237
2251
 
2238
2252
    if (UNLIKELY(p->auxch.auxp==NULL)) {
2239
 
      return csound->InitError(csound, "tablexseg: not initialized");
 
2253
      return csound->InitError(csound, Str("tablexseg: not initialised"));
2240
2254
    }
2241
2255
    segp = p->cursegp;
2242
2256
    curtab = segp->function->ftable;
2283
2297
      p->elements = (int) *p->ielements;
2284
2298
    }
2285
2299
    if ( p->elements > ftp->flen )
2286
 
      return csound->InitError(csound, "vphaseseg: invalid num. of elements");
 
2300
      return csound->InitError(csound,
 
2301
                               Str("vphaseseg: invalid num. of elements"));
2287
2302
    vector = p->vector;
2288
2303
    flength = p->elements;
2289
2304
 
2368
2383
static int kdel_set(CSOUND *csound,KDEL *p)
2369
2384
{
2370
2385
    uint32 n;
2371
 
    MYFLT *buf;
2372
2386
    n = (p->maxd = (int32) (*p->imaxd * csound->ekr));
2373
2387
    if (n == 0) n = (p->maxd = 1);
2374
2388
 
2389
2403
    MYFLT *buf = (MYFLT *)p->aux.auxp, fv1, fv2;
2390
2404
 
2391
2405
    if (UNLIKELY(buf==NULL)) {
2392
 
      return csound->InitError(csound, "vdelayk: not initialized");
 
2406
      return csound->InitError(csound, Str("vdelayk: not initialised"));
2393
2407
    }
2394
2408
 
2395
2409
    indx = p->left;
2422
2436
      p->outVec = ftp->ftable;
2423
2437
      elements = (p->elements = (int) *p->ielements);
2424
2438
      if (UNLIKELY( elements > ftp->flen ))
2425
 
        return csound->InitError(csound, "cella: invalid num of elements");
 
2439
        return csound->InitError(csound, Str("cella: invalid num of elements"));
2426
2440
    }
2427
 
    else return csound->InitError(csound, "cella: invalid output table");
 
2441
    else return csound->InitError(csound, Str("cella: invalid output table"));
2428
2442
    if (LIKELY((ftp = csound->FTnp2Find(csound,p->initStateFunc)) != NULL)) {
2429
2443
      initVec = (p->initVec = ftp->ftable);
2430
2444
      if (UNLIKELY(elements > ftp->flen ))
2431
 
        return csound->InitError(csound, "cella: invalid num of elements");
 
2445
        return csound->InitError(csound, Str("cella: invalid num of elements"));
2432
2446
    }
2433
 
    else return csound->InitError(csound, "cella: invalid initial state table");
 
2447
    else return csound->InitError(csound,
 
2448
                                  Str("cella: invalid initial state table"));
2434
2449
    if (LIKELY((ftp = csound->FTnp2Find(csound,p->iRuleFunc)) != NULL)) {
2435
2450
      p->ruleVec = ftp->ftable;
2436
2451
    }
2437
 
    else return csound->InitError(csound, "cella: invalid rule table");
 
2452
    else return csound->InitError(csound, Str("cella: invalid rule table"));
2438
2453
 
2439
2454
    if (p->auxch.auxp == NULL)
2440
2455
      csound->AuxAlloc(csound, elements * sizeof(MYFLT) * 2, &p->auxch);
2498
2513
 
2499
2514
#define S(x)    sizeof(x)
2500
2515
 
2501
 
static OENTRY localops[] = {
2502
 
  { "vtablei", S(MTABLEI),   1, "",   "iiiim", (SUBR)mtable_i,  NULL },
2503
 
  { "vtablek", S(MTABLE),    3, "",   "kkkiz", (SUBR)mtable_set, (SUBR)mtable_k, NULL },
2504
 
  { "vtablea", S(MTABLE),    5, "",   "akkiy", (SUBR)mtable_set, NULL, (SUBR)mtable_a },
2505
 
  { "vtablewi", S(MTABLEIW), 1, "",   "iiim", (SUBR)mtablew_i,  NULL },
2506
 
  { "vtablewk", S(MTABLEW),  3, "",   "kkiz", (SUBR)mtablew_set, (SUBR)mtablew_k, NULL },
2507
 
  { "vtablewa", S(MTABLEW),  5, "",   "akiy", (SUBR)mtablew_set, NULL, (SUBR)mtablew_a },
2508
 
  { "vtabi", S(MTABI),       1, "",   "iim", (SUBR)mtab_i,  NULL },
2509
 
  { "vtabk", S(MTAB),        3, "",   "kiz", (SUBR)mtab_set, (SUBR)mtab_k, NULL },
2510
 
  { "vtaba", S(MTAB),        5, "",  "aiy", (SUBR)mtab_set, NULL, (SUBR)mtab_a },
2511
 
  { "vtabwi", S(MTABIW),     1, "",  "iim", (SUBR)mtabw_i,  NULL },
2512
 
  { "vtabwk", S(MTABW),      3, "",  "kiz", (SUBR)mtabw_set, (SUBR)mtabw_k, NULL },
2513
 
  { "vtabwa", S(MTABW),      5, "",  "aiy", (SUBR)mtabw_set, NULL, (SUBR)mtabw_a },
 
2516
OENTRY vectorial_localops[] = {
 
2517
  { "vtablei", S(MTABLEI),   TR|1, "",   "iiiim", (SUBR)mtable_i,  NULL },
 
2518
  { "vtablek", S(MTABLE),    TR|3, "",   "kkkiz", (SUBR)mtable_set, (SUBR)mtable_k, NULL },
 
2519
  { "vtablea", S(MTABLE),    TR|5, "",   "akkiy", (SUBR)mtable_set, NULL, (SUBR)mtable_a },
 
2520
  { "vtablewi", S(MTABLEIW), TB|1, "",   "iiim", (SUBR)mtablew_i,  NULL },
 
2521
  { "vtablewk", S(MTABLEW),  TB|3, "",   "kkiz", (SUBR)mtablew_set, (SUBR)mtablew_k, NULL },
 
2522
  { "vtablewa", S(MTABLEW),  TB|5, "",   "akiy", (SUBR)mtablew_set, NULL, (SUBR)mtablew_a },
 
2523
  { "vtabi", S(MTABI),       TR|1, "",   "iim", (SUBR)mtab_i,  NULL },
 
2524
  { "vtabk", S(MTAB),        TR|3, "",   "kiz", (SUBR)mtab_set, (SUBR)mtab_k, NULL },
 
2525
  { "vtaba", S(MTAB),        TR|5, "",  "aiy", (SUBR)mtab_set, NULL, (SUBR)mtab_a },
 
2526
  { "vtabwi", S(MTABIW),     TB|1, "",  "iim", (SUBR)mtabw_i,  NULL },
 
2527
  { "vtabwk", S(MTABW),      TB|3, "",  "kiz", (SUBR)mtabw_set, (SUBR)mtabw_k, NULL },
 
2528
  { "vtabwa", S(MTABW),      TB|5, "",  "aiy", (SUBR)mtabw_set, NULL, (SUBR)mtabw_a },
2514
2529
 
2515
 
  { "vadd",   S(VECTOROP),   3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vaddk },
2516
 
  { "vadd_i", S(VECTOROPI),  1, "",  "iiio", (SUBR) vadd_i, NULL, NULL        },
2517
 
  { "vmult",  S(VECTOROP),   3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vmultk},
2518
 
  { "vmult_i", S(VECTOROPI), 1, "",  "iiio", (SUBR) vmult_i, NULL, NULL       },
2519
 
  { "vpow",   S(VECTOROP),   3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vpowk },
2520
 
  { "vpow_i", S(VECTOROPI),  1, "",  "iiio", (SUBR) vpow_i, NULL, NULL        },
2521
 
  { "vexp",   S(VECTOROP),   3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vexpk },
2522
 
  { "vexp_i", S(VECTOROPI),  1, "",  "iiio", (SUBR) vexp_i, NULL, NULL        },
2523
 
  { "vaddv",  S(VECTORSOP),  3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vaddvk },
2524
 
  { "vaddv_i",  S(VECTORSOPI),  1, "",  "iiioo", (SUBR)vaddv_i, NULL, NULL        },
2525
 
  { "vsubv",  S(VECTORSOP),  3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vsubvk },
2526
 
  { "vsubv_i",  S(VECTORSOPI),  1, "",  "iiioo", (SUBR)vsubv_i, NULL, NULL        },
2527
 
  { "vmultv", S(VECTORSOP),  3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vmultvk},
2528
 
  { "vmultv_i", S(VECTORSOPI),  1, "",  "iiioo", (SUBR)vmultv_i, NULL, NULL       },
2529
 
  { "vdivv",  S(VECTORSOP),  3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vdivvk },
2530
 
  { "vdivv_i",  S(VECTORSOPI),  1, "",  "iiioo", (SUBR)vdivv_i, NULL, NULL        },
2531
 
  { "vpowv",  S(VECTORSOP),  3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vpowvk },
2532
 
  { "vpowv_i",  S(VECTORSOPI),  1, "",  "iiioo", (SUBR)vpowv_i, NULL, NULL      },
2533
 
  { "vexpv",  S(VECTORSOP),  3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vexpvk },
2534
 
  { "vexpv_i",  S(VECTORSOPI),  1, "",  "iiioo", (SUBR)vexpv_i, NULL, NULL      },
2535
 
  { "vcopy",  S(VECTORSOP),  3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vcopy },
2536
 
  { "vcopy_i", S(VECTORSOP), 1, "",  "iiioo", (SUBR) vcopy_i, NULL, NULL      },
2537
 
  { "vmap",   S(VECTORSOPI),  1, "",  "iiioo", (SUBR)vmap_i, NULL, NULL          },
2538
 
  { "vlimit", S(VLIMIT),     3, "",  "ikki",(SUBR)vlimit_set, (SUBR)vlimit    },
2539
 
  { "vwrap",  S(VLIMIT),     3, "",  "ikki",(SUBR)vlimit_set, (SUBR) vwrap    },
 
2530
  { "vadd",   S(VECTOROP),   TB|3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vaddk },
 
2531
  { "vadd_i", S(VECTOROPI),  TB|1, "",  "iiio", (SUBR) vadd_i, NULL, NULL        },
 
2532
  { "vmult",  S(VECTOROP),   TB|3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vmultk},
 
2533
  { "vmult_i", S(VECTOROPI), TB|1, "",  "iiio", (SUBR) vmult_i, NULL, NULL       },
 
2534
  { "vpow",   S(VECTOROP),   TB|3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vpowk },
 
2535
  { "vpow_i", S(VECTOROPI),  TB|1, "",  "iiio", (SUBR) vpow_i, NULL, NULL        },
 
2536
  { "vexp",   S(VECTOROP),   TB|3, "",  "ikkOO", (SUBR)vectorOp_set, (SUBR) vexpk },
 
2537
  { "vexp_i", S(VECTOROPI),  TB|1, "",  "iiio", (SUBR) vexp_i, NULL, NULL        },
 
2538
  { "vaddv",  S(VECTORSOP),  TB|3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vaddvk },
 
2539
  { "vaddv_i",  S(VECTORSOPI), TB|1, "",  "iiioo", (SUBR)vaddv_i, NULL, NULL        },
 
2540
  { "vsubv",  S(VECTORSOP),  TB|3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vsubvk },
 
2541
  { "vsubv_i",  S(VECTORSOPI),  TB|1, "",  "iiioo", (SUBR)vsubv_i, NULL, NULL        },
 
2542
  { "vmultv", S(VECTORSOP),  TB|3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vmultvk},
 
2543
  { "vmultv_i", S(VECTORSOPI),  TB|1, "",  "iiioo", (SUBR)vmultv_i, NULL, NULL       },
 
2544
  { "vdivv",  S(VECTORSOP), TB| 3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vdivvk },
 
2545
  { "vdivv_i",  S(VECTORSOPI),  TB|1, "",  "iiioo", (SUBR)vdivv_i, NULL, NULL        },
 
2546
  { "vpowv",  S(VECTORSOP),  TB|3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vpowvk },
 
2547
  { "vpowv_i",  S(VECTORSOPI),  TB|1, "",  "iiioo", (SUBR)vpowv_i, NULL, NULL      },
 
2548
  { "vexpv",  S(VECTORSOP),  TB|3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vexpvk },
 
2549
  { "vexpv_i",  S(VECTORSOPI),  TB|1, "",  "iiioo", (SUBR)vexpv_i, NULL, NULL      },
 
2550
  { "vcopy",  S(VECTORSOP),  TB|3, "",  "iikOOO", (SUBR)vectorsOp_set, (SUBR) vcopy },
 
2551
  { "vcopy_i", S(VECTORSOP), TB|1, "",  "iiioo", (SUBR) vcopy_i, NULL, NULL   },
 
2552
  { "vmap",   S(VECTORSOPI), TB|1, "",  "iiioo", (SUBR)vmap_i, NULL, NULL     },
 
2553
  { "vlimit", S(VLIMIT),  TR|3, "",  "ikki",(SUBR)vlimit_set, (SUBR)vlimit    },
 
2554
  { "vwrap",  S(VLIMIT),  TB|3, "",  "ikki",(SUBR)vlimit_set, (SUBR) vwrap    },
2540
2555
  { "vmirror", S(VLIMIT),    3, "",  "ikki",(SUBR)vlimit_set, (SUBR)vmirror   },
2541
 
  { "vlinseg", S(VSEG),      3, "",  "iin", (SUBR)vseg_set,   (SUBR)vlinseg   },
 
2556
  { "vlinseg", S(VSEG),   TB|3, "",  "iin", (SUBR)vseg_set,   (SUBR)vlinseg   },
2542
2557
  { "vexpseg", S(VSEG),      3, "",  "iin", (SUBR)vseg_set,   (SUBR)vexpseg   },
2543
 
  { "vrandh", S(VRANDH),     3, "",  "ikkiovoo",(SUBR)vrandh_set, (SUBR) vrandh   },
2544
 
  { "vrandi", S(VRANDI),     3, "",  "ikkiovoo",(SUBR)vrandi_set, (SUBR)vrandi    },
2545
 
  { "vport",  S(VPORT),      3, "",  "ikio",(SUBR)vport_set,  (SUBR)vport     },
 
2558
  { "vrandh", S(VRANDH),  TB|3, "",  "ikkiovoo",(SUBR)vrandh_set, (SUBR) vrandh},
 
2559
  { "vrandi", S(VRANDI),  TB|3, "",  "ikkiovoo",(SUBR)vrandi_set, (SUBR)vrandi },
 
2560
  { "vport",  S(VPORT),   TB|3, "",  "ikio",(SUBR)vport_set,  (SUBR)vport     },
2546
2561
  { "vecdelay", S(VECDEL),   3, "",  "iiiiio",(SUBR)vecdly_set, (SUBR)vecdly  },
2547
2562
  { "vdelayk", S(KDEL),      3, "k", "kkioo",(SUBR)kdel_set,  (SUBR)kdelay    },
2548
 
  { "vcella", S(CELLA),      3, "",  "kkiiiiip",(SUBR)ca_set, (SUBR)ca        }
 
2563
  { "vcella", S(CELLA),      TR|3, "",  "kkiiiiip",(SUBR)ca_set, (SUBR)ca     }
2549
2564
};
2550
2565
 
2551
2566
int gab_vectorial_init_(CSOUND *csound)
2552
2567
{
2553
 
    return csound->AppendOpcodes(csound, &(localops[0]),
2554
 
                                 (int) (sizeof(localops) / sizeof(OENTRY)));
 
2568
    return
 
2569
      csound->AppendOpcodes(csound, &(vectorial_localops[0]),
 
2570
                            (int) (sizeof(vectorial_localops) / sizeof(OENTRY)));
2555
2571
}
2556
2572
 
 
2573