This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » Advanced Topics
  •  » xaby's composer - a full MIDI import/export - how to create own tools

#1 2009-11-09 09:42:15

xaby
Scratcher
Registered: 2008-02-13
Posts: 49

xaby's composer - a full MIDI import/export - how to create own tools

Project: xaby's composer
http://scratch.mit.edu/forums/viewtopic.php?pid=259439#p259439

SoundClub for Windows (export as WAVE, no MIDI import)
http://www.bluemoon.ee/history/scwin/

SoundClub for DOS (export and import as MIDI, MODULE, no WAVE export)

Finding a MIDI on http://www.hamienet.com/
Using SoundClub (DOS-Version) to load it, save as *.SN file

open *.SN file in SoundClub for Windows and look at the piano roll

or use the MIDI-XML function from http://www.hamienet.com/
and convert a MIDI-XML file with external tools to a sprite / picture, BMP, PNG

load it into Scratch and play it in my "xaby's composer"

-----------------------------------------------------------------------------------

If you have questions about converting MIDI-XML into pictures
I can post here some code written in PureBasic

Also usefull is the Mario Paint Composer. It's music files are simple text files,
they can be imported as ANSWER in the new Scratch 1.4 block

Last edited by xaby (2009-11-09 09:46:05)

Offline

 

#2 2009-11-11 01:45:01

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: xaby's composer - a full MIDI import/export - how to create own tools

I don't quite understand what you are explaining...
a slightly better explained version would be nice.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#3 2009-11-15 13:33:34

xaby
Scratcher
Registered: 2008-02-13
Posts: 49

Re: xaby's composer - a full MIDI import/export - how to create own tools

I will write a PHP script, it would be possible to upload a MIDI-file and it will generate a PNG for Scratch. With my Scratch Project it would be possible to play the PNG-Music

Offline

 

#4 2009-11-16 07:33:48

xaby
Scratcher
Registered: 2008-02-13
Posts: 49

Re: xaby's composer - a full MIDI import/export - how to create own tools

Coding for own music. Scratch program will released soon
Coding for external programs. Using pictures or MIDI input and or output.
Executables for Windows will follow.

2009-07-08 (JULY) .. 15.07.2009
(c) Folker Linstedt, For Scratch (http://scratch.mit.edu/), converter For MIDI-Files, Manifest ;-)

Color-Coding. For MIDI-Files. With 64 colors + any other color For ZERO

Simple decoding For easy understanding
I choose the coding so, To give kids the chance To built there own "decoder" line For line.
In the first line are the most wanted notes With it's duration, but kids can also interpretate only every fourth dot
And have everytime a quater note. which instrument is depending on:
the high of the coded row, Or the dot before music, Or the third, Or the third And the forth line
In the second line there is the velocity in a rough form, but easy To understand the coding.
there are also the other notes To have at max. 128 notes

you can interprete every line without modulation Or division Or complex If-statements

sorted by importance And decoder complexity

lines
1st : 32 Notes
2nd : 16 velocity: (2nd) * 8
3th : better velocity + second 64 instruments
4rd : 64 instruments: first 64 instruments


4 lines together will give you the full spectrum of MIDI in Srctach (without balance Or maybe raw balance)
128 Instruments, 128 Notes, 128 Velocity, 4 status

I am Not shure If 3rd is 3rd And 4th is 4th, can be change there position,
it's easier to understand the changing of an instrument (line 4), BUT in music it is more common to change the velocity.
For those, who want To experiment With instruments can ignore the 3th line If they are Not interested in more exact velocity ;-)

If you combinate 4 blocks you can:

e.g. 6 Drums (With there velocity) one block + 12 melodies With all MIDI-Feautures (change instrument every note, 128 instruments)
Or   up To 48 notes at the same time in kind tune, up tu 24 With raw velocity And 128 notes (And instruments of 128)
Or   16 notes at the same time With 128 velocity values, 128 notes And 16 instruments of 128

can also combinate With lyric blocks For karaoke Or statements To display "education stuff" ;-)
guitar grips, animations of musicans, Or integrate your own vocals via microphone


Instruments, drums, lyrics, texts, animations coded in 12 rows.

(S) first column ([S]tart column) is coded: 1..16 For instrument category, (can be interpreted As Global defined instruments)
    17 : second melodyline
    18 : third  melodyline
    19 : fourth  melodyline
   
    20 : fifth melodyline For volume balance (If Scratch will have) For drums And melody Or coded in the "End-Dot" ;-)
   
    21 .. 32 free For lyrics (one dot, one character, words from up To bottom) For karaoke ;-)
         
    33 : tempo line : the first tempo line in all played blocks at the same time will be interpreted, others will be ignored
         every dot in the upper block is a tempo 0 .. 256, dot * 4
       
    34  is DrumVolume (velocity For drums is over the drum line, this is different To melody coding) = discarded, because To complex decoding,
           DrumVolume will stand in second line like it is in the melody, but Not shure, If 64*2 Or 16*8-(2*X)+2 ... 16*8 like velocity in melody
           but, who wants To have velocity is able To make a difference between drum-volume And melody-volume
    35..50 For drum, (35..40 can also be interpreted As one of the Global defined drums)
   
    51..55 reserved For new ideas ;-) jump to block number, flip note sheet, 4th melodylines without a 3rd one :-)
   
   
   
   
    56..62 For what ever you want To do With ;-) sound effects, visualisation, animation, karol the robot ;-)
    (If the first dot in the first row And column is noch the value 32, it is Not a music-block ;-)
   
    other blocks in my program can be: lyric block, copyright And infotext block, pattern block (at the End Or the beginning of the sheet)
   
    63: Volume of the MarioPaintComposer note (like second melodyline, velocity)
    64: MarioPaint-Composer Instrument-Line (is like fourth melodyline, but using 16 till 64 standard instruments)
    ( MarioPaint will be coded like MIDI With transformation of the notes. To be compatible With the other MIDI-Feautures
    instruments And Velocity can also coded in MIDI Or With special line-marks)
   
   
   
