PassScoreCount
For the 8th Prompt Of Mathober by @fractalkitty : Counting,PassUnCount :https://blog.illestpreacha.com/mathober2023counting takes Live Python Web Data Scraping and SonicPi Sonification to Sort and Count NCAA Assist Leaders who also turn the ball over. Then some tweaking and layering was done.
For the WCCC Prompt by @sableraph: Make a Tool, PassScoreCount takes PassUnCount and do a sonification tool that not only takes in the NCAA Assist Leaders with their Assists mades but also compare that to the NCAA Scoring Leaders and their Field Goals made.
You can alter the sound by adding what multipliers to the values and time, which makes also makes it a nice soundtrack by sonification tool.
Poem
Wanting to Make the Pass
But it didn't Make it Through
Try and Try Again
But The Results Don’t Seem to Blend
As the Dribbles Go Fast
And the Squeaks can be Heard From the Shoes
What Pass Selection Do You Choose,
To Finally Make it Through
Audio - Sped Up Version (1.7x) + Filters
IllestPreacha · PassScoreCount.MP3
Audio - With Modifiers
IllestPreacha · PassScoreCount2
Code
Python - WebScraping and Data Sorting
import sys
import pandas as pd
pd.set_option('display.max_rows', None)
pd.set_option('display.max_columns', None)
NCAA_APG = pd.read_html('https://www.cbssports.com/college-basketball/stats/player/assists-turnovers/all-conf/all-pos/leaders/?sortdir=descending&sortcol=apg')
NCAA_APG_DF = NCAA_APG[0]
NCAA_APG_DF.columns
NCAA_APG_Eff = NCAA_APG_DF.loc[(NCAA_APG_DF['A/TO Assists Per Turnover'] < 3)]
NCAA_APG_Not_Eff = NCAA_APG_DF.loc[(NCAA_APG_DF['A/TO Assists Per Turnover'] > 3)]
NCAA_APG_Eff.sort_values(by=['A/TO Assists Per Turnover', 'APG Assists Per Game'], ascending=True)
NCAA_PPG = pd.read_html('https://www.cbssports.com/college-basketball/stats/player/scoring/all-conf/all-pos/leaders/?sortcol=ppg&sortdir=descending')
NCAA_PPG_DF = NCAA_PPG[0]
NCAA_PPG_DF.columns
NCAA_PPG_Eff = NCAA_PPG_DF.loc[(NCAA_PPG_DF['FG% Field Goal Percentage'] > 45)]
NCAA_PPG_Not_Eff = NCAA_PPG_DF.loc[(NCAA_PPG_DF['FG% Field Goal Percentage'] < 45)]
NCAA_PPG_Eff.sort_values(by=['FG% Field Goal Percentage', 'PPG Points Per Game'], ascending=False)
Python Code - Timer that Speaks to SonicPi
import time
import random as rd
import math
from pythonosc import osc_message_builder
from pythonosc import udp_client
value = int(input("Enter multiplier: "))
value2 = int(input("Enter another multiplier: "))
value3 = value2 / value
def ncaa(t):
print('\n' + str(NCAA_APG_Eff['AST Total Assists'].iloc[t]))
print('\n' + str(NCAA_PPG_Eff['FGM Field Goals Made'].iloc[t]))
def countdown(t):
original_input = t;
while t:
mins, secs = divmod(t, 60)
timer = '{:02d}:{:02d}'.format(mins, secs)
print(timer, end="\r")
time.sleep(1 * value2)
if t % 1 == 0:
ncaa(t)
sender = udp_client.SimpleUDPClient('127.0.0.1', 4560)
sender.send_message('/pattern1',value * [abs(int(NCAA_PPG_Eff['FGM Field Goals Made'].iloc[t]) - int(NCAA_APG_Eff['AST Total Assists'].iloc[t])),int(NCAA_APG_Eff['AST Total Assists'].iloc[t]) * value3,int(NCAA_PPG_Eff['FGM Field Goals Made'].iloc[t])])
t -= 1
if t == 0:
t = original_input
t = input("Enter the time in seconds: ")
countdown(int(t))
SonicPi
live_loop :phase1 do
use_random_seed Time.now.to_i
use_real_time
a, b, c, d = sync "/osc*/pattern1"
with_fx :flanger, mix: rrand(0.1,0.9) do
if (a > 40)
with_fx [:ixi_techno,:whammy].choose do
use_synth :piano
play [a,b/2,c/2].tick, sustain: dice(3)
end
end
if (a < 40 and a > 30)
with_fx [:flanger,:ping_pong].choose do
use_synth :beep
play [a,b/2,c/2].tick, sustain: dice(2), decay: rrand(0.2,0.6)
end
end
if (a < 30 and a > 20)
with_fx :echo do
use_synth :saw
play [a,b/2,c/2].tick
end
end
if (a < 20 and a > 10)
with_fx :vowel, voice: dice(3) + 1 do
use_synth :bnoise
play [a,b/2,c/2].tick
end
end
if (a < 10)
with_fx :distortion do
use_synth :prophet
play [a,b/2,c/2].tick, decay: a / 2
end
end
end
end