Log In  

PICO Composer v0.3

Changes


2022-06-15:

  • Set default tempo to 120 bpm
  • Set default time signature to 4/4
  • Implemented exporter and importer code

2022-06-06:

  • Fixed display code which wasn't properly accounting for sharps causing notes to eventually be drawn offscreen.

Cart #picomposer-5 | 2022-06-15 | Code ▽ | Embed ▽ | No License
4

PICO Composer main menu

When you start the cart you'll be prompted to load an album or create a new one. Use the up/down arrow keys to navigate the menu and enter to select. Either, or both, of the tempo and time signature can be left blank and you'll be given the defaults of 120 bpm and a 4/4 time signature. Any time signature that can't be parsed properly will default to 4/4.

When creating a new album the album name will be the name of the file—no need to specify .p8 extension—where your work will be saved. At the moment each "album" can only have a single song, with a single voice, on instrument 0. The idea though is to have each album contain multiple songs. Space constraints may end up making that infeasible but that's the plan for now at least.

Controls:

PICO Composer is intended to be run locally with a full keyboard and will save your work to a separate .p8 file.

Demo Song/Album

Download this cart and save it in the same directory as picomposer.p8.png Load and run picomposer and when prompted select load album, type song6 and press enter. It should load and after a couple of seconds you'll see the last few notes of the song. Press space to play the song from the beginning.

When you export an album (press e) a new file album_name.music.p8 will be created. This file can't be edited in Pico Composer and is intended to be imported for use into your own carts. To do so copy/paste the code from the example below and use the load_music() and play() functions.

Cart #picomposer_import-0 | 2022-06-15 | Code ▽ | Embed ▽ | No License
4

(Note: The song data for this cart is in the spritesheet and it's "importing" from itself into upper memory. Usually you'll be importing from the generated .music.p8 file but I wanted a self contained example.)

The importer is currently pretty heavy sitting somewhere around 600 tokens. Once I've got a few more features implemented I'll revist and try to bring the size down.


Song 6 refers to my Tunes! thread. This demo song is the same song as the 6th (currently last) song I've posted there.

As a point of comparison: By my calculation "Song 6" as I've written it in the tracker requires 752 bytes (10 sfx patterns at 68 bytes each plus 18 music patterns by 4 bytes each) while the PICO Composer song data comes in at 750. Considering I've not yet implemented any way of repeating sections—I just had to enter every single note—that gives me hope that I'll be able to keep song sizes down.

Future Development/Feature Wishlist

  • Select/edit note(s)
  • Allow all the pico-8 instruments and custom instruments
  • Multiple songs per album
  • Dynamics: volume pp, p, mp, mf, f, ff, fff
  • Allow up to 4 voices and ability to switch around between them
  • Clefs. As is the staff is in treble clef. Adding, at least, bass clef would be useful
  • Bar lines
  • crescendo, decrecendo
  • Repeat symbols and voltas
  • Effects/articulations (tremolo, etc.)
  • Maybe a mode specifically for notating drum parts
  • Possibly the ability to convert to/from the pico-8 tracker format
  • Joining notes when possible (connected 8th notes, for instance)
  • Ties and slurs
  • key signatures
  • Draw leger lines
  • Start screen with nicer menus
  • Reduce importer code size.

Proof of concept version:


This is just a proof of concept/work-in-progress to see how much interest I have in continuing to work on it and how much (or little) interest other people might have in using it.

Here's a quick little gif demo. No sound obviously but imagine each note playing as it's entered and also on playback:

Try it out:

Cart #picomposer-0 | 2022-05-15 | Code ▽ | Embed ▽ | No License
4

Controls and (current lack of) Features

Like I said, this is currently just a proof of concept and not (yet?) a useful tool so don't expect too much from it. All input is currently via keyboard.

At the start you'll be prompted for a title, bpm and time signature. None of these matter at the moment. You're locked into 4/4 at 150bpm.

Note Entry

Note Values

The top right corner shows you what note value will be inserted next. You can change this with number keys 1-5:

  • 1 - whole notes
  • 2 - half notes
  • 3 - quarter notes
  • 4 - eighth notes
  • 5 - sixteenth notes

Pitches

To insert actual notes of the selected value use the bottom row, keys z-m, just like entering notes in the tracker with 'z' being C and 'm' being B. At the moment it's just the bottom row/white keys but I'd obviously include the sharps/flats as well in a real tool.

It's a bit awkward at the moment because the notes go up until F and then drops down to G. I did that because I didn't want to mess around with ledger lines at the moment and this way everything stays on the staff. In reality I'd have the notes all going up in a particular octave and then using the up/down arrow keys—or something else—to change which octave you're in.

I'm not using the top rows for the higher octave like the tracker does because I want to reserve those keys for additional functionality like saving, adding instruments, etc.

Playback

At any time while you're entering notes press space to play the whole song from the start. When it's done you'll be back in note entry mode.

Future Development

So that's all it does at the moment. Currently there's no way to save the song, edit notes, add rests or...anything else. But here's a probably incomplete list of things I'd probably like to add at some point in no particular order.

  • Save/load songs to memory and/or another cart
  • Octaves for a full range of notes as mentioned above
  • Clefs. As is the staff is in treble clef. Adding, at least, bass clef would be useful
  • Actually allow you to enter tempo and time signature
  • Bar lines
  • Allow up to 4 voices and ability to switch around between them
  • Allow all the pico-8 instruments and custom instruments
  • Dynamics (p, f, mf, pp, crescendos, etc.)
  • Repeat symbols and voltas
  • Effects/articulations (tremolo, etc.)
  • Maybe a mode specifically for notating drum parts
  • A way to load and play the songs in carts
  • Possibly the ability to convert to/from the pico-8 tracker format
  • Joining notes when possible (connected 8th notes, for instance)
  • Ties and slurs
  • Add rests
  • Select/edit/delete note(s)
  • key signatures

That's what I've got off the top of my head. Suggestions welcome.

P#111852 2022-05-16 10:44 ( Edited 2022-06-15 17:59)

Post-Release Comments
:: dw817

I am running into a problem, @jasondelaat.

If you enter these values:

TEMPO (BPM): 1
TIME SIGNATURE: 1

It crashes showing this:

P#112797 2022-06-06 16:52

@dw817

Ah. That'll be the time signature. It's expecting something formatted as a fraction (4/4, 5/4, 7/16, etc.) I haven't yet added any checks to make sure input is well formed. I guess I'll add that to the list! And maybe include an example in the prompt.

The prompt, at least, I'll include with the next update which will be the exporter/loader code so that music can be used in other projects and not just within Pico Composer itself.

Thanks for letting me know about the bug, I appreciate it.

P#112810 2022-06-06 19:14 ( Edited 2022-06-06 19:17)

By the way, even if you're just playing around with it you'll probably want a higher tempo. The tempo here isn't the same as speed in the tracker so with tempo=1 and a 4/4 time signature a single quarter note (press 3 while editing) should play for a full minute.

In theory.

I just tried it and that actually doesn't happen which is another bug likely due to an overflow. Another check I need to add. That'll go on the list too.

Anyway, 120 is a reasonable medium-ish tempo; 40 will be very slow; 200 quite fast, etc.

P#112811 2022-06-06 19:29

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2022-06-27 21:46:20 | 0.037s | Q:21