Overview

The Android app contains classes that transfer interactions from the app views, via controller classes, to a Puredata backend. PdLib is used to communicate between Android and Pd.

overview

Phonestrument Backend Puredata patch

The main base patch is phonestrument.pd

scale_struct is an array that contains the semitone sequence information for the base scale (so 2212221 for major). This array is contained in the subpatch “pd scale_chord_arrays” Along with arrays derived from it - so the scale calculated in midinotes (array scale) and the array holding chordtones (chordtones).

“arp1chordttones”, “arp2chordttones”, “arp3chordttones”, “arp4chordttones” hold the changing chord tone information for the four layers of the arpeggio player.

The array “chordtones” is currently unused.

The array “blockchordtones” is currently unused.

pd scalewriter

This subpatch receives the message “key”, which is a midinote representing the root of the scale (so 24 for C), then generates midinotes in an ascending scale in that key into the array “scale”.

pd arpchordtone_calc

Calculates midinotes for particular chords and any modifications to them (raising the third, flattening the 7th, for example). This is called by the arpeggioplayer.

The subpatch has two main sections - the main block on the left that generates standard diatonic chordtones, and the block on the right that then modifies the generated chordtones with any accidentals (so raised third for secondary dominants, for example).

arpeggio chordtone creator

pd blockchordtone_calc

Currenty unused.

pd chordtone_calc

Currenty unused.

General

The arpeggio player needs to be triggered before the bass palyer as it sends out modified 3rd info that the bass player uses.

Receivers

Note that internal receivers and senders have yet to be differentiated from those that are designed to be accessed externally (from the app, for example).

key (scalewriter): MIDI note of key tonic (so 24 for C, for example)

metro_on (main_pulse): Main on/off switch - starts the pulse.

tempo (main_pulse): Sets tempo, in beats per minute

density (main_pulse): Sets number of pulses per beat

num_beats (main_pulse): Sets number of beats per bar

ping_patch_for_info (main_pulse): triggers senders posting patch info

num_bars (bars): sets number of bars in sequencer

loop_start_bar (bars): sets start bar for looping playback

loop_end_bar (bars): sets end bar for looping playback

record_sequence (phonestrument.pd): sets checkbox for recording

keepit (record_it): receives a filename, and writes sequence to that file in wav format

dr1_vol (drumplayer): volume for the first drum sample part

dr2_vol (drumplayer): volume for the second drum sample part

dr3_vol (drumplayer): volume for the third drum sample part

dr4_vol (drumplayer): volume for the fourth drum sample part

Senders

key_info (scalewriter): MIDI note of key on key set or change of key

Responding to the ping_patch_for_info message:

density_info (main_pulse): sends number of pulses per beat

tempo_info (main_pulse): sends current tempo in beats per minute

num_beats_info (main_pulse): sends number of beats per bar

num_bars_info (bars): sends number of bars