Tuesday, 30 April 2013

Music player, using external library and making routine!

Today's post is about many topics, but all around the same main argument: using external programs or libraries.
If already exists a program that it does what you want, you avoid a lot of work using it.
For example you may write in rebol a GUI for a command line program to see a video:

call "vlc --no-osd myvideo.avi"


Sometime you don't need to launch a big external program, you just need some feature of the external program, so probably you want to use a library. A library is like an external software, but very tiny and for just some purpose. Using a library it's quickly than a normal external software. An external library on windows usually ends with .dll extension, on Linux with .so. The following guide will use a windows DLL, but it's totally the same on Linux and Mac.

First of all you have to load the library and giving it a name, for example "lib":
lib: load/library %libwmp3.dll

now lib is a rebol library and you can interact with it using the routine!. A Library expects a command, that is case sensitive, and returns a status or an error. Let's see an example:

Mp3_SetVolume: make routine! [
return: [integer!]
initialized [integer!]
nLeftVolume [integer!]
nRightVolume [integer!]
] lib "Mp3_SetVolume"


The Mp3_SetVolume routine can now be used to set sound volume, you may use it this way:
Mp3_SetVolume myinitialized 100 100
as you see we launch the routine with all parameters declared: initialized resource, left volume, right volume. It returns 0 or 1 if all went ok or not.

You have to read library documentation to know which routines are available and what parameters they want.

Now I implemented a MP3 player using a Nick Antonaccio script, turn up the volume to listen it well:




