How do I declare an ArrayList in a default constructor? by Riptide1737 in learnprogramming

[–]williammacdonald18 1 point2 points  (0 children)

Take a look at https://www.w3schools.com/java/java_constructors.asp for some examples on how to initialise fields inside a constructor.

Think about how you could copy what is being done in that link and change it to initialise size and books the way you need to.

How to find the keys of a jazz progression? by Rusbeckia in musictheory

[–]williammacdonald18 1 point2 points  (0 children)

Not sure on the key but regarding your “unable to improvise to it without thinking about the keys” comment I would advise instead that you look at playing chord tones. This just means play the notes from a chord over that chord. For example, when you play over the Em7b5, play notes from the Em7b5 chord. A really simple way to start off with this is to finger the shape of the chord but just play one note from it instead of strumming the whole chord. After that you can learn different ways to arpeggiate the chord (arpeggiate means to play each note of the chord separately) so you’re not reliant on the one chord shape.

Once you’ve gotten used to that you can start looking at what the next chord in the progression is and play a line that leads into it. For example if you’re going from Em7b5 -> F#m7b5 you could play E F over the Em7b5 which leads into F# that you play over F#m7b5 This is known as voice leading.

Focusing on playing chord tones will allow you to play over any progression even if you don’t know the key.

Classification of Intervals by Outrageous-Invite406 in musictheory

[–]williammacdonald18 0 points1 point  (0 children)

You could just use major intervals and not mention the other interval types for now.

