Binary arithmetic including fixed point and 2’s complement.
By Brian Hook
http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/IntroductionToFixedPointMath
Binary arithmetic including fixed point and 2’s complement.
By Brian Hook
http://trac.bookofhook.com/bookofhook/trac.cgi/wiki/IntroductionToFixedPointMath
I guess, because I didnt have this blog last year, I couldn’t find my notes about git and github repositories.
So I ran into situations where I tried to send committed projects from the local repository to the github – without realizing that I needed to pull any commits down from github first, using:
# git pull origin master
Merging just doesn’t seem to work well at all. So my advice to self would be, always pull from github before you start working on your code. Or even when you create a new github with a README.md file.
Useful commands:
add new file:
git add filename
commit any changed files
git commit -a -m "this is a commit"
send commits up to github
git push origin master
This is a ruby version of the Max tweetCurl5 patch (which tweets via xively.com) described here:
https://reactivemusic.net/?p=5447
In this version, the Max patch communicates via OSC to a background server running in ruby. An advantage of this method is that both the patch and the server are compact and easy to understand. The Max patch does things in a Max way. And likewise with the ruby script.
Here’s a screen shot of the Max patch:
Max
ruby
The ruby script requires installation of the following gems
For example:
# gem install patron
# ./ruby-max-tweet.rb
The files for this project can be downloaded from the intenet-sensors archive at github
by Peter Brinkmann
libpd runs pure-data patches in iOS.
libpd for iOS on Github: https://github.com/libpd/pd-for-ios
Have set up a Github repository for the ipadOscMidi simulator app: https://github.com/tkzic/ipadoscmidi
There is also a companion Max patch for testing
Here is the README file for the project:
ipadMidiOsc ----------- March 4, 2013 version 1.0 This program is a simulator to test Midi and Osc communication in iOS. There is a companion Max/MSP patch in the archive (oscmiditest3.maxpat). The Max patch lets you control the user interface on the iPad. And it well display incoming messages from the iPad. I have only tested the default iOS midi networking devices via Mac OS, and an iRig Midi interface. This is the only documentation right now - but there are big plans, yeah, for a programming guide, and a free app store app, along the lines of audioGraph. I wanted to get this initial version out before the spacecraft lands in the backyard. Acknowledgements: The Midi code was derived from PGMidi by Pete Goodliffe The Osc code was derived from OscPack by Ross Bencina Thank you. Tom Zicarelli [email protected]
Notes:
Local Project files are in: tkzic/oscapps/ipadmiditest4
I made the update described here for iOS 6 compatibility:
http://stackoverflow.com/questions/12548856/coremidi-pgmidi-virtual-midi-error-in-ios6
Today I’m attempting to update audiograph to run under the current iOS/xcode releases. Here are some helpful solutions to resolving compilation errors and warnings…
(update) Had problems with git, because I forgot to pull the changes from Michael Tyson, down from github before I made changes to the files locally and committed them.
Ended up doing a wholesale copy and a lot of duplicated effort – anyway it seems to work now.
Very important: The current local version of audiograph is in tkzic/coreaudio/audiograph
I have also submitted a new version 1.1 to app store. but its in the same folder I just mentioned.
<code>'A view can only be associated with at most one view controller at a time!</code>
I commented these out and added the updated methods
see this link for setDelegate
see Apple docs for everything else
The ‘play’ button on the bottom toolbar didn’t work on the 5g ipod touch (with taller screen)
Here’s what fixed it (in applicationDidFinishLaunching…)
from this stack overflow post: http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution
The only really required thing to do is to add a launch image named “[email protected]” to the app resources, and in general case (if you’re lucky enough) the app will work correctly. In case the app does not handle touch events, then make sure that the key window has the proper size. The workaround is to set the proper frame: <code>[window setFrame:[[UIScreen mainScreen] bounds]]</code> There are other issues not related to screen size when migrating to iOS 6. Read iOS 6.0 Release Notesfor details. |
World map and radio simulation
This program is broken on Mac OS Monterey. The PHP code is throwing errors in the OSC library. I’m not certain there is a reasonable workaround at this point and will be looking at replacing the php code with node.js or another more reliable platform. Also, as noted below – php is no longer installed in Mac os – so it requires homebrew or macports
Compare to satellite photo of earth – note the pattern of lights.
https://github.com/tkzic/internet-sensors
folder: twitter-stream
(note: starting with mac os monterey, php is no longer included in mac os. You can install it with homebrew. See this post: https://www.ergonis.com/products/tips/install-php-on-macos.php
[note] The project displays Tweets without these externals, but you won’t hear any speech
In addition to having a Twitter account, you will need to set up a Twitter application from the developer site here:
Good instructions on how to do this can be found in this stackoverflow.com post under this heading: So you want to use the Twitter v1.1 API?
When you get to step 5 – in the instructions – instead of writing your own code, just use a text editor to copy your access tokens into this php program which is provided:
Replace the strings in this line of code by copying and pasting the appropriate ones from your Twitter application:
$t->login('consumer_key', 'consumer secret', 'access token', 'access secret');
So it will end up looking something like this:
$t->login('ZdzfNaeflihFydfOHeOA', 'eXzUOfhif4riifgRbCTnnSN0T7neYtg8dIWDC7j3bs', '205589709-5kRI1fllJvU94jjffeerSn9LrTajtxSrvO8', 'u5MuSxPseBemUIBWlMxEFaw899feedXA0eHlReCnQ');
Yeah – its cryptic…
1. open the Max Patch: world3.maxpat
2. in a terminal window run the php program: ctwitter_max3.php. [note] it runs forever. Press <ctrl-c> when you want to stop streaming Tweets.
php ./ctwitter_max3.php
3. Switch back to world3.maxpat to see dots populating the map
4. In Max, press the speaker icon (lower left) to turn on audio.
5. Activate voice synth/morse code using the blue toggle (lower left)
6. Clear the map by pressing the blue message box: “clear, drawpict a 0 0”
7. Stop the Tweet stream by pressing <ctrl-c> in the terminal window
If you have Soundflower installed, the Mac OS speech synth output can be routed back to Max for audio processing. This is somewhat complicated, but shows how to process audio in Max from other sources.
The built-in data recorder/playback is on the left side of world3.maxpat:
<span style="font-family: 'Helvetica Neue', Helvetica, Helvetica, Arial, sans-serif; font-size: 23px; font-weight: bold; line-height: 1.1;"> </span>
<span style="font-family: 'Helvetica Neue', Helvetica, Helvetica, Arial, sans-serif; font-size: 23px; font-weight: bold; line-height: 1.1;">revision history</span>
<span style="font-family: 'Helvetica Neue', Helvetica, Helvetica, Arial, sans-serif; font-size: 23px; font-weight: bold; line-height: 1.1;"> </span>
Updates for Max8 and Catalina:
Replaced [aka.speech] external with Jeremy Bernstein’s [shell] external and the Mac OS command line ‘say’ command.
Reinstalled Java Development Kit for [mxj] object
I revised the php code for the Twitter streaming project, to use the coordinates of a corner of the city polygon bounding box. That seems to be more reliable than the geo coordinates which are absent from most Tweets.
Here’s a basic pattern:
From Max, there are many ways to do this:
by Gokce Kinayoglu
http://cycling74.com/toolbox/searchtweet-design-patches-that-respond-to-twitter-posts/
This patch demonstrates the Twitter search API. Its self contained within Max – using the [mxj search tweet] external. This object allows you to input
The response is:
This patch is a great way to get Tweets into Max. You can use a [metro] object to poll the API. There are no additional programs running outside of Max.
The limitation is lack of flexibility. You don’t have access to any of the other parameters in the request response. For example, geographic data. Also, it can be difficult to install and maintain java [mxj] programs in Max.
Here’s a screenshot of a patch which takes the output of the above patch and sends it to the aka.speech object – which runs the Mac Os built in text-to-speech program