Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8621473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:49:42+00:00 2026-06-12T06:49:42+00:00

I am writing an app to record drum tablature (specifically for a sampler ).

  • 0

I am writing an app to record drum tablature (specifically for a sampler). I am following the conventions of the sampler which are:

  1. A Sequence is 1 or more Tracks. A Sequence can be quantized (break the measure up into equal parts).

  2. A Track is an instrument or sound that will be played at certain parts of a measure. Each Track is broken up into parts. The number of parts is determined by the quantization of the Sequence. As an example, if the quantization is set to 1/16, the array will have length of 16. Each element of the array then stores whether or not the sound should play at that step in the Sequence.

Naturally, I have one object to represent a Sequence. It has an attribute called tracks which is an array of Track objects. A Track object has an array attribute that is in equal length to the quantization of the Sequence.

I am suffering major analysis paralysis and am unable to determine What is a clean way for all Track objects belonging to a specific Sequence to know when the quantization has changed so it can update its own internal array?

Or

How should the Track object know what to set its array length to without coupling the Sequence object?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:49:43+00:00Added an answer on June 12, 2026 at 6:49 am

    If every track must belong to one and only one sequence, then they are coupled by nature. Reflecting that coupling in implementation is not a problem (except perhaps for unit tests).

    Since the sequence initiates this change, I would recommend a publicly-accessible method on the Sequence object that sets the quantization for the sequence as a whole, and then iterates through the sequence’s tracks to set their quantization. Sequence.setQuantization() would be publicly accessible, Track.setQuantization() should not be.

    To ensure that the coupling is maintained, I’d also limit the ability to create Track objects to a factory method on Sequence (eg: addTrack()).

    That opens up the question of independently unit testing Track and Sequence. One way to do this is to create these objects as interfaces, and then have a single implementation of each with hooks for testing code. That leads to its own ugliness, probably including a SequenceFactory, but only you can decide how much purity you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a Java app which has to add a record to a database.
I'm writing an iPhone app which should record the users voice, and feed the
I writing an app in python for google app engine where each user can
I'm writing an app in Hebrew (which is rtl). when I set my title
I'm writing an app which plays host to a series of plug-ins. Those plug-ins
I'm writing a silverlight app which does some real-time charting. Basically, I just have
I am writing a little test app which connects to a SQL Server database
I'm writing a web app using grails and spring-security 3.0.3 which requires me to
I'm writing an Android app to record and save high-rate accelerometer data (and later
I am writing an app where I am printing TCP sequence and ack numbers.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.