Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement Effects column in the Music Editor #261

Closed
nesbox opened this issue Aug 12, 2017 · 13 comments
Closed

implement Effects column in the Music Editor #261

nesbox opened this issue Aug 12, 2017 · 13 comments
Assignees
Labels
editor: music enhancement Improvement of existing feature or adding something new

Comments

@nesbox
Copy link
Owner

nesbox commented Aug 12, 2017

0x Mute delay, x = frames before mute
1x Speed, sets the speed when x is between 0 - F
2x Note delay, delay before the current row is triggered, x = frames to wait
3x Automatic portamento, slides to new notes x = speed (0 to disable)
4x Vibrato effect, x = speed
5x Jump to pattern x
6x Fine pitch, x = offset (8 is default)
examples

C-5 02 F 02 - Plays C-5 with instrument 02 at volume F for exactly 2 frames before muting.
C-5 02 F 18 - Sets track speed to "8" on this line
C-5 02 F 22 - Plays C-5 with instrument 02 at volume F after waiting 2 frames. Does not mute previous note
C-5 02 F 32 - 32 turns on portamento (note sliding) so previous pitch should slide to this note, and it will slide to any new notes until you put "30." "speed" starts at 0 and goes to a max of F (fast slides)
C-5 02 F 42 - Plays vibrato at x speed. This is usually not used on a note, but on a blank space after a note.
C-5 02 F 52 - Jumps to pattern 2 after playing this note.
C-5 02 F 62 - Plays that note but detuned by -6. since "8" is the middle, 9 is +1, 10 is +2, etc

@darkhog
Copy link

darkhog commented Aug 29, 2017

Also suggested effects:
Portamento up
Portamento down
Fine portamento up/down - same as portamento up/down, except speed is divided by 4
Volume slide up/down, so you can do fadein/outs on certain sustained instruments.

Slide to note is useful, but sometimes you don't need it & manual portamento works better.

@nesbox nesbox added the enhancement Improvement of existing feature or adding something new label Sep 15, 2017
@Decidetto
Copy link

A way to put conditions on the 5x effect would be essential for space efficiency.
It could be used to for example make it play patterns 0, then (1, 2) 2 times, then continue with patterns 3, 4, 5, repeat (6, 7) 3 times and finally return to pattern 0 to loop fully.
Much retro music is built on repetition, so needing to have copies of the same patterns in your "playlist" will make you run out of space quickly.

@StinkerB06
Copy link

This is cool! But there's no way to input them into the editor.

@kostik1337
Copy link
Contributor

I'd really like to see arpegio effect (similar to 0xy effect in protracker/fasttracker), but as I can see, there's only one digit for effect parameter.

@Decidetto: 5x effect is probably designed to add intros to songs, e.g. play first two patterns once and loop the rest of composition infinitely. For repetition, I can suggest adding two more effects, say A0 and Bx, where A0 sets loop start point and Bx sets loop end point with repetitions count

@nesbox nesbox added this to the 0.80.0 milestone Nov 23, 2019
@StinkerB06
Copy link

Also, 00 should correspond with infinite sound length to prevent breaking all current music tracks.

@nesbox nesbox self-assigned this Dec 12, 2019
@nesbox
Copy link
Owner Author

nesbox commented Dec 12, 2019

I decided to use 3 columns for the tracker command: command [0-7] 3bits, parameter1 [0-F] 4bits, parameter2 [0-F] 4bits. The existing Volume column is deprecated and will be automatically converted to the Volume Output command on a cart loading.
Here is an existing command list with the small description:

  • [-] - do nothing
  • [M] - master volume for the left/right channels
  • [C] - play chord, C37 plays +0,+3,+7 notes
  • [J] - jump to frame/row
  • [S] - slide to note (legato) with given given number of ticks
  • [P] - pitch up/down
  • [V] - vibratto with period and depth
  • [D] - delay triggering of a note with given number of ticks

The checked commands are implemented and can be tested on the music-commands-wip branch.
Here is the latest build https://builds.tic80.com/music-commands-wip.

@StinkerB06
Copy link

@nesbox To prevent breaking carts that pack binary data in the music pattern memory, the "do nothing" command should accept note volume as one of the parameters.

@nesbox
Copy link
Owner Author

nesbox commented Dec 12, 2019

@StinkerB06 do you know these carts with binary data packing?

@StinkerB06
Copy link

StinkerB06 commented Dec 12, 2019 via email

nesbox added a commit that referenced this issue Dec 13, 2019
nesbox added a commit that referenced this issue Dec 15, 2019
nesbox added a commit that referenced this issue Dec 16, 2019
nesbox added a commit that referenced this issue Dec 16, 2019
@nesbox
Copy link
Owner Author

nesbox commented Dec 16, 2019

So, the Music Commands branch is merged to master and here is an explanation of how the commands work:

*** MUSIC COMMANDS***

(please don't forget, all the command values are hex)

[M xy] - changes the master volume for left(x)/right(y) channels.
example:
M00 turns off the volume.
MF0 turns on the only left channel.
M88 turns on both channels on half of the max volume.

[C xy] - produces chords by doing a simple arpeggio that extends the base note with the given semitones.
example:
C37 plays a minor chord: 0, 3, 7, 0, 3, 7, 0, 3, 7, ...
C47 plays a major chord: 0, 4, 7, 0, 4, 7, 0, 4, 7, ...
C0C plays 0, 0, C, 0, 0, C, 0, 0, C, ...
CC0 plays 0, C, 0, C, 0, C, ...
CCC plays 0, C, C, 0, C, C, 0, C, C, ...

[J xy] - jumps to frame (x) and beat (y), row = beat*4

[S xx] - performs a pitch bend that stops when it reaches a current note with the provided number of ticks (xx).
example:
C-4 00 ---
F-4 00 S08
--- -- ---
C-4 00 S10
This will result in a pitch bend that starts with C-4, bends to F-4 in 8 ticks, and then bends back to C-4 in 16 ticks.

[P xx] - changes pitch up or down with a given offset. 128 (P80) is the default value.
example:
P82 - plays a note but detuned by 0x82-0x80=+2.
P62 - plays a note but detuned by 0x62-0x80=-30.

[V xy] - vibrates pitch with given period (x) and depth (y).
example:
V43 - vibrates pitch with period 4 and depth 3.

[D xx] - delays triggering a note with the given number of ticks (xx).
example:
D10 - plays a note after 16 ticks, you can also mute the note this way.

Also, it would be great if someone with a musical background could test it and give some feedback before release, you can download it here https://builds.tic80.com/master/2019.12.16

Thank you all for the help with the issue!

@nesbox nesbox closed this as completed Dec 16, 2019
@StinkerB06
Copy link

Oh my, this is awesome! About the binary data-breaking thing: Change the type 0x0D chunk to 0x0F.

@borbware
Copy link
Contributor

borbware commented Aug 20, 2020

The feature mentioned in this comment didn't work for me:

The existing Volume column is deprecated and will be automatically converted to the Volume Output command on a cart loading.

In my project (.lua cart made with 0.70.6 pro), the volumes were not converted; all notes were left in maximum volume.

EDIT: seems to work for .tic carts but not for .lua carts.

@nesbox
Copy link
Owner Author

nesbox commented Aug 21, 2020

Yes, conversion works with .tic carts only, because cart loading can handle different chunk types and I marked CHUNK_PATTERNS as deprecated and, unfortunately, I can't do the same for text carts.
So, to convert .lua cart

  • save .lua as .tic in 0.70
  • save .tic as .lua in .80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor: music enhancement Improvement of existing feature or adding something new
Projects
None yet
Development

No branches or pull requests

7 participants