Control

forum for discussing Control interface software

Register or log in - lost password?

Control » General

Pitch tracking documentation

(6 posts) (3 voices)
  • Started 1 year ago by rpellegrini
  • Latest reply from yongb3

Tags:

  • audio microphone pitch volume
  • audio pitch volume
  • bridal beach dresses
  • christian louboutin online outlet
  • designer prom dresses
  • fashion woman dress
  • group halloween costumes
  • halloween costumes outlet
  • pitch
  • short bride dress
  1. rpellegrini
    Member

    Hi,

    Could anyone point me to documentation and/or code fragments demonstrating the pitch tracking capabilities added in Control 1.4? Can volume also be tracked?

    Thanks very much,
    Roger

    Posted 1 year ago #
  2. admin
    Key Master

    I'll try and write up the docs tomorrow. In the meantime, here's the interface that came with the last version of Control. And yes, there's also a AudioVolume widget... works similarly to AudioPitch but with different modes (I think they're max and rms).

    loadedInterfaceName = "Pitch Tracker";
    
    interfaceOrientation = "portrait";
    
    control.storedNote = 0;
    control.storedNote2 = 0;
    control.storedNote3 = 0;
    
    infoText = "This interface tracks pitch entering the microphone using a technique called Harmonic Product Spectrum. The buttons allow noteon / noteoff capabilities for up to three notes at a time. This interface only sends pitch as MIDI numbers but can be easily modified to send frequencies via OSC.<br><br>Make sure you have a MIDI destination selected when using this interface.";
    
    pages = [[
    {
        "name": "playNote",
        "type": "Button",
        "bounds": [.0, .0, 1, .25],
        "isLocal": true,
        "label": "TRIGGER NOTE",
        "mode": "momentary",
        "ontouchstart": "midiManager.sendMIDI('noteon', 1, window.audioP.pitch, 127); control.storedNote = audioP.pitch;",
        "ontouchend": "midiManager.sendMIDI('noteon', 1, control.storedNote, 0);",
    },
    {
        "name": "playNote2",
        "type": "Button",
        "bounds": [.0, .25, 1, .25],
        "isLocal": true,
        "label": "TRIGGER NOTE 2 ",
        "mode": "momentary",
        "ontouchstart": "midiManager.sendMIDI('noteon', 1, window.audioP.pitch, 127); control.storedNote2 = audioP.pitch;",
        "ontouchend": "midiManager.sendMIDI('noteon', 1, control.storedNote2, 0);",
    },
    {
        "name": "playNote3",
        "type": "Button",
        "bounds": [.0, .5, 1, .25],
        "isLocal": true,
        "label": "TRIGGER NOTE 3 ",
        "mode": "momentary",
        "ontouchstart": "midiManager.sendMIDI('noteon', 1, window.audioP.pitch, 127); control.storedNote3 = audioP.pitch;",
        "ontouchend": "midiManager.sendMIDI('noteon', 1, control.storedNote3, 0);",
    },
    {
        "name": "pitchLabel",
        "type": "Label",
        "bounds": [0,.8,.3,.1],
        "value": "pitch",
        "oninit": "window.pitchLabel.label.style.textWrap = 'none';",
        "size": 48,
    },
    {
        "name": "info",
        "type": "Button",
    	"bounds": [.6, .8, .2, .1],
        "isLocal": true,
        "label": "info",
        "mode": "contact",
        "stroke": "#aaa",
        "ontouchstart": "control.changePage('next');"
    },
    
    {
        "name": "tabButton",
        "type": "Button",
    	"bounds": [.8, .8, .2, .1],
        "mode": "toggle",
        "stroke": "#aaa",
        "isLocal": true,
        "ontouchstart": "if(this.value == this.max) { control.showToolbar(); } else { control.hideToolbar(); }",
    	"label": "menu",
    },
    {
        "name": "audioP",
        "type": "AudioPitch",
        "mode": "hps",
        "isLocal": true,
        "onvaluechange": "pitchLabel.setValue(this.noteName)",
    },
    
    ],
    [
    {
        "name": "infoText",
        "type": "Label",
        "x": .1,
        "y": .1,
        "width": .8,
        "height": .7,
        "value": infoText,
        "verticalCenter": false,
        "align": "left",
    },
    {
        "name": "backButton",
        "type": "Button",
        "x": .8,
        "y": .9,
        "width": .19,
        "height": .09,
        "mode": "contact",
        "color": "#333333",
        "stroke": "#aaaaaa",
        "protocol": "local",
        "ontouchstart": "control.changePage(0);",
    },
    {
        "name": "infoButtonLabel",
        "type": "Label",
        "x": .8,
        "y": .9,
        "width": .19,
        "height": .09,
        "color": "#fff",
        "value": "back",
    },
    ],
    
    ];
    Posted 1 year ago #
  3. rpellegrini
    Member

    Thanks very much. Is pitch data only available as a (quantized) MIDI note, or is there an "exact" hz value available as well to reflect slides between notes?

    -Roger

    Posted 1 year ago #
  4. admin
    Key Master

    There is pitch and also freq. Freq will give you the current hz... it's actually the average of the last 20 windows. Here's the pitch callback in case you're curious:

    AudioPitch.prototype._onPitchUpdate = function(newFreq) {
        if(newFreq > 20)
            this.freqs.unshift(newFreq);
    
        // basic averaging
        var freqTotal = 0;
        for(var i = 0; i < this.freqs.length; i++) {
            freqTotal += this.freqs[i];
        }
        this.freq = freqTotal / this.freqs.length;
        while(this.freqs.length >= this.maxFreqs) { this.freqs.pop(); }
    
        this.pitch = Math.round(69 + 12 * Math.log(newFreq / 440) / Math.log(2));
        this.octave = Math.round(this.pitch / 12) - 2;
        this.number = Math.round(this.pitch % 12);
        if(this.octave < 12 && this.octave > 0)
            this.noteName = this.noteNames[this.number] + this.octave;
        else
            this.noteName = "-";
    
    //    console.log("PITCH NAME = " + this.pitch);
    
        if(this.onvaluechange != null) {
            eval(this.onvaluechange);
        }
    
        if(!this.isLocal && _protocol == "OSC") {
            var valueString = "|" + this.address;
            valueString += ":" + this.pitch;
            control.valuesString += valueString;
        }else if (!this.isLocal && _protocol == "MIDI") {
            var valueString = "|" + this.midiType + "," + (this.channel - 1) + "," + this.midiNumber+ "," + Math.round(this.pitch);
            control.valuesString += valueString;
        }
    }
    Posted 1 year ago #
  5. admin
    Key Master

    I've added documentation for both the AudioPitch and AudioVolume widgets.

    AudioVolume: http://charlie-roberts.com/Control/?page_id=358
    AudioPitch: http://charlie-roberts.com/Control/?page_id=362

    Posted 1 year ago #
  6. yongb3
    Member

    Just require the final Plunge - Bungy Jumping in Queenstown

    Heralded given that trip income of the planet, Queenstown can be an international resort city nestled amid majestic mountains and crystal clear waters of Lake Wakatipu in rugged Otago location of current Zealand's South Island. Travellers from through the entire earth flock to Queenstown for each of the details from skiing and golfing to hiking the spectacular character trails of recent Zealand's yet again state. Many people also surface to Queenstown to consider delight in certain white-knuckle death-defying journey divertissement pursuits choices the resort metropolis is famous for. In spite of irrespective of whether it braving the raging rapids from the mighty Kawarau River or leaping off a program several metres up even though within the air with just a bungy cord tied amongst their legs, Queenstown has often been the spot for hackett online shop to adrenaline junkies to gratify their really need to have for speed.

    An impressed bit of madness popularized by New Zealand's non-public AJ Hackett, bungy jumping has developed hackett london from a fringe exercise perpetrated by several foolhardy thrill seekers right into a global phenomenon. By opening the world's initial industrial bungy jumping hackett procedure in Queenstown, AJ Hackett conducted the pivotal purpose in standardising bungy leaping right into a protected and audio way for anyone to useful working experience the ultimate big. AJ Hackett's organization has taking into consideration the truth that absent on to operate bungy leaping websites throughout the world, but practically nothing can occur shut to struggling in the online game in its religious hometown of Queenstown.

    Adrenalin junkies in Queentsown have about 3 wonderful bungy leaping internet websites to select from. These consist of the Kawarau Bridge Bungy, the Ledge Bungy and Nevis Bungy, each and every of that is positioned in and about Queenstown. The initial, Kawarau hackett polo shirts Bridge Bungy, would be the site on the very first method that kicked everything off though in the 80s. The Kawarau Bridge soar delivers a forty a few metre leap which may be made use of solo or with a pal. Inspite in the modest shed, it stays the world's best-loved bungy web site with tens of hundreds jumpers annually.

    The Ledge Bungy has the difference of currently getting Queenstown's only city bungy web-site and is particularly notably perched four hundred metres over metropolis just one a specially developed runway ledge. Jumpers will experience coronary coronary heart pounding exhilaration as they plunge forty seven metres toward the amazing Queenstown landscape beneath them. The Ledge Bungy jumps may additionally be attempted with the darkness of night - a primary in New Zealand. And finally, there could be the Nevis Bungy, the greatest hackett clothing and plenty of hardcore bungy leaping knowledge in Queenstown. To not the faint of heart, the Nevis Bungy requires position on a gondola suspended by wire in mid-air across the raging waters in the Nevis River. This jump characteristics an astounding 134 metre drop - an unforgettable performing experience for individuals who exertion it.

    Bungy leaping aficionados to the lookout for that adhering to large thrill also needs to check out the bungy swing, an appealing new variation above the bungy leap. Bungy Swing very simply entails swinging throughout the air inside of a substantial arc at thoughts bending speeds when secured to some bungy harness. This fulfilling and extraordinary form of managed madness will likely be skilled for the while in the Ledge Sky Swing, which includes a 4 hundred metre arc swing about Queenstown or the Nevis Arc, wherever you can find out you accelerating from the valley at intellect blowing speeds while in the 300 metre arc.

    Posted 9 months ago #

RSS feed for this topic

Control is proudly powered by bbPress.