here is the source:
REBOL [
    File: %mp3-player-libwmp.r
    Date: 9-Aug-2009
    Title: "mp3-player-demo-using-libwmp3.dll"
    Author:   ["Nick Antonaccio" "Massimilino Vessi"]
    Purpose: {
        Demo of how to play mp3 files in REBOL using libwmp3.dll
        ( http://www.inet.hr/~zcindori/libwmp3/index.html )
        Taken from the tutorial at http://musiclessonz.com/rebol.html
    }
]
if not exists? %libwmp3.dll [
    ; "Downloading libwmp3.dll..."
  request-download/to http://musiclessonz.com/rebol_tutorial/libwmp3.dll   %libwmp3.dll
]
lib: load/library %libwmp3.dll
; ---------------------------------------------------------
; Required functions in libwmp3.dll:
; ---------------------------------------------------------

Mp3_Initialize: make routine! [
    return: [integer!]
] lib "Mp3_Initialize"
Mp3_Destroy: make routine! [
    return: [integer!]
    initialized [integer!]
] lib "Mp3_Destroy"
Mp3_OpenFile: make routine! [
    return: [integer!]
    class [integer!]
    filename [string!]
    nWaveBufferLengthMs [integer!]
    nSeekFromStart [integer!]
    nFileSize [integer!]
] lib "Mp3_OpenFile"
Mp3_Play: make routine! [
    return: [integer!]
    initialized [integer!]
] lib "Mp3_Play"
; ---------------------------------------------------------
; Some more useful values and functions:
; ---------------------------------------------------------

status: make struct! [
    fPlay [integer!]          
    ; if song is playing this value is nonzero
    fPause [integer!]          
    ; if song is paused this value is nonzero
    fStop [integer!]          
    ; if song is stoped this value is nonzero
    fEcho [integer!]          
    ; if echo is enabled this value is nonzero
    nSfxMode [integer!]        
    ; return current echo mode
    fExternalEQ [integer!]    
    ; if external equalizer is enabled this value is nonzero
    fInternalEQ [integer!]    
    ; if internal equalizer is enabled this value is nonzero    
    fVocalCut [integer!]      
    ; if vocal cut is enabled this value is nonzero
    fChannelMix [integer!]    
    ; if channel mixing is enabled this value is nonzero
    fFadeIn [integer!]        
    ; if song is in "fade in" interval this value is nonzero
    fFadeOut [integer!]        
    ; if song is in "fade out" interval this value is nonzero
    fInternalVolume [integer!]
    ; if internal volume is enabled this value is nonzero
    fLoop [integer!]          
    ; if song is in loop this value is nonzero
    fReverse [integer!]        
    ; if song is in reverse mode this value is nonzero
] none
Mp3_GetStatus: make routine! [
    return: [integer!]
    initialized [integer!]
    status [struct! []]
] lib "Mp3_GetStatus"
Mp3_Time: make struct! [
    ms [integer!]
    sec [integer!]
    bytes [integer!]
    frames [integer!]
    hms_hour [integer!]
    hms_minute [integer!]
    hms_second [integer!]
    hms_millisecond [integer!]
] none
TIME_FORMAT_MS: 1
TIME_FORMAT_SEC: 2
TIME_FORMAT_HMS: 4
TIME_FORMAT_BYTES: 8
SONG_BEGIN: 1
SONG_END: 2
SONG_CURRENT_FORWARD: 4
SONG_CURRENT_BACKWARD: 8
Mp3_Seek: make routine! [
    return: [integer!]
    initialized [integer!]
    fFormat [integer!]
    pTime [struct! []]
    nMoveMethod [integer!]
] lib "Mp3_Seek"
; Mp3_Seek stops play.   ALWAYS CALL Mp3_Play AFTER USING IT.

Mp3_PlayLoop: make routine! [
    return: [integer!]
    initialized [integer!]
    fFormatStartTime [integer!]
    pStartTime [struct! []]
    fFormatEndTime [integer!]
    pEndTime [struct! []]
    nNumOfRepeat [integer!]
] lib "Mp3_PlayLoop"
Mp3_GetPosition: make routine! [
    return: [integer!]
    initialized [integer!]
    pTime [struct! []]
] lib "Mp3_GetPosition"
Mp3_Pause: make routine! [
    return: [integer!]
    initialized [integer!]
] lib "Mp3_Pause"
Mp3_Resume: make routine! [
    return: [integer!]
    initialized [integer!]
] lib "Mp3_Resume"
Mp3_SetVolume: make routine! [
    return: [integer!]
    initialized [integer!]
    nLeftVolume [integer!]
    nRightVolume [integer!]
] lib "Mp3_SetVolume"
; volume range is 0 to 100

Mp3_SetMasterVolume: make routine! [
    return: [integer!]
    initialized [integer!]
    nLeftVolume [integer!]
    nRightVolume [integer!]
] lib "Mp3_SetMasterVolume"
; SetMasterVolume sets output volume of wave out device driver
; (the master volue of all sounds on the computer):

Mp3_VocalCut: make routine! [
    return: [integer!]
    initialized [integer!]
    fEnable [integer!]
] lib "Mp3_VocalCut"
; 1 enables vocal cut, 0 disables vocal cut

Mp3_ReverseMode: make routine! [
    return: [integer!]
    initialized [integer!]
    fEnable [integer!]
] lib "Mp3_ReverseMode"
; 1 enables playing mp3 in reverse, 0 plays normal (forward)

Mp3_Stop: make routine! [
    return: [integer!]
    initialized [integer!]
] lib "Mp3_Stop"
Mp3_Close: make routine! [
    return: [integer!]
    initialized [integer!]
] lib "Mp3_Close"
; There are MANY more powerful functions in libmp3.dll.  
; The functions above will get mp3s playing, and enable
; some basic capabilities such as pause/resume, volume
; control, seeking (fast forward and rewind), looping, as
; well as some interesting tools such as reverse play and
; vocal removal (for stereo tracks only).
; The prototypes above should provide clear enough examples
; to demonstrate how to use all the other functions in the
; library:   equalizer settings, stream playing, retrieval
; of ID field and recorded data info, effect application
; (echo, etc.), and more.   I drew these function prototypes
; from the Visual Basic example that ships with libwmp3.
; Converting the rest of the functions should be easy...
; (Wrap everything in a nice GUI and we'll have a killer
; REBOL mp3 player (on my to do list... ;))

; ---------------------------------------------------------
; Required REBOL code starts here:
; ---------------------------------------------------------

; 1st, call the Initialize function:

initialized: Mp3_Initialize
; Then open an mp3 file (change the string to select a
; different file):

view layout [
across
title "MP3 player"
return
song: h2 red 420   ;song title
return
button "open" [
    title: first request-file/filter   "*.mp3"
    song/text: second split-path title
    file: to-string to-local-file to-file title
    Mp3_OpenFile initialized file 1000 0 0
    show song
    ]
toggle "reverse mode" [either face/state [Mp3_ReverseMode initialized 1] [Mp3_ReverseMode initialized 0]]
toggle "Vocal" "No vocal" [either face/state [Mp3_VocalCut initialized 1] [Mp3_VocalCut initialized 0]]
return
across
button "<<" [
    ptime: make struct! Mp3_Time [0 -10 0 0 0 0 0 0]
    Mp3_Seek initialized TIME_FORMAT_SEC ptime SONG_CURRENT_FORWARD
    Mp3_Play initialized
    ]
toggle {||} [either face/state [ Mp3_Pause initialized] [Mp3_Resume initialized] ]
toggle ">" "Stop" [either face/state [Mp3_Play initialized] [Mp3_Stop initialized ]]
button ">>" [
    ptime: make struct! Mp3_Time [0 10 0 0 0 0 0 0]
    Mp3_Seek initialized TIME_FORMAT_SEC ptime SONG_CURRENT_FORWARD
    Mp3_Play initialized
    ]  
return  
label   "Volume:"
slider 330x20 0.5 [
    Mp3_SetVolume initialized   (to-integer (100 * face/data)) (to-integer (100 * face/data))
    vl/text: to-string (to-integer (100 * face/data))
    show vl
    ]
vl: txt 40 "50"
]

Friday, 26 April 2013

Rebol scrolling gradients demo

The following code is a demo of scrolling gradients capabilities here is a video:



Here is the source:
rebol [
        File: %movegrad.r
        license: 'BSD
        Date: 05-Feb-2011
    Title: "Moving Gradients"
    Author: "François Jouen"
    Version: 1.0
    Needs: [view 1.3.2]
    Rights: {}
        Purpose: {Graphical Animations with Gradients}
]
_grad-offset: 0x0 ; this allows directional motion
_grad-start-rng: 90.0 ; to create lines
_grad-stop-rng: 180.0 ;to create lines
_grad-angle: 0 ; 0 for horizontal motion and 90 for vertical motion
_grad-scale-x: 1 ; allows modifying frequency in x range
_grad-scale-y: 1 ; allows modifying frequency in y range
_grad-color-1: silver ; this can be modified for playing with colors
_grad-color-2: snow ; this can be modified for playing with colors
_grad-color-3: silver ; this can be modified for playing with colors

velocity: 1
mov: false
direction: "right"
ssize: 800x600; tested up 1600x1200

; for repeated linear gradient
grad: [
    fill-pen linear '_grad-offset
    repeat '_grad-start-rng '_grad-stop-rng '_grad-angle '_grad-scale-x '_grad-scale-y
    '_grad-color-1
    '_grad-color-2
    '_grad-color-3
    box
]
; controls stimulus motion direction
motion: func [to-where] [
    while [mov] [
        switch to-where [
            "right" [ _grad-offset/x: _grad-offset/x + velocity]
            "left"   [_grad-offset/x: _grad-offset/x - velocity]
            "up"     [_grad-offset/y: _grad-offset/y - velocity]
            "down"   [_grad-offset/y: _grad-offset/y + velocity]
        ]
        wait 0; for keyboard events
        show stimulus
    ]
]
MainWin: layout [
    across
    stimulus: box ssize effect [draw grad]
    return
    text "Direction"
    arrow 24x24 effect [fit arrow 0.0.0 0.7 rotate 270 ]   [_grad-angle: 0 direction: "left" show stimulus]
    arrow 24x24 effect [fit arrow 0.0.0 0.7 rotate 0] [_grad-angle: 90 direction: "up" show stimulus]
    arrow 24x24 effect [fit arrow 0.0.0 0.7 rotate 180] [_grad-angle: 90 direction: "down" show stimulus]
    arrow 24x24 effect [fit arrow 0.0.0 0.7 rotate 90] [_grad-angle: 0 direction: "right" show stimulus]
    text "Velocity"
    sl: slider 200x24 [velocity: sl/data * 9 + 1 vit/text: round/to velocity 0.01 show vit ]
    vit: info 50   "1"
    btn "Start" [mov: true motion direction ]
    btn "Stop" [mov: false ]
    btn "Zero" [_grad-offset: 0x0 show stimulus]
    btn "Quit" [Quit]
]
view/new center-face MainWin
insert-event-func [
    if (event/type = 'close)   and (event/face = MainWin) [quit]
    [event]
]
do-events

Wednesday, 24 April 2013

Mini sound synthesizer

Today I'll show a sound synthesizer:




Here is the source (skip the image and go to the code, it's really short):
REBOL [
    Title: "Mini Synthesizer"
    Author: "Ayrris Aunario"
    Email: aaunario@yahoo.com
    Purpose: {Multi-purpose music program with the following features:
            1) a 24-key (2-octave range includes middle C to B) keyboard/synthesizer with visual and audio output
            2) for most basic chords in any given key, outputs the sound of that chord, the formal musical notation, and the corresponding keyboard keys
            3) plays "Twinkle Twinkle..."
    }  
    Date: 22-Sep-2005
    Version: 0.0.3
    File: %minisynth.r
]
sound-port: open sound://
trebclefimg: make image! [48x128 #{
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000010101000000010101
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000010101010101000000010101070707000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000050505010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101010101000000000000000000000000
000000000000000000000000000000000000050505000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101000000000000
000000020202000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000010101010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000010101000000
020202000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000060606000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101010101000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000020202010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101010101000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101020202000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000020202000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000030303000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000030303
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000020202000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000030303010101000000000000000000000000010101
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000010101010101000000000000010101000000000000000000
000000010101010101000000000000000000000000010101000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000010101010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000030303000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000020202000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101060606000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000020202000000
010101020202000000000000000000000000000000000000000000000000
000000000000010101000000000000000000000000000000000000010101
000000000000010101010101000000000000000000000000000000000000
000000000000000000000000000000010101010101000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
030303010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
010101000000010101000000000000000000000000000000000000000000
000000000000000000000000000000020202000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000010101000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000010101000000000000010101020202000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000010101
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
010101040404000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000010101
000000000000000000000000000000010101010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000020202000000000000000000000000000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000010101000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101000000
000000000000000000000000000000000000000000000000000000000000
000000010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000020202000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000050505000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000010101000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000020202000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000030303000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000010101000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000010101010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000020202000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000010101020202
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000010101000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
030303010101000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000010101
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010101000000000000010101
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000010101000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
010101000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010101010101000000000000000000000000
000000000000000000000000000000010101000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
0000000000000000000000001B1B1B000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000
}
#{
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFBC93DFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF7412
0032E5FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF6500000000
23E8FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF660000000000006B
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF81
0000000000000008E2FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFCF090000
0000000000006AFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFF8360000000000
000000000AE4FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF970000000000000000
0000006AFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFE118
00000000000000000000
0020F5FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF5E000000
00000000000000000000
C0FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFDA050000000000
00000007000000006AFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF5D0000000000000969
96E9A24300001EFDFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFEF0A
000000000010CBFFFFFF
FFFD400003C2FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFA9010000
000010CEFFFFFFFFFFFF
D0000066FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF51000000000C
CDFFFFFFFFFFFFFFFC2B
003BFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFE3120000000072FFFF
FFFFFFFFFFFFFF63001B
E7FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFCD
000000000CEAFFFFFFFF
FFFFFFFFFF630000D1FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFB90000
000072FFFFFFFFFFFFFF
FFFFFFC60000D4FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF6400000010
E7FFFFFFFFFFFFFFFFFF
FFA10000D4FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFF670000004EFFFF
FFFFFFFFFFFFFFFFFF5D
0000D4FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF68000001A5FFFFFFFF
FFFFFFFFFFFFFE3E0000
D4FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF6B
000008EEFFFFFFFFFFFF
FFFFFFFFE2020000D4FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF6230000
34FBFFFFFFFFFFFFFFFF
FFFF6C000000D4FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFF30C000066FF
FFFFFFFFFFFFFFFFFFE3
0A000000D1FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFF310000092FFFFFF
FFFFFFFFFFFFFF6A0000
001AE7FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F3100000D4FFFFFFFFFF
FFFFFFFFE00800000044
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFF310
0005D0FFFFFFFFFFFFFF
FFFF3B000000003EFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF30E0034
FEFFFFFFFFFFFFFFFF75
000000000034FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFE580038FFFF
FFFFFFFFFFFFE4000000
00000AB6FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFF6C0036FFFFFFFF
FFFFFFCB190100000000
15FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF670036FFFFFFFFFFFF
FD310000000000001DF8
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF67
0036FFFFFFFFFFFD4A00
00000000000068FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFF5F0037
FFFFFFFFFC4900000000
00000000C8FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFAA0036FFFF
FFFC4900000000000000
004FFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFD40035FFFFFC48
000000000000000002D0
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFC8003BFFDA49000000
0000000000004FFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFE5
191FAC0C000000000000
00000000CFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF3D00
00000000000000000000
0056FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF30000000
000000000000000013F3
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFE448010000000000
000000000000B2FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFD2
24000000000000000000
0000006EFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF9B020000
00000000000000000000
4CFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFB74000000000000
0000000000000024E2FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFB
45000000000000000000
0000000000BFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFC63D0000
00000000000000000000
00009CFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFA3080000000000
000000000000000043C3
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
79000000000000000000
000000000025F7FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFBF0500
00000000000000000000
000149E6FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFC00800000000
00000000000000000035
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFBE0800000000000000
00000000001A1811DDFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFBF08
00000000000000000000
000049F29700D2FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFE507000000
00000000000000000090
FCFF9900ACFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFF741000000000000
0000000000009EFFFFFF
A90061FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
7C000000000000000000
000026C8FFFFFFFFF301
60FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFCD0000
00000000000000000028
E7FFFFFFFFFFF10313F7
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFF2800000000
00000000000028E8FFFF
FFFFFFFFFD4A00F1FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF7500000000000000
00000029E8FFFFFFFFFF
FFFFFF6200A6FFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFDF
04000000000000000000
28E8FFFFFFFFFFFFFFFF
FF8B00A4FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFF670000
000000000000002AE9FF
FFFFFFFFFFFFFFFFFFD2
0062FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFDF0900000000
0000000029E9FFFFFFFF
FFFFFFFFFFFFFFCD0230
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF9100000000000000
0028E9FFFFFFFFFFFFFF
FFFFFFFFFFFF2824FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFF5
240000000000000000C1
FFFFFFFFFFFFFFFFFFFF
FFFFFFF733008661399A
9E9EC2F3FFFFFFFFFFFF
FFFFFFFFFFFFFFC20000
00000000000093FFFFFF
FFFFFFFFFFFFFFFFF391
63160400000000000000
001160C9FFFFFFFFFFFF
FFFFFFFFFB2700000000
00000032E7FFFFFFFFFF
FFFFFFFFFF8F1D000000
00000000000000000000
000033ADFFFFFFFFFFFF
FFFFFF14000000000000
10DBFFFFFFFFFFFFFFFF
FFFFAB00000000000000
00000000000000000000
000089FFFFFFFFFFFFFF
D80E00000000000088FF
FFFFFFFFFFFFFFFFFFAB
00000000000000000000
00000000000000000000
0089FFFFFFFFFFFFA900
000000000017F2FFFFFF
FFFFFFFFFFFFAC000000
00000000000000000000
00000000000000000000
87FFFFFFFFFF7C000000
00000089FFFFFFFFFFFF
FFFFFFAA000000000000
00000000000000000000
000000000000000000B5
FFFFFFFF380000000000
14F2FFFFFFFFFFFFFFFF
E7070000000000000000
00000000000000000000
0000000000000019EBFF
FFFF4000000000008AFF
FFFFFFFFFFFFFFFF4400
00000000000000000000
00000000000000000000
0000000000007CFFFFFF
400000000008DBFFFFFF
FFFFFFFFFFBC00000000
00000000000000000029
3D3D0600000000000000
0000000011EFFFFF4000
00000037FFFFFFFFFFFF
FFFFFF5D000000000000
00266FACD3A20054FFFF
DED38337000000000000
0000007AFFFF40000000
008CFFFFFFFFFFFFFFFF
F81600000000000395F9
FFFFFFE00932FFFFFFFF
FFFFAD18000000000000
0028F6FF3A00000008DE
FFFFFFFFFFFFFFFFAF02
0000000003B4FFFFFFFF
FFFF2828FCFFFFFFFFFF
FFEA5A00000000000000
DCFF5A0000000AF0FFFF
FFFFFFFFFFFF9D000000
0005B3FFFFFFFFFFFFFF
3002D1FFFFFFFFFFFFFF
FA1B00000000000097FF
AD00000009EBFFFFFFFF
FFFFFFFFA0000000005E
FFFFFFFFFFFFFFFF8700
D7FFFFFFFFFFFFFFFFBE
0000000000006CFFA600
000009EBFFFFFFFFFFFF
FFFFA000000001DBFFFF
FFFFFFFFFFFF95008EFF
FFFFFFFFFFFFFFFF4600
000000007CFFED130000
09EBFFFFFFFFFFFFFFFF
A000000036FFFFFFFFFF
FFFFFFFFC10066FFFFFF
FFFFFFFFFFFF91000000
000049FEFD1700000AF3
FFFFFFFFFFFFFFFFA000
00006BFFFFFFFFFFFFFF
FFFFF8024CFEFFFFFFFF
FFFFFFFFCE0700000000
10FAFF5D000005C1FFFF
FFFFFFFFFFFF9A000000
63FFFFFFFFFFFFFFFFFF
EF0008FAFFFFFFFFFFFF
FFFFF1040000000018FA
FFB800000092FFFFFFFF
FFFFFFFFDA08000067FF
FFFFFFFFFFFFFFFFFB42
04DEFFFFFFFFFFFFFFFF
FA420000000018FAFFE2
01000064FFFFFFFFFFFF
FFFFFF6800005AFFFFFF
FFFFFFFFFFFFFF62009B
FFFFFFFFFFFFFFFFFF63
0000000066FFFFFF5500
0018F3FFFFFFFFFFFFFF
FFE008000EF6FFFFFFFF
FFFFFFFFFFA900A9FFFF
FFFFFFFFFFFFFF5C0000
000077FFFFFFD7040000
B9FFFFFFFFFFFFFFFFFF
6800019DFFFFFFFFFFFF
FFFFFFCC006EFFFFFFFF
FFFFFFFFFF5C00000000
C6FFFFFFFF56000046FF
FFFFFFFFFFFFFFFFE725
0022FDFFFFFFFFFFFFFF
FFD90B2DFFFFFFFFFFFF
FFFFFF6400000024F8FF
FFFFFFD4010000B5FFFF
FFFFFFFFFFFFFFD00000
8AFFFFFFFFFFFFFFFFFF
2630FFFFFFFFFFFFFFFF
F63300000072FFFFFFFF
FFFF88000019F5FFFFFF
FFFFFFFFFFFF9F1C0095
FFFFFFFFFFFFFFFF250E
DFFFFFFFFFFFFFFFF203
00000EEAFFFFFFFFFFFF
FA4C00003DFFFFFFFFFF
FFFFFFFFFFE333008DFF
FFFFFFFFFFFF6500D4FF
FFFFFFFFFFFFC4050000
73FFFFFFFFFFFFFFFFEC
0D00008CFFFFFFFFFFFF
FFFFFFFFFF7B048BFFFF
FFFFFFFF9C00B1FFFFFF
FFFFFFFF46000012E7FF
FFFFFFFFFFFFFFFFCA0E
00008CFFFFFFFFFFFFFF
FFFFFFFFDDBAFFFFFFFF
FFFFA40065FFFFFFFFFF
FFD80F0000ACFFFFFFFF
FFFFFFFFFFFFFFC91600
007DF4FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F00165FFFFFFFFFFFF3C
000074FFFFFFFFFFFFFF
FFFFFFFFFFFFED4E0000
38DEFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFEF01
18F7FFFFFFFF5F00002C
FAFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFE6A00000A
98FBFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFC4401FC
FFFFFA5D00002DECFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFB62B000029
C2F9FFFFFFFFFFFFFFFF
FFFFFFFFFF5D00D5FFC4
27000065EBFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFEF830E000026
93D9FBFFFFFFFFFFFFFF
FFFFFF97004D4600000F
8AFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFD15400000006
1D6E79D1D6D6D6D6D69A
73620000000555D2FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF7D0800000000
00000000000000000000
00000544FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFDC8C332D2D2D2B
2B2B2B2B2B2C2D2D060C
CBF0FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFF201FF7FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF6A00D0FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFF9D00CDFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
920075FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFDC00
6BFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF30057FF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFF62606F6FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFF5E00FDFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FF6200D5FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFC1
009EFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFBD7234
343483CCFFFFFFFFFFFF
FFFFFFFFFFFFFFC6009C
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFD2420000000000
00007BFFFFFFFFFFFFFF
FFFFFFFFFFD3083EFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
E1140000000000000000
007CFFFFFFFFFFFFFFFF
FFFFFFFF242DFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFF94C00
00000000000000000000
92FFFFFFFFFFFFFFFFFF
FFFF2231FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFCE00000000
000000000000000015EE
FFFFFFFFFFFFFFFFFFFF
242CFDFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFE5C000000000000
000000000000009FFFFF
FFFFFFFFFFFFFFFF2F02
D4FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F60E0000000000000000
00000000009BFFFFFFFF
FFFFFFFFFFFF3100CFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFF614
00000000000000000000
0000009CFFFFFFFFFFFF
FFFFFFFF2C0CDEFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFF6140000
00000000000000000000
0095FFFFFFFFFFFFFFFF
FFFF2531FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFF61400000000
000000000000000005D5
FFFFFFFFFFFFFFFFFFE3
0C2EFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFF60F000000000000
0000000000005EFFFFFF
FFFFFFFFFFFFFF9B0064
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
F9230000000000000000
0000003BF0FFFFFFFFFF
FFFFFFFFFF1B05E3FFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF9F
00000000000000000000
44F5FFFFFFFFFFFFFFFF
FFFF770066FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFA2000
0000000000001A94FFFF
FFFFFFFFFFFFFFFFFFC1
001FF3FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFC1090000
00006DB6F0FFFFFFFFFF
FFFFFFFFFFFFB80404C0
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFC008000000
7DFFFFFFFFFFFFFFFFFF
FFFFE8680004BFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFC64600000059
CEFFFFFFFFFFFFFFE78A
1E0006C1FFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFBE4400000029
5050A6A6504A0700005E
D3FFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFBF762C1A0000
0000000C2F84D3FFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFEA93939393
93D5FFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFF
FFFFFFFF
}
]
flat: make image! [12x38 #{
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000
}
#{
7F7F7FFFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFF
000000FFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFF
000000FFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFF
000000FFFFFFFFFFFFFF
FFFF000000FFFFFFFFFF
FFFFFFFF000000FFFFFF
FFFFFFFFFFFF000000FF
FFFFFFFFFFFFFFFF0000
00FFD0907F7F90E0FFFF
0000003F000000000000
A0FF0000000000000000
000000B0000000001F3F
00000000003F0000002F
F0FF4F00000000000000
00C0FFFFB00000000000
000000FFFFFFA0000000
0000000000FFFFFF5F00
0000004F000000FFFFE0
0000000000C0000000FF
FF4F000000005FFF0000
00FF90000000002FFFFF
000000D00F0000002FF0
FFFF0000001F0000005F
F0FFFFFF000000000000
5FFFFFFFFFFF00000000
0090FFFFFFFFFFFF0000
0000A0FFFFFFFFFFFFFF
000000A0FFFFFFFFFFFF
FFFF0000A0FFFFFFFFFF
FFFFFFFF7FB0FFFFFFFF
FFFFFFFFFFFF
}
]
sharp: make image! [14x43 #{
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000
000000000000
}
#{
FFFFFFFFFFFFFFF0C0C0
D0FFFFFFFFFFFFFFFFFF
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
3FFFFFFFFFFF7F00007F
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
1F5F3FA0FFFF7F00005F
904F00000000007FFFE0
4F000000000000000000
007F1F00000000000000
00000000007F00000000
0000000000000000007F
00000000000000000000
0000007F000000000000
0000000000001FB00000
00000000000000002FE0
FFFF00000000003FB0B0
00003FFFFFFF3F5F3F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
3FFFFFFFFFFF7F00007F
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00002F907FC0FFFF7F00
007FC05F00000000007F
FFFF5F00000000000000
0000007F5F0F00000000
000000000000007F0000
00000000000000000000
007F0000000000000000
00000000007F00000000
0000000000000000007F
00000000000000000000
1F90D0FF000000000000
3F5F00003FFFFFFF0000
1F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFC00000
3FFFFFFFFFFF7F00007F
FFC000003FFFFFFFFFFF
7F00007FFFC000003FFF
FFFFFFFF7F00007FFFC0
00003FFFFFFFFFFF7F00
007FFFC000003FFFFFFF
FFFF7F00007FFFD03F3F
6FFFFFFFFFFF7F00007F
FFFFFFFFFFFFFFFFFFFF
C07F7FC0FFFFFFFFFFFF
FFFF
}
]
showingchords?: false
chordnotes: copy []
chords: ["Major" "Minor" "Seventh" "Minor Seventh" "Major Seventh"]
chordkeyinds: [[5 8] [4 8] [5 8 11] [4 8 11] [5 8 12]]  
rootind: 1
selchordind: 1
roots: ["C" "C#" "D" "Eb" "E" "F" "F#" "G" "Ab" "A" "Bb" "B" "C" "C#" "D" "Eb" "E" "F" "F#" "G" "Ab" "A" "Bb" "B"]
oct-roots: copy/part roots 12
snotes: copy []
play?: false
afreq: 440
st-ratio: 2 ** (1 / 12)
tone-length: .5
inc: 10
keys: [C1 Cs1 D1 Eb1 E1 F1 Fs1 G1 Ab1 A1 Bb1 Bb C2 Cs2 D2 Eb2 E2 F2 Fs2 G2 Ab2 A2 Bb2 B2]  
keyboardkeys: "q2w3er5t6y7ucfvgbnjmk,l."

