Twitch Chat Integration – Reading Dynamic .Log File

Helios's icon

Hello!

I recently tried to integrate Twitch chat into a synthesizer patch using Chatty, a Java based desktop client which writes the chat log to a .log file. The patch is below but basically I use a 'read' message to load the file in, 'query' message for the number of lines, then output the most recent into regexp~, which recognises certain phrases.

However Max is unable to read the file 'live' – filewatch~ doesn't recognise that the file is being updated at all, even when it is clearly being written to by Chatty. Moreover if I use a 'read' message specifying the pathname and bang into it periodically, it doesn't update to the current state of the file (the number of lines doesn't update).

Essentially, I want to be able to leave this patch on overnight, while it keeps reading the messages that are given to it by Twitch chat. Does anyone know why this could be happening?

Thanks in advance,
Helios

Entropy_Cleric.maxpat
Max Patch
Look for the 'twitchChatIntegration' subpatcher

sousastep's icon
Helios's icon

Hey there @John Baylies, I've been inactive for a while but this was exactly what I was looking for, thanks :)