Where are the Python 3 Libraries for Media Computation

August 19, 2016 at 7:46 am Leave a comment

My Blog@CACM post for this month is on JES, the Jython Environment for Students, which at 14 years old and over 10,000 downloads, is probably one of the oldest, most used, and (by some definition) most successful pedagogical Python IDE’s.

The SIGCSE Members list recently had a discussion about moving from Python 2 to Python 3. Here’s a description of differences. Some writers asked about MediaComp. With respect to the Media Computation libraries, one wrote:

I’m sad about this one, because we use and like this textbook, but I think it’s time to move to Python 3.  Is there a compatible library providing the API used in the text?

Short answer: No. There are no compatible Media Computation libraries for CPython 2 or 3.

We keep trying. The latest attempt to build Media Computation libraries in CPython is here: https://github.com/sportsracer48/mediapy. It doesn’t work on all platforms yet, e.g., I can’t get it to load on MacOS.

We have yet to find a set of libraries in Python that work cross-platform identically for sample-level manipulations of sounds. For example, PyGame’s mixer object doesn’t work exactly the same on all platforms (e.g., sampling rates aren’t handled the same on all platforms, so the same code plays different speed output on different platforms). I can do pixel-level manipulations using PIL. We have not yet tried to find libraries from frame manipulations of video (as individual images). I have just downloaded the relevant libraries for Python 3 and plan to explore in the future, but since we can’t make it work yet in Python 2 (which has more mature libraries), I doubt it will work in Python 3.

I complained about this problem in my blog in 2011 (see post here). The situation is better in other languages, but not yet in Python.

  • I have been building Media Computation examples in GP, a blocks-based language (see post here).
  • Jeff Gray’s group at U. Alabama has built Blockly-like languages Pixly and Tunely for pixel and sample level manipulations.
  • Cynthia Lee at Stanford has been doing Media Computation in her classes in MATLAB and in C++
  • The Calico project supports Media Computation in IronPython (based on Python 3) and many other languages, because it builds on .NET/MONO which has good multimedia support.
  • We’re able to more and more in JavaScript-based Python implementations (like Pythy and Runestone), because JavaScript has excellent cross-platform multimedia support.

When we did the 4th edition of our Python Media Computation textbook, I looked into what we’d have to change in the book to move to Python 3. There really wasn’t much. We would have to introduce print as a function. We do very little integer division, so we’d have to explain that. The focus in our course (non-technical majors, first course) is at a higher level than the differences between Python 2 and 3. I am confident that, at the end of our course, the majority of our students would understand the differences between Python 2 and 3. As we move more to browser-based IDE’s, I can support either Python 2 or 3 syntax and semantics. Preparing students for industry jobs using exactly CPython 3 is simply not a priority in our course.

Entry filed under: Uncategorized. Tags: , , , .

From Computational Thinking to Computational Participation in K-12 Education: Yasmin Kafai in CACM C.P. Snow keeps getting more right: Why everyone needs to learn about algorithms #CS4All

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

August 2016
M T W T F S S
« Jul   Sep »
1234567
891011121314
15161718192021
22232425262728
293031  

Feeds

Blog Stats

  • 1,270,267 hits

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 4,569 other followers

CS Teaching Tips


%d bloggers like this: