Here is an updated patch with a user actor that calculates the optimum Pulse trigger setting and Particle Count based on using the properties set in the Isadora Preferences for Target Frame Rate and General Service Tasks.
You are absolutely right! You have raised this issue as a prerequisite, and thank you - your generic formula will assist in optimising patches that use this technique and is a great contribution. I will make sure it goes into the notes for the version that uploads to the Plugins page.
Kinda a weird workaround, but if you tell them to always save the file into the same folder as the Isadora file (or the desktop), you can have an Automater Applescript waiting for files to be saved into that folder. When they are, the script can check all the names of the .txt files in the folder and save the names into another "Master List" .txt file (with a set name) formatted so that each file your client saves is added as a new line to the "Master List" .txt file. That way, you can have a Data Array actor looking for the Master File that will allow your client to use the Control Panel to select which file name they want to load in. You may want to put this "Master List" Data Array actor and Control Panel in a separate Scene with a separate Control Panel so that you can add a button on your normal Control Panel that jumps you into the Master List/File Select Scene. Either that or always keep it active as a background Scene and add Controls so that you can always use it to select which Data Array actor file your client wants to select for your main Scene.
Here's a zip file with an example file, some sample text files, and an Applescript with some instructions for setup at the beginning.
Script written by L Wilson-Spiro, 2020-12-09
Technical design consultations for installations, interactive technology, and live performance
Projection and lighting design
Show Control and video programming
Theatrical electrics and carpentry
Please direct questions to email@example.com
I do my best to answer emails as soon as possible.
1) You'll need to put this folder (IsadoraFolder) on your desktop in order for this to work.
2) Whenever you save a new text file with the "File Selection" Data Array actor, make sure that it's saved to the folder "IsadoraFolder" on the desktop.
3) You'll need to follow the instructions here to monitor the folder "IsadoraFolder" on the Desktop in order to run this script whenever a file is added to the folder: https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/WatchFolders.html
You may need to give this script permission to perform changes.
1) Go to System Preferences > Security & Privacy > Accessibility
2) Click the lock (bottom left) > enter password
3) Click the "+" button
4) In the resulting dialog, locate and select this script (FileNameList)
5) Click the "+" button
6) In the resulting dialog, go to Applications > locate and select "Script Editor"
7) Click the lock again
Applescript find Username: https://discussions.apple.com/thread/3152534
Applescript list of files in folder without extension: https://stackoverflow.com/questions/37299815/applescript-how-do-i-get-get-a-file-list-of-files-in-folder-and-remove-extensio
Applescript list of files in folder with extensions: https://apple.stackexchange.com/questions/342773/can-applescript-get-folder-contents-with-file-extension-exclusion
Applescript write text to file: https://stackoverflow.com/questions/3780985/how-do-i-write-to-a-text-file-using-applescript
Applescript File paths: https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/ReferenceFilesandFolders.html
Getting AppleScript to output multiple lines to shell https://gist.github.com/hynkle/7432418
-- FIND USERNAME --
set userName to short user name of (system info)
-- SET FILEPATH TO FOLDER --
set theFolder to "/Users/" & userName & "/Desktop/IsadoraFolder" as POSIX file
-- SET FILEPATH TO FILENAMELIST.TXT --
set textFile to "Users/" & userName & "/Desktop/IsadoraFolder/FileNameList.txt"
-- CREATE MULTI-LINE STRING WITH .TXT FILE NAMES --
tell application "Finder"
-- Get full list of names of .txt files in the folder
set fileList to name of every file in folder theFolder whose name extension is "txt"
-- Start process of making each file name on a new line
set myString to "" as text
-- Put each file name on a new line
repeat with myItem in fileList
set myString to myString & myItem & linefeed
list folder theFolder
-- WRITE LIST OF FILE NAMES TO FILENAMELIST.TXT --
do shell script "echo " & quoted form of myString & " > " & quoted form of textFile
In the lockdown, I set myself a challenge to gain some understanding of using data sources available online to create a 'data-driven' Isadora patch. There is a lot of online data available; some are 'open access' and some require an access key or subscription. I have put together a demonstration patch that uses data from multiple open access (non-subscription) sources. They are The World Bank and VirusTracker. [EDIT] VirusTracker API appears to be no longer functional, therefore COVID-19 data is no longer updating in the patch download.
In creating the demo patch, I have learnt how to use the Text Formatter module to modify the request URL that gets sent to an API data source. It allows for data with different content to be updated based on dynamically changing identifiers in the request URL. For example, comparative information about a specific country requested through a 'country code' of only two characters. The VirusTracker API returns data about individual countries and the statistics associated with the current COVID19 pandemic. The virus data is updated daily. A date format identifies requested statistics from a specific day within the pandemic period. Combining the country code and the date format dynamically in a request URL patched to the Get URL Text modules returns statistics that are then available for display in the Isadora Stage. By automating the construction of the URL that identifies the dataset requested from the API, the data on the Isadora stage transforms into a dynamic representation of changing datasets.
The success of this learning development is due to the release of new Beta tools made available by @mark and the wisdom of the Guru sessions. The 'JSON Parser Beta', and the three.js 'JS Convert Rotations' module have taken a lot of the pain out of doing this kind of work. "Tip of the hat" to Mark, using one of his expressions of gratitude.
The data array is going to be very helpful for what you want to do. I would suggest you determine where your data is coming from and what form it is in. One thing about ocean tides is that there are a number of variables, for example location, time and height. So you would need to consider how to represent the data in a way that is appealing for you and your audience (you may already have that worked out). What are all the variables you want to use? There are parameters you could add such as water temperature, wave height ... so the diversity of data can be interesting to increase/decrease to recreate sonically or visually.
After your suggestion I have refocused this experimental development using the 'Get URL Text' actor as you have suggested. It has worked handsomely to bring online data into the Isadora patch environment. I have made a patch with detailed annotations about the process and offer it here as a departure point for those artists who are seeking to establish using dynamic data from a URL source in their projects.
This Isadora patch accesses live data from an online source. It uses it in a way that represents the data graphically and to locate elements in x and y space on the stage. The patch works by accessing an Open Data Source using a live internet URL. The data set includes names of Countries, their Capital City and Latitude and Longitude coordinates and other information. After scaling with Limit-Scale Value actors, the longitude and latitude data locates each city on a world map. A list of iso2 codes (2 letter country codes) has been saved as a text file and read into the patch through a Data Array actor. This Isadora patch demonstrates the Get URL Text, Text Parser, Text Formatter and Data Array actors.
@bonemap Thank you for your detailed response! I understand your point about the difficulty of sharing examples or creating them. In any case, the personal examples you have told me help me to understand better. I will investigate the manual to have a more complete picture.