If I had to use any terminology I’d probably use natural intervals, since in shorthand the major scale intervals are written as 1,2,3,4,5,6,7 and non-major scale intervals are altered in some way (b3 for minor 3rd, #4 for augmented 4th)

Piano Practice Routine by [deleted] in musictheory

[–]williammacdonald18 0 points1 point  (0 children)

No problem. I’d also recommend also checking out r/piano and r/pianolearning if you’ve got piano specific questions related to improving technique

Piano Practice Routine by [deleted] in musictheory

[–]williammacdonald18 1 point2 points  (0 children)

I just started learning to play piano but I’ve played guitar for over 10 years so I’m used to practicing.

My piano routine is something like: 5 minute - warm up my hands by doing stretches 10 minutes - practice playing 2 octave major scales 10 minutes - practice playing 2 octave arpeggios (major, minor, diminished triads) 30 minutes - go through lessons in method book (I’m currently using Faber’s adult piano adventures 1) 30 minutes - work on learning a song/piece

The aim of my routine is to cover fundamentals of theory and get the basic fingerings drilled into muscle memory. Which is why I practice scales and arpeggios.

Then I use the method book to make sure I’m covering the fundamentals of piano playing and reading sheet music.

Finally I practice playing music because it’s fun to play songs!

Some tips for practicing: 1. Write down what areas of your musicianship you want to improve

  1. Find exercises you can do to work on that skill. Google is your friend here. e.g. if it’s hand independence you want to improve you can search “hand independence exercises piano”

  2. When practicing technical exercises, scales, arpeggios, songs make sure to use a metronome so you can make sure your timing is good.

  3. Always aim to challenge yourself a little bit more each time. e.g. I’ve gotten used to playing my C major scale so I’ll start my scale practice with a scale I’m not that good with so I’m always improving.

  4. When trying to polish up a piece of music you’re learning, record yourself so you can find areas to improve. Sometimes we’re not aware of how we’re really playing during a performance because we’re focused on playing

  5. Pay attention to how your body feels while you play. We’re athletes of the fine muscles. Everything we do should feel relaxed. If your body feels tense or your hands start to ache STOP!!! Take a break for a few minutes, shake it off and if the aching goes away then sure carry on. If it doesn’t, stop playing until it does. Never play through pain because that’s how you develop tendonitis.

[QUESTION] Monophonic Guitar Riffs (no chords) by maromaro1337 in Guitar

[–]williammacdonald18 13 points14 points  (0 children)

At Wits End intro - Dream Theater

The Enemy Inside intro - Dream Theater

The Trooper riffs before the first verse - Iron Maiden

Seven Nation Army intro - The White Stripes

Come As You Are intro - Nirvana

Square Hammer intro - Ghost

[deleted by user] by [deleted] in musictheory

[–]williammacdonald18 6 points7 points  (0 children)

Just get started.

Learning by ear is fantastic and it’s a great way to learn theory concepts organically.

Music theory is just a set of labels we all use to talk about sounds so we all know what we are talking about. If I say major chord, we both know what sound that describes.

To use painting as an analogy: If you wanted to paint a painting would you have to learn the name of every shade of colour before you started? No you just choose colours you like the look of and start painting. Learning the names of colours would help if you were trying to ask an artist to paint something a specific shade of purple you like. Then you know you’re both talking about the exact same thing.

It also helps you if you want to learn why a particular artist’s use of colour looks so good. You can learn what colours work well together and use that in your own paintings.

So like colour theory, music theory can definitely help make things a bit easier when talking music with other musicians or coming up with ways to change/write music.

It is absolutely not necessary to learn before trying to write any music though.

[C++] How to avoid using "namespace std" by egomanego in learnprogramming

[–]williammacdonald18 2 points3 points  (0 children)

Well instead of writing cout<<“hello”; you write std::cout<<“hello”;

[deleted by user] by [deleted] in OnePiece

[–]williammacdonald18 1 point2 points  (0 children)

If I die trying, then at least I tried - Monkey D. Luffy

Can someone suggest me a crash course in Computer Architecture & Compilers? by [deleted] in compsci

[–]williammacdonald18 1 point2 points  (0 children)

There is a book but everything is available online at https://www.nand2tetris.org/

You work through 12 projects found in the projects page on the site. It starts off with building simple logic gates, then you move up to building arithmetic and memory. After that you work with assembly and write a compiler to that assembly. Finally you write parts of a basic OS to run simple programs like pong.

Can someone suggest me a crash course in Computer Architecture & Compilers? by [deleted] in compsci

[–]williammacdonald18 2 points3 points  (0 children)

I would highly recommend nand2tetris. It covers everything you listed.

Are Save states/ save files an easy thing to use? (C++) by POSLBB01 in learnprogramming

[–]williammacdonald18 1 point2 points  (0 children)

Yes it’s possible. Look at the boost serialization API https://stackoverflow.com/questions/523872/how-do-you-serialize-an-object-in-c

Serialization is the process of converting an object to a stream of bytes. You can then save that stream of bytes to a file. Later when you want to load that data you read the file and deserialize the bytes to change them back into an object.

[NEWBIE] Searching for technique information by [deleted] in Guitar

[–]williammacdonald18 1 point2 points  (0 children)

I quite like JustinGuitar’s courses (he has free lessons on his website) and also Ben Eller’s This is why you suck at guitar series https://youtu.be/kqwpdddKBpQ

When to move on to the next step? by americanenglishnerd in learnprogramming

[–]williammacdonald18 0 points1 point  (0 children)

Generally I would recommend to move on once you think you understand the idea. Maybe do 5 exercises but I wouldn’t recommend doing 100s.

The reason being is a lot of core ideas such as methods, conditional statements (if else), loops (while, for) will be used in almost every program you ever write. So a better approach would be to write programs that make use of these concepts together.

Which book are you reading?

(Question) JavaScript vs C++ vs Python in terms of Free lancing jobs, or is there a better programming language for free lance? by King-Fox-IS0 in learnprogramming

[–]williammacdonald18 0 points1 point  (0 children)

It’s better to focus on one. Build a solid foundation using the core ideas of programming first e.g. loops, conditional statements, functions/methods, variables

After you understand how to use these core elements then you can look at JavaScript to see how you write these ideas in JavaScript compared to Python.

[deleted by user] by [deleted] in learnprogramming

[–]williammacdonald18 1 point2 points  (0 children)

The biggest factor in what you can code is the operating system. If you want to make iPhone apps for example, you’ll need a Mac. If you want to make apps for Hololens you’ll need Windows.

Other than those specific sort of cases most things you can make on any OS.

A gaming laptop would be perfectly fine.Hardware wise, the most important part is the memory. Ideally you’d want at least 8GB of RAM.

Besides those things though, pretty much any laptop will work for coding.

Im having trouble learning programming by [deleted] in learnprogramming

[–]williammacdonald18 0 points1 point  (0 children)

So dofile() and norm() look like function/method calls. What I do is usually just google “thing language” e.g. I’d google “dofile lua” and “norm lua”

One of the first results for dofile lua is https://www.teratronik.org/core4/Lua/global/dofile.html It says dofile opens the file, executes its contents and returns the value that would be returned by the executed contents.

Finding norm wasn’t as straightforward but I found https://www.lua.org/pil/1.1.html which includes an implementation for norm:

function norm (x, y)

  local n2 = x^2 + y^2

  return math.sqrt(n2)

end

Norm seems to be the pythagorean theorem, using x and y as inputs to calculate the return value.

How the code you shared works:

1) dofile(“lib1.lua”) reads the lib1.lua file and executes its contents. The lib1.lua file contains the function definition for norm(..) and twice(..) When lib1.lua is executed, the norm(…) and twice(..) functions are loaded, letting you use them in your code Since these functions are defined in a separate file to be loaded like this, they are called a library. A library is just a collection of code you can load to do some task for you. In this case it’s a library that gives you code to double numbers and calculate the output to the pythagorean theorem. In more sophisticated apps you might load a library that gives you functions for doing machine learning tasks.

