gaGetPitch(int)

Syntax

gaGetPitch(int)

Example

// Try it with some music
// this here for example: https://www.youtube.com/watch?v=nFZL3ZJiYyY

inputVol = 0
inputPitch = 0

function setup()
 ofSeedRandom()
 ofSetCircleResolution(50)
 xPos = ofRandom(0,OUTPUT_W)
 yPos = ofRandom(0,OUTPUT_H)
end

function update()
 inputVol = gaGetVolume(0)
 inputPitch = gaGetPitch(0)
 if xPos < OUTPUT_W then
 xPos = xPos + (inputPitch*500)
 else
 xPos = 0
 end
 if yPos < OUTPUT_H then
 yPos = yPos + ofNoise(ofGetElapsedTimef())
 else
 yPos = 0
 end
end

function draw()
 
 gaBackground(0.0,0.001)
 ofSetColor(255,2055*inputVol,2055*inputPitch,60)
 ofNoFill()
 ofSetLineWidth(9)
 ofCircle(xPos,yPos,20+(inputVol*900))

end

Description

A realtime reference to the specified channel input pitch detected; depending of the sound card selected in main menu GAmuza/Preferences/Audio Streaming tab, you will have a different number of audio input channels. Index start from 0 (if you have four input channels, index will be from 0 to 3).

Parameters

int

Returns

«Float, The audio input pitch detected from the specified channel. Normalized in 0.0 - 1.0 range (from 20Hz to 20000Hz )