sample: make sound [
    rate: 44100 / 2
    channels: 1
    bits: 8
    volume: 0.5
    data: #{}
]
make-pitch: func [pitchfreq time samprate numchan /local numsamps numcycles pitchdata] [
    pitchdata: copy #{}
    numsamps: numchan * samprate / pitchfreq    
    repeat sampcount (round/floor samprate * time)[
            x: sampcount * 360 / numsamps
            append pitchdata to-char val: 128 + round 127 * sine x
    ]
    pitchdata
]
wholenoteplot: [pen black]
repeat i 15[
    append wholenoteplot compose [
        circle 15x7 (11 - round 0.4 * i) (7 - to-integer 0.1 * i)
    ]
]
acc_face: make face [
    offset:  
    size:
    edge: none
    effect: [merge]
    show?: false
]
snface: make face [
    offset:
    size: 30x14
    edge: none
    color: none
    effect: [draw wholenoteplot]
]
key: make face [
    size:
    edge: make edge [
        color: 0.0.0
        size: 1x1
    ]
    staffnote:
    accidental: none
    white?:
    indplace:
    offset:
    color:
    tone:
    make-sound: func [p][
        clear sample/data
        sample/data: make-pitch p tone-length (sample/rate) (sample/channels)
        insert sound-port sample
    ]
       
    playnote: does [
        color: yellow
        staffnote/show?: true
        if white? = 0 [accidental/show?: true]
        show output-panel
        make-sound tone
        wait sound-port
        reset
        show output-panel
    ]
    reset: does [
        color: white * white?
        staffnote/show?: false
        if white? = 0 [accidental/show?: false]
    ]
    feel: make feel[
        engage: func [face action event][
            if action = 'down [
                face/playnote
            ]
        ]
    ]  
]
trebleclef: make face[
    size: trebclefimg/size
    offset: 5x50
    color: none
    edge: none
    image: trebclefimg
    effect: [merge]
]
staff: make face [
    size: 300x200
    offset: 400x1
    color: beige
    edge: make edge [
        color: black
        size: 2x2
    ]
    plotline: copy []
   
    repeat i 9[
        append plotline 'line
        either ((abs (i - 5)) > 2) [c: 1][c: 0]
        repeat j 2[
            repeat k 2[
                y: 14 * i + 28 + j - 1
                b: mod (k + j) 2
                append plotline as-pair (-1 ** b * c * 140 + (300 * b)) y
            ]
        ]
    ]
   
    effect: [draw plotline]
    pane: snotes
]
initkeys: has [xpos ind w? tempimg pntemp black_keys prevnoteflat?][
    black_keys: copy []
    temp: copy []
    xpos: 0
    w?: 1
    prevnoteflat?: false
    snypos: 141
    foreach k keys [
        ind: index? find keys k
        either (length? to-string k) > 2 [
            w?: 0
            either find pick roots ind to-char "#" [
                snydec: 0
                tempimg: sharp
                prevnoteflat?: false
            ][
                snydec: 7
                tempimg: flat
                prevnoteflat?: true
            ]  
        ][
            either prevnoteflat? [snydec: 0][snydec: 7]
            prevnoteflat?: false
            w?: 1
        ]
        snypos: snypos - snydec
        set k make key [
            size: 20x100 + (w? * 10x100)
            offset: as-pair (xpos) (1)
            color: white * w?
            if w? = 0 [
                append snotes accidental: make acc_face [
                    size: tempimg/size
                    offset: either prevnoteflat? [
                        as-pair 120 (snypos + 21 - tempimg/size/y)
                    ][as-pair 100 (snypos - to-integer 0.5 * (tempimg/size/y - 14)) ]  
                    image: tempimg
                ]
            ]
            white?: w?
            append snotes staffnote: make snface [offset: as-pair 135 snypos show?: false]
            indplace: ind
            tone: st-ratio ** (ind - 10) * afreq
        ]
       
       
        either any [(mod ind 12) = 0   (mod ind 12) = 5][xpos: 5 * w? + inc * 2 + xpos ][xpos: 5 * w? + inc + xpos ]
        either w? = 0 [append black_keys k][append temp k]
    ]
    append snotes trebleclef
    foreach b black_keys [append temp b]
    temp
]
keyboard: make face [
    size: 500x200
    offset: 0x0
    edge: none
    pane: initkeys          
]
output-panel: make face [
    size: 700x200
    offset: 0x0
    edge: none
    pane: [keyboard staff]
]
picknotes: has [key tempblockpitch pitchsampcount tempdata pitches tempind keyinds][
    showingchords: true
    clear chordnotes
    pitches: copy []
    keyinds: copy []
    append/only pitches make-pitch (get in (get pick keys rootind) 'tone) (2 * tone-length) (sample/rate) (sample/channels)
    append chordnotes pick roots rootind
    append keyinds rootind
    key: get pick keys rootind
    do in key 'playnote
    foreach ind (pick chordkeyinds selchordind) [
        append keyinds tempind: rootind - 1 + ind
        key: get pick keys tempind
        do in key 'playnote
        append/only pitches make-pitch (get in key 'tone) (2 * tone-length) (sample/rate) (sample/channels)
        append chordnotes pick roots tempind
    ]
   
    clear sample/data
   
    repeat i (length? pitches/1) [
        tempdata: 0
        repeat j (length? pitches)[
                tempdata: tempdata + (pick (pick pitches j) i)  
        ]
        append sample/data to-char tempdata / (length? pitches)
    ]  
   
    foreach k keyinds [
        key: get pick keys k
        set in key 'color yellow      
        set in (get in key 'staffnote) 'show? true
        if (get in key 'white?) = 0 [set in (get in key 'accidental) 'show? true]
    ]
    show output-panel
    insert sound-port sample
    wait sound-port
    foreach k keyinds [
        key: get pick keys k
        do in key 'reset
    ]
    showingchords?: false
]
   
input-panel: make face [
    size: 700x300
    offset: 0x200
    edge: make edge [
        color: 0.0.0
        size: 1x1
    ]
    pane: layout [
            across
            choice data oct-roots [if not showingchords? [rootind: index? find roots value picknotes t/text: form chordnotes show window] ]
            choice data chords [if not showingchords? [selchordind: index? find chords value picknotes t/text: form chordnotes show window]] with [offset: 10x10]
            h3 "Notes of the chord:"
            t: field form chordnotes  
            return
            below
            pad 180
            across      
            button "Play Sample" [play?: true play-song]
            button "Stop Sample" [play?: false]
    ]
]
song: [1 1 2    
        8 1 2
        10 1 2
        8 2 1
        6 1 2
        5 1 2
        3 1 2
        1 2 1
        8 1 2
        6 1 2
        5 1 2
        3 2 1
        8 1 2
        6 1 2
        5 1 2
        3 2 1
        1 1 2  
        8 1 2
        10 1 2
        8 2 1
        6 1 2
        5 1 2
        3 1 2
        1 2 1]  
play-song: does [
    foreach [no le times] song [
        if not play? [break]
        tone-length: le * .5
        k: get pick keys no
        loop times [
            k/playnote
            wait 0.05
        ]
    ]
]      
       
       
   
view/new window: layout [
    window-box: box 700x500 feel [
        engage: func [face action event /local ind][
            if action = 'key [
                if find keyboardkeys to-char event/key [
                    ind: index? find keyboardkeys to-char event/key
                    do in (get pick keys ind) 'playnote
                    show face
                ]
            ]
        ]
    ]
    with [
        pane: [input-panel output-panel]    
    ]
]
   
focus window-box
do-events
close sound-port