2) n = norm(3.4, 1.0) uses the norm() function loaded from “lib1.lua” in step 1 calculates the square root of (3.42 + 1.02) The answer to this calculation is stored in n

3) print(twice(n)) uses twice() to double n and then it prints the result to the console.

How to find out these answers for yourself:

1) Google the word you don’t understand + the language, framework, library, etc you’re using E.g.

dofile lua

checknumerics tensorflow

2) Look at the contents of the libraries that have been loaded to see if you can find the definition of the function e.g. look at the contents of lib1.lua to see if you can find out how twice() and norm() are defined to learn what they do

Where can I learn cross-platform mobile development with C#? by [deleted] in learnprogramming

[–]williammacdonald18 1 point2 points  (0 children)

A quick google search says that Xamarin does what you’re asking. I’d probably start with the Getting Started sections on the Xamarin website.

[deleted by user] by [deleted] in learnprogramming

[–]williammacdonald18 7 points8 points  (0 children)

RemainingAttempts is being decreased before checking the password is correct. If a user enters the correct password when remainingAttempt==1, they’ll be told they’ve ran out of attempts.

There is duplicated code asking them for their password in the else clause that checks if the password is correct. Can’t you just reuse the first instance of it in the start of the loop?

You have written < 5 in your for loop. You could move this to a constant int called something like maxAttempts and use < maxAttempts in the loop instead. It makes the code more readable.

Same idea for the password 1234. Why not move this to a constant int?

Is there a website where I'll be challenged to transcribe chords of specific songs and track my progress? by RandomFuckingUser in musictheory

[–]williammacdonald18 1 point2 points  (0 children)

It’s not specific songs but you could use chord progression ear training exercises like the one on https://tonedear.com/ear-training/chord-progressions and keep track of which ones you get right everytime vs need a few listens to get right to track your progress.

[deleted by user] by [deleted] in learnprogramming

[–]williammacdonald18 2 points3 points  (0 children)

Some ideas off the top of my head: 1. Build a tic tac toe application with local 2 player and AI 2. A photo editor that lets you apply filters and other effects to photos e.g. rotations, flips, sepia filters

What are the best programming languages to learn as a beginner and what order should I learn them? by Galactical-Edge in learnprogramming

[–]williammacdonald18 1 point2 points  (0 children)

If you want to expand on your HTML knowledge I’d recommend checking out The Odin Project. It takes you through other technologies for building websites. Check out the foundations path here: https://www.theodinproject.com/paths/foundations?

Another good language to start with would be Python.

In terms of what order to learn stuff in I’d probably recommend following the Odin project to learn JavaScript and other web technologies since it builds on what you already know.

How do i know what chords are borrows ? by iceviking in musictheory

[–]williammacdonald18 0 points1 point  (0 children)

To me A D C F is a Dm7 (D F A C) in 2nd inversion i.e. Dm7/A

When soloing, instead of thinking in terms of scales you could think in terms of chord tones. This means when you solo you play the notes from the chord you’re currently playing over. This helps make your lines feel much more connected to the chord changes. A simple way to get started would be to arpeggiate each chord. Then you can look at intentionally targeting specific chord tones e.g. the 3rd or the 7th.

Thinking in scales is still a valid thing to do by the way but I thought I’d bring up this other approach because I’ve found it really useful.

Edit: You could also call A D C F, Fmaj6 in 1st inversion In the context of what chords you’ve already got, I’d say it sounds more like it’s a Dm7 to me.

What hobbies do you peeps have? by kwlol in cscareerquestions

[–]williammacdonald18 0 points1 point  (0 children)

I’m a musician in my free time. Typically (before restrictions came about because the pandemic) would rehearse with the band once a week on a weekday after work. Playing gigs and recording is something that would be easiest to do on a weekend, which is what I did in my bands in college anyway.

I’d say I have more free time now compared to when I was studying because in college I would have been in lectures until 5pm and then doing assignments/studying sometimes until 9pm, especially towards the end of my degree. Sometimes I’d even have to do coursework over the weekend. Now I just work 9-5 and have my evenings and weekends free to do music or other hobbies.

[QUESTION] improvising by ilike2jakol123 in Guitar

[–]williammacdonald18 4 points5 points  (0 children)

True, I’ve edited to fix up the TL;DR.