(E) last  column ([E]nd column) is coded: 1..8 For instrument Or drum, means Instrument-Number: ((S)-1)*8+((E)-1),

Drums in one row: only drumnumber, drums in two rows: 61 drums + 64 velocitys (*2)

If no interpretation of the first column, there will be a standardinstruments And drums depending on the linenumber


Drum-Number (playable 27..87) possible 1..61 (61), MIDI-Drum-Number: 35..81 (47) + 27..34 (8) + 82..87 (6)
Means: If (S)>34 And (S)<51 (S) can be interpreted As MIDI-Drumnumber
Or As ((S)-34)+((E)-1)*4, so If (E) is 1 you will have the same instruments when using the possible DrumNumberList
e.g.: (S) = 35 [DrumNumber 35], With the second Dot:
((S)-34)+((E)-1)*4, (E)=1, result will be 1, first element of the drumlist is Drum 35


coding melody:
possible: one line, two lines, three lines, four lines

first line:  1..32 For notes +53 :  Notenumber: 54..85  (For most children's song enough) New note
             33..64 For notes +21 :  Notenumber: 54..85  (For most children's song enough) StilPlaying the note
             
            (all notes With the same duration, No Note: any other color)
     
second line: (more notes And a raw velocity)
             
               1..16 For velocity:  velocity     * 8 : 8, 16, 24, ... 64 is middle, 128 max. note form first line is 54..85
              17..32 For velocity: (velocity-16) * 8 : 8, 16, 24, ... 64 is middle, 128 max. note from first line is  0..31
              33..48 For velocity: (velocity-32) * 8 : 8, 16, 24, ... 64 is middle, 128 max. note from first line is 32..53 And 86..95                           
              49..64 For velocity: (velocity-48) * 8 : 8, 16, 24, ... 64 is middle, 128 max. note from first line is 96..127         
           
third line:   
              1..8 (0..7) velocity: (secondline velocity) * 8 - second melodyline [velocity], instrument: 0 * 64 + 4th line
              9..16 (0..7) velocity: (secondline velocity) * 8 - second melodyline [velocity], instrument: 1 * 64 + 4th line
             
              17..24 play it LEFT
              25..32
             
              33..40 play it RIGHT                           
              41..48
             
              49..56 maybe no MIDI instrument, but soundeffect (4th line), speed of the sound-file will be the same es notes. A is 440 Hz
              57..64
             
fourth line:  1..64 instruments           
 

If possible, music is coded:

13 lines, 1 Not in use For music, 1 is For block mark, lyrics, tempo ... what ever

00 unsued For simple music interpretation

01 PIANO_1 (kid notes) [numbers at the PIANO_ have the meaning of importance of the exactness]
02         (PIANO_12 With no velocity, only notes 54..85 [the 2 standard octaves])
03   (PIANO_6 With no exactly velocity, but With velocity And all available notes)
04         (PIANO_07 With no velocity, only notes 54..85 [the 2 standard octaves])

05 PIANO_2 (kid notes)
06         (PIANO_11 With no velocity, only notes 54..85 [the 2 standard octaves])
07   (PIANO_5 With no exactly velocity, but With velocity And all available notes)
08         (PIANO_08 With no velocity, only notes 54..85 [the 2 standard octaves])

09 PIANO_3 (kid notes)
10         (PIANO_10 With no velocity, only notes 54..85 [the 2 standard octaves])
11   (PIANO_4 With no exactly velocity, but With velocity And all available notes)
12         (PIANO_09 With no velocity, only notes 54..85 [the 2 standard octaves])

It's easy to put another melody line between the existing, but what if you want to refine
the melodyline? cut information is easy, but expanding the block is complex

It's easy to copy one block to another. but it would be not kid-user-friendly ...
compress, decompress (expanding) TOOL integrated in the xaby's composer would be an option
but would be a TOOL For advanced user, because you have To choose the lines you want To extract
And you should have the free-blocks  For expansion.

what If you have 4 blocks (at the same time) With 12 notes For each block?
every block will have a new usage of four blocks Or two blocks (If converted To 2 lines per melody)

The importance of the exactness: till you use 5 notes at the same time, the first melody will have all its MIDI-feautres
If it is very very important To have all MIDI-Features, you can also change the range And use line 12 With PIANO_6 instead of PIANO_9

melody-lines will be coded from up To down
drum-lines will be coded from buttom To top, it's better (easier) to have drums in seperate blocks
Or have two drums For one melody.

Offline

 

#5 2009-11-20 15:23:02

xaby
Scratcher
Registered: 2008-02-13
Posts: 49

Re: xaby's composer - a full MIDI import/export - how to create own tools

Project with some problems.

http://scratch.mit.edu/projects/xaby/767674

Offline

 
  • Index
  •  » Advanced Topics
  •  » xaby's composer - a full MIDI import/export - how to create own tools

Board footer