Data Load/Store and the Paleo Database

Note: The paleo test data is not included with this release, and the examples below are believed not to work.

Load Event Lists from MIDI files

[   | num fn el |
   Cursor wait showWhile:
      [1 to: 100 do: [ :ind |
         num := ind asZeroFilledString: 3.
         fn := SirenUtility scoreDir, 'Scarlatti/K', num, '.MID'.
         (FileDirectory root fileExists: fn)
            ifTrue: [el := (MIDIFileReader scoreFromFileNamed: fn) asEventList.
               el at: #name put: (''ScarlattiK'', num) asSymbol.
               el at: #composer put: ''Domenico Scarlatti''.
               el at: #instrumentation put: #harpsichord.
               el at: #style put: #Baroque.
               Siren eventLists at: (''ScarlattiK'', num) asSymbol put: el]]]]

Siren eventLists explore
EventList someInstance
EventList instanceCount
EventList allInstances

Loading Sound Files

[   | dir fn |
   dir := Siren soundDir, ''SimpleT/justin_b/''.
   Transcript cr.
   10 to: 14 do: [ :ind |
      fn := (FileDirectory on: dir) fileNamesMatching: (ind printString, ''*'').
      fn isEmpty
         ifFalse: [fn := fn first.
            Transcript show: ''Reading sound from: '', dir, fn; cr.
            StoredSound fromFile: dir, fn]]]

Siren sounds inspect
Siren initializeSoundDictionary

Loading Spectral Data Files

[   | dir fn |
   dir := Siren soundDir, ''sharc/tuba/''.
   Transcript cr.
   ((FileDirectory on: dir) fileNamesMatching: (''*.spect'')) do:
      [ :fn |
      Transcript show: ''Reading sound from: '', dir, fn; cr.
      Spectrum fromFile: dir, fn]]]

Siren spectra inspect
Siren Siren initializeSpectrumDictionary