Week of the 10/21/2024 - #43
Contents
tech
- 3D perspective
- MIDI Resources
arts
- Shinto Perspectives in Miyazaki’s Anime Film “Spirited Away”
3D perspective
Last month was FlashParty in Argentina. I created a 256 byte entry which projected an xor pattern on a plane. For this I used the code for the floor tiling effect in the famous memories 256 MSDOS entry. To understand a bit better how the projection works I found this site which does a great job at explaining how to project from 3D onto the screen. Here are a list of some useful links:
- Welcome to Computer Graphics - Teaching computer graphics programming to regular folks. Original content written by professionals with years of field experience. We dive straight into code, dissect equations, avoid fancy jargon and external libraries. Explained in plain English. Free.
- Building a Basic Perspective Projection Matrix - Explains how to build a 3D perspective projection matrix.
- The Orthographic Projection Matrix - Explains how to build a 3D orthographic projection matrix.
- The Pinhole Camera Model - This chapter explores the pinhole camera model
- GH repo with source code - Official Scratchapixel website’s code repo.
- Ray Tracing in One Weekend - Another great 3D resource
MIDI Resources
Also for my FlashParty entry I wanted to use MIDI sounds. One problem I had was that I wasn’t able to get MIDI working in Dosbox under Linux. After some research I understood how to do it. Basically you need to be running a MIDI emulation software that listens to MIDI events and converts them to sound. This can be done with an application called Timidity. By running Timidity on a separate terminal it will listen to MIDI events and produce sound. Here’s how you can do it:
- Install
timidiy++
- Run timidity in the background with:
$ timidity -iA -p8
This will make Timidity listen on port 129:0 - 129:3
- You can see what ports are active with:
aconnect -o
- In your DOSBOX configuration, in the MIDI section put:
[midi]
# mpu401: Type of MPU-401 to emulate.
# Possible values: intelligent, uart, none.
# mididevice: Device that will receive the MIDI data from MPU-401.
# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none.
# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use.
# See the README/Manual for more details.
mpu401=uart
mididevice=alsa
midiconfig=129:0
One important parameter when you run Timidity is the -p8
: this makes sure you do not produce more than 8 simultaneous sounds (voices). Most 256 byte intros send key down events but not key up. By abusing that most MIDI instruments have a limited number of voices once you send the 9th note, the first one will be turned off. In this way you save precious bytes that would be needed to turn off notes.
During the development I found this resources to be very useful:
- General MIDI - Timidity supports the General MIDI instruments. “General MIDI (also known as GM or GM 1) is a standardized specification for electronic musical instruments that respond to MIDI messages.”. In this page you can see all instruments that are available out of the box when you use Timidity.
Drum sounds:
For MIDI Channel 10, each MIDI KEY number (“NOTE#”) corresponds to a different drum sound, as shown below. While many current instruments also have additional sounds above or below the range show here, and may even have additional “kits” with variations of these sounds, only these sounds are supported by General MIDI Level 1 devices.
==================================================
Key# Note Drum Sound Key# Note Drum Sound
==================================================
35 B0 Acoustic Bass Drum 59 B2 Ride Cymbal 2
36 C1 Bass Drum 1 60 C3 Hi Bongo
37 C#1 Side Stick 61 C#3 Low Bongo
38 D1 Acoustic Snare 62 D3 Mute Hi Conga
39 Eb1 Hand Clap 63 Eb3 Open Hi Conga
40 E1 Electric Snare 64 E3 Low Conga
41 F1 Low Floor Tom 65 F3 High Timbale
42 F#1 Closed Hi Hat 66 F#3 Low Timbale
43 G1 High Floor Tom 67 G3 High Agogo
44 Ab1 Pedal Hi-Hat 68 Ab3 Low Agogo
45 A1 Low Tom 69 A3 Cabasa
46 Bb1 Open Hi-Hat 70 Bb3 Maracas
47 B1 Low-Mid Tom 71 B3 Short Whistle
48 C2 Hi Mid Tom 72 C4 Long Whistle
49 C#2 Crash Cymbal 1 73 C#4 Short Guiro
50 D2 High Tom 74 D4 Long Guiro
51 Eb2 Ride Cymbal 1 75 Eb4 Claves
52 E2 Chinese Cymbal 76 E4 Hi Wood Block
53 F2 Ride Bell 77 F4 Low Wood Block
54 F#2 Tambourine 78 F#4 Mute Cuica
55 G2 Splash Cymbal 79 G4 Open Cuica
56 Ab2 Cowbell 80 Ab4 Mute Triangle
57 A2 Crash Cymbal 2 81 A4 Open Triangle
58 Bb2 Vibraslap
Shinto Perspectives in Miyazaki’s Anime Film “Spirited Away”
A couple of weekends ago I went to a publishing fair and came across a small book called: “Chihiro y su filosofia”. The book is basically a translation into spanish of the research article ‘Shinto Perspectives in Miyazaki’s Anime Film “Spirited Away”’ written by James W. Boyd & Tetsuya Nishimura of the Colorado State University. You can read the original article here. Here is the abstract:
“Among the anime films by Hayao Miyazaki made available in English translation, Spirited Away contains the most folk and Shrine Shinto motifs. The central locale of the film is a bathhouse where a great variety of creatures, including kami, come to bathe and be refreshed. This feature, plus the portrayal of various other folk beliefs and Shrine Shinto perspectives, suggests that Miyazaki is affirming some basic Japanese cultural values which can be a source of confidence and renewal for contemporary viewers.”
Since the first time I saw the movie it was aparent to me that it referenced a lot of things from Japanese culture but I never knew exactly what. This article and book does a great job of explaining exactly that. The book is printed by artefacto editorial a small editorial based here in Argentina. Check the Instagram article here.
I created an .epub
version of the article here. The markdown source can be found here.