You can create this graphic equalizer with Trapcode Soundkeys and Maya. Use my Python script, below, to automatically import keyframe data and create the eq.
Trapcode Soundkeys, an Adobe After Effects plugin, breaks audio into into about 27 frequency blocks, “ranges”, and allows you to drive animation, set keyframes, or export keyframes. To export keys, copy the keyframes from the After Effects timeline, then paste into a text editor to create your data.txt files. Each frequency range should have it’s own text file, named sequentially. Use a code editor like BB Edit or Text Wrangler, as these apps will save your .txt files with UNIX line returns, which are necessary to make my Python script work properly.
Place all the data files in a directory, by themselves, and use the Python script below to automatically build the EQ in Maya.
## make a graphic equalizer, based on keyframe data from After Effects and Sound Keys.
import os
import maya.cmds as mc
## add path to keyframe data files - just the source directory that contains them.
rootdir='/path/to/data/folder'
theAttribute = 'data'
count = 0
theCubes = []
for subdir, dirs, files in os.walk(rootdir):
dataFiles = [each for each in files if each.endswith('.txt')]
for thisFile in dataFiles:
## create a cube for each data file, and distibute them across the X axis
mc.polyCube()
cube = mc.ls(sl = True)
cubeName=cube[0]
theCubes.append(cubeName)
mc.setAttr((cubeName + '.translateY'), .5);
mc.makeIdentity(apply=True, t =True, r=True, s=True, n= 0)
mc.ResetTransformations()
mc.move( count -(len(dataFiles)/2), 0, 0)
count +=1
count = 0
for subdir, dirs, files in os.walk(rootdir):
dataFiles = [each for each in files if each.endswith('.txt')]
for thisFile, o in zip(dataFiles, theCubes):
## prepare each cube for animation by ading an attibute to accept the keys, and creating an expression
theName = theCubes[count]
mc.addAttr( theName, shortName='data', longName='data', defaultValue=1.0)
mc.setAttr ( (theName + '.data'), e=True, keyable=True)
mc.expression(o=theName, s = (theName + '.scaleY =' + theName + '.data / 4'), ae = True, uc = all)
## make shader for each cube
myBlinn = mc.shadingNode('blinn', asShader=True, name = ("myBlinn" + str(count)))
myShader = mc.sets(renderable=True, noSurfaceShader=True, empty=True, name = ('myBlinn' + str(count) + 'SG'))
mc.connectAttr( (myBlinn + ".outColor"), (myShader + ".surfaceShader"), f=True)
mc.setAttr((myBlinn + ".color"), 0.1, 0.1, 0.1, type ='double3' )
mySetRange = mc.shadingNode('setRange', asUtility=True)
mySetRange2 = mc.shadingNode('setRange', asUtility=True)
mc.setAttr((mySetRange + ".minX"),230)
mc.setAttr((mySetRange + ".maxX") ,240)
mc.setAttr((mySetRange + ".oldMaxX") ,25)
mc.setAttr((mySetRange2 + ".maxX") ,3)
mc.setAttr((mySetRange2 + ".minX") ,.1)
mc.setAttr((mySetRange2 + ".oldMaxX") ,25)
myRamp = mc.shadingNode('ramp', asTexture=True)
my2dPlace = mc.shadingNode('place2dTexture', asUtility=True)
mc.connectAttr((my2dPlace + ".outUV"), (myRamp + ".uv"))
mc.connectAttr((my2dPlace + ".outUvFilterSize"), (myRamp + ".uvFilterSize"))
mc.setAttr((myRamp + ".colorEntryList[2].color"), 0, 0, 0 , type = 'double3')
mc.removeMultiInstance((myRamp + ".colorEntryList[0]"), b=True )
mc.removeMultiInstance(myRamp + ".colorEntryList[1]", b=True )
mc.connectAttr( (theName + ".scaleY"), (mySetRange + ".valueX"), f=True)
mc.connectAttr( (theName+ ".scaleY"), (mySetRange2 + ".valueX"), f=True)
mc.connectAttr( (theName + ".scaleY"), (mySetRange2 + ".valueY"), f=True)
mc.connectAttr( (theName + ".scaleY"), (mySetRange2 + ".valueZ"), f=True)
myhsvToRgb = mc.createNode('hsvToRgb', ss=True)
mc.setAttr((myhsvToRgb+".inHsv"), .75, .75, .75)
mc.connectAttr( (mySetRange + ".outValueX"), (myhsvToRgb + ".inHsvR"), f=True )
mc.connectAttr( (myRamp + ".outColor"), (myBlinn + ".incandescence"), f=True )
mc.connectAttr( (myhsvToRgb + ".outRgb"), (myRamp+ ".colorEntryList[2].color"), f=True )
mc.connectAttr( (mySetRange2 + ".outValue"), (myRamp + ".colorGain"), f=True )
mc.select(theName)
mc.sets( e=True, forceElement= myShader)
count +=1
## read keyframe data and set keyframes
dataFile = open((os.path.join(rootdir, thisFile)), 'r')
lines = dataFile.readlines()
dataFile.close()
mylines = lines[10:-4]
for eachLine in mylines:
data = eachLine.split('\t')
theFrame = data[1]
theValue = data[2]
mc.setKeyframe( o, v=float(theValue), at=theAttribute, t =float(theFrame))
## the code below will set the playback range to equal the amount of the keyframe data in the files
fileData = open(rootdir + '/' + dataFiles[0])
lines= fileData.readlines()
fileData.close()
myLines = lines[10:-4]
countLines = len(myLines)
mc.playbackOptions( minTime='0sec', maxTime=countLines)
The Red Blue Chair was a chair designed in 1917 by Gerrit Rietveld. It represents one of the first explorations by the De Stijl art movement in three dimensions.
Part of a Thai music video in tribute to Petchara, a star of the 60′s, and featuring Weir, a current star. I was tasked with adding cg diamonds falling from above.