Herrpaule

complet

Feb 22nd, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 26.49 KB | None | 0 0
  1. <patch-1.0>
  2.    <obj type="gpio/spi/config" sha="62af644b09e7f654b36d66533da8ea5971ddb351" uuid="d3e75d8a02e2ccabbbc2af3bc2fcdb8ea65a6133" name="config_1" x="56" y="0">
  3.       <params/>
  4.       <attribs>
  5.          <combo attributeName="clock_polarity" selection="CPOL=0"/>
  6.          <combo attributeName="clock_phase" selection="CPHA=0"/>
  7.          <combo attributeName="baudrate" selection="FPCLK/64"/>
  8.          <combo attributeName="format" selection="LSB first"/>
  9.       </attribs>
  10.    </obj>
  11.    <obj type="script/script2" sha="362a4413ceaefbe716480bf8f9c62eb3587fe6c0" uuid="d39e743cf47c9221f4e99c133430148cf74c68c5" name="script2_1" x="196" y="0">
  12.       <params/>
  13.       <attribs>
  14.          <text attributeName="script">
  15.             <sText><![CDATA[uint8_t *txbuf;
  16. uint8_t *rxbuf;
  17.  
  18. int pin = 0;
  19.  
  20. void setup(void){
  21.     static uint8_t _txbuf[8] __attribute__ ((section (".sram2")));
  22.     static uint8_t _rxbuf[8] __attribute__ ((section (".sram2")));
  23.     txbuf = _txbuf;
  24.     rxbuf = _rxbuf;
  25.  
  26.     palSetPadMode(GPIOA,2,PAL_MODE_OUTPUT_PUSHPULL);
  27.     palWritePad(GPIOA,2,1);
  28.     palSetPadMode(GPIOA,3,PAL_MODE_OUTPUT_PUSHPULL);
  29.     palWritePad(GPIOA,3,1);
  30. }
  31.  
  32. void loop(void){
  33.  
  34.    
  35.     txbuf[2] = 0b00000000;
  36.    
  37.         for(int pin=0; pin<8; pin++){
  38.  
  39.             txbuf[0] = pin < 4 ? 0b01100000 : 0b11100000;
  40.      
  41.             if (pin % 4 == 0) { // pin == 0 || pin == 4
  42.                 txbuf[1] = 0b00000000;
  43.             } else if (pin % 4 == 1) { // pin == 1 || pin == 5
  44.                 txbuf[1] = 0b00000010;
  45.             } else if (pin % 4 == 2) { // pin == 2 || pin == 6
  46.                 txbuf[1] = 0b00000001;
  47.             } else {
  48.                 txbuf[1] = 0b00000011;
  49.             }
  50.            
  51.  
  52.  
  53.        
  54.         palWritePad(GPIOA,3,0);
  55.         spiSelect(&SPID1);      // START SPI
  56.         spiSend(&SPID1,3,txbuf);
  57.         spiReceive(&SPID1,3,rxbuf);
  58.         spiUnselect(&SPID1);
  59.         palWritePad(GPIOA,3,1);
  60.  
  61.    
  62.         int z = (rxbuf[1] << 8| rxbuf[0]) << 16;
  63.  
  64.  
  65.  
  66.         if (pin == 0){
  67.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv0_value],z,0xFFFD);
  68.         }
  69.         else if (pin == 1){
  70.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv1_value],z,0xFFFD);
  71.         }
  72.         else if (pin == 2){
  73.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv2_value],z,0xFFFD);
  74.         }
  75.         else if (pin == 3){
  76.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv3_value],z,0xFFFD);
  77.         }
  78.         else if (pin == 4){
  79.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv4_value],z,0xFFFD);
  80.         }
  81.         else if (pin == 5){
  82.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv5_value],z,0xFFFD);
  83.         }
  84.         else if (pin == 6){
  85.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv6_value],z,0xFFFD);
  86.         }
  87.         else if (pin == 7){
  88.             PExParameterChange(&parent->PExch[PARAM_INDEX_cv7_value],z,0xFFFD);
  89.         }
  90.        
  91.         chThdSleepMilliseconds(1);
  92.  
  93.         }
  94.        
  95.         txbuf[2] = 0b00000000;
  96.    
  97.         for(int pin=0; pin<8; pin++){
  98.  
  99.             txbuf[0] = pin < 4 ? 0b01100000 : 0b11100000;
  100.      
  101.             if (pin % 4 == 0) { // pin == 0 || pin == 4
  102.                 txbuf[1] = 0b00000000;
  103.             } else if (pin % 4 == 1) { // pin == 1 || pin == 5
  104.                 txbuf[1] = 0b00000010;
  105.             } else if (pin % 4 == 2) { // pin == 2 || pin == 6
  106.                 txbuf[1] = 0b00000001;
  107.             } else {
  108.                 txbuf[1] = 0b00000011;
  109.             }
  110.            
  111.  
  112.  
  113.        
  114.         palWritePad(GPIOA,2,0);
  115.         spiSelect(&SPID1);      // START SPI
  116.         spiSend(&SPID1,3,txbuf);
  117.         spiReceive(&SPID1,3,rxbuf);
  118.         spiUnselect(&SPID1);
  119.         palWritePad(GPIOA,2,1);
  120.  
  121.    
  122.         int z = 0x07FFFFFF - ((rxbuf[1] << 8| rxbuf[0]) << 16);
  123.    
  124.    
  125.         if (pin == 0){
  126.             PExParameterChange(&parent->PExch[PARAM_INDEX_p0_value],z,0xFFFD);
  127.         }
  128.         else if (pin == 1){
  129.             PExParameterChange(&parent->PExch[PARAM_INDEX_p1_value],z,0xFFFD);
  130.         }
  131.         else if (pin == 2){
  132.             PExParameterChange(&parent->PExch[PARAM_INDEX_p2_value],z,0xFFFD);
  133.         }
  134.         else if (pin == 3){
  135.             PExParameterChange(&parent->PExch[PARAM_INDEX_p3_value],z,0xFFFD);
  136.         }
  137.         else if (pin == 4){
  138.             PExParameterChange(&parent->PExch[PARAM_INDEX_p4_value],z,0xFFFD);
  139.         }
  140.         else if (pin == 5){
  141.             PExParameterChange(&parent->PExch[PARAM_INDEX_p5_value],z,0xFFFD);
  142.         }
  143.         else if (pin == 6){
  144.             PExParameterChange(&parent->PExch[PARAM_INDEX_p6_value],z,0xFFFD);
  145.         }
  146.         else if (pin == 7){
  147.             PExParameterChange(&parent->PExch[PARAM_INDEX_p7_value],(z),0xFFFD);
  148.         }
  149.        
  150.         chThdSleepMilliseconds(1);
  151.         }
  152.    
  153. }]]></sText>
  154.          </text>
  155.       </attribs>
  156.    </obj>
  157.    <comment type="patch/comment" x="56" y="112" text="PA5 = SCK"/>
  158.    <comment type="patch/comment" x="294" y="112" text="PA5 = SCK"/>
  159.    <comment type="patch/comment" x="56" y="126" text="PA6 = MISO"/>
  160.    <comment type="patch/comment" x="294" y="126" text="PA6 = MISO"/>
  161.    <comment type="patch/comment" x="56" y="140" text="PA7 = MOSI"/>
  162.    <comment type="patch/comment" x="294" y="140" text="PA7 = MOSI"/>
  163.    <comment type="patch/comment" x="56" y="154" text="PA4 = NSS"/>
  164.    <comment type="patch/comment" x="294" y="154" text="PA4 = NSS"/>
  165.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p0" x="294" y="168">
  166.       <params>
  167.          <frac32.u.map name="value" value="32.15624952316284"/>
  168.       </params>
  169.       <attribs/>
  170.    </obj>
  171.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p4" x="406" y="168">
  172.       <params>
  173.          <frac32.u.map name="value" value="32.03124952316284"/>
  174.       </params>
  175.       <attribs/>
  176.    </obj>
  177.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv4" x="56" y="182">
  178.       <params>
  179.          <frac32.u.map name="value" value="46.09375"/>
  180.       </params>
  181.       <attribs/>
  182.    </obj>
  183.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p1" x="294" y="252">
  184.       <params>
  185.          <frac32.u.map name="value" value="32.09374952316284"/>
  186.       </params>
  187.       <attribs/>
  188.    </obj>
  189.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p5" x="406" y="252">
  190.       <params>
  191.          <frac32.u.map name="value" value="32.12499952316284"/>
  192.       </params>
  193.       <attribs/>
  194.    </obj>
  195.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv6" x="56" y="266">
  196.       <params>
  197.          <frac32.u.map name="value" value="37.40625"/>
  198.       </params>
  199.       <attribs/>
  200.    </obj>
  201.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv7" x="56" y="350">
  202.       <params>
  203.          <frac32.u.map name="value" value="63.9375"/>
  204.       </params>
  205.       <attribs/>
  206.    </obj>
  207.    <obj type="euxo/gate" sha="7ba08a06ed1ecb39567238f4290a90c1b0e51f6b" uuid="41c2b366ce6a8906e2a535492e105bbbabbb943b" name="gate_1" x="756" y="476">
  208.       <params/>
  209.       <attribs/>
  210.    </obj>
  211.    <obj type="euxo/button-led" sha="f009e129636c60676b92d441e0199c6d4a61a0a3" uuid="88d2151461aa28402c82fe2802243d8a9d924860" name="button-led_1" x="854" y="476">
  212.       <params/>
  213.       <attribs/>
  214.    </obj>
  215.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p2" x="1050" y="602">
  216.       <params>
  217.          <frac32.u.map name="value" value="21.718749523162842"/>
  218.       </params>
  219.       <attribs/>
  220.    </obj>
  221.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_8" x="1134" y="602">
  222.       <params/>
  223.       <attribs/>
  224.    </obj>
  225.    <obj type="patch/modsource" sha="e0ee10b85ac38b70a682a69ace823af08f4b707d" uuid="c98f018a8d204ef6df1bf7008af6fd7d20f12fe4" name="mod1" x="1288" y="602">
  226.       <params/>
  227.       <attribs/>
  228.    </obj>
  229.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv1" x="630" y="616">
  230.       <params>
  231.          <frac32.u.map name="value" value="23.4375"/>
  232.       </params>
  233.       <attribs/>
  234.    </obj>
  235.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_2" x="700" y="616">
  236.       <params/>
  237.       <attribs/>
  238.    </obj>
  239.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p6" x="154" y="686">
  240.       <params>
  241.          <frac32.u.map name="value" value="32.15624952316284"/>
  242.       </params>
  243.       <attribs/>
  244.    </obj>
  245.    <obj type="logic/change" sha="31f9f39b8a82231a3534fbcf7b4dd65416f283e" uuid="42071f8cb4cfe1f35956c0bd5a313a57e049bec4" name="change_1" x="420" y="686">
  246.       <params/>
  247.       <attribs/>
  248.    </obj>
  249.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv0" x="630" y="700">
  250.       <params>
  251.          <frac32.u.map name="value" value="32.5"/>
  252.       </params>
  253.       <attribs/>
  254.    </obj>
  255.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_3" x="700" y="700">
  256.       <params/>
  257.       <attribs/>
  258.    </obj>
  259.    <obj type="midi/out/cc" sha="1b744279459ce1e561d7d64d8c8c1b5eec0258bf" uuid="7ca9b2c1b4339022c491a8afd70353c17d765584" name="cc_1" x="420" y="728">
  260.       <params/>
  261.       <attribs>
  262.          <combo attributeName="device" selection="usb device port 1"/>
  263.          <spinner attributeName="channel" value="1"/>
  264.          <spinner attributeName="cc" value="14"/>
  265.       </attribs>
  266.    </obj>
  267.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="note" x="1204" y="742">
  268.       <params>
  269.          <frac32.u.map name="value" value="64.0"/>
  270.       </params>
  271.       <attribs/>
  272.    </obj>
  273.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv2" x="630" y="784">
  274.       <params>
  275.          <frac32.u.map name="value" value="41.8125"/>
  276.       </params>
  277.       <attribs/>
  278.    </obj>
  279.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_4" x="700" y="784">
  280.       <params/>
  281.       <attribs/>
  282.    </obj>
  283.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="velo" x="1204" y="826">
  284.       <params>
  285.          <frac32.u.map name="value" value="64.0"/>
  286.       </params>
  287.       <attribs/>
  288.    </obj>
  289.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_11" x="1316" y="826">
  290.       <params/>
  291.       <attribs/>
  292.    </obj>
  293.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv3" x="630" y="868">
  294.       <params>
  295.          <frac32.u.map name="value" value="16.125"/>
  296.       </params>
  297.       <attribs/>
  298.    </obj>
  299.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_5" x="700" y="868">
  300.       <params/>
  301.       <attribs/>
  302.    </obj>
  303.    <obj type="env/adsr m" sha="1f562efbdacf6ce50c72a52bef93223b46fed8e3" uuid="98bd39fb828c392b28126d259cb5175e6f6ea34b" name="adsr_2" x="882" y="868">
  304.       <params>
  305.          <frac32.s.map name="a" value="0.0"/>
  306.          <frac32.s.map name="d" value="0.0"/>
  307.          <frac32.u.map name="s" value="0.0"/>
  308.          <frac32.s.map name="r" value="0.0"/>
  309.       </params>
  310.       <attribs/>
  311.    </obj>
  312.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_12" x="1316" y="868">
  313.       <params/>
  314.       <attribs/>
  315.    </obj>
  316.    <obj type="midi/out/note" sha="30f60759a7391e48e5c23608906d46ce3c44df8c" uuid="a76ae870da278cbbce5501a57ce7bd0e0ea4215c" name="note_1" x="1484" y="868">
  317.       <params/>
  318.       <attribs>
  319.          <combo attributeName="device" selection="usb device port 1"/>
  320.          <spinner attributeName="channel" value="1"/>
  321.       </attribs>
  322.    </obj>
  323.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p3" x="1260" y="1190">
  324.       <params>
  325.          <frac32.u.map name="value" value="5.062499523162842"/>
  326.       </params>
  327.       <attribs/>
  328.    </obj>
  329.    <obj type="ctrl/dial b" sha="b26f881dfa1451f0269e068eb6b3d824b43b41d3" uuid="862e7d7f29093cb1ce4aed72244d118ad4d46692" name="dial_3" x="1526" y="1232">
  330.       <params>
  331.          <frac32.s.map name="value" value="-5.0"/>
  332.       </params>
  333.       <attribs/>
  334.    </obj>
  335.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_7" x="1596" y="1232">
  336.       <params/>
  337.       <attribs/>
  338.    </obj>
  339.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="p7" x="602" y="1288">
  340.       <params>
  341.          <frac32.u.map name="value" value="28.624999523162842"/>
  342.       </params>
  343.       <attribs/>
  344.    </obj>
  345.    <obj type="script/script2" sha="362a4413ceaefbe716480bf8f9c62eb3587fe6c0" uuid="d39e743cf47c9221f4e99c133430148cf74c68c5" name="script2_3" x="714" y="1288">
  346.       <params/>
  347.       <attribs>
  348.          <text attributeName="script">
  349.             <sText><![CDATA[uint8_t step = 0;
  350. int last_in = 0, diff = 0;
  351. int oct;
  352. uint32_t note;
  353. uint32_t stepSize;
  354. uint32_t rootNote;
  355.  
  356. void setup(void){
  357.        stepSize = 0x00200000;
  358.        rootNote = 0xFFB00000;
  359.        out2 = 0xFFB00000;
  360.    }
  361.  
  362. void loop(void){
  363.     // diff = in1 > last_in ? in1 - last_in : last_in - in1;
  364.    
  365.         // if (diff > 200) {
  366.    
  367.        if (in1 <= 26869759) {
  368.            step = in1/2239146;
  369.            oct  = 0;
  370.        }
  371.        else if (in1 > 26869759 && in1 < 53739519) {
  372.            step = (in1-26869759)/2239147;
  373.            oct  = 1;
  374.        }
  375.        else if (in1 > 53739519 && in1 < 80543743) {
  376.            step = (in1-53739519)/2233685;
  377.            oct  = 2;
  378.        }
  379.        else if (in1 > 80543743 && in1 < 107413503) {
  380.            step = (in1-80543743)/2233685;
  381.            oct  = 3;
  382.        }
  383.  
  384.        last_in = in1;
  385.        out1 = rootNote + ((stepSize * step) + (oct * 0x1800000));
  386.        out2 = rootNote + (stepSize * step) + (oct * 0x1800000);
  387.     // }
  388.    // chThdSleepMilliseconds(1);
  389. }]]></sText>
  390.          </text>
  391.       </attribs>
  392.    </obj>
  393.    <obj type="ctrl/dial p" sha="1f21216639bb798a4ea7902940999a5bcfd0de90" name="cv5" x="1246" y="1302">
  394.       <params>
  395.          <frac32.u.map name="value" value="33.625"/>
  396.       </params>
  397.       <attribs/>
  398.    </obj>
  399.    <patcher type="patch/patcher" sha="da39a3ee5e6b4b0d3255bfef95601890afd80709" uuid="a245c220448000c901caef03c8b07740d533914a" name="sdbenchmark_1" x="406" y="1316">
  400.       <params/>
  401.       <attribs/>
  402.       <subpatch>
  403.          <nets/>
  404.          <settings>
  405.             <subpatchmode>no</subpatchmode>
  406.          </settings>
  407.          <notes><![CDATA[]]></notes>
  408.       </subpatch>
  409.    </patcher>
  410.    <obj type="math/*" sha="ec71f518aa0e133062e5a9d4828d3739865c99f" uuid="922423f2db9f222aa3e5ba095778288c446da47a" name="*_1" x="1330" y="1316">
  411.       <params/>
  412.       <attribs/>
  413.    </obj>
  414.    <obj type="math/+" sha="49587c7bc7e1813d8a9a7a9be012580af00ea274" uuid="44553fdc8628c67ab535845ed1be304ad6c9553b" name="+_1" x="1526" y="1316">
  415.       <params/>
  416.       <attribs/>
  417.    </obj>
  418.    <obj type="conv/unipolar2bipolar" sha="5f55b7ee58828996387d37c5431384eb14c9dd16" uuid="efc8ee28c508740c5edf7995eaaa07a6d6818e5e" name="unipolar2bipolar_6" x="1400" y="1330">
  419.       <params/>
  420.       <attribs/>
  421.    </obj>
  422.    <obj type="osc/square sync" sha="589b6f1d673b7fd79f9156a008d3939499d098dd" uuid="8c4efe949c87c913d572a4303b8c63e097dac37e" name="square_2" x="868" y="1358">
  423.       <params>
  424.          <frac32.s.map name="pitch" value="-24.199999809265137"/>
  425.       </params>
  426.       <attribs/>
  427.    </obj>
  428.    <obj type="script/script2" sha="362a4413ceaefbe716480bf8f9c62eb3587fe6c0" uuid="d39e743cf47c9221f4e99c133430148cf74c68c5" name="script2_2" x="574" y="1372">
  429.       <params/>
  430.       <attribs>
  431.          <text attributeName="script">
  432.             <sText><![CDATA[int step = 0;
  433. int last_in = 0, diff = 0;
  434. int oct = 0;
  435. uint32_t note;
  436.  
  437. void setup(void){
  438.    
  439.    }
  440.  
  441. void loop(void){
  442.    diff = in1 > last_in ? in1 - last_in : last_in - in1;
  443.    
  444.    if (diff > 1000) {
  445.  
  446.        if (in1 <= 26869759) {
  447.            step = in1/2239146;
  448.  
  449.            switch(step){
  450.                case 0: note = 0xFB000000; break;  // -4 = C4
  451.                case 1: note = 0xFB200000; break;   // -3 = C4#
  452.                case 2: note = 0xFB400000; break;   // -2 = D4
  453.                case 3: note = 0xFB600000; break;   // -1 = D4#
  454.                case 4: note = 0xFB800000; break;   // 0 = E4
  455.                case 5: note = 0xFBA00000; break;   // 1 = F4
  456.                case 6: note = 0xFBE00000; break;   // 2 = F4#
  457.                case 7: note = 0xFC000000; break;   // 3 = G4
  458.                case 8: note = 0xFC200000; break;   // 4 = G4#
  459.                case 9: note = 0xFC400000; break;   // 5 = A4
  460.                case 10: note = 0xFC600000; break;  // 6 = B4
  461.            }  
  462.        }
  463.        else if (in1 > 26869759 && in1 < 53739519) {
  464.            step = (in1-26869759)/2239147;
  465.  
  466.            switch (step) {
  467.                case 0: note = 0xFC800000; break;   // 7 = C5
  468.                case 1: note = 0xFCA00000; break;   // 8 = ...
  469.                case 2: note = 0xFCC00000; break;   // 9
  470.                case 3: note = 0xFCE00000; break;   // 10
  471.                case 4: note = 0xFD000000; break;   // 11
  472.                case 5: note = 0xFD200000; break;   // 12
  473.                case 6: note = 0xFD400000; break;   // 13
  474.                case 7: note = 0xFD600000; break;   // 14
  475.                case 8: note = 0xFD800000; break;   // 15
  476.                case 9: note = 0xFDA00000; break;   // 16
  477.                case 10: note = 0xFDC00000; break;  // 17
  478.                case 11: note = 0xFDE00000; break;  // 18
  479.            }
  480.        }
  481.        else if (in1 > 53739519 && in1 < 80543743) {
  482.            step = (in1-53739519)/2233685;
  483.  
  484.            switch (step) {
  485.                case 0: note = 0xFE000000; break;   // 19
  486.                case 1: note = 0xFE200000; break;   // 20
  487.                case 2: note = 0xFE400000; break;   // 21
  488.                case 3: note = 0xFE600000; break;   // 22
  489.                case 4: note = 0xFE800000; break;   // 23
  490.                case 5: note = 0xFEA00000; break;   // 24
  491.                case 6: note = 0xFEC00000; break;   // 25
  492.                case 7: note = 0xFEE00000; break;   // 26
  493.                case 8: note = 0xFF000000; break;   // 28
  494.                case 9: note = 0xFF200000; break;   // 29
  495.                case 10: note = 0xFF400000; break;  // 30
  496.                case 11: note = 0xFF600000; break;  // 31
  497.                // case 12: note = 0x03E00000; break;   // 32
  498.            }      
  499.        }
  500.  
  501.        last_in = in1;
  502.        out1 = note;
  503.    }
  504.  
  505.    chThdSleepMilliseconds(1);
  506. }]]></sText>
  507.          </text>
  508.       </attribs>
  509.    </obj>
  510.    <obj type="disp/i" sha="e98a25a12afc62efc1991c3bb5290ccdf7214102" uuid="5e35fd0c62d81e70017289250cf28edd26e19e4a" name="i_2" x="770" y="1372">
  511.       <params/>
  512.       <attribs/>
  513.    </obj>
  514.    <obj type="disp/hex" sha="e21d1bcdfadc4f2009b547d002484bede0762978" uuid="87617898f70d90033f8add921438bf0d11721fdd" name="hex_8" x="742" y="1428">
  515.       <params/>
  516.       <attribs/>
  517.    </obj>
  518.    <obj type="osc/tri" sha="e7066d3dcd0e52be1613be8b5ccc96acee0ed064" uuid="905879afa8256b0ca207557d656949e476ca6f16" name="tri_1" x="868" y="1456">
  519.       <params>
  520.          <frac32.s.map name="pitch" value="-11.799999713897705"/>
  521.       </params>
  522.       <attribs/>
  523.    </obj>
  524.    <obj type="mix/mix 4" sha="6d667381bdeea6a139000a94f808f3e63efd414a" uuid="e6f9a0cc7aadc1b89516143cf1ccb79b3538d05a" name="mix_1" x="1022" y="1456">
  525.       <params>
  526.          <frac32.u.map name="gain1" value="28.5"/>
  527.          <frac32.u.map name="gain2" value="32.0"/>
  528.          <frac32.u.map name="gain3" value="0.0"/>
  529.          <frac32.u.map name="gain4" value="0.0"/>
  530.       </params>
  531.       <attribs/>
  532.    </obj>
  533.    <obj type="gain/vca" sha="c904cdd24d65968df2f5796e107db3747dd691a6" uuid="a9f2dcd18043e2f47364e45cb8814f63c2a37c0d" name="vca_1" x="1148" y="1470">
  534.       <params/>
  535.       <attribs/>
  536.    </obj>
  537.    <obj type="filter/lp svf" sha="2eb13844b5cc2430c3152a486b56326ff9919b0b" uuid="2003da6360b4fdb967cd635e9f6544e832fd522e" name="lp_1" x="1246" y="1512">
  538.       <params>
  539.          <frac32.s.map name="pitch" value="31.0"/>
  540.          <frac32.u.map name="reso" value="0.0"/>
  541.       </params>
  542.       <attribs/>
  543.    </obj>
  544.    <obj type="mix/mix 4" sha="6d667381bdeea6a139000a94f808f3e63efd414a" uuid="e6f9a0cc7aadc1b89516143cf1ccb79b3538d05a" name="mix_2" x="1414" y="1512">
  545.       <params>
  546.          <frac32.u.map name="gain1" value="0.0"/>
  547.          <frac32.u.map name="gain2" value="0.0"/>
  548.          <frac32.u.map name="gain3" value="0.0"/>
  549.          <frac32.u.map name="gain4" value="0.0"/>
  550.       </params>
  551.       <attribs/>
  552.    </obj>
  553.    <obj type="mix/mix 4" sha="6d667381bdeea6a139000a94f808f3e63efd414a" uuid="e6f9a0cc7aadc1b89516143cf1ccb79b3538d05a" name="mix_3" x="1512" y="1512">
  554.       <params>
  555.          <frac32.u.map name="gain1" value="0.0"/>
  556.          <frac32.u.map name="gain2" value="31.5"/>
  557.          <frac32.u.map name="gain3" value="0.0"/>
  558.          <frac32.u.map name="gain4" value="0.0"/>
  559.       </params>
  560.       <attribs/>
  561.    </obj>
  562.    <obj type="math/*c" sha="a73a2cafcf92eb4b6524655dcee98a569d5ddc28" uuid="7a66f52a9594e7e9eb31328ea725cb3641a80b55" name="*c_3" x="1512" y="1764">
  563.       <params>
  564.          <frac32.u.map name="amp" value="29.5"/>
  565.       </params>
  566.       <attribs/>
  567.    </obj>
  568.    <obj type="math/*c" sha="a73a2cafcf92eb4b6524655dcee98a569d5ddc28" uuid="7a66f52a9594e7e9eb31328ea725cb3641a80b55" name="*c_1" x="1638" y="1764">
  569.       <params>
  570.          <frac32.u.map name="amp" value="29.5"/>
  571.       </params>
  572.       <attribs/>
  573.    </obj>
  574.    <obj type="audio/out stereo" sha="c27566f972d15f25252f61b5cff014a3edce9706" uuid="a1ca7a567f535acc21055669829101d3ee7f0189" name="out_1" x="1792" y="1764">
  575.       <params/>
  576.       <attribs/>
  577.    </obj>
  578.    <nets>
  579.       <net>
  580.          <source obj="p7" outlet="out"/>
  581.          <dest obj="script2_2" inlet="in1_"/>
  582.          <dest obj="script2_3" inlet="in1_"/>
  583.       </net>
  584.       <net>
  585.          <source obj="gate_1" outlet="GATE1"/>
  586.          <dest obj="button-led_1" inlet="LED1"/>
  587.          <dest obj="adsr_2" inlet="gate"/>
  588.          <dest obj="mod1" inlet="trig"/>
  589.       </net>
  590.       <net>
  591.          <source obj="mix_1" outlet="out"/>
  592.          <dest obj="vca_1" inlet="a"/>
  593.       </net>
  594.       <net>
  595.          <source obj="vca_1" outlet="o"/>
  596.          <dest obj="lp_1" inlet="in"/>
  597.          <dest obj="mix_2" inlet="in1"/>
  598.          <dest obj="mix_3" inlet="in1"/>
  599.       </net>
  600.       <net>
  601.          <source obj="*c_1" outlet="out"/>
  602.          <dest obj="out_1" inlet="left"/>
  603.       </net>
  604.       <net>
  605.          <source obj="cv1" outlet="out"/>
  606.          <dest obj="unipolar2bipolar_2" inlet="i"/>
  607.       </net>
  608.       <net>
  609.          <source obj="cv0" outlet="out"/>
  610.          <dest obj="unipolar2bipolar_3" inlet="i"/>
  611.       </net>
  612.       <net>
  613.          <source obj="cv2" outlet="out"/>
  614.          <dest obj="unipolar2bipolar_4" inlet="i"/>
  615.       </net>
  616.       <net>
  617.          <source obj="cv3" outlet="out"/>
  618.          <dest obj="unipolar2bipolar_5" inlet="i"/>
  619.       </net>
  620.       <net>
  621.          <source obj="unipolar2bipolar_2" outlet="o"/>
  622.          <dest obj="adsr_2" inlet="a"/>
  623.       </net>
  624.       <net>
  625.          <source obj="unipolar2bipolar_3" outlet="o"/>
  626.          <dest obj="adsr_2" inlet="d"/>
  627.       </net>
  628.       <net>
  629.          <source obj="unipolar2bipolar_4" outlet="o"/>
  630.          <dest obj="adsr_2" inlet="s"/>
  631.       </net>
  632.       <net>
  633.          <source obj="unipolar2bipolar_5" outlet="o"/>
  634.          <dest obj="adsr_2" inlet="r"/>
  635.       </net>
  636.       <net>
  637.          <source obj="*_1" outlet="result"/>
  638.          <dest obj="unipolar2bipolar_6" inlet="i"/>
  639.       </net>
  640.       <net>
  641.          <source obj="cv5" outlet="out"/>
  642.          <dest obj="*_1" inlet="b"/>
  643.       </net>
  644.       <net>
  645.          <source obj="dial_3" outlet="out"/>
  646.          <dest obj="unipolar2bipolar_7" inlet="i"/>
  647.       </net>
  648.       <net>
  649.          <source obj="unipolar2bipolar_7" outlet="o"/>
  650.          <dest obj="+_1" inlet="in1"/>
  651.       </net>
  652.       <net>
  653.          <source obj="unipolar2bipolar_8" outlet="o"/>
  654.          <dest obj="mod1" inlet="v"/>
  655.       </net>
  656.       <net>
  657.          <source obj="p2" outlet="out"/>
  658.          <dest obj="unipolar2bipolar_8" inlet="i"/>
  659.       </net>
  660.       <net>
  661.          <source obj="p6" outlet="out"/>
  662.          <dest obj="change_1" inlet="in"/>
  663.          <dest obj="cc_1" inlet="v"/>
  664.       </net>
  665.       <net>
  666.          <source obj="change_1" outlet="trig"/>
  667.          <dest obj="cc_1" inlet="trig"/>
  668.       </net>
  669.       <net>
  670.          <source obj="note" outlet="out"/>
  671.          <dest obj="unipolar2bipolar_11" inlet="i"/>
  672.       </net>
  673.       <net>
  674.          <source obj="unipolar2bipolar_11" outlet="o"/>
  675.          <dest obj="note_1" inlet="note"/>
  676.       </net>
  677.       <net>
  678.          <source obj="velo" outlet="out"/>
  679.          <dest obj="unipolar2bipolar_12" inlet="i"/>
  680.       </net>
  681.       <net>
  682.          <source obj="unipolar2bipolar_12" outlet="o"/>
  683.          <dest obj="note_1" inlet="velo"/>
  684.       </net>
  685.       <net>
  686.          <source obj="gate_1" outlet="GATE2"/>
  687.          <dest obj="button-led_1" inlet="LED2"/>
  688.          <dest obj="note_1" inlet="trig"/>
  689.       </net>
  690.       <net>
  691.          <source obj="mix_2" outlet="out"/>
  692.          <dest obj="*c_3" inlet="in"/>
  693.       </net>
  694.       <net>
  695.          <source obj="mix_3" outlet="out"/>
  696.          <dest obj="*c_1" inlet="in"/>
  697.       </net>
  698.       <net>
  699.          <source obj="script2_3" outlet="out1_"/>
  700.          <dest obj="hex_8" inlet="in"/>
  701.          <dest obj="i_2" inlet="in"/>
  702.          <dest obj="square_2" inlet="pitch"/>
  703.          <dest obj="tri_1" inlet="pitch"/>
  704.       </net>
  705.       <net>
  706.          <source obj="adsr_2" outlet="env"/>
  707.          <dest obj="vca_1" inlet="v"/>
  708.       </net>
  709.       <net>
  710.          <source obj="p3" outlet="out"/>
  711.          <dest obj="*_1" inlet="a"/>
  712.       </net>
  713.       <net>
  714.          <source obj="unipolar2bipolar_6" outlet="o"/>
  715.          <dest obj="+_1" inlet="in2"/>
  716.       </net>
  717.       <net>
  718.          <source obj="*c_3" outlet="out"/>
  719.          <dest obj="out_1" inlet="right"/>
  720.       </net>
  721.       <net>
  722.          <source obj="square_2" outlet="wave"/>
  723.          <dest obj="mix_1" inlet="in1"/>
  724.       </net>
  725.       <net>
  726.          <source obj="tri_1" outlet="wave"/>
  727.          <dest obj="mix_1" inlet="in2"/>
  728.       </net>
  729.       <net>
  730.          <source obj="lp_1" outlet="out"/>
  731.          <dest obj="mix_2" inlet="in2"/>
  732.          <dest obj="mix_3" inlet="in2"/>
  733.       </net>
  734.    </nets>
  735.    <settings>
  736.       <subpatchmode>no</subpatchmode>
  737.    </settings>
  738.    <notes><![CDATA[]]></notes>
  739.    <windowPos>
  740.       <x>308</x>
  741.       <y>70</y>
  742.       <width>1455</width>
  743.       <height>877</height>
  744.    </windowPos>
  745. </patch-1.0>
Advertisement
Add Comment
Please, Sign In to add comment