Changeset 29980


Ignore:
Timestamp:
06/15/15 21:12:16 (6 years ago)
Author:
davidb
Message:

Further changes as a result of preparing the final submission of the DLfM workshop paper

Location:
main/trunk/model-sites-dev/respooled/collect/popup-video-respooled
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/audiosynth.view.js

    r29943 r29980  
    325325    }
    326326
     327
    327328    if (e.shiftKey) {
    328329        return fnDrumKeyboard(e);
     330    }
     331
     332    if (e.altKey) {
     333        return fnGuitarKeyboard(e);
    329334    }
    330335   
     
    484489
    485490    var fnDrumKeyboard = function(e) {
    486     //console.log("*** drum pressed: " + e.key);
    487     if (e.key == "C") {
     491    console.log("*** drum pressed keyCode: " + e.keyCode);
     492    if (e.keyCode == "C".charCodeAt(0)) {
    488493        $('#drum1').trigger("mousedown");
    489494    }
    490     else if (e.key == "V") {
     495    else if (e.keyCode == "V".charCodeAt(0)) {
    491496        $('#drum2').trigger("mousedown");
    492497    }
    493     else if (e.key == "B") {
     498    else if (e.keyCode == "B".charCodeAt(0)) {
    494499        $('#drum3').trigger("mousedown");
    495500    }
    496     else if (e.key == "N") {
     501    else if (e.keyCode == "N".charCodeAt(0)) {
    497502        $('#drum4').trigger("mousedown");
    498503    }
    499     else if (e.key == "M") {
     504    else if (e.keyCode == "M".charCodeAt(0)) {
    500505        $('#drum5').trigger("mousedown");
    501506    }
     
    504509    return true; // let other things outside of this piano/drum chain (such as the customGuitar input) see the event
    505510    }
     511
     512
     513
     514
     515
     516    var fnGuitarKeyboard = function(e) {
     517    console.log("*** guitar pressed keycode: " + e.keyCode);
     518    if (e.keyCode == "Q".charCodeAt(0)) {
     519        $('#offscreen-jtab-chord-0').trigger("click");
     520    }
     521    else if (e.keyCode == "W".charCodeAt(0)) {
     522        $('#offscreen-jtab-chord-3').trigger("click");
     523    }
     524    else if (e.keyCode == "E".charCodeAt(0)) {
     525        $('#offscreen-jtab-chord-6').trigger("click");
     526    }
     527    else if (e.keyCode == "R".charCodeAt(0)) {
     528        $('#offscreen-jtab-chord-7').trigger("click");
     529    }
     530    else if (e.keyCode == "T".charCodeAt(0)) {
     531        $('#offscreen-jtab-chord-10').trigger("click");
     532    }
     533    else if (e.keyCode == "Y".charCodeAt(0)) {
     534        $('#offscreen-jtab-chord-13').trigger("click");
     535    }
     536    else if (e.keyCode == "U".charCodeAt(0)) {
     537        $('#offscreen-jtab-chord-16').trigger("click");
     538    }
     539
     540
     541    e.preventDefault();
     542    return true; // let other things outside of this piano/guitar chain see the event
     543    }
     544
    506545
    507546
  • main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/js/game-on.js

    r29898 r29980  
    223223            var base_ctime = track_block.baseCTime;
    224224           
     225            var track_fill = track_block.fill;
     226            var track_fillbackground = track_block.fillBackground;
     227
    225228            var block_events = track_block.events;
    226229           
    227230            var block_min_midi_pitch = num_midi_pitches-1;
    228231            var block_max_midi_pitch = 0;
    229 
     232           
    230233            var block_events_len = block_events.length;
    231234            for (var ne=0; ne<block_events_len; ne++) {
     
    244247            //rect.attr({stroke:"none", strokeWidth:0.2, fill:"#2E52A4"});
    245248            //rect.attr({stroke:"black",fill:"#2E52A4"});
    246             rect.attr({"stroke":"black","stroke-width":0.25, "fill":"#2E52A4"});
     249            var fill = note_event.fill || track_fill || "#2E52A4";
     250            rect.attr({"stroke":"black","stroke-width":0.25, "fill":fill});
    247251            go_top_level_group.push(rect);
    248252
     
    259263            var last_event = block_events[block_events_len-1];
    260264            var last_note_off = last_event.midiNoteOff;
    261             var block_duration = (base_ctime + last_note_off)/1000.0;
    262 
     265            var block_duration = (base_ctime + last_note_off)/1000.0
     266;
    263267            var block_x_org = (base_ctime/total_duration) * go_paper_x_dim;
    264268            var block_x_dim = (block_duration/total_duration) * go_paper_x_dim;
     
    269273            if (gs.xsltParams.interface_name != "respooled") {
    270274            var block_rect = goPaper.rect(block_x_org-1,block_y_org-1,block_x_dim+2,block_y_dim+2); // fudge factor!
    271             block_rect.attr({"stroke":"none", "stroke-width":0, "fill":"rgba(46, 82, 164, 0.5)"});
     275            var fillbackground = track_fillbackground || "rgba(46, 82, 164, 0.5)";
     276            block_rect.attr({"stroke":"none", "stroke-width":0, "fill":fillbackground});
    272277           
    273278            var block_tip = track_block.name;
  • main/trunk/model-sites-dev/respooled/collect/popup-video-respooled/transform/pages/document.xsl

    r29942 r29980  
    19481948
    19491949        <gsf:div id="mytab" style="display:inline-block; heightXX: 130px; width: 780px;">
    1950           <gsf:div id="scaled-mytab" widthXX="2000px" heightXX="300px">
    1951        
    1952 
    1953 <!--       
    1954         <gsf:div id="offscreen-jtab-chord-0" class="chordLineupBlock"/>
    1955          
    1956         <div class="chordLineupBlock">
    1957           <gsf:div id="offscreen-jtab-chord-1"/>
    1958           <gsf:div id="offscreen-jtab-chord-2"/>
    1959         </div>
    1960        
    1961         <gsf:div id="offscreen-jtab-chord-3" class="chordLineupBlock"/>
    1962        
    1963         <div class="chordLineupBlock">
    1964           <gsf:div id="offscreen-jtab-chord-4"/>
    1965           <gsf:div id="offscreen-jtab-chord-5"/>
    1966         </div>
    1967        
    1968         <gsf:div id="offscreen-jtab-chord-6" class="chordLineupBlock"/>
    1969         <gsf:div id="offscreen-jtab-chord-7" class="chordLineupBlock"/>
    1970        
    1971         <div class="chordLineupBlock">
    1972           <gsf:div id="offscreen-jtab-chord-8"/>
    1973           <gsf:div id="offscreen-jtab-chord-9"/>
    1974         </div>
    1975        
    1976         <gsf:div id="offscreen-jtab-chord-10" class="chordLineupBlock"/>
    1977          
    1978         <div class="chordLineupBlock">
    1979           <gsf:div id="offscreen-jtab-chord-11"/>
    1980           <gsf:div id="offscreen-jtab-chord-12"/>
    1981         </div>
    1982        
    1983         <gsf:div id="offscreen-jtab-chord-13" class="chordLineupBlock"/>
    1984        
    1985         <div class="chordLineupBlock">
    1986           <gsf:div id="offscreen-jtab-chord-14"/>
    1987           <gsf:div id="offscreen-jtab-chord-15"/>
    1988         </div>
    1989        
    1990         <gsf:div id="offscreen-jtab-chord-16" class="chordLineupBlock"/>       
    1991 -->
    1992 
    1993           </gsf:div>
     1950          <gsf:div id="scaled-mytab" widthXX="2000px" heightXX="300px"/>
     1951          <gsf:div style="font-style:italic">
     1952        <p style="font-size:85%;">
     1953          Keyboard shortcuts: Alt + Q-U. Changes selected chord, matched to be the same as the piano shortcuts.
     1954        </p>
     1955<!--
     1956        <p>
     1957          C=Alt-Q, D=Alt-W, ... B=Alt-U; C#/Db=Alt-2, D#/Eb=Alt-3, ...
     1958        </p>
     1959-->
     1960
     1961          </gsf:div>
    19941962          <gsf:div id="addCustomChord" style="display:none;">
    19951963        <input id="addCustomChordText" type="text" size="10"/>
     
    21022070
    21032071   
    2104 
    2105 /*
    2106             $('#offscreen-jtab-chord-0').click(function(e) { chordChange('0') });
    2107             $('#offscreen-jtab-chord-1').click(function(e) { chordChange('1') });
    2108             $('#offscreen-jtab-chord-2').click(function(e) { chordChange('2') });
    2109             $('#offscreen-jtab-chord-3').click(function(e) { chordChange('3') });
    2110             $('#offscreen-jtab-chord-4').click(function(e) { chordChange('4') });
    2111             $('#offscreen-jtab-chord-5').click(function(e) { chordChange('5') });
    2112             $('#offscreen-jtab-chord-6').click(function(e) { chordChange('6') });
    2113             $('#offscreen-jtab-chord-7').click(function(e) { chordChange('7') });
    2114             $('#offscreen-jtab-chord-8').click(function(e) { chordChange('8') });
    2115             $('#offscreen-jtab-chord-9').click(function(e) { chordChange('9') });
    2116             $('#offscreen-jtab-chord-10').click(function(e) { chordChange('10') });
    2117             $('#offscreen-jtab-chord-11').click(function(e) { chordChange('11') });
    2118             $('#offscreen-jtab-chord-12').click(function(e) { chordChange('12') });
    2119             $('#offscreen-jtab-chord-13').click(function(e) { chordChange('13') });
    2120             $('#offscreen-jtab-chord-14').click(function(e) { chordChange('14') });
    2121             $('#offscreen-jtab-chord-15').click(function(e) { chordChange('15') });
    2122             $('#offscreen-jtab-chord-16').click(function(e) { chordChange('16') });
    2123 */
    2124 
    21252072        $('#scaled-mytab').append($('#offscreen-jtab-chord-lineup'));
    21262073
Note: See TracChangeset for help on using the changeset viewer.